# 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.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3Deployment do
  @moduledoc """
  Represents a deployment in an environment. A deployment happens when a flow version configured to be active in the environment. You can configure running pre-deployment steps, e.g. running validation test cases, experiment auto-rollout, etc.

  ## Attributes

  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - End time of this deployment.
  *   `flowVersion` (*type:* `String.t`, *default:* `nil`) - The name of the flow version for this deployment. Format: projects//locations//agents//flows//versions/.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the deployment. Format: projects//locations//agents//environments//deployments/.
  *   `result` (*type:* `GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3DeploymentResult.t`, *default:* `nil`) - Result of the deployment.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Start time of this deployment.
  *   `state` (*type:* `String.t`, *default:* `nil`) - The current state of the deployment.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endTime => DateTime.t() | nil,
          :flowVersion => String.t() | nil,
          :name => String.t() | nil,
          :result =>
            GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3DeploymentResult.t() | nil,
          :startTime => DateTime.t() | nil,
          :state => String.t() | nil
        }

  field(:endTime, as: DateTime)
  field(:flowVersion)
  field(:name)
  field(:result, as: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3DeploymentResult)
  field(:startTime, as: DateTime)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3Deployment do
  def decode(value, options) do
    GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3Deployment.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3Deployment do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
