# 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
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.PacketMirroring do
  @moduledoc """
  Represents a Packet Mirroring resource. Packet Mirroring clones the traffic of specified instances in your Virtual Private Cloud (VPC) network and forwards it to a collector destination, such as an instance group of an internal TCP/UDP load balancer, for analysis or examination. For more information about setting up Packet Mirroring, see Using Packet Mirroring.

  ## Attributes

  *   `collectorIlb` (*type:* `GoogleApi.Compute.V1.Model.PacketMirroringForwardingRuleInfo.t`, *default:* `nil`) - The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true.
  *   `creationTimestamp` (*type:* `String.t`, *default:* `nil`) - [Output Only] Creation timestamp in RFC3339 text format.
  *   `description` (*type:* `String.t`, *default:* `nil`) - An optional description of this resource. Provide this property when you create the resource.
  *   `enable` (*type:* `String.t`, *default:* `nil`) - Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE.
  *   `filter` (*type:* `GoogleApi.Compute.V1.Model.PacketMirroringFilter.t`, *default:* `nil`) - Filter for mirrored traffic. If unspecified, all traffic is mirrored.
  *   `id` (*type:* `String.t`, *default:* `nil`) - [Output Only] The unique identifier for the resource. This identifier is defined by the server.
  *   `kind` (*type:* `String.t`, *default:* `compute#packetMirroring`) - [Output Only] Type of the resource. Always compute#packetMirroring for packet mirrorings.
  *   `mirroredResources` (*type:* `GoogleApi.Compute.V1.Model.PacketMirroringMirroredResourceInfo.t`, *default:* `nil`) - PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
  *   `network` (*type:* `GoogleApi.Compute.V1.Model.PacketMirroringNetworkInfo.t`, *default:* `nil`) - Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network.
  *   `priority` (*type:* `integer()`, *default:* `nil`) - The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535.
  *   `region` (*type:* `String.t`, *default:* `nil`) - [Output Only] URI of the region where the packetMirroring resides.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - [Output Only] Server-defined URL for the resource.

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :collectorIlb => GoogleApi.Compute.V1.Model.PacketMirroringForwardingRuleInfo.t() | nil,
          :creationTimestamp => String.t() | nil,
          :description => String.t() | nil,
          :enable => String.t() | nil,
          :filter => GoogleApi.Compute.V1.Model.PacketMirroringFilter.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :mirroredResources =>
            GoogleApi.Compute.V1.Model.PacketMirroringMirroredResourceInfo.t() | nil,
          :name => String.t() | nil,
          :network => GoogleApi.Compute.V1.Model.PacketMirroringNetworkInfo.t() | nil,
          :priority => integer() | nil,
          :region => String.t() | nil,
          :selfLink => String.t() | nil

  field(:collectorIlb, as: GoogleApi.Compute.V1.Model.PacketMirroringForwardingRuleInfo)
  field(:filter, as: GoogleApi.Compute.V1.Model.PacketMirroringFilter)
  field(:mirroredResources, as: GoogleApi.Compute.V1.Model.PacketMirroringMirroredResourceInfo)
  field(:network, as: GoogleApi.Compute.V1.Model.PacketMirroringNetworkInfo)

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

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