# 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.GKEHub.V1.Model.Membership do
  @moduledoc """
  Membership contains information about a member cluster.

  ## Attributes

  *   `authority` (*type:* `GoogleApi.GKEHub.V1.Model.Authority.t`, *default:* `nil`) - Optional. How to identify workloads from this Membership. See the documentation on Workload Identity for more details: https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
  *   `clusterTier` (*type:* `String.t`, *default:* `nil`) - Output only. The tier of the cluster.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. When the Membership was created.
  *   `deleteTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. When the Membership was deleted.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Output only. Description of this membership, limited to 63 characters. Must match the regex: `a-zA-Z0-9*` This field is present for legacy purposes.
  *   `endpoint` (*type:* `GoogleApi.GKEHub.V1.Model.MembershipEndpoint.t`, *default:* `nil`) - Optional. Endpoint information to reach this member.
  *   `externalId` (*type:* `String.t`, *default:* `nil`) - Optional. An externally-generated and managed ID for this Membership. This ID may be modified after creation, but this is not recommended. The ID must match the regex: `a-zA-Z0-9*` If this Membership represents a Kubernetes cluster, this value should be set to the UID of the `kube-system` namespace object.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Labels for this membership.
  *   `lastConnectionTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. For clusters using Connect, the timestamp of the most recent connection established with Google Cloud. This time is updated every several minutes, not continuously. For clusters that do not use GKE Connect, or that have never connected successfully, this field will be unset.
  *   `monitoringConfig` (*type:* `GoogleApi.GKEHub.V1.Model.MonitoringConfig.t`, *default:* `nil`) - Optional. The monitoring config information for this membership.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The full, unique name of this Membership resource in the format `projects/*/locations/*/memberships/{membership_id}`, set during creation. `membership_id` must be a valid RFC 1123 compliant DNS label: 1. At most 63 characters in length 2. It must consist of lower case alphanumeric characters or `-` 3. It must start and end with an alphanumeric character Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, with a maximum length of 63 characters.
  *   `state` (*type:* `GoogleApi.GKEHub.V1.Model.MembershipState.t`, *default:* `nil`) - Output only. State of the Membership resource.
  *   `uniqueId` (*type:* `String.t`, *default:* `nil`) - Output only. Google-generated UUID for this resource. This is unique across all Membership resources. If a Membership resource is deleted and another resource with the same name is created, it gets a different unique_id.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. When the Membership was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authority => GoogleApi.GKEHub.V1.Model.Authority.t() | nil,
          :clusterTier => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :deleteTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :endpoint => GoogleApi.GKEHub.V1.Model.MembershipEndpoint.t() | nil,
          :externalId => String.t() | nil,
          :labels => map() | nil,
          :lastConnectionTime => DateTime.t() | nil,
          :monitoringConfig => GoogleApi.GKEHub.V1.Model.MonitoringConfig.t() | nil,
          :name => String.t() | nil,
          :state => GoogleApi.GKEHub.V1.Model.MembershipState.t() | nil,
          :uniqueId => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:authority, as: GoogleApi.GKEHub.V1.Model.Authority)
  field(:clusterTier)
  field(:createTime, as: DateTime)
  field(:deleteTime, as: DateTime)
  field(:description)
  field(:endpoint, as: GoogleApi.GKEHub.V1.Model.MembershipEndpoint)
  field(:externalId)
  field(:labels, type: :map)
  field(:lastConnectionTime, as: DateTime)
  field(:monitoringConfig, as: GoogleApi.GKEHub.V1.Model.MonitoringConfig)
  field(:name)
  field(:state, as: GoogleApi.GKEHub.V1.Model.MembershipState)
  field(:uniqueId)
  field(:updateTime, as: DateTime)
end

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

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