# 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.KubernetesResource do
  @moduledoc """
  KubernetesResource contains the YAML manifests and configuration for Membership Kubernetes resources in the cluster. After CreateMembership or UpdateMembership, these resources should be re-applied in the cluster.

  ## Attributes

  *   `connectResources` (*type:* `list(GoogleApi.GKEHub.V1.Model.ResourceManifest.t)`, *default:* `nil`) - Output only. The Kubernetes resources for installing the GKE Connect agent This field is only populated in the Membership returned from a successful long-running operation from CreateMembership or UpdateMembership. It is not populated during normal GetMembership or ListMemberships requests. To get the resource manifest after the initial registration, the caller should make a UpdateMembership call with an empty field mask.
  *   `membershipCrManifest` (*type:* `String.t`, *default:* `nil`) - Input only. The YAML representation of the Membership CR. This field is ignored for GKE clusters where Hub can read the CR directly. Callers should provide the CR that is currently present in the cluster during CreateMembership or UpdateMembership, or leave this field empty if none exists. The CR manifest is used to validate the cluster has not been registered with another Membership.
  *   `membershipResources` (*type:* `list(GoogleApi.GKEHub.V1.Model.ResourceManifest.t)`, *default:* `nil`) - Output only. Additional Kubernetes resources that need to be applied to the cluster after Membership creation, and after every update. This field is only populated in the Membership returned from a successful long-running operation from CreateMembership or UpdateMembership. It is not populated during normal GetMembership or ListMemberships requests. To get the resource manifest after the initial registration, the caller should make a UpdateMembership call with an empty field mask.
  *   `resourceOptions` (*type:* `GoogleApi.GKEHub.V1.Model.ResourceOptions.t`, *default:* `nil`) - Optional. Options for Kubernetes resource generation.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :connectResources => list(GoogleApi.GKEHub.V1.Model.ResourceManifest.t()) | nil,
          :membershipCrManifest => String.t() | nil,
          :membershipResources => list(GoogleApi.GKEHub.V1.Model.ResourceManifest.t()) | nil,
          :resourceOptions => GoogleApi.GKEHub.V1.Model.ResourceOptions.t() | nil
        }

  field(:connectResources, as: GoogleApi.GKEHub.V1.Model.ResourceManifest, type: :list)
  field(:membershipCrManifest)
  field(:membershipResources, as: GoogleApi.GKEHub.V1.Model.ResourceManifest, type: :list)
  field(:resourceOptions, as: GoogleApi.GKEHub.V1.Model.ResourceOptions)
end

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

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