service.go 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package storagegateway
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/defaults"
  6. "github.com/aws/aws-sdk-go/aws/request"
  7. "github.com/aws/aws-sdk-go/aws/service"
  8. "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
  9. "github.com/aws/aws-sdk-go/internal/protocol/jsonrpc"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // AWS Storage Gateway is the service that connects an on-premises software
  13. // appliance with cloud-based storage to provide seamless and secure integration
  14. // between an organization's on-premises IT environment and AWS's storage infrastructure.
  15. // The service enables you to securely upload data to the AWS cloud for cost
  16. // effective backup and rapid disaster recovery.
  17. //
  18. // Use the following links to get started using the AWS Storage Gateway Service
  19. // API Reference:
  20. //
  21. // AWS Storage Gateway Required Request Headers (http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayHTTPRequestsHeaders.html):
  22. // Describes the required headers that you must send with every POST request
  23. // to AWS Storage Gateway. Signing Requests (http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewaySigningRequests.html):
  24. // AWS Storage Gateway requires that you authenticate every request you send;
  25. // this topic describes how sign such a request. Error Responses (http://docs.aws.amazon.com/storagegateway/latest/userguide/APIErrorResponses.html):
  26. // Provides reference information about AWS Storage Gateway errors. Operations
  27. // in AWS Storage Gateway (http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPIOperations.html):
  28. // Contains detailed descriptions of all AWS Storage Gateway operations, their
  29. // request parameters, response elements, possible errors, and examples of requests
  30. // and responses. AWS Storage Gateway Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/index.html?rande.html):
  31. // Provides a list of each of the regions and endpoints available for use with
  32. // AWS Storage Gateway.
  33. type StorageGateway struct {
  34. *service.Service
  35. }
  36. // Used for custom service initialization logic
  37. var initService func(*service.Service)
  38. // Used for custom request initialization logic
  39. var initRequest func(*request.Request)
  40. // New returns a new StorageGateway client.
  41. func New(config *aws.Config) *StorageGateway {
  42. service := &service.Service{
  43. ServiceInfo: serviceinfo.ServiceInfo{
  44. Config: defaults.DefaultConfig.Merge(config),
  45. ServiceName: "storagegateway",
  46. APIVersion: "2013-06-30",
  47. JSONVersion: "1.1",
  48. TargetPrefix: "StorageGateway_20130630",
  49. },
  50. }
  51. service.Initialize()
  52. // Handlers
  53. service.Handlers.Sign.PushBack(v4.Sign)
  54. service.Handlers.Build.PushBack(jsonrpc.Build)
  55. service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
  56. service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
  57. service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
  58. // Run custom service initialization if present
  59. if initService != nil {
  60. initService(service)
  61. }
  62. return &StorageGateway{service}
  63. }
  64. // newRequest creates a new request for a StorageGateway operation and runs any
  65. // custom request initialization.
  66. func (c *StorageGateway) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  67. req := c.NewRequest(op, params, data)
  68. // Run custom request initialization if present
  69. if initRequest != nil {
  70. initRequest(req)
  71. }
  72. return req
  73. }