lib/google_api/chat/v1/model/deprecated_event.ex

# 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.Chat.V1.Model.DeprecatedEvent do
  @moduledoc """
  Google Chat events.

  ## Attributes

  *   `action` (*type:* `GoogleApi.Chat.V1.Model.FormAction.t`, *default:* `nil`) - The form action data associated with an interactive card that was clicked. Only populated for CARD_CLICKED events. See the [Interactive Cards guide](/chat/how-tos/cards-onclick) for more information.
  *   `common` (*type:* `GoogleApi.Chat.V1.Model.CommonEventObject.t`, *default:* `nil`) - This will include form information for dialogs such as form inputs, action parameters.
  *   `configCompleteRedirectUrl` (*type:* `String.t`, *default:* `nil`) - The URL the bot should redirect the user to after they have completed an authorization or configuration flow outside of Google Chat. See the [Authorizing access to 3p services guide](/chat/how-tos/auth-3p) for more information.
  *   `dialogEventType` (*type:* `String.t`, *default:* `nil`) - The type of dialog event we have received.
  *   `eventTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp indicating when the event occurred.
  *   `isDialogEvent` (*type:* `boolean()`, *default:* `nil`) - Whether or not this event is related to dialogs request, submit or cancel. This will be set to true when we want a request/submit/cancel event.
  *   `message` (*type:* `GoogleApi.Chat.V1.Model.Message.t`, *default:* `nil`) - The message that triggered the event, if applicable.
  *   `space` (*type:* `GoogleApi.Chat.V1.Model.Space.t`, *default:* `nil`) - The space in which the event occurred.
  *   `threadKey` (*type:* `String.t`, *default:* `nil`) - The bot-defined key for the thread related to the event. See the thread_key field of the `spaces.message.create` request for more information.
  *   `token` (*type:* `String.t`, *default:* `nil`) - A secret value that bots can use to verify if a request is from Google. The token is randomly generated by Google, remains static, and can be obtained from the Google Chat API configuration page in the Cloud Console. Developers can revoke/regenerate it if needed from the same page.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of the event.
  *   `user` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - The user that triggered the event.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :action => GoogleApi.Chat.V1.Model.FormAction.t() | nil,
          :common => GoogleApi.Chat.V1.Model.CommonEventObject.t() | nil,
          :configCompleteRedirectUrl => String.t() | nil,
          :dialogEventType => String.t() | nil,
          :eventTime => DateTime.t() | nil,
          :isDialogEvent => boolean() | nil,
          :message => GoogleApi.Chat.V1.Model.Message.t() | nil,
          :space => GoogleApi.Chat.V1.Model.Space.t() | nil,
          :threadKey => String.t() | nil,
          :token => String.t() | nil,
          :type => String.t() | nil,
          :user => GoogleApi.Chat.V1.Model.User.t() | nil
        }

  field(:action, as: GoogleApi.Chat.V1.Model.FormAction)
  field(:common, as: GoogleApi.Chat.V1.Model.CommonEventObject)
  field(:configCompleteRedirectUrl)
  field(:dialogEventType)
  field(:eventTime, as: DateTime)
  field(:isDialogEvent)
  field(:message, as: GoogleApi.Chat.V1.Model.Message)
  field(:space, as: GoogleApi.Chat.V1.Model.Space)
  field(:threadKey)
  field(:token)
  field(:type)
  field(:user, as: GoogleApi.Chat.V1.Model.User)
end

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

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