# 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.AcmeDNS.V1.Model.RotateChallengesRequest do
  @moduledoc """
  The request message for the RotateChallenges RPC. Requires an access token, a root domain, and either records_to_add or records_to_remove to be populated. Records may be set for multiple subdomains at once to support SAN requests for multiple subdomains in a single domain. By default, ACME TXT record challenges that are older than 30 days will be removed. Set `keep_expired_records` to false if this behavior is undesired. There is a record maximum of 100 records per domain including expired records. Any request sent that would exceed this maximum will result in a FAILED_PRECONDITION error. NEXT ID: 6

  ## Attributes

  *   `accessToken` (*type:* `String.t`, *default:* `nil`) - Required. ACME DNS access token. This is a base64 token secret that is procured from the Google Domains website. It authorizes ACME TXT record updates for a domain.
  *   `keepExpiredRecords` (*type:* `boolean()`, *default:* `nil`) - Keep records older than 30 days that were used for previous requests.
  *   `recordsToAdd` (*type:* `list(GoogleApi.AcmeDNS.V1.Model.AcmeTxtRecord.t)`, *default:* `nil`) - ACME TXT record challenges to add. Supports multiple challenges on the same FQDN.
  *   `recordsToRemove` (*type:* `list(GoogleApi.AcmeDNS.V1.Model.AcmeTxtRecord.t)`, *default:* `nil`) - ACME TXT record challenges to remove.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accessToken => String.t() | nil,
          :keepExpiredRecords => boolean() | nil,
          :recordsToAdd => list(GoogleApi.AcmeDNS.V1.Model.AcmeTxtRecord.t()) | nil,
          :recordsToRemove => list(GoogleApi.AcmeDNS.V1.Model.AcmeTxtRecord.t()) | nil
        }

  field(:accessToken)
  field(:keepExpiredRecords)
  field(:recordsToAdd, as: GoogleApi.AcmeDNS.V1.Model.AcmeTxtRecord, type: :list)
  field(:recordsToRemove, as: GoogleApi.AcmeDNS.V1.Model.AcmeTxtRecord, type: :list)
end

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

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