# 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.GoogleCloudIntegrationsV1alphaIntegrationVersion do
  @moduledoc """
  The integration version definition.

  ## Attributes

  *   `cloudLoggingDetails` (*type:* `GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaCloudLoggingDetails.t`, *default:* `nil`) - Optional. Cloud Logging details for the integration version
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Auto-generated.
  *   `databasePersistencePolicy` (*type:* `String.t`, *default:* `nil`) - Optional. Flag to disable database persistence for execution data, including event execution info, execution export info, execution metadata index and execution param index.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. The integration description.
  *   `enableVariableMasking` (*type:* `boolean()`, *default:* `nil`) - Optional. True if variable masking feature should be turned on for this version
  *   `errorCatcherConfigs` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaErrorCatcherConfig.t)`, *default:* `nil`) - Optional. Error Catch Task configuration for the integration. It's optional.
  *   `integrationConfigParameters` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaIntegrationConfigParameter.t)`, *default:* `nil`) - Optional. Config Parameters that are expected to be passed to the integration when an integration is published. This consists of all the parameters that are expected to provide configuration in the integration execution. This gives the user the ability to provide default values, value, add information like connection url, project based configuration value and also provide data types of each parameter.
  *   `integrationParameters` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaIntegrationParameter.t)`, *default:* `nil`) - Optional. Parameters that are expected to be passed to the integration when an event is triggered. This consists of all the parameters that are expected in the integration execution. This gives the user the ability to provide default values, add information like PII and also provide data types of each parameter.
  *   `integrationParametersInternal` (*type:* `GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoWorkflowParameters.t`, *default:* `nil`) - Optional. Parameters that are expected to be passed to the integration when an event is triggered. This consists of all the parameters that are expected in the integration execution. This gives the user the ability to provide default values, add information like PII and also provide data types of each parameter.
  *   `lastModifierEmail` (*type:* `String.t`, *default:* `nil`) - Optional. The last modifier's email address. Generated based on the End User Credentials/LOAS role of the user making the call.
  *   `lockHolder` (*type:* `String.t`, *default:* `nil`) - Optional. The edit lock holder's email address. Generated based on the End User Credentials/LOAS role of the user making the call.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Auto-generated primary key.
  *   `origin` (*type:* `String.t`, *default:* `nil`) - Optional. The origin that indicates where this integration is coming from.
  *   `parentTemplateId` (*type:* `String.t`, *default:* `nil`) - Optional. The id of the template which was used to create this integration_version.
  *   `runAsServiceAccount` (*type:* `String.t`, *default:* `nil`) - Optional. The run-as service account email, if set and auth config is not configured, that will be used to generate auth token to be used in Connector task, Rest caller task and Cloud function task.
  *   `snapshotNumber` (*type:* `String.t`, *default:* `nil`) - Optional. An increasing sequence that is set when a new snapshot is created. The last created snapshot can be identified by [workflow_name, org_id latest(snapshot_number)]. However, last created snapshot need not be same as the HEAD. So users should always use "HEAD" tag to identify the head.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. User should not set it as an input.
  *   `status` (*type:* `String.t`, *default:* `nil`) - Output only. Generated by eventbus. User should not set it as an input.
  *   `taskConfigs` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaTaskConfig.t)`, *default:* `nil`) - Optional. Task configuration for the integration. It's optional, but the integration doesn't do anything without task_configs.
  *   `taskConfigsInternal` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoTaskConfig.t)`, *default:* `nil`) - Optional. Task configuration for the integration. It's optional, but the integration doesn't do anything without task_configs.
  *   `teardown` (*type:* `GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoTeardown.t`, *default:* `nil`) - Optional. Contains a graph of tasks that will be executed before putting the event in a terminal state (SUCCEEDED/FAILED/FATAL), regardless of success or failure, similar to "finally" in code.
  *   `triggerConfigs` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaTriggerConfig.t)`, *default:* `nil`) - Optional. Trigger configurations.
  *   `triggerConfigsInternal` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoTriggerConfig.t)`, *default:* `nil`) - Optional. Trigger configurations.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Auto-generated.
  *   `userLabel` (*type:* `String.t`, *default:* `nil`) - Optional. A user-defined label that annotates an integration version. Typically, this is only set when the integration version is created.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudLoggingDetails =>
            GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaCloudLoggingDetails.t()
            | nil,
          :createTime => DateTime.t() | nil,
          :databasePersistencePolicy => String.t() | nil,
          :description => String.t() | nil,
          :enableVariableMasking => boolean() | nil,
          :errorCatcherConfigs =>
            list(
              GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaErrorCatcherConfig.t()
            )
            | nil,
          :integrationConfigParameters =>
            list(
              GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaIntegrationConfigParameter.t()
            )
            | nil,
          :integrationParameters =>
            list(
              GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaIntegrationParameter.t()
            )
            | nil,
          :integrationParametersInternal =>
            GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoWorkflowParameters.t()
            | nil,
          :lastModifierEmail => String.t() | nil,
          :lockHolder => String.t() | nil,
          :name => String.t() | nil,
          :origin => String.t() | nil,
          :parentTemplateId => String.t() | nil,
          :runAsServiceAccount => String.t() | nil,
          :snapshotNumber => String.t() | nil,
          :state => String.t() | nil,
          :status => String.t() | nil,
          :taskConfigs =>
            list(
              GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaTaskConfig.t()
            )
            | nil,
          :taskConfigsInternal =>
            list(
              GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoTaskConfig.t()
            )
            | nil,
          :teardown =>
            GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoTeardown.t() | nil,
          :triggerConfigs =>
            list(
              GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaTriggerConfig.t()
            )
            | nil,
          :triggerConfigsInternal =>
            list(
              GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoTriggerConfig.t()
            )
            | nil,
          :updateTime => DateTime.t() | nil,
          :userLabel => String.t() | nil
        }

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

  field(:createTime, as: DateTime)
  field(:databasePersistencePolicy)
  field(:description)
  field(:enableVariableMasking)

  field(:errorCatcherConfigs,
    as: GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaErrorCatcherConfig,
    type: :list
  )

  field(:integrationConfigParameters,
    as:
      GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaIntegrationConfigParameter,
    type: :list
  )

  field(:integrationParameters,
    as: GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaIntegrationParameter,
    type: :list
  )

  field(:integrationParametersInternal,
    as: GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoWorkflowParameters
  )

  field(:lastModifierEmail)
  field(:lockHolder)
  field(:name)
  field(:origin)
  field(:parentTemplateId)
  field(:runAsServiceAccount)
  field(:snapshotNumber)
  field(:state)
  field(:status)

  field(:taskConfigs,
    as: GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaTaskConfig,
    type: :list
  )

  field(:taskConfigsInternal,
    as: GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoTaskConfig,
    type: :list
  )

  field(:teardown, as: GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoTeardown)

  field(:triggerConfigs,
    as: GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaTriggerConfig,
    type: :list
  )

  field(:triggerConfigsInternal,
    as: GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoTriggerConfig,
    type: :list
  )

  field(:updateTime, as: DateTime)
  field(:userLabel)
end

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

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