# 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.EnterpriseCrmEventbusProtoSuspensionConfig do
  @moduledoc """


  ## Attributes

  *   `customMessage` (*type:* `String.t`, *default:* `nil`) - Optional information to provide recipients of the suspension in addition to the resolution URL, typically containing relevant parameter values from the originating workflow.
  *   `notifications` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoNotification.t)`, *default:* `nil`) - 
  *   `suspensionExpiration` (*type:* `GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoSuspensionExpiration.t`, *default:* `nil`) - Indicates the next steps when no external actions happen on the suspension.
  *   `whoMayResolve` (*type:* `list(GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoSuspensionAuthPermissions.t)`, *default:* `nil`) - Identities able to resolve this suspension.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :customMessage => String.t() | nil,
          :notifications =>
            list(GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoNotification.t())
            | nil,
          :suspensionExpiration =>
            GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoSuspensionExpiration.t()
            | nil,
          :whoMayResolve =>
            list(
              GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoSuspensionAuthPermissions.t()
            )
            | nil
        }

  field(:customMessage)

  field(:notifications,
    as: GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoNotification,
    type: :list
  )

  field(:suspensionExpiration,
    as: GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoSuspensionExpiration
  )

  field(:whoMayResolve,
    as: GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoSuspensionAuthPermissions,
    type: :list
  )
end

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

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