examples_test.go 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  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_GetPipelineState() {
  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.GetPipelineStateInput{
  315. Name: aws.String("PipelineName"), // Required
  316. }
  317. resp, err := svc.GetPipelineState(params)
  318. if err != nil {
  319. // Print the error, cast err to awserr.Error to get the Code and
  320. // Message from an error.
  321. fmt.Println(err.Error())
  322. return
  323. }
  324. // Pretty-print the response data.
  325. fmt.Println(resp)
  326. }
  327. func ExampleCodePipeline_GetThirdPartyJobDetails() {
  328. sess, err := session.NewSession()
  329. if err != nil {
  330. fmt.Println("failed to create session,", err)
  331. return
  332. }
  333. svc := codepipeline.New(sess)
  334. params := &codepipeline.GetThirdPartyJobDetailsInput{
  335. ClientToken: aws.String("ClientToken"), // Required
  336. JobId: aws.String("ThirdPartyJobId"), // Required
  337. }
  338. resp, err := svc.GetThirdPartyJobDetails(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_ListActionTypes() {
  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.ListActionTypesInput{
  356. ActionOwnerFilter: aws.String("ActionOwner"),
  357. NextToken: aws.String("NextToken"),
  358. }
  359. resp, err := svc.ListActionTypes(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_ListPipelines() {
  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.ListPipelinesInput{
  377. NextToken: aws.String("NextToken"),
  378. }
  379. resp, err := svc.ListPipelines(params)
  380. if err != nil {
  381. // Print the error, cast err to awserr.Error to get the Code and
  382. // Message from an error.
  383. fmt.Println(err.Error())
  384. return
  385. }
  386. // Pretty-print the response data.
  387. fmt.Println(resp)
  388. }
  389. func ExampleCodePipeline_PollForJobs() {
  390. sess, err := session.NewSession()
  391. if err != nil {
  392. fmt.Println("failed to create session,", err)
  393. return
  394. }
  395. svc := codepipeline.New(sess)
  396. params := &codepipeline.PollForJobsInput{
  397. ActionTypeId: &codepipeline.ActionTypeId{ // Required
  398. Category: aws.String("ActionCategory"), // Required
  399. Owner: aws.String("ActionOwner"), // Required
  400. Provider: aws.String("ActionProvider"), // Required
  401. Version: aws.String("Version"), // Required
  402. },
  403. MaxBatchSize: aws.Int64(1),
  404. QueryParam: map[string]*string{
  405. "Key": aws.String("ActionConfigurationQueryableValue"), // Required
  406. // More values...
  407. },
  408. }
  409. resp, err := svc.PollForJobs(params)
  410. if err != nil {
  411. // Print the error, cast err to awserr.Error to get the Code and
  412. // Message from an error.
  413. fmt.Println(err.Error())
  414. return
  415. }
  416. // Pretty-print the response data.
  417. fmt.Println(resp)
  418. }
  419. func ExampleCodePipeline_PollForThirdPartyJobs() {
  420. sess, err := session.NewSession()
  421. if err != nil {
  422. fmt.Println("failed to create session,", err)
  423. return
  424. }
  425. svc := codepipeline.New(sess)
  426. params := &codepipeline.PollForThirdPartyJobsInput{
  427. ActionTypeId: &codepipeline.ActionTypeId{ // Required
  428. Category: aws.String("ActionCategory"), // Required
  429. Owner: aws.String("ActionOwner"), // Required
  430. Provider: aws.String("ActionProvider"), // Required
  431. Version: aws.String("Version"), // Required
  432. },
  433. MaxBatchSize: aws.Int64(1),
  434. }
  435. resp, err := svc.PollForThirdPartyJobs(params)
  436. if err != nil {
  437. // Print the error, cast err to awserr.Error to get the Code and
  438. // Message from an error.
  439. fmt.Println(err.Error())
  440. return
  441. }
  442. // Pretty-print the response data.
  443. fmt.Println(resp)
  444. }
  445. func ExampleCodePipeline_PutActionRevision() {
  446. sess, err := session.NewSession()
  447. if err != nil {
  448. fmt.Println("failed to create session,", err)
  449. return
  450. }
  451. svc := codepipeline.New(sess)
  452. params := &codepipeline.PutActionRevisionInput{
  453. ActionName: aws.String("ActionName"), // Required
  454. ActionRevision: &codepipeline.ActionRevision{ // Required
  455. Created: aws.Time(time.Now()), // Required
  456. RevisionChangeId: aws.String("RevisionChangeIdentifier"), // Required
  457. RevisionId: aws.String("Revision"), // Required
  458. },
  459. PipelineName: aws.String("PipelineName"), // Required
  460. StageName: aws.String("StageName"), // Required
  461. }
  462. resp, err := svc.PutActionRevision(params)
  463. if err != nil {
  464. // Print the error, cast err to awserr.Error to get the Code and
  465. // Message from an error.
  466. fmt.Println(err.Error())
  467. return
  468. }
  469. // Pretty-print the response data.
  470. fmt.Println(resp)
  471. }
  472. func ExampleCodePipeline_PutApprovalResult() {
  473. sess, err := session.NewSession()
  474. if err != nil {
  475. fmt.Println("failed to create session,", err)
  476. return
  477. }
  478. svc := codepipeline.New(sess)
  479. params := &codepipeline.PutApprovalResultInput{
  480. ActionName: aws.String("ActionName"), // Required
  481. PipelineName: aws.String("PipelineName"), // Required
  482. Result: &codepipeline.ApprovalResult{ // Required
  483. Status: aws.String("ApprovalStatus"), // Required
  484. Summary: aws.String("ApprovalSummary"), // Required
  485. },
  486. StageName: aws.String("StageName"), // Required
  487. Token: aws.String("ApprovalToken"),
  488. }
  489. resp, err := svc.PutApprovalResult(params)
  490. if err != nil {
  491. // Print the error, cast err to awserr.Error to get the Code and
  492. // Message from an error.
  493. fmt.Println(err.Error())
  494. return
  495. }
  496. // Pretty-print the response data.
  497. fmt.Println(resp)
  498. }
  499. func ExampleCodePipeline_PutJobFailureResult() {
  500. sess, err := session.NewSession()
  501. if err != nil {
  502. fmt.Println("failed to create session,", err)
  503. return
  504. }
  505. svc := codepipeline.New(sess)
  506. params := &codepipeline.PutJobFailureResultInput{
  507. FailureDetails: &codepipeline.FailureDetails{ // Required
  508. Message: aws.String("Message"), // Required
  509. Type: aws.String("FailureType"), // Required
  510. ExternalExecutionId: aws.String("ExecutionId"),
  511. },
  512. JobId: aws.String("JobId"), // Required
  513. }
  514. resp, err := svc.PutJobFailureResult(params)
  515. if err != nil {
  516. // Print the error, cast err to awserr.Error to get the Code and
  517. // Message from an error.
  518. fmt.Println(err.Error())
  519. return
  520. }
  521. // Pretty-print the response data.
  522. fmt.Println(resp)
  523. }
  524. func ExampleCodePipeline_PutJobSuccessResult() {
  525. sess, err := session.NewSession()
  526. if err != nil {
  527. fmt.Println("failed to create session,", err)
  528. return
  529. }
  530. svc := codepipeline.New(sess)
  531. params := &codepipeline.PutJobSuccessResultInput{
  532. JobId: aws.String("JobId"), // Required
  533. ContinuationToken: aws.String("ContinuationToken"),
  534. CurrentRevision: &codepipeline.CurrentRevision{
  535. ChangeIdentifier: aws.String("RevisionChangeIdentifier"), // Required
  536. Revision: aws.String("Revision"), // Required
  537. },
  538. ExecutionDetails: &codepipeline.ExecutionDetails{
  539. ExternalExecutionId: aws.String("ExecutionId"),
  540. PercentComplete: aws.Int64(1),
  541. Summary: aws.String("ExecutionSummary"),
  542. },
  543. }
  544. resp, err := svc.PutJobSuccessResult(params)
  545. if err != nil {
  546. // Print the error, cast err to awserr.Error to get the Code and
  547. // Message from an error.
  548. fmt.Println(err.Error())
  549. return
  550. }
  551. // Pretty-print the response data.
  552. fmt.Println(resp)
  553. }
  554. func ExampleCodePipeline_PutThirdPartyJobFailureResult() {
  555. sess, err := session.NewSession()
  556. if err != nil {
  557. fmt.Println("failed to create session,", err)
  558. return
  559. }
  560. svc := codepipeline.New(sess)
  561. params := &codepipeline.PutThirdPartyJobFailureResultInput{
  562. ClientToken: aws.String("ClientToken"), // Required
  563. FailureDetails: &codepipeline.FailureDetails{ // Required
  564. Message: aws.String("Message"), // Required
  565. Type: aws.String("FailureType"), // Required
  566. ExternalExecutionId: aws.String("ExecutionId"),
  567. },
  568. JobId: aws.String("ThirdPartyJobId"), // Required
  569. }
  570. resp, err := svc.PutThirdPartyJobFailureResult(params)
  571. if err != nil {
  572. // Print the error, cast err to awserr.Error to get the Code and
  573. // Message from an error.
  574. fmt.Println(err.Error())
  575. return
  576. }
  577. // Pretty-print the response data.
  578. fmt.Println(resp)
  579. }
  580. func ExampleCodePipeline_PutThirdPartyJobSuccessResult() {
  581. sess, err := session.NewSession()
  582. if err != nil {
  583. fmt.Println("failed to create session,", err)
  584. return
  585. }
  586. svc := codepipeline.New(sess)
  587. params := &codepipeline.PutThirdPartyJobSuccessResultInput{
  588. ClientToken: aws.String("ClientToken"), // Required
  589. JobId: aws.String("ThirdPartyJobId"), // Required
  590. ContinuationToken: aws.String("ContinuationToken"),
  591. CurrentRevision: &codepipeline.CurrentRevision{
  592. ChangeIdentifier: aws.String("RevisionChangeIdentifier"), // Required
  593. Revision: aws.String("Revision"), // Required
  594. },
  595. ExecutionDetails: &codepipeline.ExecutionDetails{
  596. ExternalExecutionId: aws.String("ExecutionId"),
  597. PercentComplete: aws.Int64(1),
  598. Summary: aws.String("ExecutionSummary"),
  599. },
  600. }
  601. resp, err := svc.PutThirdPartyJobSuccessResult(params)
  602. if err != nil {
  603. // Print the error, cast err to awserr.Error to get the Code and
  604. // Message from an error.
  605. fmt.Println(err.Error())
  606. return
  607. }
  608. // Pretty-print the response data.
  609. fmt.Println(resp)
  610. }
  611. func ExampleCodePipeline_RetryStageExecution() {
  612. sess, err := session.NewSession()
  613. if err != nil {
  614. fmt.Println("failed to create session,", err)
  615. return
  616. }
  617. svc := codepipeline.New(sess)
  618. params := &codepipeline.RetryStageExecutionInput{
  619. PipelineExecutionId: aws.String("PipelineExecutionId"), // Required
  620. PipelineName: aws.String("PipelineName"), // Required
  621. RetryMode: aws.String("StageRetryMode"), // Required
  622. StageName: aws.String("StageName"), // Required
  623. }
  624. resp, err := svc.RetryStageExecution(params)
  625. if err != nil {
  626. // Print the error, cast err to awserr.Error to get the Code and
  627. // Message from an error.
  628. fmt.Println(err.Error())
  629. return
  630. }
  631. // Pretty-print the response data.
  632. fmt.Println(resp)
  633. }
  634. func ExampleCodePipeline_StartPipelineExecution() {
  635. sess, err := session.NewSession()
  636. if err != nil {
  637. fmt.Println("failed to create session,", err)
  638. return
  639. }
  640. svc := codepipeline.New(sess)
  641. params := &codepipeline.StartPipelineExecutionInput{
  642. Name: aws.String("PipelineName"), // Required
  643. }
  644. resp, err := svc.StartPipelineExecution(params)
  645. if err != nil {
  646. // Print the error, cast err to awserr.Error to get the Code and
  647. // Message from an error.
  648. fmt.Println(err.Error())
  649. return
  650. }
  651. // Pretty-print the response data.
  652. fmt.Println(resp)
  653. }
  654. func ExampleCodePipeline_UpdatePipeline() {
  655. sess, err := session.NewSession()
  656. if err != nil {
  657. fmt.Println("failed to create session,", err)
  658. return
  659. }
  660. svc := codepipeline.New(sess)
  661. params := &codepipeline.UpdatePipelineInput{
  662. Pipeline: &codepipeline.PipelineDeclaration{ // Required
  663. ArtifactStore: &codepipeline.ArtifactStore{ // Required
  664. Location: aws.String("ArtifactStoreLocation"), // Required
  665. Type: aws.String("ArtifactStoreType"), // Required
  666. EncryptionKey: &codepipeline.EncryptionKey{
  667. Id: aws.String("EncryptionKeyId"), // Required
  668. Type: aws.String("EncryptionKeyType"), // Required
  669. },
  670. },
  671. Name: aws.String("PipelineName"), // Required
  672. RoleArn: aws.String("RoleArn"), // Required
  673. Stages: []*codepipeline.StageDeclaration{ // Required
  674. { // Required
  675. Actions: []*codepipeline.ActionDeclaration{ // Required
  676. { // Required
  677. ActionTypeId: &codepipeline.ActionTypeId{ // Required
  678. Category: aws.String("ActionCategory"), // Required
  679. Owner: aws.String("ActionOwner"), // Required
  680. Provider: aws.String("ActionProvider"), // Required
  681. Version: aws.String("Version"), // Required
  682. },
  683. Name: aws.String("ActionName"), // Required
  684. Configuration: map[string]*string{
  685. "Key": aws.String("ActionConfigurationValue"), // Required
  686. // More values...
  687. },
  688. InputArtifacts: []*codepipeline.InputArtifact{
  689. { // Required
  690. Name: aws.String("ArtifactName"), // Required
  691. },
  692. // More values...
  693. },
  694. OutputArtifacts: []*codepipeline.OutputArtifact{
  695. { // Required
  696. Name: aws.String("ArtifactName"), // Required
  697. },
  698. // More values...
  699. },
  700. RoleArn: aws.String("RoleArn"),
  701. RunOrder: aws.Int64(1),
  702. },
  703. // More values...
  704. },
  705. Name: aws.String("StageName"), // Required
  706. Blockers: []*codepipeline.BlockerDeclaration{
  707. { // Required
  708. Name: aws.String("BlockerName"), // Required
  709. Type: aws.String("BlockerType"), // Required
  710. },
  711. // More values...
  712. },
  713. },
  714. // More values...
  715. },
  716. Version: aws.Int64(1),
  717. },
  718. }
  719. resp, err := svc.UpdatePipeline(params)
  720. if err != nil {
  721. // Print the error, cast err to awserr.Error to get the Code and
  722. // Message from an error.
  723. fmt.Println(err.Error())
  724. return
  725. }
  726. // Pretty-print the response data.
  727. fmt.Println(resp)
  728. }