Aliyun.Oss.Object.ACL (aliyun_oss v3.3.0)

Object operations - ACL.

Summary

Functions

GetObjectACL - gets the access control list (ACL) of an object.

PutObjectACL - modifies the access control list (ACL) of an object.

Functions

get(config, bucket, object)

@spec get(Aliyun.Oss.Config.t(), String.t(), String.t()) ::
  {:error, Exception.t()} | {:ok, Aliyun.Oss.Client.Response.t()}

GetObjectACL - gets the access control list (ACL) of an object.

Examples

iex> Aliyun.Oss.Object.ACL.get(config, "some-bucket", "some-object")
{:ok, %Aliyun.Oss.Client.Response{
    data: %{
      "AccessControlPolicy" => %{
        "AccessControlList" => %{"Grant" => "default"},
        "Owner" => %{
          "DisplayName" => "1111111111111111",
          "ID" => "1111111111111111"
        }
      }
    },
    headers: %{
      "connection" => ["keep-alive"],
    }
  }
}

put(config, bucket, object, acl)

@spec put(Aliyun.Oss.Config.t(), String.t(), String.t(), String.t()) ::
  {:error, Exception.t()} | {:ok, Aliyun.Oss.Client.Response.t()}

PutObjectACL - modifies the access control list (ACL) of an object.

Examples

iex> Aliyun.Oss.Object.ACL.put(config, "some-bucket", "some-object", "private")
{:ok, %Aliyun.Oss.Client.Response{
    data: "",
    headers: %{
      "connection" => ["keep-alive"],
      "content-length" => ["0"],
      ...
    }
  }
}