# 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.NetworkConnectivity.V1.Model.PscConnection do
  @moduledoc """
  Information about a specific Private Service Connect connection.

  ## Attributes

  *   `consumerAddress` (*type:* `String.t`, *default:* `nil`) - The resource reference of the consumer address.
  *   `consumerForwardingRule` (*type:* `String.t`, *default:* `nil`) - The resource reference of the PSC Forwarding Rule within the consumer VPC.
  *   `consumerTargetProject` (*type:* `String.t`, *default:* `nil`) - The project where the PSC connection is created.
  *   `error` (*type:* `GoogleApi.NetworkConnectivity.V1.Model.GoogleRpcStatus.t`, *default:* `nil`) - The most recent error during operating this connection. Deprecated, please use error_info instead.
  *   `errorInfo` (*type:* `GoogleApi.NetworkConnectivity.V1.Model.GoogleRpcErrorInfo.t`, *default:* `nil`) - Output only. The error info for the latest error during operating this connection.
  *   `errorType` (*type:* `String.t`, *default:* `nil`) - The error type indicates whether the error is consumer facing, producer facing or system internal.
  *   `gceOperation` (*type:* `String.t`, *default:* `nil`) - The last Compute Engine operation to setup PSC connection.
  *   `ipVersion` (*type:* `String.t`, *default:* `nil`) - The requested IP version for the PSC connection.
  *   `producerInstanceId` (*type:* `String.t`, *default:* `nil`) - Immutable. Deprecated. Use producer_instance_metadata instead. An immutable identifier for the producer instance.
  *   `producerInstanceMetadata` (*type:* `map()`, *default:* `nil`) - Immutable. An immutable map for the producer instance metadata.
  *   `pscConnectionId` (*type:* `String.t`, *default:* `nil`) - The PSC connection id of the PSC forwarding rule.
  *   `selectedSubnetwork` (*type:* `String.t`, *default:* `nil`) - Output only. The URI of the subnetwork selected to allocate IP address for this connection.
  *   `serviceClass` (*type:* `String.t`, *default:* `nil`) - Output only. [Output only] The service class associated with this PSC Connection. The value is derived from the SCPolicy and matches the service class name provided by the customer.
  *   `state` (*type:* `String.t`, *default:* `nil`) - State of the PSC Connection
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :consumerAddress => String.t() | nil,
          :consumerForwardingRule => String.t() | nil,
          :consumerTargetProject => String.t() | nil,
          :error => GoogleApi.NetworkConnectivity.V1.Model.GoogleRpcStatus.t() | nil,
          :errorInfo => GoogleApi.NetworkConnectivity.V1.Model.GoogleRpcErrorInfo.t() | nil,
          :errorType => String.t() | nil,
          :gceOperation => String.t() | nil,
          :ipVersion => String.t() | nil,
          :producerInstanceId => String.t() | nil,
          :producerInstanceMetadata => map() | nil,
          :pscConnectionId => String.t() | nil,
          :selectedSubnetwork => String.t() | nil,
          :serviceClass => String.t() | nil,
          :state => String.t() | nil
        }

  field(:consumerAddress)
  field(:consumerForwardingRule)
  field(:consumerTargetProject)
  field(:error, as: GoogleApi.NetworkConnectivity.V1.Model.GoogleRpcStatus)
  field(:errorInfo, as: GoogleApi.NetworkConnectivity.V1.Model.GoogleRpcErrorInfo)
  field(:errorType)
  field(:gceOperation)
  field(:ipVersion)
  field(:producerInstanceId)
  field(:producerInstanceMetadata, type: :map)
  field(:pscConnectionId)
  field(:selectedSubnetwork)
  field(:serviceClass)
  field(:state)
end

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

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