# 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.PolicyControllerMembershipState do
  @moduledoc """
  **Policy Controller**: State for a single cluster.

  ## Attributes

  *   `componentStates` (*type:* `%{optional(String.t) => GoogleApi.GKEHub.V1.Model.PolicyControllerOnClusterState.t}`, *default:* `nil`) - Currently these include (also serving as map keys): 1. "admission" 2. "audit" 3. "mutation"
  *   `policyContentState` (*type:* `GoogleApi.GKEHub.V1.Model.PolicyControllerPolicyContentState.t`, *default:* `nil`) - The overall content state observed by the Hub Feature controller.
  *   `state` (*type:* `String.t`, *default:* `nil`) - The overall Policy Controller lifecycle state observed by the Hub Feature controller.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :componentStates =>
            %{
              optional(String.t()) => GoogleApi.GKEHub.V1.Model.PolicyControllerOnClusterState.t()
            }
            | nil,
          :policyContentState =>
            GoogleApi.GKEHub.V1.Model.PolicyControllerPolicyContentState.t() | nil,
          :state => String.t() | nil
        }

  field(:componentStates, as: GoogleApi.GKEHub.V1.Model.PolicyControllerOnClusterState, type: :map)

  field(:policyContentState, as: GoogleApi.GKEHub.V1.Model.PolicyControllerPolicyContentState)
  field(:state)
end

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

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