# 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.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaErrorCatcherConfig do
  @moduledoc """
  Configuration detail of a error catch task

  ## Attributes

  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. User-provided description intended to give more business context about the error catcher config.
  *   `errorCatcherId` (*type:* `String.t`, *default:* `nil`) - Required. An error catcher id is string representation for the error catcher config. Within a workflow, error_catcher_id uniquely identifies an error catcher config among all error catcher configs for the workflow
  *   `errorCatcherNumber` (*type:* `String.t`, *default:* `nil`) - Required. A number to uniquely identify each error catcher config within the workflow on UI.
  *   `label` (*type:* `String.t`, *default:* `nil`) - Optional. The user created label for a particular error catcher. Optional.
  *   `position` (*type:* `GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaCoordinate.t`, *default:* `nil`) - Optional. Informs the front-end application where to draw this error catcher config on the UI.
  *   `startErrorTasks` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaNextTask.t)`, *default:* `nil`) - Required. The set of start tasks that are to be executed for the error catch flow
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :description => String.t() | nil,
          :errorCatcherId => String.t() | nil,
          :errorCatcherNumber => String.t() | nil,
          :label => String.t() | nil,
          :position =>
            GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaCoordinate.t()
            | nil,
          :startErrorTasks =>
            list(GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaNextTask.t())
            | nil
        }

  field(:description)
  field(:errorCatcherId)
  field(:errorCatcherNumber)
  field(:label)

  field(:position,
    as: GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaCoordinate
  )

  field(:startErrorTasks,
    as: GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaNextTask,
    type: :list
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaErrorCatcherConfig do
  def decode(value, options) do
    GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaErrorCatcherConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaErrorCatcherConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
