# NOTE: This file is auto generated by googly. Do not edit it manually. defmodule Googly.CloudStorage.Model.Channel do @moduledoc """ An notification channel used to watch for resource changes. ## Attributes * `address` (*type:* `String.t()`) - The address where notifications are delivered for this channel. * `expiration` (*type:* `String.t()`) - Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. * `id` (*type:* `String.t()`) - A UUID or similar unique string that identifies this channel. * `kind` (*type:* `String.t()`) - Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel". * `params` (*type:* `map()`) - Additional parameters controlling delivery channel behavior. Optional. * `payload` (*type:* `boolean()`) - A Boolean value to indicate whether payload is wanted. Optional. * `resource_id` (*type:* `String.t()`) - An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. * `resource_uri` (*type:* `String.t()`) - A version-specific identifier for the watched resource. * `token` (*type:* `String.t()`) - An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. * `type` (*type:* `String.t()`) - The type of delivery mechanism used for this channel. """ defstruct [ :address, :expiration, :id, :kind, :params, :payload, :resource_id, :resource_uri, :token, :type ] @type t :: %__MODULE__{ address: String.t() | nil, expiration: String.t() | nil, id: String.t() | nil, kind: String.t() | nil, params: map() | nil, payload: boolean() | nil, resource_id: String.t() | nil, resource_uri: String.t() | nil, token: String.t() | nil, type: String.t() | nil } @wire %{resource_id: "resourceId", resource_uri: "resourceUri"} @doc false def __wire__, do: @wire @doc false def decode(nil), do: nil def decode(list) when is_list(list), do: Enum.map(list, &decode/1) def decode(m) do %__MODULE__{ address: m["address"], expiration: m["expiration"], id: m["id"], kind: m["kind"], params: m["params"], payload: m["payload"], resource_id: m["resourceId"], resource_uri: m["resourceUri"], token: m["token"], type: m["type"] } end end