# 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.VMMigration.V1.Model.NetworkInterface do
  @moduledoc """
  NetworkInterface represents a NIC of a VM.

  ## Attributes

  *   `externalIp` (*type:* `String.t`, *default:* `nil`) - Optional. The external IP to define in the NIC.
  *   `internalIp` (*type:* `String.t`, *default:* `nil`) - Optional. The internal IP to define in the NIC. The formats accepted are: `ephemeral` \\ ipv4 address \\ a named address resource full path.
  *   `network` (*type:* `String.t`, *default:* `nil`) - The network to connect the NIC to.
  *   `networkTier` (*type:* `String.t`, *default:* `nil`) - Optional. The networking tier used for optimizing connectivity between instances and systems on the internet. Applies only for external ephemeral IP addresses. If left empty, will default to PREMIUM.
  *   `subnetwork` (*type:* `String.t`, *default:* `nil`) - Optional. The subnetwork to connect the NIC to.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :externalIp => String.t() | nil,
          :internalIp => String.t() | nil,
          :network => String.t() | nil,
          :networkTier => String.t() | nil,
          :subnetwork => String.t() | nil
        }

  field(:externalIp)
  field(:internalIp)
  field(:network)
  field(:networkTier)
  field(:subnetwork)
end

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

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