service.go 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package cloudformation
  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. // AWS CloudFormation enables you to create and manage AWS infrastructure deployments
  13. // predictably and repeatedly. AWS CloudFormation helps you leverage AWS products
  14. // such as Amazon EC2, EBS, Amazon SNS, ELB, and Auto Scaling to build highly-reliable,
  15. // highly scalable, cost effective applications without worrying about creating
  16. // and configuring the underlying AWS infrastructure.
  17. //
  18. // With AWS CloudFormation, you declare all of your resources and dependencies
  19. // in a template file. The template defines a collection of resources as a single
  20. // unit called a stack. AWS CloudFormation creates and deletes all member resources
  21. // of the stack together and manages all dependencies between the resources
  22. // for you.
  23. //
  24. // For more information about this product, go to the CloudFormation Product
  25. // Page (http://aws.amazon.com/cloudformation/).
  26. //
  27. // Amazon CloudFormation makes use of other AWS products. If you need additional
  28. // technical information about a specific AWS product, you can find the product's
  29. // technical documentation at http://aws.amazon.com/documentation/ (http://aws.amazon.com/documentation/).
  30. type CloudFormation struct {
  31. *service.Service
  32. }
  33. // Used for custom service initialization logic
  34. var initService func(*service.Service)
  35. // Used for custom request initialization logic
  36. var initRequest func(*request.Request)
  37. // New returns a new CloudFormation client.
  38. func New(config *aws.Config) *CloudFormation {
  39. service := &service.Service{
  40. ServiceInfo: serviceinfo.ServiceInfo{
  41. Config: defaults.DefaultConfig.Merge(config),
  42. ServiceName: "cloudformation",
  43. APIVersion: "2010-05-15",
  44. },
  45. }
  46. service.Initialize()
  47. // Handlers
  48. service.Handlers.Sign.PushBack(v4.Sign)
  49. service.Handlers.Build.PushBack(query.Build)
  50. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  51. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  52. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  53. // Run custom service initialization if present
  54. if initService != nil {
  55. initService(service)
  56. }
  57. return &CloudFormation{service}
  58. }
  59. // newRequest creates a new request for a CloudFormation operation and runs any
  60. // custom request initialization.
  61. func (c *CloudFormation) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  62. req := c.NewRequest(op, params, data)
  63. // Run custom request initialization if present
  64. if initRequest != nil {
  65. initRequest(req)
  66. }
  67. return req
  68. }