service.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package applicationautoscaling
  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/jsonrpc"
  10. )
  11. // Application Auto Scaling is a general purpose Auto Scaling service for supported
  12. // elastic AWS resources. With Application Auto Scaling, you can automatically
  13. // scale your AWS resources, with an experience similar to that of Auto Scaling.
  14. //
  15. // Application Auto Scaling supports scaling the following AWS resources:
  16. //
  17. // * Amazon ECS services
  18. //
  19. // * Amazon EC2 Spot fleet instances
  20. //
  21. // You can use Application Auto Scaling to accomplish the following tasks:
  22. //
  23. // * Define scaling policies for automatically adjusting your AWS resources
  24. //
  25. // * Scale your resources in response to CloudWatch alarms
  26. //
  27. // * View history of your scaling events
  28. //
  29. // Application Auto Scaling is available in the following regions:
  30. //
  31. // * us-east-1
  32. //
  33. // * us-west-1
  34. //
  35. // * us-west-2
  36. //
  37. // * ap-southeast-1
  38. //
  39. // * ap-southeast-2
  40. //
  41. // * ap-northeast-1
  42. //
  43. // * eu-central-1
  44. //
  45. // * eu-west-1
  46. //The service client's operations are safe to be used concurrently.
  47. // It is not safe to mutate any of the client's properties though.
  48. type ApplicationAutoScaling struct {
  49. *client.Client
  50. }
  51. // Used for custom client initialization logic
  52. var initClient func(*client.Client)
  53. // Used for custom request initialization logic
  54. var initRequest func(*request.Request)
  55. // A ServiceName is the name of the service the client will make API calls to.
  56. const ServiceName = "autoscaling"
  57. // New creates a new instance of the ApplicationAutoScaling client with a session.
  58. // If additional configuration is needed for the client instance use the optional
  59. // aws.Config parameter to add your extra config.
  60. //
  61. // Example:
  62. // // Create a ApplicationAutoScaling client from just a session.
  63. // svc := applicationautoscaling.New(mySession)
  64. //
  65. // // Create a ApplicationAutoScaling client with additional configuration
  66. // svc := applicationautoscaling.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  67. func New(p client.ConfigProvider, cfgs ...*aws.Config) *ApplicationAutoScaling {
  68. c := p.ClientConfig(ServiceName, cfgs...)
  69. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  70. }
  71. // newClient creates, initializes and returns a new service client instance.
  72. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *ApplicationAutoScaling {
  73. svc := &ApplicationAutoScaling{
  74. Client: client.New(
  75. cfg,
  76. metadata.ClientInfo{
  77. ServiceName: ServiceName,
  78. SigningName: "application-autoscaling",
  79. SigningRegion: signingRegion,
  80. Endpoint: endpoint,
  81. APIVersion: "2016-02-06",
  82. JSONVersion: "1.1",
  83. TargetPrefix: "AnyScaleFrontendService",
  84. },
  85. handlers,
  86. ),
  87. }
  88. // Handlers
  89. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  90. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  91. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  92. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  93. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  94. // Run custom client initialization if present
  95. if initClient != nil {
  96. initClient(svc.Client)
  97. }
  98. return svc
  99. }
  100. // newRequest creates a new request for a ApplicationAutoScaling operation and runs any
  101. // custom request initialization.
  102. func (c *ApplicationAutoScaling) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  103. req := c.NewRequest(op, params, data)
  104. // Run custom request initialization if present
  105. if initRequest != nil {
  106. initRequest(req)
  107. }
  108. return req
  109. }