# 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.GoogleCloudIntegrationsV1alphaTestCase do
  @moduledoc """
  Defines the functional test case for Application Integration. Next available id: 15

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Auto-generated.
  *   `creatorEmail` (*type:* `String.t`, *default:* `nil`) - Optional. The creator's email address. Generated based on the End User Credentials/LOAS role of the user making the call.
  *   `databasePersistencePolicy` (*type:* `String.t`, *default:* `nil`) - Optional. Various policies for how to persist the test execution info including execution info, execution export info, execution metadata index and execution param index..
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Description of the test case.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. The display name of test case.
  *   `lastModifierEmail` (*type:* `String.t`, *default:* `nil`) - The last modifier's email address. Generated based on the End User Credentials/LOAS role of the user making the call.
  *   `lockHolderEmail` (*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.
  *   `testInputParameters` (*type:* `list(GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaIntegrationParameter.t)`, *default:* `nil`) - Optional. Parameters that are expected to be passed to the test case when the test case is triggered. This gives the user the ability to provide default values. This should include all the output variables of the trigger as input variables.
  *   `testTaskConfigs` (*type:* `list(GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTestTaskConfig.t)`, *default:* `nil`) - Optional. However, the test case doesn't mock or assert anything without test_task_configs.
  *   `triggerConfig` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTriggerConfig.t`, *default:* `nil`) - Optional. Auto-generated.
  *   `triggerId` (*type:* `String.t`, *default:* `nil`) - Required. This defines the trigger ID in workflow which is considered to be executed as starting point of the test case
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Auto-generated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :creatorEmail => String.t() | nil,
          :databasePersistencePolicy => String.t() | nil,
          :description => String.t() | nil,
          :displayName => String.t() | nil,
          :lastModifierEmail => String.t() | nil,
          :lockHolderEmail => String.t() | nil,
          :name => String.t() | nil,
          :testInputParameters =>
            list(
              GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaIntegrationParameter.t()
            )
            | nil,
          :testTaskConfigs =>
            list(GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTestTaskConfig.t())
            | nil,
          :triggerConfig =>
            GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTriggerConfig.t() | nil,
          :triggerId => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:creatorEmail)
  field(:databasePersistencePolicy)
  field(:description)
  field(:displayName)
  field(:lastModifierEmail)
  field(:lockHolderEmail)
  field(:name)

  field(:testInputParameters,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaIntegrationParameter,
    type: :list
  )

  field(:testTaskConfigs,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTestTaskConfig,
    type: :list
  )

  field(:triggerConfig,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTriggerConfig
  )

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

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

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