# 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.ClusterUpgradeFleetSpec do
  @moduledoc """
  **ClusterUpgrade**: The configuration for the fleet-level ClusterUpgrade feature.

  ## Attributes

  *   `gkeUpgradeOverrides` (*type:* `list(GoogleApi.GKEHub.V1.Model.ClusterUpgradeGKEUpgradeOverride.t)`, *default:* `nil`) - Allow users to override some properties of each GKE upgrade.
  *   `postConditions` (*type:* `GoogleApi.GKEHub.V1.Model.ClusterUpgradePostConditions.t`, *default:* `nil`) - Required. Post conditions to evaluate to mark an upgrade COMPLETE. Required.
  *   `upstreamFleets` (*type:* `list(String.t)`, *default:* `nil`) - This fleet consumes upgrades that have COMPLETE status code in the upstream fleets. See UpgradeStatus.Code for code definitions. The fleet name should be either fleet project number or id. This is defined as repeated for future proof reasons. Initial implementation will enforce at most one upstream fleet.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :gkeUpgradeOverrides =>
            list(GoogleApi.GKEHub.V1.Model.ClusterUpgradeGKEUpgradeOverride.t()) | nil,
          :postConditions => GoogleApi.GKEHub.V1.Model.ClusterUpgradePostConditions.t() | nil,
          :upstreamFleets => list(String.t()) | nil
        }

  field(:gkeUpgradeOverrides,
    as: GoogleApi.GKEHub.V1.Model.ClusterUpgradeGKEUpgradeOverride,
    type: :list
  )

  field(:postConditions, as: GoogleApi.GKEHub.V1.Model.ClusterUpgradePostConditions)
  field(:upstreamFleets, type: :list)
end

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

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