lib/google_api/compute/v1/model/network_endpoint.ex

# 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.Compute.V1.Model.NetworkEndpoint do
  @moduledoc """
  The network endpoint.

  ## Attributes

  *   `annotations` (*type:* `map()`, *default:* `nil`) - Metadata defined as annotations on the network endpoint.
  *   `fqdn` (*type:* `String.t`, *default:* `nil`) - Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT.
  *   `instance` (*type:* `String.t`, *default:* `nil`) - The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035.
  *   `ipAddress` (*type:* `String.t`, *default:* `nil`) - Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used.
  *   `port` (*type:* `integer()`, *default:* `nil`) - Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotations => map() | nil,
          :fqdn => String.t() | nil,
          :instance => String.t() | nil,
          :ipAddress => String.t() | nil,
          :port => integer() | nil
        }

  field(:annotations, type: :map)
  field(:fqdn)
  field(:instance)
  field(:ipAddress)
  field(:port)
end

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

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