# 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.GoogleCloudIntegrationsV1alphaIntegrationTemplateVersion do
  @moduledoc """
  IntegrationTemplateVersion definition. An IntegrationTemplateVersion provides configurations required to construct an IntegrationVersion. It cannot be executed directly like an Integration. Users can create IntegrationTemplateVersions using Integrations. These Templates can be shared by users across GCP projects. Next available: 17

  ## Attributes

  *   `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 templateversion description. Permitted format is alphanumeric with underscores and no spaces.
  *   `enableVariableMasking` (*type:* `boolean()`, *default:* `nil`) - Optional. True if variable masking feature should be turned on for generated workflows
  *   `errorCatcherConfigs` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaErrorCatcherConfig.t)`, *default:* `nil`) - Optional. Error Catch Task configuration for the IntegrationTemplateVersion. It's optional.
  *   `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.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Auto-generated primary key. Format: projects/{project}/locations/{location}/products/{product}/integrationtemplates/{integrationtemplate}/versions/{version}
  *   `parentIntegrationVersionId` (*type:* `String.t`, *default:* `nil`) - Optional. ID of the IntegrationVersion that was used to create this IntegrationTemplateVersion
  *   `snapshotNumber` (*type:* `String.t`, *default:* `nil`) - Output only. An increasing sequence that is set when a new snapshot is created.
  *   `status` (*type:* `String.t`, *default:* `nil`) - Optional. Generated by eventbus. User should not set it as an input.
  *   `taskConfigs` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoTaskConfig.t)`, *default:* `nil`) - Optional. Task configuration for the IntegrationTemplateVersion. It's optional, but the IntegrationTemplateVersion 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.
  *   `templateParameters` (*type:* `GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoWorkflowParameters.t`, *default:* `nil`) - Optional. Parameters that are expected to be passed to the IntegrationTemplateVersion when an event is triggered. This consists of all the parameters that are expected in the IntegrationTemplateVersion execution. This gives the user the ability to provide default values, add information like PII and also provide data types of each parameter.
  *   `triggerConfigs` (*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__{
          :createTime => DateTime.t() | nil,
          :databasePersistencePolicy => String.t() | nil,
          :description => String.t() | nil,
          :enableVariableMasking => boolean() | nil,
          :errorCatcherConfigs =>
            list(
              GoogleApi.Integrations.V1alpha.Model.GoogleCloudIntegrationsV1alphaErrorCatcherConfig.t()
            )
            | nil,
          :lastModifierEmail => String.t() | nil,
          :name => String.t() | nil,
          :parentIntegrationVersionId => String.t() | nil,
          :snapshotNumber => String.t() | nil,
          :status => String.t() | nil,
          :taskConfigs =>
            list(
              GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoTaskConfig.t()
            )
            | nil,
          :teardown =>
            GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoTeardown.t() | nil,
          :templateParameters =>
            GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoWorkflowParameters.t()
            | nil,
          :triggerConfigs =>
            list(
              GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoTriggerConfig.t()
            )
            | nil,
          :updateTime => DateTime.t() | nil,
          :userLabel => String.t() | nil
        }

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

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

  field(:lastModifierEmail)
  field(:name)
  field(:parentIntegrationVersionId)
  field(:snapshotNumber)
  field(:status)

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

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

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

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

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

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

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