# 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.MyBusinessVerifications.V1.Model.VerificationOption do
  @moduledoc """
  The verification option represents how to verify the location (indicated by verification method) and where the verification will be sent to (indicated by display data).

  ## Attributes

  *   `addressData` (*type:* `GoogleApi.MyBusinessVerifications.V1.Model.AddressVerificationData.t`, *default:* `nil`) - Set only if the method is MAIL.
  *   `announcement` (*type:* `String.t`, *default:* `nil`) - Set only if the method is VETTED_PARTNER.
  *   `emailData` (*type:* `GoogleApi.MyBusinessVerifications.V1.Model.EmailVerificationData.t`, *default:* `nil`) - Set only if the method is EMAIL.
  *   `phoneNumber` (*type:* `String.t`, *default:* `nil`) - Set only if the method is PHONE_CALL or SMS. Phone number that the PIN will be sent to.
  *   `verificationMethod` (*type:* `String.t`, *default:* `nil`) - Method to verify the location.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :addressData =>
            GoogleApi.MyBusinessVerifications.V1.Model.AddressVerificationData.t() | nil,
          :announcement => String.t() | nil,
          :emailData =>
            GoogleApi.MyBusinessVerifications.V1.Model.EmailVerificationData.t() | nil,
          :phoneNumber => String.t() | nil,
          :verificationMethod => String.t() | nil
        }

  field(:addressData, as: GoogleApi.MyBusinessVerifications.V1.Model.AddressVerificationData)
  field(:announcement)
  field(:emailData, as: GoogleApi.MyBusinessVerifications.V1.Model.EmailVerificationData)
  field(:phoneNumber)
  field(:verificationMethod)
end

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

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