service.go 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package configservice
  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 Config provides a way to keep track of the configurations of all the
  13. // AWS resources associated with your AWS account. You can use AWS Config to
  14. // get the current and historical configurations of each AWS resource and also
  15. // to get information about the relationship between the resources. An AWS resource
  16. // can be an Amazon Compute Cloud (Amazon EC2) instance, an Elastic Block Store
  17. // (EBS) volume, an Elastic network Interface (ENI), or a security group. For
  18. // a complete list of resources currently supported by AWS Config, see Supported
  19. // AWS Resources (http://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources).
  20. //
  21. // You can access and manage AWS Config through the AWS Management Console,
  22. // the AWS Command Line Interface (AWS CLI), the AWS Config API, or the AWS
  23. // SDKs for AWS Config
  24. //
  25. // This reference guide contains documentation for the AWS Config API and the
  26. // AWS CLI commands that you can use to manage AWS Config.
  27. //
  28. // The AWS Config API uses the Signature Version 4 protocol for signing requests.
  29. // For more information about how to sign a request with this protocol, see
  30. // Signature Version 4 Signing Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
  31. //
  32. // For detailed information about AWS Config features and their associated
  33. // actions or commands, as well as how to work with AWS Management Console,
  34. // see What Is AWS Config? (http://docs.aws.amazon.com/config/latest/developerguide/WhatIsConfig.html)
  35. // in the AWS Config Developer Guide.
  36. type ConfigService struct {
  37. *service.Service
  38. }
  39. // Used for custom service initialization logic
  40. var initService func(*service.Service)
  41. // Used for custom request initialization logic
  42. var initRequest func(*request.Request)
  43. // New returns a new ConfigService client.
  44. func New(config *aws.Config) *ConfigService {
  45. service := &service.Service{
  46. ServiceInfo: serviceinfo.ServiceInfo{
  47. Config: defaults.DefaultConfig.Merge(config),
  48. ServiceName: "config",
  49. APIVersion: "2014-11-12",
  50. JSONVersion: "1.1",
  51. TargetPrefix: "StarlingDoveService",
  52. },
  53. }
  54. service.Initialize()
  55. // Handlers
  56. service.Handlers.Sign.PushBack(v4.Sign)
  57. service.Handlers.Build.PushBack(jsonrpc.Build)
  58. service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
  59. service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
  60. service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
  61. // Run custom service initialization if present
  62. if initService != nil {
  63. initService(service)
  64. }
  65. return &ConfigService{service}
  66. }
  67. // newRequest creates a new request for a ConfigService operation and runs any
  68. // custom request initialization.
  69. func (c *ConfigService) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  70. req := c.NewRequest(op, params, data)
  71. // Run custom request initialization if present
  72. if initRequest != nil {
  73. initRequest(req)
  74. }
  75. return req
  76. }