# 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.RegionalEndpoint do
  @moduledoc """
  The RegionalEndpoint resource.

  ## Attributes

  *   `accessType` (*type:* `String.t`, *default:* `nil`) - Required. The access type of this regional endpoint. This field is reflected in the PSC Forwarding Rule configuration to enable global access.
  *   `address` (*type:* `String.t`, *default:* `nil`) - Optional. The IP Address of the Regional Endpoint. When no address is provided, an IP from the subnetwork is allocated. Use one of the following formats: * IPv4 address as in `10.0.0.1` * Address resource URI as in `projects/{project}/regions/{region}/addresses/{address_name}` for an IPv4 or IPv6 address.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the RegionalEndpoint was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. A description of this resource.
  *   `ipAddress` (*type:* `String.t`, *default:* `nil`) - Output only. The literal IP address of the PSC Forwarding Rule created on behalf of the customer. This field is deprecated. Use address instead.
  *   `labels` (*type:* `map()`, *default:* `nil`) - User-defined labels.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The name of a RegionalEndpoint. Pattern: `projects/{project}/locations/{location}/regionalEndpoints/^[-a-z0-9](?:[-a-z0-9]{0,44})[a-z0-9]$`.
  *   `network` (*type:* `String.t`, *default:* `nil`) - The name of the VPC network for this private regional endpoint. Format: `projects/{project}/global/networks/{network}`
  *   `pscForwardingRule` (*type:* `String.t`, *default:* `nil`) - Output only. The resource reference of the PSC Forwarding Rule created on behalf of the customer. Format: `//compute.googleapis.com/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule_name}`
  *   `subnetwork` (*type:* `String.t`, *default:* `nil`) - The name of the subnetwork from which the IP address will be allocated. Format: `projects/{project}/regions/{region}/subnetworks/{subnetwork}`
  *   `targetGoogleApi` (*type:* `String.t`, *default:* `nil`) - Required. The service endpoint this private regional endpoint connects to. Format: `{apiname}.{region}.p.rep.googleapis.com` Example: "cloudkms.us-central1.p.rep.googleapis.com".
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the RegionalEndpoint was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accessType => String.t() | nil,
          :address => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :ipAddress => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :network => String.t() | nil,
          :pscForwardingRule => String.t() | nil,
          :subnetwork => String.t() | nil,
          :targetGoogleApi => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:accessType)
  field(:address)
  field(:createTime, as: DateTime)
  field(:description)
  field(:ipAddress)
  field(:labels, type: :map)
  field(:name)
  field(:network)
  field(:pscForwardingRule)
  field(:subnetwork)
  field(:targetGoogleApi)
  field(:updateTime, as: DateTime)
end

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

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