examples_test.go 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package codepipeline_test
  3. import (
  4. "bytes"
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws"
  8. "github.com/aws/aws-sdk-go/aws/session"
  9. "github.com/aws/aws-sdk-go/service/codepipeline"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleCodePipeline_AcknowledgeJob() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := codepipeline.New(sess)
  20. params := &codepipeline.AcknowledgeJobInput{
  21. JobId: aws.String("JobId"), // Required
  22. Nonce: aws.String("Nonce"), // Required
  23. }
  24. resp, err := svc.AcknowledgeJob(params)
  25. if err != nil {
  26. // Print the error, cast err to awserr.Error to get the Code and
  27. // Message from an error.
  28. fmt.Println(err.Error())
  29. return
  30. }
  31. // Pretty-print the response data.
  32. fmt.Println(resp)
  33. }
  34. func ExampleCodePipeline_AcknowledgeThirdPartyJob() {
  35. sess, err := session.NewSession()
  36. if err != nil {
  37. fmt.Println("failed to create session,", err)
  38. return
  39. }
  40. svc := codepipeline.New(sess)
  41. params := &codepipeline.AcknowledgeThirdPartyJobInput{
  42. ClientToken: aws.String("ClientToken"), // Required
  43. JobId: aws.String("ThirdPartyJobId"), // Required
  44. Nonce: aws.String("Nonce"), // Required
  45. }
  46. resp, err := svc.AcknowledgeThirdPartyJob(params)
  47. if err != nil {
  48. // Print the error, cast err to awserr.Error to get the Code and
  49. // Message from an error.
  50. fmt.Println(err.Error())
  51. return
  52. }
  53. // Pretty-print the response data.
  54. fmt.Println(resp)
  55. }
  56. func ExampleCodePipeline_CreateCustomActionType() {
  57. sess, err := session.NewSession()
  58. if err != nil {
  59. fmt.Println("failed to create session,", err)
  60. return
  61. }
  62. svc := codepipeline.New(sess)
  63. params := &codepipeline.CreateCustomActionTypeInput{
  64. Category: aws.String("ActionCategory"), // Required
  65. InputArtifactDetails: &codepipeline.ArtifactDetails{ // Required
  66. MaximumCount: aws.Int64(1), // Required
  67. MinimumCount: aws.Int64(1), // Required
  68. },
  69. OutputArtifactDetails: &codepipeline.ArtifactDetails{ // Required
  70. MaximumCount: aws.Int64(1), // Required
  71. MinimumCount: aws.Int64(1), // Required
  72. },
  73. Provider: aws.String("ActionProvider"), // Required
  74. Version: aws.String("Version"), // Required
  75. ConfigurationProperties: []*codepipeline.ActionConfigurationProperty{
  76. { // Required
  77. Key: aws.Bool(true), // Required
  78. Name: aws.String("ActionConfigurationKey"), // Required
  79. Required: aws.Bool(true), // Required
  80. Secret: aws.Bool(true), // Required
  81. Description: aws.String("Description"),
  82. Queryable: aws.Bool(true),
  83. Type: aws.String("ActionConfigurationPropertyType"),
  84. },
  85. // More values...
  86. },
  87. Settings: &codepipeline.ActionTypeSettings{
  88. EntityUrlTemplate: aws.String("UrlTemplate"),
  89. ExecutionUrlTemplate: aws.String("UrlTemplate"),
  90. RevisionUrlTemplate: aws.String("UrlTemplate"),
  91. ThirdPartyConfigurationUrl: aws.String("Url"),
  92. },
  93. }
  94. resp, err := svc.CreateCustomActionType(params)
  95. if err != nil {
  96. // Print the error, cast err to awserr.Error to get the Code and
  97. // Message from an error.
  98. fmt.Println(err.Error())
  99. return
  100. }
  101. // Pretty-print the response data.
  102. fmt.Println(resp)
  103. }
  104. func ExampleCodePipeline_CreatePipeline() {
  105. sess, err := session.NewSession()
  106. if err != nil {
  107. fmt.Println("failed to create session,", err)
  108. return
  109. }
  110. svc := codepipeline.New(sess)
  111. params := &codepipeline.CreatePipelineInput{
  112. Pipeline: &codepipeline.PipelineDeclaration{ // Required
  113. ArtifactStore: &codepipeline.ArtifactStore{ // Required
  114. Location: aws.String("ArtifactStoreLocation"), // Required
  115. Type: aws.String("ArtifactStoreType"), // Required
  116. EncryptionKey: &codepipeline.EncryptionKey{
  117. Id: aws.String("EncryptionKeyId"), // Required
  118. Type: aws.String("EncryptionKeyType"), // Required
  119. },
  120. },
  121. Name: aws.String("PipelineName"), // Required
  122. RoleArn: aws.String("RoleArn"), // Required
  123. Stages: []*codepipeline.StageDeclaration{ // Required
  124. { // Required
  125. Actions: []*codepipeline.ActionDeclaration{ // Required
  126. { // Required
  127. ActionTypeId: &codepipeline.ActionTypeId{ // Required
  128. Category: aws.String("ActionCategory"), // Required
  129. Owner: aws.String("ActionOwner"), // Required
  130. Provider: aws.String("ActionProvider"), // Required
  131. Version: aws.String("Version"), // Required
  132. },
  133. Name: aws.String("ActionName"), // Required
  134. Configuration: map[string]*string{
  135. "Key": aws.String("ActionConfigurationValue"), // Required
  136. // More values...
  137. },
  138. InputArtifacts: []*codepipeline.InputArtifact{
  139. { // Required
  140. Name: aws.String("ArtifactName"), // Required
  141. },
  142. // More values...
  143. },
  144. OutputArtifacts: []*codepipeline.OutputArtifact{
  145. { // Required
  146. Name: aws.String("ArtifactName"), // Required
  147. },
  148. // More values...
  149. },
  150. RoleArn: aws.String("RoleArn"),
  151. RunOrder: aws.Int64(1),
  152. },
  153. // More values...
  154. },
  155. Name: aws.String("StageName"), // Required
  156. Blockers: []*codepipeline.BlockerDeclaration{
  157. { // Required
  158. Name: aws.String("BlockerName"), // Required
  159. Type: aws.String("BlockerType"), // Required
  160. },
  161. // More values...
  162. },
  163. },
  164. // More values...
  165. },
  166. Version: aws.Int64(1),
  167. },
  168. }
  169. resp, err := svc.CreatePipeline(params)
  170. if err != nil {
  171. // Print the error, cast err to awserr.Error to get the Code and
  172. // Message from an error.
  173. fmt.Println(err.Error())
  174. return
  175. }
  176. // Pretty-print the response data.
  177. fmt.Println(resp)
  178. }
  179. func ExampleCodePipeline_DeleteCustomActionType() {
  180. sess, err := session.NewSession()
  181. if err != nil {
  182. fmt.Println("failed to create session,", err)
  183. return
  184. }
  185. svc := codepipeline.New(sess)
  186. params := &codepipeline.DeleteCustomActionTypeInput{
  187. Category: aws.String("ActionCategory"), // Required
  188. Provider: aws.String("ActionProvider"), // Required
  189. Version: aws.String("Version"), // Required
  190. }
  191. resp, err := svc.DeleteCustomActionType(params)
  192. if err != nil {
  193. // Print the error, cast err to awserr.Error to get the Code and
  194. // Message from an error.
  195. fmt.Println(err.Error())
  196. return
  197. }
  198. // Pretty-print the response data.
  199. fmt.Println(resp)
  200. }
  201. func ExampleCodePipeline_DeletePipeline() {
  202. sess, err := session.NewSession()
  203. if err != nil {
  204. fmt.Println("failed to create session,", err)
  205. return
  206. }
  207. svc := codepipeline.New(sess)
  208. params := &codepipeline.DeletePipelineInput{
  209. Name: aws.String("PipelineName"), // Required
  210. }
  211. resp, err := svc.DeletePipeline(params)
  212. if err != nil {
  213. // Print the error, cast err to awserr.Error to get the Code and
  214. // Message from an error.
  215. fmt.Println(err.Error())
  216. return
  217. }
  218. // Pretty-print the response data.
  219. fmt.Println(resp)
  220. }
  221. func ExampleCodePipeline_DisableStageTransition() {
  222. sess, err := session.NewSession()
  223. if err != nil {
  224. fmt.Println("failed to create session,", err)
  225. return
  226. }
  227. svc := codepipeline.New(sess)
  228. params := &codepipeline.DisableStageTransitionInput{
  229. PipelineName: aws.String("PipelineName"), // Required
  230. Reason: aws.String("DisabledReason"), // Required
  231. StageName: aws.String("StageName"), // Required
  232. TransitionType: aws.String("StageTransitionType"), // Required
  233. }
  234. resp, err := svc.DisableStageTransition(params)
  235. if err != nil {
  236. // Print the error, cast err to awserr.Error to get the Code and
  237. // Message from an error.
  238. fmt.Println(err.Error())
  239. return
  240. }
  241. // Pretty-print the response data.
  242. fmt.Println(resp)
  243. }
  244. func ExampleCodePipeline_EnableStageTransition() {
  245. sess, err := session.NewSession()
  246. if err != nil {
  247. fmt.Println("failed to create session,", err)
  248. return
  249. }
  250. svc := codepipeline.New(sess)
  251. params := &codepipeline.EnableStageTransitionInput{
  252. PipelineName: aws.String("PipelineName"), // Required
  253. StageName: aws.String("StageName"), // Required
  254. TransitionType: aws.String("StageTransitionType"), // Required
  255. }
  256. resp, err := svc.EnableStageTransition(params)
  257. if err != nil {
  258. // Print the error, cast err to awserr.Error to get the Code and
  259. // Message from an error.
  260. fmt.Println(err.Error())
  261. return
  262. }
  263. // Pretty-print the response data.
  264. fmt.Println(resp)
  265. }
  266. func ExampleCodePipeline_GetJobDetails() {
  267. sess, err := session.NewSession()
  268. if err != nil {
  269. fmt.Println("failed to create session,", err)
  270. return
  271. }
  272. svc := codepipeline.New(sess)
  273. params := &codepipeline.GetJobDetailsInput{
  274. JobId: aws.String("JobId"), // Required
  275. }
  276. resp, err := svc.GetJobDetails(params)
  277. if err != nil {
  278. // Print the error, cast err to awserr.Error to get the Code and
  279. // Message from an error.
  280. fmt.Println(err.Error())
  281. return
  282. }
  283. // Pretty-print the response data.
  284. fmt.Println(resp)
  285. }
  286. func ExampleCodePipeline_GetPipeline() {
  287. sess, err := session.NewSession()
  288. if err != nil {
  289. fmt.Println("failed to create session,", err)
  290. return
  291. }
  292. svc := codepipeline.New(sess)
  293. params := &codepipeline.GetPipelineInput{
  294. Name: aws.String("PipelineName"), // Required
  295. Version: aws.Int64(1),
  296. }
  297. resp, err := svc.GetPipeline(params)
  298. if err != nil {
  299. // Print the error, cast err to awserr.Error to get the Code and
  300. // Message from an error.
  301. fmt.Println(err.Error())
  302. return
  303. }
  304. // Pretty-print the response data.
  305. fmt.Println(resp)
  306. }
  307. func ExampleCodePipeline_GetPipelineExecution() {
  308. sess, err := session.NewSession()
  309. if err != nil {
  310. fmt.Println("failed to create session,", err)
  311. return
  312. }
  313. svc := codepipeline.New(sess)
  314. params := &codepipeline.GetPipelineExecutionInput{
  315. PipelineExecutionId: aws.String("PipelineExecutionId"), // Required
  316. PipelineName: aws.String("PipelineName"), // Required
  317. }
  318. resp, err := svc.GetPipelineExecution(params)
  319. if err != nil {
  320. // Print the error, cast err to awserr.Error to get the Code and
  321. // Message from an error.
  322. fmt.Println(err.Error())
  323. return
  324. }
  325. // Pretty-print the response data.
  326. fmt.Println(resp)
  327. }
  328. func ExampleCodePipeline_GetPipelineState() {
  329. sess, err := session.NewSession()
  330. if err != nil {
  331. fmt.Println("failed to create session,", err)
  332. return
  333. }
  334. svc := codepipeline.New(sess)
  335. params := &codepipeline.GetPipelineStateInput{
  336. Name: aws.String("PipelineName"), // Required
  337. }
  338. resp, err := svc.GetPipelineState(params)
  339. if err != nil {
  340. // Print the error, cast err to awserr.Error to get the Code and
  341. // Message from an error.
  342. fmt.Println(err.Error())
  343. return
  344. }
  345. // Pretty-print the response data.
  346. fmt.Println(resp)
  347. }
  348. func ExampleCodePipeline_GetThirdPartyJobDetails() {
  349. sess, err := session.NewSession()
  350. if err != nil {
  351. fmt.Println("failed to create session,", err)
  352. return
  353. }
  354. svc := codepipeline.New(sess)
  355. params := &codepipeline.GetThirdPartyJobDetailsInput{
  356. ClientToken: aws.String("ClientToken"), // Required
  357. JobId: aws.String("ThirdPartyJobId"), // Required
  358. }
  359. resp, err := svc.GetThirdPartyJobDetails(params)
  360. if err != nil {
  361. // Print the error, cast err to awserr.Error to get the Code and
  362. // Message from an error.
  363. fmt.Println(err.Error())
  364. return
  365. }
  366. // Pretty-print the response data.
  367. fmt.Println(resp)
  368. }
  369. func ExampleCodePipeline_ListActionTypes() {
  370. sess, err := session.NewSession()
  371. if err != nil {
  372. fmt.Println("failed to create session,", err)
  373. return
  374. }
  375. svc := codepipeline.New(sess)
  376. params := &codepipeline.ListActionTypesInput{
  377. ActionOwnerFilter: aws.String("ActionOwner"),
  378. NextToken: aws.String("NextToken"),
  379. }
  380. resp, err := svc.ListActionTypes(params)
  381. if err != nil {
  382. // Print the error, cast err to awserr.Error to get the Code and
  383. // Message from an error.
  384. fmt.Println(err.Error())
  385. return
  386. }
  387. // Pretty-print the response data.
  388. fmt.Println(resp)
  389. }
  390. func ExampleCodePipeline_ListPipelines() {
  391. sess, err := session.NewSession()
  392. if err != nil {
  393. fmt.Println("failed to create session,", err)
  394. return
  395. }
  396. svc := codepipeline.New(sess)
  397. params := &codepipeline.ListPipelinesInput{
  398. NextToken: aws.String("NextToken"),
  399. }
  400. resp, err := svc.ListPipelines(params)
  401. if err != nil {
  402. // Print the error, cast err to awserr.Error to get the Code and
  403. // Message from an error.
  404. fmt.Println(err.Error())
  405. return
  406. }
  407. // Pretty-print the response data.
  408. fmt.Println(resp)
  409. }
  410. func ExampleCodePipeline_PollForJobs() {
  411. sess, err := session.NewSession()
  412. if err != nil {
  413. fmt.Println("failed to create session,", err)
  414. return
  415. }
  416. svc := codepipeline.New(sess)
  417. params := &codepipeline.PollForJobsInput{
  418. ActionTypeId: &codepipeline.ActionTypeId{ // Required
  419. Category: aws.String("ActionCategory"), // Required
  420. Owner: aws.String("ActionOwner"), // Required
  421. Provider: aws.String("ActionProvider"), // Required
  422. Version: aws.String("Version"), // Required
  423. },
  424. MaxBatchSize: aws.Int64(1),
  425. QueryParam: map[string]*string{
  426. "Key": aws.String("ActionConfigurationQueryableValue"), // Required
  427. // More values...
  428. },
  429. }
  430. resp, err := svc.PollForJobs(params)
  431. if err != nil {
  432. // Print the error, cast err to awserr.Error to get the Code and
  433. // Message from an error.
  434. fmt.Println(err.Error())
  435. return
  436. }
  437. // Pretty-print the response data.
  438. fmt.Println(resp)
  439. }
  440. func ExampleCodePipeline_PollForThirdPartyJobs() {
  441. sess, err := session.NewSession()
  442. if err != nil {
  443. fmt.Println("failed to create session,", err)
  444. return
  445. }
  446. svc := codepipeline.New(sess)
  447. params := &codepipeline.PollForThirdPartyJobsInput{
  448. ActionTypeId: &codepipeline.ActionTypeId{ // Required
  449. Category: aws.String("ActionCategory"), // Required
  450. Owner: aws.String("ActionOwner"), // Required
  451. Provider: aws.String("ActionProvider"), // Required
  452. Version: aws.String("Version"), // Required
  453. },
  454. MaxBatchSize: aws.Int64(1),
  455. }
  456. resp, err := svc.PollForThirdPartyJobs(params)
  457. if err != nil {
  458. // Print the error, cast err to awserr.Error to get the Code and
  459. // Message from an error.
  460. fmt.Println(err.Error())
  461. return
  462. }
  463. // Pretty-print the response data.
  464. fmt.Println(resp)
  465. }
  466. func ExampleCodePipeline_PutActionRevision() {
  467. sess, err := session.NewSession()
  468. if err != nil {
  469. fmt.Println("failed to create session,", err)
  470. return
  471. }
  472. svc := codepipeline.New(sess)
  473. params := &codepipeline.PutActionRevisionInput{
  474. ActionName: aws.String("ActionName"), // Required
  475. ActionRevision: &codepipeline.ActionRevision{ // Required
  476. Created: aws.Time(time.Now()), // Required
  477. RevisionChangeId: aws.String("RevisionChangeIdentifier"), // Required
  478. RevisionId: aws.String("Revision"), // Required
  479. },
  480. PipelineName: aws.String("PipelineName"), // Required
  481. StageName: aws.String("StageName"), // Required
  482. }
  483. resp, err := svc.PutActionRevision(params)
  484. if err != nil {
  485. // Print the error, cast err to awserr.Error to get the Code and
  486. // Message from an error.
  487. fmt.Println(err.Error())
  488. return
  489. }
  490. // Pretty-print the response data.
  491. fmt.Println(resp)
  492. }
  493. func ExampleCodePipeline_PutApprovalResult() {
  494. sess, err := session.NewSession()
  495. if err != nil {
  496. fmt.Println("failed to create session,", err)
  497. return
  498. }
  499. svc := codepipeline.New(sess)
  500. params := &codepipeline.PutApprovalResultInput{
  501. ActionName: aws.String("ActionName"), // Required
  502. PipelineName: aws.String("PipelineName"), // Required
  503. Result: &codepipeline.ApprovalResult{ // Required
  504. Status: aws.String("ApprovalStatus"), // Required
  505. Summary: aws.String("ApprovalSummary"), // Required
  506. },
  507. StageName: aws.String("StageName"), // Required
  508. Token: aws.String("ApprovalToken"), // Required
  509. }
  510. resp, err := svc.PutApprovalResult(params)
  511. if err != nil {
  512. // Print the error, cast err to awserr.Error to get the Code and
  513. // Message from an error.
  514. fmt.Println(err.Error())
  515. return
  516. }
  517. // Pretty-print the response data.
  518. fmt.Println(resp)
  519. }
  520. func ExampleCodePipeline_PutJobFailureResult() {
  521. sess, err := session.NewSession()
  522. if err != nil {
  523. fmt.Println("failed to create session,", err)
  524. return
  525. }
  526. svc := codepipeline.New(sess)
  527. params := &codepipeline.PutJobFailureResultInput{
  528. FailureDetails: &codepipeline.FailureDetails{ // Required
  529. Message: aws.String("Message"), // Required
  530. Type: aws.String("FailureType"), // Required
  531. ExternalExecutionId: aws.String("ExecutionId"),
  532. },
  533. JobId: aws.String("JobId"), // Required
  534. }
  535. resp, err := svc.PutJobFailureResult(params)
  536. if err != nil {
  537. // Print the error, cast err to awserr.Error to get the Code and
  538. // Message from an error.
  539. fmt.Println(err.Error())
  540. return
  541. }
  542. // Pretty-print the response data.
  543. fmt.Println(resp)
  544. }
  545. func ExampleCodePipeline_PutJobSuccessResult() {
  546. sess, err := session.NewSession()
  547. if err != nil {
  548. fmt.Println("failed to create session,", err)
  549. return
  550. }
  551. svc := codepipeline.New(sess)
  552. params := &codepipeline.PutJobSuccessResultInput{
  553. JobId: aws.String("JobId"), // Required
  554. ContinuationToken: aws.String("ContinuationToken"),
  555. CurrentRevision: &codepipeline.CurrentRevision{
  556. ChangeIdentifier: aws.String("RevisionChangeIdentifier"), // Required
  557. Revision: aws.String("Revision"), // Required
  558. Created: aws.Time(time.Now()),
  559. RevisionSummary: aws.String("RevisionSummary"),
  560. },
  561. ExecutionDetails: &codepipeline.ExecutionDetails{
  562. ExternalExecutionId: aws.String("ExecutionId"),
  563. PercentComplete: aws.Int64(1),
  564. Summary: aws.String("ExecutionSummary"),
  565. },
  566. }
  567. resp, err := svc.PutJobSuccessResult(params)
  568. if err != nil {
  569. // Print the error, cast err to awserr.Error to get the Code and
  570. // Message from an error.
  571. fmt.Println(err.Error())
  572. return
  573. }
  574. // Pretty-print the response data.
  575. fmt.Println(resp)
  576. }
  577. func ExampleCodePipeline_PutThirdPartyJobFailureResult() {
  578. sess, err := session.NewSession()
  579. if err != nil {
  580. fmt.Println("failed to create session,", err)
  581. return
  582. }
  583. svc := codepipeline.New(sess)
  584. params := &codepipeline.PutThirdPartyJobFailureResultInput{
  585. ClientToken: aws.String("ClientToken"), // Required
  586. FailureDetails: &codepipeline.FailureDetails{ // Required
  587. Message: aws.String("Message"), // Required
  588. Type: aws.String("FailureType"), // Required
  589. ExternalExecutionId: aws.String("ExecutionId"),
  590. },
  591. JobId: aws.String("ThirdPartyJobId"), // Required
  592. }
  593. resp, err := svc.PutThirdPartyJobFailureResult(params)
  594. if err != nil {
  595. // Print the error, cast err to awserr.Error to get the Code and
  596. // Message from an error.
  597. fmt.Println(err.Error())
  598. return
  599. }
  600. // Pretty-print the response data.
  601. fmt.Println(resp)
  602. }
  603. func ExampleCodePipeline_PutThirdPartyJobSuccessResult() {
  604. sess, err := session.NewSession()
  605. if err != nil {
  606. fmt.Println("failed to create session,", err)
  607. return
  608. }
  609. svc := codepipeline.New(sess)
  610. params := &codepipeline.PutThirdPartyJobSuccessResultInput{
  611. ClientToken: aws.String("ClientToken"), // Required
  612. JobId: aws.String("ThirdPartyJobId"), // Required
  613. ContinuationToken: aws.String("ContinuationToken"),
  614. CurrentRevision: &codepipeline.CurrentRevision{
  615. ChangeIdentifier: aws.String("RevisionChangeIdentifier"), // Required
  616. Revision: aws.String("Revision"), // Required
  617. Created: aws.Time(time.Now()),
  618. RevisionSummary: aws.String("RevisionSummary"),
  619. },
  620. ExecutionDetails: &codepipeline.ExecutionDetails{
  621. ExternalExecutionId: aws.String("ExecutionId"),
  622. PercentComplete: aws.Int64(1),
  623. Summary: aws.String("ExecutionSummary"),
  624. },
  625. }
  626. resp, err := svc.PutThirdPartyJobSuccessResult(params)
  627. if err != nil {
  628. // Print the error, cast err to awserr.Error to get the Code and
  629. // Message from an error.
  630. fmt.Println(err.Error())
  631. return
  632. }
  633. // Pretty-print the response data.
  634. fmt.Println(resp)
  635. }
  636. func ExampleCodePipeline_RetryStageExecution() {
  637. sess, err := session.NewSession()
  638. if err != nil {
  639. fmt.Println("failed to create session,", err)
  640. return
  641. }
  642. svc := codepipeline.New(sess)
  643. params := &codepipeline.RetryStageExecutionInput{
  644. PipelineExecutionId: aws.String("PipelineExecutionId"), // Required
  645. PipelineName: aws.String("PipelineName"), // Required
  646. RetryMode: aws.String("StageRetryMode"), // Required
  647. StageName: aws.String("StageName"), // Required
  648. }
  649. resp, err := svc.RetryStageExecution(params)
  650. if err != nil {
  651. // Print the error, cast err to awserr.Error to get the Code and
  652. // Message from an error.
  653. fmt.Println(err.Error())
  654. return
  655. }
  656. // Pretty-print the response data.
  657. fmt.Println(resp)
  658. }
  659. func ExampleCodePipeline_StartPipelineExecution() {
  660. sess, err := session.NewSession()
  661. if err != nil {
  662. fmt.Println("failed to create session,", err)
  663. return
  664. }
  665. svc := codepipeline.New(sess)
  666. params := &codepipeline.StartPipelineExecutionInput{
  667. Name: aws.String("PipelineName"), // Required
  668. }
  669. resp, err := svc.StartPipelineExecution(params)
  670. if err != nil {
  671. // Print the error, cast err to awserr.Error to get the Code and
  672. // Message from an error.
  673. fmt.Println(err.Error())
  674. return
  675. }
  676. // Pretty-print the response data.
  677. fmt.Println(resp)
  678. }
  679. func ExampleCodePipeline_UpdatePipeline() {
  680. sess, err := session.NewSession()
  681. if err != nil {
  682. fmt.Println("failed to create session,", err)
  683. return
  684. }
  685. svc := codepipeline.New(sess)
  686. params := &codepipeline.UpdatePipelineInput{
  687. Pipeline: &codepipeline.PipelineDeclaration{ // Required
  688. ArtifactStore: &codepipeline.ArtifactStore{ // Required
  689. Location: aws.String("ArtifactStoreLocation"), // Required
  690. Type: aws.String("ArtifactStoreType"), // Required
  691. EncryptionKey: &codepipeline.EncryptionKey{
  692. Id: aws.String("EncryptionKeyId"), // Required
  693. Type: aws.String("EncryptionKeyType"), // Required
  694. },
  695. },
  696. Name: aws.String("PipelineName"), // Required
  697. RoleArn: aws.String("RoleArn"), // Required
  698. Stages: []*codepipeline.StageDeclaration{ // Required
  699. { // Required
  700. Actions: []*codepipeline.ActionDeclaration{ // Required
  701. { // Required
  702. ActionTypeId: &codepipeline.ActionTypeId{ // Required
  703. Category: aws.String("ActionCategory"), // Required
  704. Owner: aws.String("ActionOwner"), // Required
  705. Provider: aws.String("ActionProvider"), // Required
  706. Version: aws.String("Version"), // Required
  707. },
  708. Name: aws.String("ActionName"), // Required
  709. Configuration: map[string]*string{
  710. "Key": aws.String("ActionConfigurationValue"), // Required
  711. // More values...
  712. },
  713. InputArtifacts: []*codepipeline.InputArtifact{
  714. { // Required
  715. Name: aws.String("ArtifactName"), // Required
  716. },
  717. // More values...
  718. },
  719. OutputArtifacts: []*codepipeline.OutputArtifact{
  720. { // Required
  721. Name: aws.String("ArtifactName"), // Required
  722. },
  723. // More values...
  724. },
  725. RoleArn: aws.String("RoleArn"),
  726. RunOrder: aws.Int64(1),
  727. },
  728. // More values...
  729. },
  730. Name: aws.String("StageName"), // Required
  731. Blockers: []*codepipeline.BlockerDeclaration{
  732. { // Required
  733. Name: aws.String("BlockerName"), // Required
  734. Type: aws.String("BlockerType"), // Required
  735. },
  736. // More values...
  737. },
  738. },
  739. // More values...
  740. },
  741. Version: aws.Int64(1),
  742. },
  743. }
  744. resp, err := svc.UpdatePipeline(params)
  745. if err != nil {
  746. // Print the error, cast err to awserr.Error to get the Code and
  747. // Message from an error.
  748. fmt.Println(err.Error())
  749. return
  750. }
  751. // Pretty-print the response data.
  752. fmt.Println(resp)
  753. }