# 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.GoogleCloudIntegrationsV1alphaExecution do
  @moduledoc """
  The Execution resource contains detailed information of an individual integration execution.

  ## Attributes

  *   `cloudKmsKey` (*type:* `String.t`, *default:* `nil`) - Optional. Cloud KMS resource name for the CMEK encryption key.
  *   `cloudLoggingDetails` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaCloudLoggingDetails.t`, *default:* `nil`) - Cloud Logging details for the integration version
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Created time of the execution.
  *   `directSubExecutions` (*type:* `list(GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaExecution.t)`, *default:* `nil`) - Direct sub executions of the following Execution.
  *   `eventExecutionDetails` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoEventExecutionDetails.t`, *default:* `nil`) - The execution info about this event.
  *   `executionDetails` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaExecutionDetails.t`, *default:* `nil`) - Detailed info of this execution.
  *   `executionMethod` (*type:* `String.t`, *default:* `nil`) - The ways user posts this event.
  *   `integrationVersionState` (*type:* `String.t`, *default:* `nil`) - Output only. State of the integration version
  *   `name` (*type:* `String.t`, *default:* `nil`) - Auto-generated primary key.
  *   `replayInfo` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaExecutionReplayInfo.t`, *default:* `nil`) - Output only. Replay info for the execution
  *   `requestParameters` (*type:* `%{optional(String.t) => GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaValueType.t}`, *default:* `nil`) - Event parameters come in as part of the request.
  *   `requestParams` (*type:* `list(GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterEntry.t)`, *default:* `nil`) - Event parameters come in as part of the request.
  *   `responseParameters` (*type:* `%{optional(String.t) => GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaValueType.t}`, *default:* `nil`) - Event parameters returned as part of the response. In the case of error, the `ErrorInfo` field is returned in the following format: { "ErrorInfo": { "message": String, "code": Number } } 
  *   `responseParams` (*type:* `list(GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterEntry.t)`, *default:* `nil`) - 
  *   `snapshotNumber` (*type:* `String.t`, *default:* `nil`) - Output only. An increasing sequence that is set when a new snapshot is created
  *   `triggerId` (*type:* `String.t`, *default:* `nil`) - The trigger id of the integration trigger config. If both trigger_id and client_id is present, the integration is executed from the start tasks provided by the matching trigger config otherwise it is executed from the default start tasks.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Last modified time of the execution.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudKmsKey => String.t() | nil,
          :cloudLoggingDetails =>
            GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaCloudLoggingDetails.t()
            | nil,
          :createTime => DateTime.t() | nil,
          :directSubExecutions =>
            list(GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaExecution.t())
            | nil,
          :eventExecutionDetails =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoEventExecutionDetails.t()
            | nil,
          :executionDetails =>
            GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaExecutionDetails.t()
            | nil,
          :executionMethod => String.t() | nil,
          :integrationVersionState => String.t() | nil,
          :name => String.t() | nil,
          :replayInfo =>
            GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaExecutionReplayInfo.t()
            | nil,
          :requestParameters =>
            %{
              optional(String.t()) =>
                GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaValueType.t()
            }
            | nil,
          :requestParams =>
            list(
              GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterEntry.t()
            )
            | nil,
          :responseParameters =>
            %{
              optional(String.t()) =>
                GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaValueType.t()
            }
            | nil,
          :responseParams =>
            list(
              GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterEntry.t()
            )
            | nil,
          :snapshotNumber => String.t() | nil,
          :triggerId => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:cloudKmsKey)

  field(:cloudLoggingDetails,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaCloudLoggingDetails
  )

  field(:createTime, as: DateTime)

  field(:directSubExecutions,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaExecution,
    type: :list
  )

  field(:eventExecutionDetails,
    as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoEventExecutionDetails
  )

  field(:executionDetails,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaExecutionDetails
  )

  field(:executionMethod)
  field(:integrationVersionState)
  field(:name)

  field(:replayInfo,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaExecutionReplayInfo
  )

  field(:requestParameters,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaValueType,
    type: :map
  )

  field(:requestParams,
    as: GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterEntry,
    type: :list
  )

  field(:responseParameters,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaValueType,
    type: :map
  )

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

  field(:snapshotNumber)
  field(:triggerId)
  field(:updateTime, as: DateTime)
end

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

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