# 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.SQLAdmin.V1.Model.PscConfig do
  @moduledoc """
  PSC settings for a Cloud SQL instance.

  ## Attributes

  *   `allowedConsumerProjects` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The list of consumer projects that are allow-listed for PSC connections to this instance. This instance can be connected to with PSC from any network in these projects. Each consumer project in this list may be represented by a project number (numeric) or by a project id (alphanumeric).
  *   `pscAutoConnections` (*type:* `list(GoogleApi.SQLAdmin.V1.Model.PscAutoConnectionConfig.t)`, *default:* `nil`) - Optional. The list of settings for requested Private Service Connect consumer endpoints that can be used to connect to this Cloud SQL instance.
  *   `pscEnabled` (*type:* `boolean()`, *default:* `nil`) - Whether PSC connectivity is enabled for this instance.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowedConsumerProjects => list(String.t()) | nil,
          :pscAutoConnections =>
            list(GoogleApi.SQLAdmin.V1.Model.PscAutoConnectionConfig.t()) | nil,
          :pscEnabled => boolean() | nil
        }

  field(:allowedConsumerProjects, type: :list)
  field(:pscAutoConnections, as: GoogleApi.SQLAdmin.V1.Model.PscAutoConnectionConfig, type: :list)
  field(:pscEnabled)
end

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

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