# 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.Job do
  @moduledoc """
  Job represents an operation for a `Rollout`.

  ## Attributes

  *   `advanceChildRolloutJob` (*type:* `GoogleApi.CloudDeploy.V1.Model.AdvanceChildRolloutJob.t`, *default:* `nil`) - Output only. An advanceChildRollout Job.
  *   `createChildRolloutJob` (*type:* `GoogleApi.CloudDeploy.V1.Model.CreateChildRolloutJob.t`, *default:* `nil`) - Output only. A createChildRollout Job.
  *   `deployJob` (*type:* `GoogleApi.CloudDeploy.V1.Model.DeployJob.t`, *default:* `nil`) - Output only. A deploy Job.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. The ID of the Job.
  *   `jobRun` (*type:* `String.t`, *default:* `nil`) - Output only. The name of the `JobRun` responsible for the most recent invocation of this Job.
  *   `postdeployJob` (*type:* `GoogleApi.CloudDeploy.V1.Model.PostdeployJob.t`, *default:* `nil`) - Output only. A postdeploy Job.
  *   `predeployJob` (*type:* `GoogleApi.CloudDeploy.V1.Model.PredeployJob.t`, *default:* `nil`) - Output only. A predeploy Job.
  *   `skipMessage` (*type:* `String.t`, *default:* `nil`) - Output only. Additional information on why the Job was skipped, if available.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the Job.
  *   `verifyJob` (*type:* `GoogleApi.CloudDeploy.V1.Model.VerifyJob.t`, *default:* `nil`) - Output only. A verify Job.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :advanceChildRolloutJob =>
            GoogleApi.CloudDeploy.V1.Model.AdvanceChildRolloutJob.t() | nil,
          :createChildRolloutJob =>
            GoogleApi.CloudDeploy.V1.Model.CreateChildRolloutJob.t() | nil,
          :deployJob => GoogleApi.CloudDeploy.V1.Model.DeployJob.t() | nil,
          :id => String.t() | nil,
          :jobRun => String.t() | nil,
          :postdeployJob => GoogleApi.CloudDeploy.V1.Model.PostdeployJob.t() | nil,
          :predeployJob => GoogleApi.CloudDeploy.V1.Model.PredeployJob.t() | nil,
          :skipMessage => String.t() | nil,
          :state => String.t() | nil,
          :verifyJob => GoogleApi.CloudDeploy.V1.Model.VerifyJob.t() | nil
        }

  field(:advanceChildRolloutJob, as: GoogleApi.CloudDeploy.V1.Model.AdvanceChildRolloutJob)
  field(:createChildRolloutJob, as: GoogleApi.CloudDeploy.V1.Model.CreateChildRolloutJob)
  field(:deployJob, as: GoogleApi.CloudDeploy.V1.Model.DeployJob)
  field(:id)
  field(:jobRun)
  field(:postdeployJob, as: GoogleApi.CloudDeploy.V1.Model.PostdeployJob)
  field(:predeployJob, as: GoogleApi.CloudDeploy.V1.Model.PredeployJob)
  field(:skipMessage)
  field(:state)
  field(:verifyJob, as: GoogleApi.CloudDeploy.V1.Model.VerifyJob)
end

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

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