service.go 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package codepipeline
  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
  12. //
  13. // This is the AWS CodePipeline API Reference. This guide provides descriptions
  14. // of the actions and data types for AWS CodePipeline. Some functionality for
  15. // your pipeline is only configurable through the API. For additional information,
  16. // see the AWS CodePipeline User Guide (http://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html).
  17. //
  18. // You can use the AWS CodePipeline API to work with pipelines, stages, actions,
  19. // gates, and transitions, as described below.
  20. //
  21. // Pipelines are models of automated release processes. Each pipeline is uniquely
  22. // named, and consists of actions, gates, and stages.
  23. //
  24. // You can work with pipelines by calling:
  25. //
  26. // * CreatePipeline, which creates a uniquely-named pipeline.
  27. //
  28. // * DeletePipeline, which deletes the specified pipeline.
  29. //
  30. // * GetPipeline, which returns information about a pipeline structure.
  31. //
  32. // * GetPipelineExecution, which returns information about a specific execution
  33. // of a pipeline.
  34. //
  35. // * GetPipelineState, which returns information about the current state
  36. // of the stages and actions of a pipeline.
  37. //
  38. // * ListPipelines, which gets a summary of all of the pipelines associated
  39. // with your account.
  40. //
  41. // * StartPipelineExecution, which runs the the most recent revision of an
  42. // artifact through the pipeline.
  43. //
  44. // * UpdatePipeline, which updates a pipeline with edits or changes to the
  45. // structure of the pipeline.
  46. //
  47. // Pipelines include stages, which are which are logical groupings of gates
  48. // and actions. Each stage contains one or more actions that must complete before
  49. // the next stage begins. A stage will result in success or failure. If a stage
  50. // fails, then the pipeline stops at that stage and will remain stopped until
  51. // either a new version of an artifact appears in the source location, or a
  52. // user takes action to re-run the most recent artifact through the pipeline.
  53. // You can call GetPipelineState, which displays the status of a pipeline, including
  54. // the status of stages in the pipeline, or GetPipeline, which returns the entire
  55. // structure of the pipeline, including the stages of that pipeline. For more
  56. // information about the structure of stages and actions, also refer to the
  57. // AWS CodePipeline Pipeline Structure Reference (http://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-structure.html).
  58. //
  59. // Pipeline stages include actions, which are categorized into categories such
  60. // as source or build actions performed within a stage of a pipeline. For example,
  61. // you can use a source action to import artifacts into a pipeline from a source
  62. // such as Amazon S3. Like stages, you do not work with actions directly in
  63. // most cases, but you do define and interact with actions when working with
  64. // pipeline operations such as CreatePipeline and GetPipelineState.
  65. //
  66. // Pipelines also include transitions, which allow the transition of artifacts
  67. // from one stage to the next in a pipeline after the actions in one stage complete.
  68. //
  69. // You can work with transitions by calling:
  70. //
  71. // * DisableStageTransition, which prevents artifacts from transitioning
  72. // to the next stage in a pipeline.
  73. //
  74. // * EnableStageTransition, which enables transition of artifacts between
  75. // stages in a pipeline.
  76. //
  77. // Using the API to integrate with AWS CodePipeline
  78. //
  79. // For third-party integrators or developers who want to create their own integrations
  80. // with AWS CodePipeline, the expected sequence varies from the standard API
  81. // user. In order to integrate with AWS CodePipeline, developers will need to
  82. // work with the following items:
  83. //
  84. // Jobs, which are instances of an action. For example, a job for a source action
  85. // might import a revision of an artifact from a source.
  86. //
  87. // You can work with jobs by calling:
  88. //
  89. // * AcknowledgeJob, which confirms whether a job worker has received the
  90. // specified job,
  91. //
  92. // * GetJobDetails, which returns the details of a job,
  93. //
  94. // * PollForJobs, which determines whether there are any jobs to act upon,
  95. //
  96. //
  97. // * PutJobFailureResult, which provides details of a job failure, and
  98. //
  99. // * PutJobSuccessResult, which provides details of a job success.
  100. //
  101. // Third party jobs, which are instances of an action created by a partner action
  102. // and integrated into AWS CodePipeline. Partner actions are created by members
  103. // of the AWS Partner Network.
  104. //
  105. // You can work with third party jobs by calling:
  106. //
  107. // * AcknowledgeThirdPartyJob, which confirms whether a job worker has received
  108. // the specified job,
  109. //
  110. // * GetThirdPartyJobDetails, which requests the details of a job for a partner
  111. // action,
  112. //
  113. // * PollForThirdPartyJobs, which determines whether there are any jobs to
  114. // act upon,
  115. //
  116. // * PutThirdPartyJobFailureResult, which provides details of a job failure,
  117. // and
  118. //
  119. // * PutThirdPartyJobSuccessResult, which provides details of a job success.
  120. //The service client's operations are safe to be used concurrently.
  121. // It is not safe to mutate any of the client's properties though.
  122. type CodePipeline struct {
  123. *client.Client
  124. }
  125. // Used for custom client initialization logic
  126. var initClient func(*client.Client)
  127. // Used for custom request initialization logic
  128. var initRequest func(*request.Request)
  129. // A ServiceName is the name of the service the client will make API calls to.
  130. const ServiceName = "codepipeline"
  131. // New creates a new instance of the CodePipeline client with a session.
  132. // If additional configuration is needed for the client instance use the optional
  133. // aws.Config parameter to add your extra config.
  134. //
  135. // Example:
  136. // // Create a CodePipeline client from just a session.
  137. // svc := codepipeline.New(mySession)
  138. //
  139. // // Create a CodePipeline client with additional configuration
  140. // svc := codepipeline.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  141. func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodePipeline {
  142. c := p.ClientConfig(ServiceName, cfgs...)
  143. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  144. }
  145. // newClient creates, initializes and returns a new service client instance.
  146. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *CodePipeline {
  147. svc := &CodePipeline{
  148. Client: client.New(
  149. cfg,
  150. metadata.ClientInfo{
  151. ServiceName: ServiceName,
  152. SigningRegion: signingRegion,
  153. Endpoint: endpoint,
  154. APIVersion: "2015-07-09",
  155. JSONVersion: "1.1",
  156. TargetPrefix: "CodePipeline_20150709",
  157. },
  158. handlers,
  159. ),
  160. }
  161. // Handlers
  162. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  163. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  164. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  165. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  166. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  167. // Run custom client initialization if present
  168. if initClient != nil {
  169. initClient(svc.Client)
  170. }
  171. return svc
  172. }
  173. // newRequest creates a new request for a CodePipeline operation and runs any
  174. // custom request initialization.
  175. func (c *CodePipeline) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  176. req := c.NewRequest(op, params, data)
  177. // Run custom request initialization if present
  178. if initRequest != nil {
  179. initRequest(req)
  180. }
  181. return req
  182. }