# 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.GoogleCloudIntegrationsV1alphaTestTaskConfig do
  @moduledoc """
  The task mock configuration details and assertions for functional tests. Next available id: 6

  ## Attributes

  *   `assertions` (*type:* `list(GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaAssertion.t)`, *default:* `nil`) - Optional. List of conditions or expressions which should be evaluated to true unless there is a bug/problem in the integration. These are evaluated one the task execution is completed as per the mock strategy in test case
  *   `mockConfig` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaMockConfig.t`, *default:* `nil`) - Optional. Defines how to mock the given task during test execution
  *   `task` (*type:* `String.t`, *default:* `nil`) - Required. This defines in the test case, the task name in integration which will be mocked by this test task config
  *   `taskConfig` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTaskConfig.t`, *default:* `nil`) - Optional. Auto-generated.
  *   `taskNumber` (*type:* `String.t`, *default:* `nil`) - Required. This defines in the test case, the task in integration which will be mocked by this test task config
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :assertions =>
            list(GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaAssertion.t())
            | nil,
          :mockConfig =>
            GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaMockConfig.t() | nil,
          :task => String.t() | nil,
          :taskConfig =>
            GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTaskConfig.t() | nil,
          :taskNumber => String.t() | nil
        }

  field(:assertions,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaAssertion,
    type: :list
  )

  field(:mockConfig, as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaMockConfig)
  field(:task)
  field(:taskConfig, as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaTaskConfig)
  field(:taskNumber)
end

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

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