The PutBucketPolicyResponse contains any headers returned by S3.
            
 Declaration Syntax
 Declaration Syntax| C# | 
public class PutBucketPolicyResponse : S3Response
 Members
 Members| All Members | Constructors | Methods | Properties | ||
| Icon | Member | Description | 
|---|---|---|
|  | PutBucketPolicyResponse()()()() | Initializes a new instance of the PutBucketPolicyResponse class | 
|  | AmazonId2 | 
            Gets and sets the AmazonId2 property. 
            This property corresponds to the x-amz-id-2 header in the HTTP response from the Amazon S3 service. The value of this header is used for internal troubleshooting purposes.
            (Inherited from S3Response.) | 
|  | Dispose()()()() | 
            Disposes of all managed and unmanaged resources.
            (Inherited from S3Response.) | 
|  | Equals(Object) | (Inherited from Object.) | 
|  | GetHashCode()()()() | Serves as a hash function for a particular type. (Inherited from Object.) | 
|  | GetType()()()() | Gets the type of the current instance.(Inherited from Object.) | 
|  | Headers | 
            Gets and sets the Headers property.
            Information like the request-id, the amz-id-2 are
            retrieved fro the Headers and presented to the user
            via properties of the response object.
            (Inherited from S3Response.) | 
|  | Metadata | 
            Gets and sets the Metadata property.
            (Inherited from S3Response.) | 
|  | RequestId | 
            Gets and sets the RequestId property.
            (Inherited from S3Response.) | 
|  | ResponseStream | 
            Gets and sets the ResponseStream property. This property
            only has a valid value for GetObjectResponses. In order to
            use this stream without leaking the underlying resource, please
            wrap access to the stream within a using block.
            (Inherited from S3Response.)  CopyC# | 
|  | ResponseXml | 
            Gets and sets the ResponseXml property. This is the 
            original xml response received from S3
            (Inherited from S3Response.) | 
|  | StatusCode | 
            Gets the HTTP Status code from the service response.
            (Inherited from S3Response.) | 
|  | ToString()()()() | 
            String Representation of this object. Overrides Object.ToString()
            (Inherited from S3Response.) | 
 Examples
 ExamplesThis example shows how to Get, Put and Delete bucket policies.
 CopyBucketPolicy samples
CopyBucketPolicy samples// Create a client AmazonS3Client client = new AmazonS3Client(); // Put sample bucket policy (overwrite an existing policy) string newPolicy = @"{ ""Statement"":[{ ""Sid"":""BasicPerms"", ""Effect"":""Allow"", ""Principal"": { ""AWS"": ""*"" }, ""Action"":[""s3:PutObject"",""s3:GetObject""], ""Resource"":[""arn:aws:s3:::samplebucketname/*""] }]}"; PutBucketPolicyRequest putRequest = new PutBucketPolicyRequest { BucketName = "SampleBucket", Policy = newPolicy }; client.PutBucketPolicy(putRequest); // Retrieve current policy GetBucketPolicyRequest getRequest = new GetBucketPolicyRequest { BucketName = "SampleBucket" }; string policy = client.GetBucketPolicy(getRequest).Policy; Console.WriteLine(policy); Debug.Assert(policy.Contains("BasicPerms")); // Delete current policy DeleteBucketPolicyRequest deleteRequest = new DeleteBucketPolicyRequest { BucketName = "SampleBucket" }; client.DeleteBucketPolicy(deleteRequest); // Retrieve current policy and verify that it is null policy = client.GetBucketPolicy(getRequest).Policy; Debug.Assert(policy == null);*/
 Inheritance Hierarchy
 Inheritance Hierarchy| Object | ||
|  | S3Response | |
|  | PutBucketPolicyResponse | |