service.go 7.4 KB

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