# 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.DeployJobRun do
  @moduledoc """
  DeployJobRun contains information specific to a deploy `JobRun`.

  ## Attributes

  *   `artifact` (*type:* `GoogleApi.CloudDeploy.V1.Model.DeployArtifact.t`, *default:* `nil`) - Output only. The artifact of a deploy job run, if available.
  *   `build` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the Cloud Build `Build` object that is used to deploy. Format is `projects/{project}/locations/{location}/builds/{build}`.
  *   `failureCause` (*type:* `String.t`, *default:* `nil`) - Output only. The reason the deploy failed. This will always be unspecified while the deploy is in progress or if it succeeded.
  *   `failureMessage` (*type:* `String.t`, *default:* `nil`) - Output only. Additional information about the deploy failure, if available.
  *   `metadata` (*type:* `GoogleApi.CloudDeploy.V1.Model.DeployJobRunMetadata.t`, *default:* `nil`) - Output only. Metadata containing information about the deploy job run.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :artifact => GoogleApi.CloudDeploy.V1.Model.DeployArtifact.t() | nil,
          :build => String.t() | nil,
          :failureCause => String.t() | nil,
          :failureMessage => String.t() | nil,
          :metadata => GoogleApi.CloudDeploy.V1.Model.DeployJobRunMetadata.t() | nil
        }

  field(:artifact, as: GoogleApi.CloudDeploy.V1.Model.DeployArtifact)
  field(:build)
  field(:failureCause)
  field(:failureMessage)
  field(:metadata, as: GoogleApi.CloudDeploy.V1.Model.DeployJobRunMetadata)
end

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

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