# 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.Connectors.V1.Model.AuthorizationCodeLink do
  @moduledoc """
  This configuration captures the details required to render an authorization link for the OAuth Authorization Code Flow.

  ## Attributes

  *   `clientId` (*type:* `String.t`, *default:* `nil`) - Optional. The client ID assigned to the Google Cloud Connectors OAuth app for the connector data source.
  *   `clientSecret` (*type:* `GoogleApi.Connectors.V1.Model.Secret.t`, *default:* `nil`) - Optional. The client secret assigned to the Google Cloud Connectors OAuth app for the connector data source.
  *   `enablePkce` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether to enable PKCE for the auth code flow.
  *   `omitQueryParams` (*type:* `boolean()`, *default:* `nil`) - Optional. Omit query params from the redirect URI.
  *   `scopes` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The scopes for which the user will authorize Google Cloud Connectors on the connector data source.
  *   `uri` (*type:* `String.t`, *default:* `nil`) - Optional. The base URI the user must click to trigger the authorization code login flow.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :clientId => String.t() | nil,
          :clientSecret => GoogleApi.Connectors.V1.Model.Secret.t() | nil,
          :enablePkce => boolean() | nil,
          :omitQueryParams => boolean() | nil,
          :scopes => list(String.t()) | nil,
          :uri => String.t() | nil
        }

  field(:clientId)
  field(:clientSecret, as: GoogleApi.Connectors.V1.Model.Secret)
  field(:enablePkce)
  field(:omitQueryParams)
  field(:scopes, type: :list)
  field(:uri)
end

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

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