Aliyun.Oss.Bucket.Policy.put

You're seeing just the function put, go back to Aliyun.Oss.Bucket.Policy module for more information.
Link to this function

put(bucket, policy)

Specs

put(String.t(), map()) ::
  {:error, error()} | {:ok, Aliyun.Oss.Client.Response.t()}

PutBucketPolicy接口用于为指定的存储空间(Bucket)设置授权策略(Policy)。

Examples

iex> policy = %{
  "Statement" => [
    %{
      "Action" => ["oss:PutObject", "oss:GetObject"],
      "Effect" => "Deny",
      "Principal" => ["1234567890"],
      "Resource" => ["acs:oss:*:1234567890:*/*"]
    }
  ],
  "Version" => "1"
}
iex> Aliyun.Oss.Bucket.Policy.put("some-bucket", policy)
{:ok, %Aliyun.Oss.Client.Response{
  data: "",
  headers: [
    {"Date", "Wed, 05 Dec 2018 02:34:57 GMT"},
    ...
  ]
}}