service.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package elasticbeanstalk
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/client"
  6. "github.com/aws/aws-sdk-go/aws/client/metadata"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/aws/signer/v4"
  9. "github.com/aws/aws-sdk-go/private/protocol/query"
  10. )
  11. // AWS Elastic Beanstalk makes it easy for you to create, deploy, and manage
  12. // scalable, fault-tolerant applications running on the Amazon Web Services
  13. // cloud.
  14. //
  15. // For more information about this product, go to the AWS Elastic Beanstalk
  16. // (http://aws.amazon.com/elasticbeanstalk/) details page. The location of the
  17. // latest AWS Elastic Beanstalk WSDL is http://elasticbeanstalk.s3.amazonaws.com/doc/2010-12-01/AWSElasticBeanstalk.wsdl
  18. // (http://elasticbeanstalk.s3.amazonaws.com/doc/2010-12-01/AWSElasticBeanstalk.wsdl).
  19. // To install the Software Development Kits (SDKs), Integrated Development Environment
  20. // (IDE) Toolkits, and command line tools that enable you to access the API,
  21. // go to Tools for Amazon Web Services (http://aws.amazon.com/tools/).
  22. //
  23. // Endpoints
  24. //
  25. // For a list of region-specific endpoints that AWS Elastic Beanstalk supports,
  26. // go to Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region)
  27. // in the Amazon Web Services Glossary.
  28. //The service client's operations are safe to be used concurrently.
  29. // It is not safe to mutate any of the client's properties though.
  30. type ElasticBeanstalk struct {
  31. *client.Client
  32. }
  33. // Used for custom client initialization logic
  34. var initClient func(*client.Client)
  35. // Used for custom request initialization logic
  36. var initRequest func(*request.Request)
  37. // A ServiceName is the name of the service the client will make API calls to.
  38. const ServiceName = "elasticbeanstalk"
  39. // New creates a new instance of the ElasticBeanstalk client with a session.
  40. // If additional configuration is needed for the client instance use the optional
  41. // aws.Config parameter to add your extra config.
  42. //
  43. // Example:
  44. // // Create a ElasticBeanstalk client from just a session.
  45. // svc := elasticbeanstalk.New(mySession)
  46. //
  47. // // Create a ElasticBeanstalk client with additional configuration
  48. // svc := elasticbeanstalk.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  49. func New(p client.ConfigProvider, cfgs ...*aws.Config) *ElasticBeanstalk {
  50. c := p.ClientConfig(ServiceName, cfgs...)
  51. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  52. }
  53. // newClient creates, initializes and returns a new service client instance.
  54. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *ElasticBeanstalk {
  55. svc := &ElasticBeanstalk{
  56. Client: client.New(
  57. cfg,
  58. metadata.ClientInfo{
  59. ServiceName: ServiceName,
  60. SigningRegion: signingRegion,
  61. Endpoint: endpoint,
  62. APIVersion: "2010-12-01",
  63. },
  64. handlers,
  65. ),
  66. }
  67. // Handlers
  68. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  69. svc.Handlers.Build.PushBackNamed(query.BuildHandler)
  70. svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
  71. svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
  72. svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
  73. // Run custom client initialization if present
  74. if initClient != nil {
  75. initClient(svc.Client)
  76. }
  77. return svc
  78. }
  79. // newRequest creates a new request for a ElasticBeanstalk operation and runs any
  80. // custom request initialization.
  81. func (c *ElasticBeanstalk) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  82. req := c.NewRequest(op, params, data)
  83. // Run custom request initialization if present
  84. if initRequest != nil {
  85. initRequest(req)
  86. }
  87. return req
  88. }