# 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.DisplayVideo.V1.Model.ContactInfo do
  @moduledoc """
  Contact information defining a Customer Match audience member.

  ## Attributes

  *   `countryCode` (*type:* `String.t`, *default:* `nil`) - Country code of the member. Must also be set with the following fields: * hashed_first_name * hashed_last_name * zip_codes
  *   `hashedEmails` (*type:* `list(String.t)`, *default:* `nil`) - A list of SHA256 hashed email of the member. Before hashing, remove all whitespace and make sure the string is all lowercase.
  *   `hashedFirstName` (*type:* `String.t`, *default:* `nil`) - SHA256 hashed first name of the member. Before hashing, remove all whitespace and make sure the string is all lowercase. Must also be set with the following fields: * country_code * hashed_last_name * zip_codes
  *   `hashedLastName` (*type:* `String.t`, *default:* `nil`) - SHA256 hashed last name of the member. Before hashing, remove all whitespace and make sure the string is all lowercase. Must also be set with the following fields: * country_code * hashed_first_name * zip_codes
  *   `hashedPhoneNumbers` (*type:* `list(String.t)`, *default:* `nil`) - A list of SHA256 hashed phone numbers of the member. Before hashing, all phone numbers must be formatted using the [E.164 format](//en.wikipedia.org/wiki/E.164) and include the country calling code.
  *   `zipCodes` (*type:* `list(String.t)`, *default:* `nil`) - A list of zip codes of the member. Must also be set with the following fields: * country_code * hashed_first_name * hashed_last_name
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :countryCode => String.t() | nil,
          :hashedEmails => list(String.t()) | nil,
          :hashedFirstName => String.t() | nil,
          :hashedLastName => String.t() | nil,
          :hashedPhoneNumbers => list(String.t()) | nil,
          :zipCodes => list(String.t()) | nil
        }

  field(:countryCode)
  field(:hashedEmails, type: :list)
  field(:hashedFirstName)
  field(:hashedLastName)
  field(:hashedPhoneNumbers, type: :list)
  field(:zipCodes, type: :list)
end

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

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