requester_qos.go 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. package s3
  2. import (
  3. "github.com/ks3sdklib/aws-sdk-go/aws"
  4. )
  5. type PutRequesterQosInput struct {
  6. // The name of the bucket.
  7. Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`
  8. // Requester flow control configuration container.
  9. RequesterQosConfiguration *RequesterQosConfiguration `locationName:"RequesterQosConfiguration" type:"structure" required:"true"`
  10. // Set extend request headers. If the existing fields do not support setting the request header you need, you can set it through this field.
  11. ExtendHeaders map[string]*string `location:"extendHeaders" type:"map"`
  12. // Set extend query params. If the existing fields do not support setting the query param you need, you can set it through this field.
  13. ExtendQueryParams map[string]*string `location:"extendQueryParams" type:"map"`
  14. metadataPutRequesterQosInput `json:"-" xml:"-"`
  15. }
  16. type metadataPutRequesterQosInput struct {
  17. SDKShapeTraits bool `type:"structure" payload:"RequesterQosConfiguration"`
  18. }
  19. type RequesterQosConfiguration struct {
  20. // Set the requester flow control rules.
  21. Rules []*RequesterQosRule `locationName:"Rule" type:"list" flattened:"true" required:"true"`
  22. }
  23. type RequesterQosRule struct {
  24. // Specify the account type that needs flow control.
  25. // Optional values: User/Role.
  26. UserType *string `locationName:"UserType" type:"string" required:"true"`
  27. // Specify the account that needs flow control.
  28. // Format: accountId/userName、accountId/roleName.
  29. Krn *string `locationName:"Krn" type:"string" required:"true"`
  30. // Set access account flow control quota.
  31. Quotas []*BucketQosQuota `locationName:"Quota" type:"list" flattened:"true" required:"true"`
  32. }
  33. type PutRequesterQosOutput struct {
  34. // The HTTP headers of the response.
  35. Metadata map[string]*string `location:"headers" type:"map"`
  36. // The HTTP status code of the response.
  37. StatusCode *int64 `location:"statusCode" type:"integer"`
  38. }
  39. // PutRequesterQosRequest generates a request for the PutRequesterQos operation.
  40. func (c *S3) PutRequesterQosRequest(input *PutRequesterQosInput) (req *aws.Request, output *PutRequesterQosOutput) {
  41. op := &aws.Operation{
  42. Name: "PutRequesterQos",
  43. HTTPMethod: "PUT",
  44. HTTPPath: "/{Bucket}?requesterqos",
  45. }
  46. if input == nil {
  47. input = &PutRequesterQosInput{}
  48. }
  49. req = c.newRequest(op, input, output)
  50. output = &PutRequesterQosOutput{}
  51. req.Data = output
  52. return
  53. }
  54. // PutRequesterQos sets requester flow control configuration.
  55. func (c *S3) PutRequesterQos(input *PutRequesterQosInput) (*PutRequesterQosOutput, error) {
  56. req, out := c.PutRequesterQosRequest(input)
  57. err := req.Send()
  58. return out, err
  59. }
  60. func (c *S3) PutRequesterQosWithContext(ctx aws.Context, input *PutRequesterQosInput) (*PutRequesterQosOutput, error) {
  61. req, out := c.PutRequesterQosRequest(input)
  62. req.SetContext(ctx)
  63. err := req.Send()
  64. return out, err
  65. }
  66. type GetRequesterQosInput struct {
  67. // The name of the bucket.
  68. Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`
  69. // Set extend request headers. If the existing fields do not support setting the request header you need, you can set it through this field.
  70. ExtendHeaders map[string]*string `location:"extendHeaders" type:"map"`
  71. // Set extend query params. If the existing fields do not support setting the query param you need, you can set it through this field.
  72. ExtendQueryParams map[string]*string `location:"extendQueryParams" type:"map"`
  73. }
  74. type GetRequesterQosOutput struct {
  75. // Requester flow control configuration container.
  76. RequesterQosConfiguration *RequesterQosConfiguration `locationName:"RequesterQosConfiguration" type:"structure"`
  77. // The HTTP headers of the response.
  78. Metadata map[string]*string `location:"headers" type:"map"`
  79. // The HTTP status code of the response.
  80. StatusCode *int64 `location:"statusCode" type:"integer"`
  81. metadataGetRequesterQosOutput `json:"-" xml:"-"`
  82. }
  83. type metadataGetRequesterQosOutput struct {
  84. SDKShapeTraits bool `type:"structure" payload:"RequesterQosConfiguration"`
  85. }
  86. // GetRequesterQosRequest generates a request for the GetRequesterQos operation.
  87. func (c *S3) GetRequesterQosRequest(input *GetRequesterQosInput) (req *aws.Request, output *GetRequesterQosOutput) {
  88. op := &aws.Operation{
  89. Name: "GetRequesterQos",
  90. HTTPMethod: "GET",
  91. HTTPPath: "/{Bucket}?requesterqos",
  92. }
  93. if input == nil {
  94. input = &GetRequesterQosInput{}
  95. }
  96. req = c.newRequest(op, input, output)
  97. output = &GetRequesterQosOutput{}
  98. req.Data = output
  99. return
  100. }
  101. // GetRequesterQos gets requester flow control configuration.
  102. func (c *S3) GetRequesterQos(input *GetRequesterQosInput) (*GetRequesterQosOutput, error) {
  103. req, out := c.GetRequesterQosRequest(input)
  104. err := req.Send()
  105. return out, err
  106. }
  107. func (c *S3) GetRequesterQosWithContext(ctx aws.Context, input *GetRequesterQosInput) (*GetRequesterQosOutput, error) {
  108. req, out := c.GetRequesterQosRequest(input)
  109. req.SetContext(ctx)
  110. err := req.Send()
  111. return out, err
  112. }
  113. type DeleteRequesterQosInput struct {
  114. // The name of the bucket.
  115. Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`
  116. // Set extend request headers. If the existing fields do not support setting the request header you need, you can set it through this field.
  117. ExtendHeaders map[string]*string `location:"extendHeaders" type:"map"`
  118. // Set extend query params. If the existing fields do not support setting the query param you need, you can set it through this field.
  119. ExtendQueryParams map[string]*string `location:"extendQueryParams" type:"map"`
  120. }
  121. type DeleteRequesterQosOutput struct {
  122. // The HTTP headers of the response.
  123. Metadata map[string]*string `location:"headers" type:"map"`
  124. // The HTTP status code of the response.
  125. StatusCode *int64 `location:"statusCode" type:"integer"`
  126. }
  127. // DeleteRequesterQosRequest generates a request for the DeleteRequesterQos operation.
  128. func (c *S3) DeleteRequesterQosRequest(input *DeleteRequesterQosInput) (req *aws.Request, output *DeleteRequesterQosOutput) {
  129. op := &aws.Operation{
  130. Name: "DeleteRequesterQos",
  131. HTTPMethod: "DELETE",
  132. HTTPPath: "/{Bucket}?requesterqos",
  133. }
  134. if input == nil {
  135. input = &DeleteRequesterQosInput{}
  136. }
  137. req = c.newRequest(op, input, output)
  138. output = &DeleteRequesterQosOutput{}
  139. req.Data = output
  140. return
  141. }
  142. // DeleteRequesterQos deletes requester flow control configuration.
  143. func (c *S3) DeleteRequesterQos(input *DeleteRequesterQosInput) (*DeleteRequesterQosOutput, error) {
  144. req, out := c.DeleteRequesterQosRequest(input)
  145. err := req.Send()
  146. return out, err
  147. }
  148. func (c *S3) DeleteRequesterQosWithContext(ctx aws.Context, input *DeleteRequesterQosInput) (*DeleteRequesterQosOutput, error) {
  149. req, out := c.DeleteRequesterQosRequest(input)
  150. req.SetContext(ctx)
  151. err := req.Send()
  152. return out, err
  153. }