Amazon.S3.AmazonS3Client.PutACL C# (CSharp) Метод

PutACL() публичный Метод

Sets the permissions on a bucket using access control lists (ACL).
public PutACL ( PutACLRequest request ) : PutACLResponse
request PutACLRequest Container for the necessary parameters to execute the PutACL service method.
Результат PutACLResponse
        public PutACLResponse PutACL(PutACLRequest request)
        {
            var marshaller = new PutACLRequestMarshaller();
            var unmarshaller = PutACLResponseUnmarshaller.Instance;

            return Invoke<PutACLRequest,PutACLResponse>(request, marshaller, unmarshaller);
        }

Usage Example

Пример #1
0
        public void TestPostUpload()
        {
            var region = RegionEndpoint.USWest1;

            using (var client = new AmazonS3Client(region))
            {
                var bucketName = S3TestUtils.CreateBucket(client);
                client.PutACL(new PutACLRequest
                {
                    BucketName = bucketName,
                    CannedACL = S3CannedACL.BucketOwnerFullControl
                });

                var credentials = GetCredentials(client);
                try
                {
                    var response = testPost("foo/bar/content.txt", bucketName, testContentStream("Line one\nLine two\nLine three\n"), "", credentials, region);
                    Assert.IsNotNull(response.RequestId);
                    Assert.IsNotNull(response.HostId);
                    Assert.AreEqual(HttpStatusCode.NoContent, response.StatusCode);
                }
                finally
                {
                    AmazonS3Util.DeleteS3BucketWithObjects(client, bucketName);
                }
            }
        }
All Usage Examples Of Amazon.S3.AmazonS3Client::PutACL
AmazonS3Client