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 """
  A Google Chat app interaction event. To learn about interaction events, see [Receive and respond to interactions with your Google Chat app](https://developers.google.com/workspace/chat/api/guides/message-formats). To learn about event types and for example event payloads, see [Types of Google Chat app interaction events](https://developers.google.com/workspace/chat/events). In addition to receiving events from user interactions, Chat apps can receive events about changes to spaces, such as when a new member is added to a space. To learn about space events, see [Work with events from Google Chat](https://developers.google.com/workspace/chat/events-overview).

  ## Attributes

  *   `action` (*type:* `GoogleApi.Chat.V1.Model.FormAction.t`, *default:* `nil`) - For `CARD_CLICKED` interaction events, the form action data associated when a user clicks a card or dialog. To learn more, see [Read form data input by users on cards](https://developers.google.com/workspace/chat/read-form-data).
  *   `common` (*type:* `GoogleApi.Chat.V1.Model.CommonEventObject.t`, *default:* `nil`) - Represents information about the user's client, such as locale, host app, and platform. For Chat apps, `CommonEventObject` includes information submitted by users interacting with [dialogs](https://developers.google.com/workspace/chat/dialogs), like data entered on a card.
  *   `configCompleteRedirectUrl` (*type:* `String.t`, *default:* `nil`) - The URL the Chat app should redirect the user to after they have completed an authorization or configuration flow outside of Google Chat. For more information, see [Connect a Chat app with other services & tools](https://developers.google.com/workspace/chat/connect-web-services-tools).
  *   `dialogEventType` (*type:* `String.t`, *default:* `nil`) - The type of [dialog](https://developers.google.com/workspace/chat/dialogs) interaction event received.
  *   `eventTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp indicating when the interaction event occurred.
  *   `isDialogEvent` (*type:* `boolean()`, *default:* `nil`) - For `CARD_CLICKED` interaction events, whether the user interacted with a [dialog](https://developers.google.com/workspace/chat/dialogs).
  *   `message` (*type:* `GoogleApi.Chat.V1.Model.Message.t`, *default:* `nil`) - The message that triggered the interaction event, if applicable.
  *   `space` (*type:* `GoogleApi.Chat.V1.Model.Space.t`, *default:* `nil`) - The space in which the interaction event occurred.
  *   `threadKey` (*type:* `String.t`, *default:* `nil`) - The Chat app-defined key for the thread related to the interaction event. See [`spaces.messages.thread.threadKey`](/chat/api/reference/rest/v1/spaces.messages#Thread.FIELDS.thread_key) for more information.
  *   `token` (*type:* `String.t`, *default:* `nil`) - A secret value that legacy Chat apps can use to verify if a request is from Google. Google randomly generates the token, and its value remains static. You can obtain, revoke, or regenerate the token from the [Chat API configuration page](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat) in the Google Cloud Console. Modern Chat apps don't use this field. It is absent from API responses and the [Chat API configuration page](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat).
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of interaction event. For details, see [Types of Google Chat app interaction events](https://developers.google.com/workspace/chat/events).
  *   `user` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - The user that triggered the interaction 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