# 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.NetworkConnectivity.V1.Model.Spoke do
  @moduledoc """
  A Network Connectivity Center spoke represents one or more network connectivity resources. When you create a spoke, you associate it with a hub. You must also identify a value for exactly one of the following fields: * linked_vpn_tunnels * linked_interconnect_attachments * linked_router_appliance_instances * linked_vpc_network

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the spoke was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. An optional description of the spoke.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
  *   `fieldPathsPendingUpdate` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The list of fields waiting for hub administration's approval.
  *   `group` (*type:* `String.t`, *default:* `nil`) - Optional. The name of the group that this spoke is associated with.
  *   `hub` (*type:* `String.t`, *default:* `nil`) - Immutable. The name of the hub that this spoke is attached to.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional labels in key-value pair format. For more information about labels, see [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
  *   `linkedInterconnectAttachments` (*type:* `GoogleApi.NetworkConnectivity.V1.Model.LinkedInterconnectAttachments.t`, *default:* `nil`) - Optional. VLAN attachments that are associated with the spoke.
  *   `linkedProducerVpcNetwork` (*type:* `GoogleApi.NetworkConnectivity.V1.Model.LinkedProducerVpcNetwork.t`, *default:* `nil`) - Optional. The linked producer VPC that is associated with the spoke.
  *   `linkedRouterApplianceInstances` (*type:* `GoogleApi.NetworkConnectivity.V1.Model.LinkedRouterApplianceInstances.t`, *default:* `nil`) - Optional. Router appliance instances that are associated with the spoke.
  *   `linkedVpcNetwork` (*type:* `GoogleApi.NetworkConnectivity.V1.Model.LinkedVpcNetwork.t`, *default:* `nil`) - Optional. VPC network that is associated with the spoke.
  *   `linkedVpnTunnels` (*type:* `GoogleApi.NetworkConnectivity.V1.Model.LinkedVpnTunnels.t`, *default:* `nil`) - Optional. VPN tunnels that are associated with the spoke.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The name of the spoke. Spoke names must be unique. They use the following form: `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
  *   `reasons` (*type:* `list(GoogleApi.NetworkConnectivity.V1.Model.StateReason.t)`, *default:* `nil`) - Output only. The reasons for current state of the spoke.
  *   `spokeType` (*type:* `String.t`, *default:* `nil`) - Output only. The type of resource associated with the spoke.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current lifecycle state of this spoke.
  *   `uniqueId` (*type:* `String.t`, *default:* `nil`) - Output only. The Google-generated UUID for the spoke. This value is unique across all spoke resources. If a spoke is deleted and another with the same name is created, the new spoke is assigned a different `unique_id`.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the spoke was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :etag => String.t() | nil,
          :fieldPathsPendingUpdate => list(String.t()) | nil,
          :group => String.t() | nil,
          :hub => String.t() | nil,
          :labels => map() | nil,
          :linkedInterconnectAttachments =>
            GoogleApi.NetworkConnectivity.V1.Model.LinkedInterconnectAttachments.t() | nil,
          :linkedProducerVpcNetwork =>
            GoogleApi.NetworkConnectivity.V1.Model.LinkedProducerVpcNetwork.t() | nil,
          :linkedRouterApplianceInstances =>
            GoogleApi.NetworkConnectivity.V1.Model.LinkedRouterApplianceInstances.t() | nil,
          :linkedVpcNetwork => GoogleApi.NetworkConnectivity.V1.Model.LinkedVpcNetwork.t() | nil,
          :linkedVpnTunnels => GoogleApi.NetworkConnectivity.V1.Model.LinkedVpnTunnels.t() | nil,
          :name => String.t() | nil,
          :reasons => list(GoogleApi.NetworkConnectivity.V1.Model.StateReason.t()) | nil,
          :spokeType => String.t() | nil,
          :state => String.t() | nil,
          :uniqueId => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:description)
  field(:etag)
  field(:fieldPathsPendingUpdate, type: :list)
  field(:group)
  field(:hub)
  field(:labels, type: :map)

  field(:linkedInterconnectAttachments,
    as: GoogleApi.NetworkConnectivity.V1.Model.LinkedInterconnectAttachments
  )

  field(:linkedProducerVpcNetwork,
    as: GoogleApi.NetworkConnectivity.V1.Model.LinkedProducerVpcNetwork
  )

  field(:linkedRouterApplianceInstances,
    as: GoogleApi.NetworkConnectivity.V1.Model.LinkedRouterApplianceInstances
  )

  field(:linkedVpcNetwork, as: GoogleApi.NetworkConnectivity.V1.Model.LinkedVpcNetwork)
  field(:linkedVpnTunnels, as: GoogleApi.NetworkConnectivity.V1.Model.LinkedVpnTunnels)
  field(:name)
  field(:reasons, as: GoogleApi.NetworkConnectivity.V1.Model.StateReason, type: :list)
  field(:spokeType)
  field(:state)
  field(:uniqueId)
  field(:updateTime, as: DateTime)
end

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

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