# 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.ServiceNetworking.V1.Model.SecondaryIpRangeSpec do
  @moduledoc """


  ## Attributes

  *   `ipPrefixLength` (*type:* `integer()`, *default:* `nil`) - Required. The prefix length of the secondary IP range. Use CIDR range notation, such as `30` to provision a secondary IP range with an `x.x.x.x/30` CIDR range. The IP address range is drawn from a pool of available ranges in the service consumer's allocated range.
  *   `outsideAllocationPublicIpRange` (*type:* `String.t`, *default:* `nil`) - Optional. Enable outside allocation using public IP addresses. Any public IP range may be specified. If this field is provided, we will not use customer reserved ranges for this secondary IP range.
  *   `rangeName` (*type:* `String.t`, *default:* `nil`) - Required. A name for the secondary IP range. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork.
  *   `requestedAddress` (*type:* `String.t`, *default:* `nil`) - Optional. The starting address of a range. The address must be a valid IPv4 address in the x.x.x.x format. This value combined with the IP prefix range is the CIDR range for the secondary IP range. The range must be within the allocated range that is assigned to the private connection. If the CIDR range isn't available, the call fails.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :ipPrefixLength => integer() | nil,
          :outsideAllocationPublicIpRange => String.t() | nil,
          :rangeName => String.t() | nil,
          :requestedAddress => String.t() | nil
        }

  field(:ipPrefixLength)
  field(:outsideAllocationPublicIpRange)
  field(:rangeName)
  field(:requestedAddress)
end

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

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