| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- package s3
- import (
- "github.com/ks3sdklib/aws-sdk-go/aws"
- )
- type PutBucketEncryptionInput struct {
- // The name of the bucket.
- Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`
- // Bucket encryption configuration container.
- ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"ServerSideEncryptionConfiguration" type:"structure" required:"true"`
- // Set extend request headers. If the existing fields do not support setting the request header you need, you can set it through this field.
- ExtendHeaders map[string]*string `location:"extendHeaders" type:"map"`
- // Set extend query params. If the existing fields do not support setting the query param you need, you can set it through this field.
- ExtendQueryParams map[string]*string `location:"extendQueryParams" type:"map"`
- metadataPutBucketEncryptionInput `json:"-" xml:"-"`
- }
- type metadataPutBucketEncryptionInput struct {
- SDKShapeTraits bool `type:"structure" payload:"ServerSideEncryptionConfiguration"`
- AutoFillMD5 bool
- }
- type ServerSideEncryptionConfiguration struct {
- // Default encryption rule for bucket.
- Rule *BucketEncryptionRule `locationName:"Rule" type:"structure" required:"true"`
- }
- type BucketEncryptionRule struct {
- // The child element of the default encryption configuration for the bucket.
- ApplyServerSideEncryptionByDefault *ApplyServerSideEncryptionByDefault `locationName:"ApplyServerSideEncryptionByDefault" type:"structure" required:"true"`
- }
- type ApplyServerSideEncryptionByDefault struct {
- // The server-side encryption algorithm to be used by the bucket's default encryption configuration.
- SSEAlgorithm *string `locationName:"SSEAlgorithm" type:"string" required:"true"`
- }
- type PutBucketEncryptionOutput struct {
- // The HTTP headers of the response.
- Metadata map[string]*string `location:"headers" type:"map"`
- // The HTTP status code of the response.
- StatusCode *int64 `location:"statusCode" type:"integer"`
- }
- // PutBucketEncryptionRequest generates a request for the PutBucketEncryption operation.
- func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) (req *aws.Request, output *PutBucketEncryptionOutput) {
- op := &aws.Operation{
- Name: "PutBucketEncryption",
- HTTPMethod: "PUT",
- HTTPPath: "/{Bucket}?encryption",
- }
- if input == nil {
- input = &PutBucketEncryptionInput{}
- }
- input.AutoFillMD5 = true
- req = c.newRequest(op, input, output)
- output = &PutBucketEncryptionOutput{}
- req.Data = output
- return
- }
- // PutBucketEncryption sets bucket encryption configuration.
- func (c *S3) PutBucketEncryption(input *PutBucketEncryptionInput) (*PutBucketEncryptionOutput, error) {
- req, out := c.PutBucketEncryptionRequest(input)
- err := req.Send()
- return out, err
- }
- func (c *S3) PutBucketEncryptionWithContext(ctx aws.Context, input *PutBucketEncryptionInput) (*PutBucketEncryptionOutput, error) {
- req, out := c.PutBucketEncryptionRequest(input)
- req.SetContext(ctx)
- err := req.Send()
- return out, err
- }
- type GetBucketEncryptionInput struct {
- // The name of the bucket.
- Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`
- // Set extend request headers. If the existing fields do not support setting the request header you need, you can set it through this field.
- ExtendHeaders map[string]*string `location:"extendHeaders" type:"map"`
- // Set extend query params. If the existing fields do not support setting the query param you need, you can set it through this field.
- ExtendQueryParams map[string]*string `location:"extendQueryParams" type:"map"`
- }
- type GetBucketEncryptionOutput struct {
- // Bucket encryption configuration container.
- ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"ServerSideEncryptionConfiguration" type:"structure"`
- // The HTTP headers of the response.
- Metadata map[string]*string `location:"headers" type:"map"`
- // The HTTP status code of the response.
- StatusCode *int64 `location:"statusCode" type:"integer"`
- metadataGetBucketEncryptionOutput `json:"-" xml:"-"`
- }
- type metadataGetBucketEncryptionOutput struct {
- SDKShapeTraits bool `type:"structure" payload:"ServerSideEncryptionConfiguration"`
- }
- // GetBucketEncryptionRequest generates a request for the GetBucketEncryption operation.
- func (c *S3) GetBucketEncryptionRequest(input *GetBucketEncryptionInput) (req *aws.Request, output *GetBucketEncryptionOutput) {
- op := &aws.Operation{
- Name: "GetBucketEncryption",
- HTTPMethod: "GET",
- HTTPPath: "/{Bucket}?encryption",
- }
- if input == nil {
- input = &GetBucketEncryptionInput{}
- }
- req = c.newRequest(op, input, output)
- output = &GetBucketEncryptionOutput{}
- req.Data = output
- return
- }
- // GetBucketEncryption gets bucket encryption configuration.
- func (c *S3) GetBucketEncryption(input *GetBucketEncryptionInput) (*GetBucketEncryptionOutput, error) {
- req, out := c.GetBucketEncryptionRequest(input)
- err := req.Send()
- return out, err
- }
- func (c *S3) GetBucketEncryptionWithContext(ctx aws.Context, input *GetBucketEncryptionInput) (*GetBucketEncryptionOutput, error) {
- req, out := c.GetBucketEncryptionRequest(input)
- req.SetContext(ctx)
- err := req.Send()
- return out, err
- }
- type DeleteBucketEncryptionInput struct {
- // The name of the bucket.
- Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`
- // Set extend request headers. If the existing fields do not support setting the request header you need, you can set it through this field.
- ExtendHeaders map[string]*string `location:"extendHeaders" type:"map"`
- // Set extend query params. If the existing fields do not support setting the query param you need, you can set it through this field.
- ExtendQueryParams map[string]*string `location:"extendQueryParams" type:"map"`
- }
- type DeleteBucketEncryptionOutput struct {
- // The HTTP headers of the response.
- Metadata map[string]*string `location:"headers" type:"map"`
- // The HTTP status code of the response.
- StatusCode *int64 `location:"statusCode" type:"integer"`
- }
- // DeleteBucketEncryptionRequest generates a request for the DeleteBucketEncryption operation.
- func (c *S3) DeleteBucketEncryptionRequest(input *DeleteBucketEncryptionInput) (req *aws.Request, output *DeleteBucketEncryptionOutput) {
- op := &aws.Operation{
- Name: "DeleteBucketEncryption",
- HTTPMethod: "DELETE",
- HTTPPath: "/{Bucket}?encryption",
- }
- if input == nil {
- input = &DeleteBucketEncryptionInput{}
- }
- req = c.newRequest(op, input, output)
- output = &DeleteBucketEncryptionOutput{}
- req.Data = output
- return
- }
- // DeleteBucketEncryption deletes bucket encryption configuration.
- func (c *S3) DeleteBucketEncryption(input *DeleteBucketEncryptionInput) (*DeleteBucketEncryptionOutput, error) {
- req, out := c.DeleteBucketEncryptionRequest(input)
- err := req.Send()
- return out, err
- }
- func (c *S3) DeleteBucketEncryptionWithContext(ctx aws.Context, input *DeleteBucketEncryptionInput) (*DeleteBucketEncryptionOutput, error) {
- req, out := c.DeleteBucketEncryptionRequest(input)
- req.SetContext(ctx)
- err := req.Send()
- return out, err
- }
|