# 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.Feature do
  @moduledoc """
  Feature represents the settings and status of any Fleet Feature.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. When the Feature resource was created.
  *   `deleteTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. When the Feature resource was deleted.
  *   `fleetDefaultMemberConfig` (*type:* `GoogleApi.GKEHub.V1.Model.CommonFleetDefaultMemberConfigSpec.t`, *default:* `nil`) - Optional. Feature configuration applicable to all memberships of the fleet.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Labels for this Feature.
  *   `membershipSpecs` (*type:* `%{optional(String.t) => GoogleApi.GKEHub.V1.Model.MembershipFeatureSpec.t}`, *default:* `nil`) - Optional. Membership-specific configuration for this Feature. If this Feature does not support any per-Membership configuration, this field may be unused. The keys indicate which Membership the configuration is for, in the form: `projects/{p}/locations/{l}/memberships/{m}` Where {p} is the project, {l} is a valid location and {m} is a valid Membership in this project at that location. {p} WILL match the Feature's project. {p} will always be returned as the project number, but the project ID is also accepted during input. If the same Membership is specified in the map twice (using the project ID form, and the project number form), exactly ONE of the entries will be saved, with no guarantees as to which. For this reason, it is recommended the same format be used for all entries when mutating a Feature.
  *   `membershipStates` (*type:* `%{optional(String.t) => GoogleApi.GKEHub.V1.Model.MembershipFeatureState.t}`, *default:* `nil`) - Output only. Membership-specific Feature status. If this Feature does report any per-Membership status, this field may be unused. The keys indicate which Membership the state is for, in the form: `projects/{p}/locations/{l}/memberships/{m}` Where {p} is the project number, {l} is a valid location and {m} is a valid Membership in this project at that location. {p} MUST match the Feature's project number.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The full, unique name of this Feature resource in the format `projects/*/locations/*/features/*`.
  *   `resourceState` (*type:* `GoogleApi.GKEHub.V1.Model.FeatureResourceState.t`, *default:* `nil`) - Output only. State of the Feature resource itself.
  *   `scopeSpecs` (*type:* `%{optional(String.t) => GoogleApi.GKEHub.V1.Model.ScopeFeatureSpec.t}`, *default:* `nil`) - Optional. Scope-specific configuration for this Feature. If this Feature does not support any per-Scope configuration, this field may be unused. The keys indicate which Scope the configuration is for, in the form: `projects/{p}/locations/global/scopes/{s}` Where {p} is the project, {s} is a valid Scope in this project. {p} WILL match the Feature's project. {p} will always be returned as the project number, but the project ID is also accepted during input. If the same Scope is specified in the map twice (using the project ID form, and the project number form), exactly ONE of the entries will be saved, with no guarantees as to which. For this reason, it is recommended the same format be used for all entries when mutating a Feature.
  *   `scopeStates` (*type:* `%{optional(String.t) => GoogleApi.GKEHub.V1.Model.ScopeFeatureState.t}`, *default:* `nil`) - Output only. Scope-specific Feature status. If this Feature does report any per-Scope status, this field may be unused. The keys indicate which Scope the state is for, in the form: `projects/{p}/locations/global/scopes/{s}` Where {p} is the project, {s} is a valid Scope in this project. {p} WILL match the Feature's project.
  *   `spec` (*type:* `GoogleApi.GKEHub.V1.Model.CommonFeatureSpec.t`, *default:* `nil`) - Optional. Fleet-wide Feature configuration. If this Feature does not support any Fleet-wide configuration, this field may be unused.
  *   `state` (*type:* `GoogleApi.GKEHub.V1.Model.CommonFeatureState.t`, *default:* `nil`) - Output only. The Fleet-wide Feature state.
  *   `unreachable` (*type:* `list(String.t)`, *default:* `nil`) - Output only. List of locations that could not be reached while fetching this feature.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. When the Feature resource was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :deleteTime => DateTime.t() | nil,
          :fleetDefaultMemberConfig =>
            GoogleApi.GKEHub.V1.Model.CommonFleetDefaultMemberConfigSpec.t() | nil,
          :labels => map() | nil,
          :membershipSpecs =>
            %{optional(String.t()) => GoogleApi.GKEHub.V1.Model.MembershipFeatureSpec.t()} | nil,
          :membershipStates =>
            %{optional(String.t()) => GoogleApi.GKEHub.V1.Model.MembershipFeatureState.t()} | nil,
          :name => String.t() | nil,
          :resourceState => GoogleApi.GKEHub.V1.Model.FeatureResourceState.t() | nil,
          :scopeSpecs =>
            %{optional(String.t()) => GoogleApi.GKEHub.V1.Model.ScopeFeatureSpec.t()} | nil,
          :scopeStates =>
            %{optional(String.t()) => GoogleApi.GKEHub.V1.Model.ScopeFeatureState.t()} | nil,
          :spec => GoogleApi.GKEHub.V1.Model.CommonFeatureSpec.t() | nil,
          :state => GoogleApi.GKEHub.V1.Model.CommonFeatureState.t() | nil,
          :unreachable => list(String.t()) | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:deleteTime, as: DateTime)

  field(:fleetDefaultMemberConfig,
    as: GoogleApi.GKEHub.V1.Model.CommonFleetDefaultMemberConfigSpec
  )

  field(:labels, type: :map)
  field(:membershipSpecs, as: GoogleApi.GKEHub.V1.Model.MembershipFeatureSpec, type: :map)
  field(:membershipStates, as: GoogleApi.GKEHub.V1.Model.MembershipFeatureState, type: :map)
  field(:name)
  field(:resourceState, as: GoogleApi.GKEHub.V1.Model.FeatureResourceState)
  field(:scopeSpecs, as: GoogleApi.GKEHub.V1.Model.ScopeFeatureSpec, type: :map)
  field(:scopeStates, as: GoogleApi.GKEHub.V1.Model.ScopeFeatureState, type: :map)
  field(:spec, as: GoogleApi.GKEHub.V1.Model.CommonFeatureSpec)
  field(:state, as: GoogleApi.GKEHub.V1.Model.CommonFeatureState)
  field(:unreachable, type: :list)
  field(:updateTime, as: DateTime)
end

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

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