service.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package codedeploy
  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. // Overview This reference guide provides descriptions of the AWS CodeDeploy
  12. // APIs. For more information about AWS CodeDeploy, see the AWS CodeDeploy User
  13. // Guide (docs.aws.amazon.com/codedeploy/latest/userguide).
  14. //
  15. // Using the APIs You can use the AWS CodeDeploy APIs to work with the following:
  16. //
  17. // Applications are unique identifiers used by AWS CodeDeploy to ensure the
  18. // correct combinations of revisions, deployment configurations, and deployment
  19. // groups are being referenced during deployments.
  20. //
  21. // You can use the AWS CodeDeploy APIs to create, delete, get, list, and update
  22. // applications.
  23. //
  24. // Deployment configurations are sets of deployment rules and success and
  25. // failure conditions used by AWS CodeDeploy during deployments.
  26. //
  27. // You can use the AWS CodeDeploy APIs to create, delete, get, and list deployment
  28. // configurations.
  29. //
  30. // Deployment groups are groups of instances to which application revisions
  31. // can be deployed.
  32. //
  33. // You can use the AWS CodeDeploy APIs to create, delete, get, list, and update
  34. // deployment groups.
  35. //
  36. // Instances represent Amazon EC2 instances to which application revisions
  37. // are deployed. Instances are identified by their Amazon EC2 tags or Auto Scaling
  38. // group names. Instances belong to deployment groups.
  39. //
  40. // You can use the AWS CodeDeploy APIs to get and list instance.
  41. //
  42. // Deployments represent the process of deploying revisions to instances.
  43. //
  44. // You can use the AWS CodeDeploy APIs to create, get, list, and stop deployments.
  45. //
  46. // Application revisions are archive files stored in Amazon S3 buckets or
  47. // GitHub repositories. These revisions contain source content (such as source
  48. // code, web pages, executable files, and deployment scripts) along with an
  49. // application specification (AppSpec) file. (The AppSpec file is unique to
  50. // AWS CodeDeploy; it defines the deployment actions you want AWS CodeDeploy
  51. // to execute.) Ffor application revisions stored in Amazon S3 buckets, an application
  52. // revision is uniquely identified by its Amazon S3 object key and its ETag,
  53. // version, or both. For application revisions stored in GitHub repositories,
  54. // an application revision is uniquely identified by its repository name and
  55. // commit ID. Application revisions are deployed through deployment groups.
  56. //
  57. // You can use the AWS CodeDeploy APIs to get, list, and register application
  58. // revisions.
  59. //The service client's operations are safe to be used concurrently.
  60. // It is not safe to mutate any of the client's properties though.
  61. type CodeDeploy struct {
  62. *client.Client
  63. }
  64. // Used for custom client initialization logic
  65. var initClient func(*client.Client)
  66. // Used for custom request initialization logic
  67. var initRequest func(*request.Request)
  68. // A ServiceName is the name of the service the client will make API calls to.
  69. const ServiceName = "codedeploy"
  70. // New creates a new instance of the CodeDeploy client with a session.
  71. // If additional configuration is needed for the client instance use the optional
  72. // aws.Config parameter to add your extra config.
  73. //
  74. // Example:
  75. // // Create a CodeDeploy client from just a session.
  76. // svc := codedeploy.New(mySession)
  77. //
  78. // // Create a CodeDeploy client with additional configuration
  79. // svc := codedeploy.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  80. func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodeDeploy {
  81. c := p.ClientConfig(ServiceName, cfgs...)
  82. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  83. }
  84. // newClient creates, initializes and returns a new service client instance.
  85. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *CodeDeploy {
  86. svc := &CodeDeploy{
  87. Client: client.New(
  88. cfg,
  89. metadata.ClientInfo{
  90. ServiceName: ServiceName,
  91. SigningRegion: signingRegion,
  92. Endpoint: endpoint,
  93. APIVersion: "2014-10-06",
  94. JSONVersion: "1.1",
  95. TargetPrefix: "CodeDeploy_20141006",
  96. },
  97. handlers,
  98. ),
  99. }
  100. // Handlers
  101. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  102. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  103. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  104. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  105. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  106. // Run custom client initialization if present
  107. if initClient != nil {
  108. initClient(svc.Client)
  109. }
  110. return svc
  111. }
  112. // newRequest creates a new request for a CodeDeploy operation and runs any
  113. // custom request initialization.
  114. func (c *CodeDeploy) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  115. req := c.NewRequest(op, params, data)
  116. // Run custom request initialization if present
  117. if initRequest != nil {
  118. initRequest(req)
  119. }
  120. return req
  121. }