# 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.EventingConfigTemplate do
  @moduledoc """
  Eventing Config details of a connector version.

  ## Attributes

  *   `additionalVariables` (*type:* `list(GoogleApi.Connectors.V1.Model.ConfigVariableTemplate.t)`, *default:* `nil`) - Additional fields that need to be rendered.
  *   `authConfigTemplates` (*type:* `list(GoogleApi.Connectors.V1.Model.AuthConfigTemplate.t)`, *default:* `nil`) - AuthConfigTemplates represents the auth values for the webhook adapter.
  *   `autoRefresh` (*type:* `boolean()`, *default:* `nil`) - Auto refresh to extend webhook life.
  *   `autoRegistrationSupported` (*type:* `boolean()`, *default:* `nil`) - Auto Registration supported.
  *   `encryptionKeyTemplate` (*type:* `GoogleApi.Connectors.V1.Model.ConfigVariableTemplate.t`, *default:* `nil`) - Encryption key (can be either Google managed or CMEK).
  *   `enrichmentSupported` (*type:* `boolean()`, *default:* `nil`) - Enrichment Supported.
  *   `eventListenerType` (*type:* `String.t`, *default:* `nil`) - The type of the event listener for a specific connector.
  *   `isEventingSupported` (*type:* `boolean()`, *default:* `nil`) - Is Eventing Supported.
  *   `listenerAuthConfigTemplates` (*type:* `list(GoogleApi.Connectors.V1.Model.AuthConfigTemplate.t)`, *default:* `nil`) - ListenerAuthConfigTemplates represents the auth values for the event listener.
  *   `proxyDestinationConfig` (*type:* `GoogleApi.Connectors.V1.Model.DestinationConfigTemplate.t`, *default:* `nil`) - Proxy destination config template.
  *   `registrationDestinationConfig` (*type:* `GoogleApi.Connectors.V1.Model.DestinationConfigTemplate.t`, *default:* `nil`) - Registration host destination config template.
  *   `triggerConfigVariables` (*type:* `list(GoogleApi.Connectors.V1.Model.ConfigVariableTemplate.t)`, *default:* `nil`) - Trigger Config fields that needs to be rendered
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :additionalVariables =>
            list(GoogleApi.Connectors.V1.Model.ConfigVariableTemplate.t()) | nil,
          :authConfigTemplates =>
            list(GoogleApi.Connectors.V1.Model.AuthConfigTemplate.t()) | nil,
          :autoRefresh => boolean() | nil,
          :autoRegistrationSupported => boolean() | nil,
          :encryptionKeyTemplate =>
            GoogleApi.Connectors.V1.Model.ConfigVariableTemplate.t() | nil,
          :enrichmentSupported => boolean() | nil,
          :eventListenerType => String.t() | nil,
          :isEventingSupported => boolean() | nil,
          :listenerAuthConfigTemplates =>
            list(GoogleApi.Connectors.V1.Model.AuthConfigTemplate.t()) | nil,
          :proxyDestinationConfig =>
            GoogleApi.Connectors.V1.Model.DestinationConfigTemplate.t() | nil,
          :registrationDestinationConfig =>
            GoogleApi.Connectors.V1.Model.DestinationConfigTemplate.t() | nil,
          :triggerConfigVariables =>
            list(GoogleApi.Connectors.V1.Model.ConfigVariableTemplate.t()) | nil
        }

  field(:additionalVariables,
    as: GoogleApi.Connectors.V1.Model.ConfigVariableTemplate,
    type: :list
  )

  field(:authConfigTemplates, as: GoogleApi.Connectors.V1.Model.AuthConfigTemplate, type: :list)
  field(:autoRefresh)
  field(:autoRegistrationSupported)
  field(:encryptionKeyTemplate, as: GoogleApi.Connectors.V1.Model.ConfigVariableTemplate)
  field(:enrichmentSupported)
  field(:eventListenerType)
  field(:isEventingSupported)

  field(:listenerAuthConfigTemplates,
    as: GoogleApi.Connectors.V1.Model.AuthConfigTemplate,
    type: :list
  )

  field(:proxyDestinationConfig, as: GoogleApi.Connectors.V1.Model.DestinationConfigTemplate)

  field(:registrationDestinationConfig,
    as: GoogleApi.Connectors.V1.Model.DestinationConfigTemplate
  )

  field(:triggerConfigVariables,
    as: GoogleApi.Connectors.V1.Model.ConfigVariableTemplate,
    type: :list
  )
end

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

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