# 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.NetworkSecurity.V1.Model.AddressGroup do
  @moduledoc """
  AddressGroup is a resource that specifies how a collection of IP/DNS used in Firewall Policy.

  ## Attributes

  *   `capacity` (*type:* `integer()`, *default:* `nil`) - Required. Capacity of the Address Group
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the resource was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Free-text description of the resource.
  *   `items` (*type:* `list(String.t)`, *default:* `nil`) - Optional. List of items.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Set of label tags associated with the AddressGroup resource.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Name of the AddressGroup resource. It matches pattern `projects/*/locations/{location}/addressGroups/`.
  *   `purpose` (*type:* `list(String.t)`, *default:* `nil`) - Optional. List of supported purposes of the Address Group.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - Output only. Server-defined fully-qualified URL for this resource.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Required. The type of the Address Group. Possible values are "IPv4" or "IPV6".
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the resource was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :capacity => integer() | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :items => list(String.t()) | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :purpose => list(String.t()) | nil,
          :selfLink => String.t() | nil,
          :type => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:capacity)
  field(:createTime, as: DateTime)
  field(:description)
  field(:items, type: :list)
  field(:labels, type: :map)
  field(:name)
  field(:purpose, type: :list)
  field(:selfLink)
  field(:type)
  field(:updateTime, as: DateTime)
end

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

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