Current section
Files
Jump to
Current section
Files
lib/googly/cloud_storage/model/notification.ex
# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.CloudStorage.Model.Notification do
@moduledoc """
A subscription to receive Google PubSub notifications.
## Attributes
* `custom_attributes` (*type:* `map()`) - An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.
* `etag` (*type:* `String.t()`) - HTTP 1.1 Entity tag for this subscription notification.
* `event_types` (*type:* `list(String.t())`) - If present, only send notifications about listed event types. If empty, sent notifications for all event types.
* `id` (*type:* `String.t()`) - The ID of the notification.
* `kind` (*type:* `String.t()`) - The kind of item this is. For notifications, this is always storage#notification.
* `object_name_prefix` (*type:* `String.t()`) - If present, only apply this notification configuration to object names that begin with this prefix.
* `payload_format` (*type:* `String.t()`) - The desired content of the Payload.
* `self_link` (*type:* `String.t()`) - The canonical URL of this notification.
* `topic` (*type:* `String.t()`) - The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
"""
defstruct [
:custom_attributes,
:etag,
:event_types,
:id,
:kind,
:object_name_prefix,
:payload_format,
:self_link,
:topic
]
@type t :: %__MODULE__{
custom_attributes: map() | nil,
etag: String.t() | nil,
event_types: list(String.t()) | nil,
id: String.t() | nil,
kind: String.t() | nil,
object_name_prefix: String.t() | nil,
payload_format: String.t() | nil,
self_link: String.t() | nil,
topic: String.t() | nil
}
@wire %{self_link: "selfLink"}
@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__{
custom_attributes: m["custom_attributes"],
etag: m["etag"],
event_types: m["event_types"],
id: m["id"],
kind: m["kind"],
object_name_prefix: m["object_name_prefix"],
payload_format: m["payload_format"],
self_link: m["selfLink"],
topic: m["topic"]
}
end
end