# 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.GoogleCloudIntegrationsV1alphaScheduleIntegrationsRequest do
  @moduledoc """
  The request for scheduling an integration.

  ## Attributes

  *   `inputParameters` (*type:* `%{optional(String.t) => GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaValueType.t}`, *default:* `nil`) - Optional. Input parameters used by integration execution.
  *   `parameterEntries` (*type:* `list(GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterEntry.t)`, *default:* `nil`) - Parameters are a part of Event and can be used to communicate between different tasks that are part of the same integration execution.
  *   `parameters` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoEventParameters.t`, *default:* `nil`) - Passed in as parameters to each integration execution.
  *   `requestId` (*type:* `String.t`, *default:* `nil`) - This is used to de-dup incoming request: if the duplicate request was detected, the response from the previous execution is returned.
  *   `scheduleTime` (*type:* `DateTime.t`, *default:* `nil`) - The time that the integration should be executed. If the time is less or equal to the current time, the integration is executed immediately.
  *   `triggerId` (*type:* `String.t`, *default:* `nil`) - Required. Matched against all {@link TriggerConfig}s across all integrations. i.e. TriggerConfig.trigger_id.equals(trigger_id)
  *   `userGeneratedExecutionId` (*type:* `String.t`, *default:* `nil`) - Optional. This is a unique id provided by the method caller. If provided this will be used as the execution_id when a new execution info is created. This is a string representation of a UUID. Must have no more than 36 characters and contain only alphanumeric characters and hyphens.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :inputParameters =>
            %{
              optional(String.t()) =>
                GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaValueType.t()
            }
            | nil,
          :parameterEntries =>
            list(
              GoogleApi.Integrations.V1.Model.EnterpriseCrmFrontendsEventbusProtoParameterEntry.t()
            )
            | nil,
          :parameters =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoEventParameters.t() | nil,
          :requestId => String.t() | nil,
          :scheduleTime => DateTime.t() | nil,
          :triggerId => String.t() | nil,
          :userGeneratedExecutionId => String.t() | nil
        }

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

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

  field(:parameters, as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoEventParameters)

  field(:requestId)
  field(:scheduleTime, as: DateTime)
  field(:triggerId)
  field(:userGeneratedExecutionId)
end

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

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