# 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.V1.Model.EnterpriseCrmEventbusProtoScatterResponse do
  @moduledoc """


  ## Attributes

  *   `errorMsg` (*type:* `String.t`, *default:* `nil`) - The error message of the failure if applicable.
  *   `executionIds` (*type:* `list(String.t)`, *default:* `nil`) - The execution ids of each Subworkflow fired by this scatter.
  *   `isSuccessful` (*type:* `boolean()`, *default:* `nil`) - If execution is sync, this is true if the execution passed and false if it failed. If the execution is async, this is true if the WF was fired off successfully, and false if it failed to execute. The success or failure of the subworkflows executed are not captured.
  *   `responseParams` (*type:* `list(GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParameterEntry.t)`, *default:* `nil`) - A list of all the response parameters in the aggregtorMap stored with the remapped key.
  *   `scatterElement` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParameterValueType.t`, *default:* `nil`) - The element that was scattered for this execution.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :errorMsg => String.t() | nil,
          :executionIds => list(String.t()) | nil,
          :isSuccessful => boolean() | nil,
          :responseParams =>
            list(GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParameterEntry.t())
            | nil,
          :scatterElement =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParameterValueType.t() | nil
        }

  field(:errorMsg)
  field(:executionIds, type: :list)
  field(:isSuccessful)

  field(:responseParams,
    as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParameterEntry,
    type: :list
  )

  field(:scatterElement,
    as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoParameterValueType
  )
end

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

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