service.go 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package cloudwatch
  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/query"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // This is the Amazon CloudWatch API Reference. This guide provides detailed
  13. // information about Amazon CloudWatch actions, data types, parameters, and
  14. // errors. For detailed information about Amazon CloudWatch features and their
  15. // associated API calls, go to the Amazon CloudWatch Developer Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide).
  16. //
  17. // Amazon CloudWatch is a web service that enables you to publish, monitor,
  18. // and manage various metrics, as well as configure alarm actions based on data
  19. // from metrics. For more information about this product go to http://aws.amazon.com/cloudwatch
  20. // (http://aws.amazon.com/cloudwatch).
  21. //
  22. // For information about the namespace, metric names, and dimensions that
  23. // other Amazon Web Services products use to send metrics to Cloudwatch, go
  24. // to Amazon CloudWatch Metrics, Namespaces, and Dimensions Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html)
  25. // in the Amazon CloudWatch Developer Guide.
  26. //
  27. // Use the following links to get started using the Amazon CloudWatch API Reference:
  28. //
  29. // Actions (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Operations.html):
  30. // An alphabetical list of all Amazon CloudWatch actions. Data Types (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Types.html):
  31. // An alphabetical list of all Amazon CloudWatch data types. Common Parameters
  32. // (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CommonParameters.html):
  33. // Parameters that all Query actions can use. Common Errors (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CommonErrors.html):
  34. // Client and server errors that all actions can return. Regions and Endpoints
  35. // (http://docs.aws.amazon.com/general/latest/gr/index.html?rande.html): Itemized
  36. // regions and endpoints for all AWS products. WSDL Location (http://monitoring.amazonaws.com/doc/2010-08-01/CloudWatch.wsdl):
  37. // http://monitoring.amazonaws.com/doc/2010-08-01/CloudWatch.wsdl In addition
  38. // to using the Amazon CloudWatch API, you can also use the following SDKs and
  39. // third-party libraries to access Amazon CloudWatch programmatically.
  40. //
  41. // AWS SDK for Java Documentation (http://aws.amazon.com/documentation/sdkforjava/)
  42. // AWS SDK for .NET Documentation (http://aws.amazon.com/documentation/sdkfornet/)
  43. // AWS SDK for PHP Documentation (http://aws.amazon.com/documentation/sdkforphp/)
  44. // AWS SDK for Ruby Documentation (http://aws.amazon.com/documentation/sdkforruby/)
  45. // Developers in the AWS developer community also provide their own libraries,
  46. // which you can find at the following AWS developer centers:
  47. //
  48. // AWS Java Developer Center (http://aws.amazon.com/java/) AWS PHP Developer
  49. // Center (http://aws.amazon.com/php/) AWS Python Developer Center (http://aws.amazon.com/python/)
  50. // AWS Ruby Developer Center (http://aws.amazon.com/ruby/) AWS Windows and .NET
  51. // Developer Center (http://aws.amazon.com/net/)
  52. type CloudWatch struct {
  53. *service.Service
  54. }
  55. // Used for custom service initialization logic
  56. var initService func(*service.Service)
  57. // Used for custom request initialization logic
  58. var initRequest func(*request.Request)
  59. // New returns a new CloudWatch client.
  60. func New(config *aws.Config) *CloudWatch {
  61. service := &service.Service{
  62. ServiceInfo: serviceinfo.ServiceInfo{
  63. Config: defaults.DefaultConfig.Merge(config),
  64. ServiceName: "monitoring",
  65. APIVersion: "2010-08-01",
  66. },
  67. }
  68. service.Initialize()
  69. // Handlers
  70. service.Handlers.Sign.PushBack(v4.Sign)
  71. service.Handlers.Build.PushBack(query.Build)
  72. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  73. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  74. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  75. // Run custom service initialization if present
  76. if initService != nil {
  77. initService(service)
  78. }
  79. return &CloudWatch{service}
  80. }
  81. // newRequest creates a new request for a CloudWatch operation and runs any
  82. // custom request initialization.
  83. func (c *CloudWatch) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  84. req := c.NewRequest(op, params, data)
  85. // Run custom request initialization if present
  86. if initRequest != nil {
  87. initRequest(req)
  88. }
  89. return req
  90. }