# 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.AlloyDB.V1.Model.PscInstanceConfig do
  @moduledoc """
  PscInstanceConfig contains PSC related configuration at an instance level.

  ## Attributes

  *   `allowedConsumerProjects` (*type:* `list(String.t)`, *default:* `nil`) - Optional. List of consumer projects that are allowed to create PSC endpoints to service-attachments to this instance.
  *   `pscAutoConnections` (*type:* `list(GoogleApi.AlloyDB.V1.Model.PscAutoConnectionConfig.t)`, *default:* `nil`) - Optional. Configurations for setting up PSC service automation.
  *   `pscDnsName` (*type:* `String.t`, *default:* `nil`) - Output only. The DNS name of the instance for PSC connectivity. Name convention: ...alloydb-psc.goog
  *   `pscInterfaceConfigs` (*type:* `list(GoogleApi.AlloyDB.V1.Model.PscInterfaceConfig.t)`, *default:* `nil`) - Optional. Configurations for setting up PSC interfaces attached to the instance which are used for outbound connectivity. Only primary instances can have PSC interface attached. Currently we only support 0 or 1 PSC interface.
  *   `serviceAttachmentLink` (*type:* `String.t`, *default:* `nil`) - Output only. The service attachment created when Private Service Connect (PSC) is enabled for the instance. The name of the resource will be in the format of `projects//regions//serviceAttachments/`
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowedConsumerProjects => list(String.t()) | nil,
          :pscAutoConnections =>
            list(GoogleApi.AlloyDB.V1.Model.PscAutoConnectionConfig.t()) | nil,
          :pscDnsName => String.t() | nil,
          :pscInterfaceConfigs => list(GoogleApi.AlloyDB.V1.Model.PscInterfaceConfig.t()) | nil,
          :serviceAttachmentLink => String.t() | nil
        }

  field(:allowedConsumerProjects, type: :list)
  field(:pscAutoConnections, as: GoogleApi.AlloyDB.V1.Model.PscAutoConnectionConfig, type: :list)
  field(:pscDnsName)
  field(:pscInterfaceConfigs, as: GoogleApi.AlloyDB.V1.Model.PscInterfaceConfig, type: :list)
  field(:serviceAttachmentLink)
end

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

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