# NOTE: This file is auto generated by googly. Do not edit it manually. defmodule Googly.CloudStorage.Model.Policy do @moduledoc """ A bucket/object/managedFolder IAM policy. ## Attributes * `bindings` (*type:* `list(Googly.CloudStorage.Model.PolicyBindings.t())`) - An association between a role, which comes with a set of permissions, and members who may assume that role. * `etag` (*type:* `String.t()`) - HTTP 1.1 Entity tag for the policy. * `kind` (*type:* `String.t()`) - The kind of item this is. For policies, this is always storage#policy. This field is ignored on input. * `resource_id` (*type:* `String.t()`) - The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input. * `version` (*type:* `integer()`) - The IAM policy format version. """ defstruct [:bindings, :etag, :kind, :resource_id, :version] @type t :: %__MODULE__{ bindings: list(Googly.CloudStorage.Model.PolicyBindings.t()) | nil, etag: String.t() | nil, kind: String.t() | nil, resource_id: String.t() | nil, version: integer() | nil } @wire %{resource_id: "resourceId"} @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__{ bindings: Googly.CloudStorage.Model.PolicyBindings.decode(m["bindings"]), etag: m["etag"], kind: m["kind"], resource_id: m["resourceId"], version: m["version"] } end end