# 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.CloudDeploy.V1.Model.RepairRolloutOperation do
  @moduledoc """
  Contains the information for an automated `repair rollout` operation.

  ## Attributes

  *   `currentRepairPhaseIndex` (*type:* `String.t`, *default:* `nil`) - Output only. The index of the current repair action in the repair sequence.
  *   `jobId` (*type:* `String.t`, *default:* `nil`) - Output only. The job ID for the Job to repair.
  *   `phaseId` (*type:* `String.t`, *default:* `nil`) - Output only. The phase ID of the phase that includes the job being repaired.
  *   `repairPhases` (*type:* `list(GoogleApi.CloudDeploy.V1.Model.RepairPhase.t)`, *default:* `nil`) - Output only. Records of the repair attempts. Each repair phase may have multiple retry attempts or single rollback attempt.
  *   `rollout` (*type:* `String.t`, *default:* `nil`) - Output only. The name of the rollout that initiates the `AutomationRun`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :currentRepairPhaseIndex => String.t() | nil,
          :jobId => String.t() | nil,
          :phaseId => String.t() | nil,
          :repairPhases => list(GoogleApi.CloudDeploy.V1.Model.RepairPhase.t()) | nil,
          :rollout => String.t() | nil
        }

  field(:currentRepairPhaseIndex)
  field(:jobId)
  field(:phaseId)
  field(:repairPhases, as: GoogleApi.CloudDeploy.V1.Model.RepairPhase, type: :list)
  field(:rollout)
end

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

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