# 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.VerifiedAccess.V1.Model.VerifyChallengeResponseResult do
  @moduledoc """
  Result message for VerifiedAccess.VerifyChallengeResponse.

  ## Attributes

  *   `attestedDeviceId` (*type:* `String.t`, *default:* `nil`) - Attested device id (ADID) of the device, read from the verified data.
  *   `deviceEnrollmentId` (*type:* `String.t`, *default:* `nil`) - Device enrollment id is returned in this field (for the machine response only).
  *   `devicePermanentId` (*type:* `String.t`, *default:* `nil`) - Device permanent id is returned in this field (for the machine response only).
  *   `signedPublicKeyAndChallenge` (*type:* `String.t`, *default:* `nil`) - Certificate Signing Request (in the SPKAC format, base64 encoded) is returned in this field. This field will be set only if device has included CSR in its challenge response. (the option to include CSR is now available for both user and machine responses)
  *   `verificationOutput` (*type:* `String.t`, *default:* `nil`) - For EMCert check, device permanent id is returned here. For EUCert check, signed_public_key_and_challenge [base64 encoded] is returned if present, otherwise empty string is returned. This field is deprecated, please use device_permanent_id or signed_public_key_and_challenge fields.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attestedDeviceId => String.t() | nil,
          :deviceEnrollmentId => String.t() | nil,
          :devicePermanentId => String.t() | nil,
          :signedPublicKeyAndChallenge => String.t() | nil,
          :verificationOutput => String.t() | nil
        }

  field(:attestedDeviceId)
  field(:deviceEnrollmentId)
  field(:devicePermanentId)
  field(:signedPublicKeyAndChallenge)
  field(:verificationOutput)
end

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

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