# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Vault.V1.Model.MailCountResult do
  @moduledoc """
  Gmail and classic Hangouts-specific count metrics.

  ## Attributes

  *   `accountCountErrors` (*type:* `list(GoogleApi.Vault.V1.Model.AccountCountError.t)`, *default:* `nil`) - Errors occurred when querying these accounts.
  *   `accountCounts` (*type:* `list(GoogleApi.Vault.V1.Model.AccountCount.t)`, *default:* `nil`) - Subtotal count per matching account that have more than zero messages.
  *   `matchingAccountsCount` (*type:* `String.t`, *default:* `nil`) - Total number of accounts that can be queried and have more than zero messages.
  *   `nonQueryableAccounts` (*type:* `list(String.t)`, *default:* `nil`) - When **DataScope** is **HELD_DATA** and when account emails are passed in explicitly, the list of accounts in the request that are not queried because they are not on hold in the matter. For other data scopes, this field is not set.
  *   `queriedAccountsCount` (*type:* `String.t`, *default:* `nil`) - Total number of accounts involved in this count operation.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountCountErrors => list(GoogleApi.Vault.V1.Model.AccountCountError.t()) | nil,
          :accountCounts => list(GoogleApi.Vault.V1.Model.AccountCount.t()) | nil,
          :matchingAccountsCount => String.t() | nil,
          :nonQueryableAccounts => list(String.t()) | nil,
          :queriedAccountsCount => String.t() | nil
        }

  field(:accountCountErrors, as: GoogleApi.Vault.V1.Model.AccountCountError, type: :list)
  field(:accountCounts, as: GoogleApi.Vault.V1.Model.AccountCount, type: :list)
  field(:matchingAccountsCount)
  field(:nonQueryableAccounts, type: :list)
  field(:queriedAccountsCount)
end

defimpl Poison.Decoder, for: GoogleApi.Vault.V1.Model.MailCountResult do
  def decode(value, options) do
    GoogleApi.Vault.V1.Model.MailCountResult.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Vault.V1.Model.MailCountResult do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
