# 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.CustomConnectorVersion do
  @moduledoc """
  CustomConnectorVersion indicates a specific version of a connector.

  ## Attributes

  *   `authConfig` (*type:* `GoogleApi.Connectors.V1.Model.AuthConfig.t`, *default:* `nil`) - Optional. Authentication config for accessing connector facade/ proxy. This is used only when enable_backend_destination_config is true.
  *   `backendVariableTemplates` (*type:* `list(GoogleApi.Connectors.V1.Model.ConfigVariableTemplate.t)`, *default:* `nil`) - Optional. Backend variables config templates. This translates to additional variable templates in connection.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Created time.
  *   `destinationConfigs` (*type:* `list(GoogleApi.Connectors.V1.Model.DestinationConfig.t)`, *default:* `nil`) - Optional. Destination config(s) for accessing connector facade/ proxy. This is used only when enable_backend_destination_config is true.
  *   `enableBackendDestinationConfig` (*type:* `boolean()`, *default:* `nil`) - Optional. When enabled, the connector will be a facade/ proxy, and connects to the destination provided during connection creation.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. https://cloud.google.com/compute/docs/labeling-resources
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. Resource name of the Version. Format: projects/{project}/locations/{location}/customConnectors/{custom_connector}/customConnectorVersions/{custom_connector_version}
  *   `partnerMetadata` (*type:* `GoogleApi.Connectors.V1.Model.PartnerMetadata.t`, *default:* `nil`) - Optional. Partner metadata details. This should be populated only when publishing the custom connector to partner connector.
  *   `publishStatus` (*type:* `GoogleApi.Connectors.V1.Model.PublishStatus.t`, *default:* `nil`) - Output only. Publish status of a custom connector.
  *   `serviceAccount` (*type:* `String.t`, *default:* `nil`) - Optional. Service account used by runtime plane to access auth config secrets.
  *   `specLocation` (*type:* `String.t`, *default:* `nil`) - Optional. Location of the custom connector spec. The location can be either a public url like `https://public-url.com/spec` Or a Google Cloud Storage location like `gs:///`
  *   `specServerUrls` (*type:* `list(String.t)`, *default:* `nil`) - Output only. Server URLs parsed from the spec.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the custom connector version.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Updated time.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authConfig => GoogleApi.Connectors.V1.Model.AuthConfig.t() | nil,
          :backendVariableTemplates =>
            list(GoogleApi.Connectors.V1.Model.ConfigVariableTemplate.t()) | nil,
          :createTime => DateTime.t() | nil,
          :destinationConfigs => list(GoogleApi.Connectors.V1.Model.DestinationConfig.t()) | nil,
          :enableBackendDestinationConfig => boolean() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :partnerMetadata => GoogleApi.Connectors.V1.Model.PartnerMetadata.t() | nil,
          :publishStatus => GoogleApi.Connectors.V1.Model.PublishStatus.t() | nil,
          :serviceAccount => String.t() | nil,
          :specLocation => String.t() | nil,
          :specServerUrls => list(String.t()) | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:authConfig, as: GoogleApi.Connectors.V1.Model.AuthConfig)

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

  field(:createTime, as: DateTime)
  field(:destinationConfigs, as: GoogleApi.Connectors.V1.Model.DestinationConfig, type: :list)
  field(:enableBackendDestinationConfig)
  field(:labels, type: :map)
  field(:name)
  field(:partnerMetadata, as: GoogleApi.Connectors.V1.Model.PartnerMetadata)
  field(:publishStatus, as: GoogleApi.Connectors.V1.Model.PublishStatus)
  field(:serviceAccount)
  field(:specLocation)
  field(:specServerUrls, type: :list)
  field(:state)
  field(:updateTime, as: DateTime)
end

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

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