# 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.GoogleCloudIntegrationsV1alphaSuspension do
  @moduledoc """
  A record representing a suspension.

  ## Attributes

  *   `approvalConfig` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaSuspensionApprovalConfig.t`, *default:* `nil`) - Controls the notifications and approval permissions for this suspension.
  *   `audit` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaSuspensionAudit.t`, *default:* `nil`) - Metadata pertaining to the resolution of this suspension.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Auto-generated.
  *   `eventExecutionInfoId` (*type:* `String.t`, *default:* `nil`) - Required. ID of the associated execution.
  *   `integration` (*type:* `String.t`, *default:* `nil`) - Required. The name of the originating integration.
  *   `lastModifyTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Auto-generated.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Resource name for suspensions suspension/{suspension_id}
  *   `state` (*type:* `String.t`, *default:* `nil`) - Required. State of this suspension, indicating what action a resolver has taken.
  *   `suspensionConfig` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoSuspensionConfig.t`, *default:* `nil`) - Controls the notifications and resolver permissions for this suspension.
  *   `taskId` (*type:* `String.t`, *default:* `nil`) - Required. Task id of the associated SuspensionTask.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :approvalConfig =>
            GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaSuspensionApprovalConfig.t()
            | nil,
          :audit =>
            GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaSuspensionAudit.t()
            | nil,
          :createTime => DateTime.t() | nil,
          :eventExecutionInfoId => String.t() | nil,
          :integration => String.t() | nil,
          :lastModifyTime => DateTime.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :suspensionConfig =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoSuspensionConfig.t() | nil,
          :taskId => String.t() | nil
        }

  field(:approvalConfig,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaSuspensionApprovalConfig
  )

  field(:audit, as: GoogleApi.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaSuspensionAudit)
  field(:createTime, as: DateTime)
  field(:eventExecutionInfoId)
  field(:integration)
  field(:lastModifyTime, as: DateTime)
  field(:name)
  field(:state)

  field(:suspensionConfig,
    as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusProtoSuspensionConfig
  )

  field(:taskId)
end

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

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