examples_test.go 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package elastictranscoder_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/elastictranscoder"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleElasticTranscoder_CancelJob() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := elastictranscoder.New(sess)
  20. params := &elastictranscoder.CancelJobInput{
  21. Id: aws.String("Id"), // Required
  22. }
  23. resp, err := svc.CancelJob(params)
  24. if err != nil {
  25. // Print the error, cast err to awserr.Error to get the Code and
  26. // Message from an error.
  27. fmt.Println(err.Error())
  28. return
  29. }
  30. // Pretty-print the response data.
  31. fmt.Println(resp)
  32. }
  33. func ExampleElasticTranscoder_CreateJob() {
  34. sess, err := session.NewSession()
  35. if err != nil {
  36. fmt.Println("failed to create session,", err)
  37. return
  38. }
  39. svc := elastictranscoder.New(sess)
  40. params := &elastictranscoder.CreateJobInput{
  41. Input: &elastictranscoder.JobInput{ // Required
  42. AspectRatio: aws.String("AspectRatio"),
  43. Container: aws.String("JobContainer"),
  44. DetectedProperties: &elastictranscoder.DetectedProperties{
  45. DurationMillis: aws.Int64(1),
  46. FileSize: aws.Int64(1),
  47. FrameRate: aws.String("FloatString"),
  48. Height: aws.Int64(1),
  49. Width: aws.Int64(1),
  50. },
  51. Encryption: &elastictranscoder.Encryption{
  52. InitializationVector: aws.String("ZeroTo255String"),
  53. Key: aws.String("Base64EncodedString"),
  54. KeyMd5: aws.String("Base64EncodedString"),
  55. Mode: aws.String("EncryptionMode"),
  56. },
  57. FrameRate: aws.String("FrameRate"),
  58. Interlaced: aws.String("Interlaced"),
  59. Key: aws.String("LongKey"),
  60. Resolution: aws.String("Resolution"),
  61. },
  62. PipelineId: aws.String("Id"), // Required
  63. Output: &elastictranscoder.CreateJobOutput{
  64. AlbumArt: &elastictranscoder.JobAlbumArt{
  65. Artwork: []*elastictranscoder.Artwork{
  66. { // Required
  67. AlbumArtFormat: aws.String("JpgOrPng"),
  68. Encryption: &elastictranscoder.Encryption{
  69. InitializationVector: aws.String("ZeroTo255String"),
  70. Key: aws.String("Base64EncodedString"),
  71. KeyMd5: aws.String("Base64EncodedString"),
  72. Mode: aws.String("EncryptionMode"),
  73. },
  74. InputKey: aws.String("WatermarkKey"),
  75. MaxHeight: aws.String("DigitsOrAuto"),
  76. MaxWidth: aws.String("DigitsOrAuto"),
  77. PaddingPolicy: aws.String("PaddingPolicy"),
  78. SizingPolicy: aws.String("SizingPolicy"),
  79. },
  80. // More values...
  81. },
  82. MergePolicy: aws.String("MergePolicy"),
  83. },
  84. Captions: &elastictranscoder.Captions{
  85. CaptionFormats: []*elastictranscoder.CaptionFormat{
  86. { // Required
  87. Encryption: &elastictranscoder.Encryption{
  88. InitializationVector: aws.String("ZeroTo255String"),
  89. Key: aws.String("Base64EncodedString"),
  90. KeyMd5: aws.String("Base64EncodedString"),
  91. Mode: aws.String("EncryptionMode"),
  92. },
  93. Format: aws.String("CaptionFormatFormat"),
  94. Pattern: aws.String("CaptionFormatPattern"),
  95. },
  96. // More values...
  97. },
  98. CaptionSources: []*elastictranscoder.CaptionSource{
  99. { // Required
  100. Encryption: &elastictranscoder.Encryption{
  101. InitializationVector: aws.String("ZeroTo255String"),
  102. Key: aws.String("Base64EncodedString"),
  103. KeyMd5: aws.String("Base64EncodedString"),
  104. Mode: aws.String("EncryptionMode"),
  105. },
  106. Key: aws.String("LongKey"),
  107. Label: aws.String("Name"),
  108. Language: aws.String("Key"),
  109. TimeOffset: aws.String("TimeOffset"),
  110. },
  111. // More values...
  112. },
  113. MergePolicy: aws.String("CaptionMergePolicy"),
  114. },
  115. Composition: []*elastictranscoder.Clip{
  116. { // Required
  117. TimeSpan: &elastictranscoder.TimeSpan{
  118. Duration: aws.String("Time"),
  119. StartTime: aws.String("Time"),
  120. },
  121. },
  122. // More values...
  123. },
  124. Encryption: &elastictranscoder.Encryption{
  125. InitializationVector: aws.String("ZeroTo255String"),
  126. Key: aws.String("Base64EncodedString"),
  127. KeyMd5: aws.String("Base64EncodedString"),
  128. Mode: aws.String("EncryptionMode"),
  129. },
  130. Key: aws.String("Key"),
  131. PresetId: aws.String("Id"),
  132. Rotate: aws.String("Rotate"),
  133. SegmentDuration: aws.String("FloatString"),
  134. ThumbnailEncryption: &elastictranscoder.Encryption{
  135. InitializationVector: aws.String("ZeroTo255String"),
  136. Key: aws.String("Base64EncodedString"),
  137. KeyMd5: aws.String("Base64EncodedString"),
  138. Mode: aws.String("EncryptionMode"),
  139. },
  140. ThumbnailPattern: aws.String("ThumbnailPattern"),
  141. Watermarks: []*elastictranscoder.JobWatermark{
  142. { // Required
  143. Encryption: &elastictranscoder.Encryption{
  144. InitializationVector: aws.String("ZeroTo255String"),
  145. Key: aws.String("Base64EncodedString"),
  146. KeyMd5: aws.String("Base64EncodedString"),
  147. Mode: aws.String("EncryptionMode"),
  148. },
  149. InputKey: aws.String("WatermarkKey"),
  150. PresetWatermarkId: aws.String("PresetWatermarkId"),
  151. },
  152. // More values...
  153. },
  154. },
  155. OutputKeyPrefix: aws.String("Key"),
  156. Outputs: []*elastictranscoder.CreateJobOutput{
  157. { // Required
  158. AlbumArt: &elastictranscoder.JobAlbumArt{
  159. Artwork: []*elastictranscoder.Artwork{
  160. { // Required
  161. AlbumArtFormat: aws.String("JpgOrPng"),
  162. Encryption: &elastictranscoder.Encryption{
  163. InitializationVector: aws.String("ZeroTo255String"),
  164. Key: aws.String("Base64EncodedString"),
  165. KeyMd5: aws.String("Base64EncodedString"),
  166. Mode: aws.String("EncryptionMode"),
  167. },
  168. InputKey: aws.String("WatermarkKey"),
  169. MaxHeight: aws.String("DigitsOrAuto"),
  170. MaxWidth: aws.String("DigitsOrAuto"),
  171. PaddingPolicy: aws.String("PaddingPolicy"),
  172. SizingPolicy: aws.String("SizingPolicy"),
  173. },
  174. // More values...
  175. },
  176. MergePolicy: aws.String("MergePolicy"),
  177. },
  178. Captions: &elastictranscoder.Captions{
  179. CaptionFormats: []*elastictranscoder.CaptionFormat{
  180. { // Required
  181. Encryption: &elastictranscoder.Encryption{
  182. InitializationVector: aws.String("ZeroTo255String"),
  183. Key: aws.String("Base64EncodedString"),
  184. KeyMd5: aws.String("Base64EncodedString"),
  185. Mode: aws.String("EncryptionMode"),
  186. },
  187. Format: aws.String("CaptionFormatFormat"),
  188. Pattern: aws.String("CaptionFormatPattern"),
  189. },
  190. // More values...
  191. },
  192. CaptionSources: []*elastictranscoder.CaptionSource{
  193. { // Required
  194. Encryption: &elastictranscoder.Encryption{
  195. InitializationVector: aws.String("ZeroTo255String"),
  196. Key: aws.String("Base64EncodedString"),
  197. KeyMd5: aws.String("Base64EncodedString"),
  198. Mode: aws.String("EncryptionMode"),
  199. },
  200. Key: aws.String("LongKey"),
  201. Label: aws.String("Name"),
  202. Language: aws.String("Key"),
  203. TimeOffset: aws.String("TimeOffset"),
  204. },
  205. // More values...
  206. },
  207. MergePolicy: aws.String("CaptionMergePolicy"),
  208. },
  209. Composition: []*elastictranscoder.Clip{
  210. { // Required
  211. TimeSpan: &elastictranscoder.TimeSpan{
  212. Duration: aws.String("Time"),
  213. StartTime: aws.String("Time"),
  214. },
  215. },
  216. // More values...
  217. },
  218. Encryption: &elastictranscoder.Encryption{
  219. InitializationVector: aws.String("ZeroTo255String"),
  220. Key: aws.String("Base64EncodedString"),
  221. KeyMd5: aws.String("Base64EncodedString"),
  222. Mode: aws.String("EncryptionMode"),
  223. },
  224. Key: aws.String("Key"),
  225. PresetId: aws.String("Id"),
  226. Rotate: aws.String("Rotate"),
  227. SegmentDuration: aws.String("FloatString"),
  228. ThumbnailEncryption: &elastictranscoder.Encryption{
  229. InitializationVector: aws.String("ZeroTo255String"),
  230. Key: aws.String("Base64EncodedString"),
  231. KeyMd5: aws.String("Base64EncodedString"),
  232. Mode: aws.String("EncryptionMode"),
  233. },
  234. ThumbnailPattern: aws.String("ThumbnailPattern"),
  235. Watermarks: []*elastictranscoder.JobWatermark{
  236. { // Required
  237. Encryption: &elastictranscoder.Encryption{
  238. InitializationVector: aws.String("ZeroTo255String"),
  239. Key: aws.String("Base64EncodedString"),
  240. KeyMd5: aws.String("Base64EncodedString"),
  241. Mode: aws.String("EncryptionMode"),
  242. },
  243. InputKey: aws.String("WatermarkKey"),
  244. PresetWatermarkId: aws.String("PresetWatermarkId"),
  245. },
  246. // More values...
  247. },
  248. },
  249. // More values...
  250. },
  251. Playlists: []*elastictranscoder.CreateJobPlaylist{
  252. { // Required
  253. Format: aws.String("PlaylistFormat"),
  254. HlsContentProtection: &elastictranscoder.HlsContentProtection{
  255. InitializationVector: aws.String("ZeroTo255String"),
  256. Key: aws.String("Base64EncodedString"),
  257. KeyMd5: aws.String("Base64EncodedString"),
  258. KeyStoragePolicy: aws.String("KeyStoragePolicy"),
  259. LicenseAcquisitionUrl: aws.String("ZeroTo512String"),
  260. Method: aws.String("HlsContentProtectionMethod"),
  261. },
  262. Name: aws.String("Filename"),
  263. OutputKeys: []*string{
  264. aws.String("Key"), // Required
  265. // More values...
  266. },
  267. PlayReadyDrm: &elastictranscoder.PlayReadyDrm{
  268. Format: aws.String("PlayReadyDrmFormatString"),
  269. InitializationVector: aws.String("ZeroTo255String"),
  270. Key: aws.String("NonEmptyBase64EncodedString"),
  271. KeyId: aws.String("KeyIdGuid"),
  272. KeyMd5: aws.String("NonEmptyBase64EncodedString"),
  273. LicenseAcquisitionUrl: aws.String("OneTo512String"),
  274. },
  275. },
  276. // More values...
  277. },
  278. UserMetadata: map[string]*string{
  279. "Key": aws.String("String"), // Required
  280. // More values...
  281. },
  282. }
  283. resp, err := svc.CreateJob(params)
  284. if err != nil {
  285. // Print the error, cast err to awserr.Error to get the Code and
  286. // Message from an error.
  287. fmt.Println(err.Error())
  288. return
  289. }
  290. // Pretty-print the response data.
  291. fmt.Println(resp)
  292. }
  293. func ExampleElasticTranscoder_CreatePipeline() {
  294. sess, err := session.NewSession()
  295. if err != nil {
  296. fmt.Println("failed to create session,", err)
  297. return
  298. }
  299. svc := elastictranscoder.New(sess)
  300. params := &elastictranscoder.CreatePipelineInput{
  301. InputBucket: aws.String("BucketName"), // Required
  302. Name: aws.String("Name"), // Required
  303. Role: aws.String("Role"), // Required
  304. AwsKmsKeyArn: aws.String("KeyArn"),
  305. ContentConfig: &elastictranscoder.PipelineOutputConfig{
  306. Bucket: aws.String("BucketName"),
  307. Permissions: []*elastictranscoder.Permission{
  308. { // Required
  309. Access: []*string{
  310. aws.String("AccessControl"), // Required
  311. // More values...
  312. },
  313. Grantee: aws.String("Grantee"),
  314. GranteeType: aws.String("GranteeType"),
  315. },
  316. // More values...
  317. },
  318. StorageClass: aws.String("StorageClass"),
  319. },
  320. Notifications: &elastictranscoder.Notifications{
  321. Completed: aws.String("SnsTopic"),
  322. Error: aws.String("SnsTopic"),
  323. Progressing: aws.String("SnsTopic"),
  324. Warning: aws.String("SnsTopic"),
  325. },
  326. OutputBucket: aws.String("BucketName"),
  327. ThumbnailConfig: &elastictranscoder.PipelineOutputConfig{
  328. Bucket: aws.String("BucketName"),
  329. Permissions: []*elastictranscoder.Permission{
  330. { // Required
  331. Access: []*string{
  332. aws.String("AccessControl"), // Required
  333. // More values...
  334. },
  335. Grantee: aws.String("Grantee"),
  336. GranteeType: aws.String("GranteeType"),
  337. },
  338. // More values...
  339. },
  340. StorageClass: aws.String("StorageClass"),
  341. },
  342. }
  343. resp, err := svc.CreatePipeline(params)
  344. if err != nil {
  345. // Print the error, cast err to awserr.Error to get the Code and
  346. // Message from an error.
  347. fmt.Println(err.Error())
  348. return
  349. }
  350. // Pretty-print the response data.
  351. fmt.Println(resp)
  352. }
  353. func ExampleElasticTranscoder_CreatePreset() {
  354. sess, err := session.NewSession()
  355. if err != nil {
  356. fmt.Println("failed to create session,", err)
  357. return
  358. }
  359. svc := elastictranscoder.New(sess)
  360. params := &elastictranscoder.CreatePresetInput{
  361. Container: aws.String("PresetContainer"), // Required
  362. Name: aws.String("Name"), // Required
  363. Audio: &elastictranscoder.AudioParameters{
  364. AudioPackingMode: aws.String("AudioPackingMode"),
  365. BitRate: aws.String("AudioBitRate"),
  366. Channels: aws.String("AudioChannels"),
  367. Codec: aws.String("AudioCodec"),
  368. CodecOptions: &elastictranscoder.AudioCodecOptions{
  369. BitDepth: aws.String("AudioBitDepth"),
  370. BitOrder: aws.String("AudioBitOrder"),
  371. Profile: aws.String("AudioCodecProfile"),
  372. Signed: aws.String("AudioSigned"),
  373. },
  374. SampleRate: aws.String("AudioSampleRate"),
  375. },
  376. Description: aws.String("Description"),
  377. Thumbnails: &elastictranscoder.Thumbnails{
  378. AspectRatio: aws.String("AspectRatio"),
  379. Format: aws.String("JpgOrPng"),
  380. Interval: aws.String("Digits"),
  381. MaxHeight: aws.String("DigitsOrAuto"),
  382. MaxWidth: aws.String("DigitsOrAuto"),
  383. PaddingPolicy: aws.String("PaddingPolicy"),
  384. Resolution: aws.String("ThumbnailResolution"),
  385. SizingPolicy: aws.String("SizingPolicy"),
  386. },
  387. Video: &elastictranscoder.VideoParameters{
  388. AspectRatio: aws.String("AspectRatio"),
  389. BitRate: aws.String("VideoBitRate"),
  390. Codec: aws.String("VideoCodec"),
  391. CodecOptions: map[string]*string{
  392. "Key": aws.String("CodecOption"), // Required
  393. // More values...
  394. },
  395. DisplayAspectRatio: aws.String("AspectRatio"),
  396. FixedGOP: aws.String("FixedGOP"),
  397. FrameRate: aws.String("FrameRate"),
  398. KeyframesMaxDist: aws.String("KeyframesMaxDist"),
  399. MaxFrameRate: aws.String("MaxFrameRate"),
  400. MaxHeight: aws.String("DigitsOrAuto"),
  401. MaxWidth: aws.String("DigitsOrAuto"),
  402. PaddingPolicy: aws.String("PaddingPolicy"),
  403. Resolution: aws.String("Resolution"),
  404. SizingPolicy: aws.String("SizingPolicy"),
  405. Watermarks: []*elastictranscoder.PresetWatermark{
  406. { // Required
  407. HorizontalAlign: aws.String("HorizontalAlign"),
  408. HorizontalOffset: aws.String("PixelsOrPercent"),
  409. Id: aws.String("PresetWatermarkId"),
  410. MaxHeight: aws.String("PixelsOrPercent"),
  411. MaxWidth: aws.String("PixelsOrPercent"),
  412. Opacity: aws.String("Opacity"),
  413. SizingPolicy: aws.String("WatermarkSizingPolicy"),
  414. Target: aws.String("Target"),
  415. VerticalAlign: aws.String("VerticalAlign"),
  416. VerticalOffset: aws.String("PixelsOrPercent"),
  417. },
  418. // More values...
  419. },
  420. },
  421. }
  422. resp, err := svc.CreatePreset(params)
  423. if err != nil {
  424. // Print the error, cast err to awserr.Error to get the Code and
  425. // Message from an error.
  426. fmt.Println(err.Error())
  427. return
  428. }
  429. // Pretty-print the response data.
  430. fmt.Println(resp)
  431. }
  432. func ExampleElasticTranscoder_DeletePipeline() {
  433. sess, err := session.NewSession()
  434. if err != nil {
  435. fmt.Println("failed to create session,", err)
  436. return
  437. }
  438. svc := elastictranscoder.New(sess)
  439. params := &elastictranscoder.DeletePipelineInput{
  440. Id: aws.String("Id"), // Required
  441. }
  442. resp, err := svc.DeletePipeline(params)
  443. if err != nil {
  444. // Print the error, cast err to awserr.Error to get the Code and
  445. // Message from an error.
  446. fmt.Println(err.Error())
  447. return
  448. }
  449. // Pretty-print the response data.
  450. fmt.Println(resp)
  451. }
  452. func ExampleElasticTranscoder_DeletePreset() {
  453. sess, err := session.NewSession()
  454. if err != nil {
  455. fmt.Println("failed to create session,", err)
  456. return
  457. }
  458. svc := elastictranscoder.New(sess)
  459. params := &elastictranscoder.DeletePresetInput{
  460. Id: aws.String("Id"), // Required
  461. }
  462. resp, err := svc.DeletePreset(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 ExampleElasticTranscoder_ListJobsByPipeline() {
  473. sess, err := session.NewSession()
  474. if err != nil {
  475. fmt.Println("failed to create session,", err)
  476. return
  477. }
  478. svc := elastictranscoder.New(sess)
  479. params := &elastictranscoder.ListJobsByPipelineInput{
  480. PipelineId: aws.String("Id"), // Required
  481. Ascending: aws.String("Ascending"),
  482. PageToken: aws.String("Id"),
  483. }
  484. resp, err := svc.ListJobsByPipeline(params)
  485. if err != nil {
  486. // Print the error, cast err to awserr.Error to get the Code and
  487. // Message from an error.
  488. fmt.Println(err.Error())
  489. return
  490. }
  491. // Pretty-print the response data.
  492. fmt.Println(resp)
  493. }
  494. func ExampleElasticTranscoder_ListJobsByStatus() {
  495. sess, err := session.NewSession()
  496. if err != nil {
  497. fmt.Println("failed to create session,", err)
  498. return
  499. }
  500. svc := elastictranscoder.New(sess)
  501. params := &elastictranscoder.ListJobsByStatusInput{
  502. Status: aws.String("JobStatus"), // Required
  503. Ascending: aws.String("Ascending"),
  504. PageToken: aws.String("Id"),
  505. }
  506. resp, err := svc.ListJobsByStatus(params)
  507. if err != nil {
  508. // Print the error, cast err to awserr.Error to get the Code and
  509. // Message from an error.
  510. fmt.Println(err.Error())
  511. return
  512. }
  513. // Pretty-print the response data.
  514. fmt.Println(resp)
  515. }
  516. func ExampleElasticTranscoder_ListPipelines() {
  517. sess, err := session.NewSession()
  518. if err != nil {
  519. fmt.Println("failed to create session,", err)
  520. return
  521. }
  522. svc := elastictranscoder.New(sess)
  523. params := &elastictranscoder.ListPipelinesInput{
  524. Ascending: aws.String("Ascending"),
  525. PageToken: aws.String("Id"),
  526. }
  527. resp, err := svc.ListPipelines(params)
  528. if err != nil {
  529. // Print the error, cast err to awserr.Error to get the Code and
  530. // Message from an error.
  531. fmt.Println(err.Error())
  532. return
  533. }
  534. // Pretty-print the response data.
  535. fmt.Println(resp)
  536. }
  537. func ExampleElasticTranscoder_ListPresets() {
  538. sess, err := session.NewSession()
  539. if err != nil {
  540. fmt.Println("failed to create session,", err)
  541. return
  542. }
  543. svc := elastictranscoder.New(sess)
  544. params := &elastictranscoder.ListPresetsInput{
  545. Ascending: aws.String("Ascending"),
  546. PageToken: aws.String("Id"),
  547. }
  548. resp, err := svc.ListPresets(params)
  549. if err != nil {
  550. // Print the error, cast err to awserr.Error to get the Code and
  551. // Message from an error.
  552. fmt.Println(err.Error())
  553. return
  554. }
  555. // Pretty-print the response data.
  556. fmt.Println(resp)
  557. }
  558. func ExampleElasticTranscoder_ReadJob() {
  559. sess, err := session.NewSession()
  560. if err != nil {
  561. fmt.Println("failed to create session,", err)
  562. return
  563. }
  564. svc := elastictranscoder.New(sess)
  565. params := &elastictranscoder.ReadJobInput{
  566. Id: aws.String("Id"), // Required
  567. }
  568. resp, err := svc.ReadJob(params)
  569. if err != nil {
  570. // Print the error, cast err to awserr.Error to get the Code and
  571. // Message from an error.
  572. fmt.Println(err.Error())
  573. return
  574. }
  575. // Pretty-print the response data.
  576. fmt.Println(resp)
  577. }
  578. func ExampleElasticTranscoder_ReadPipeline() {
  579. sess, err := session.NewSession()
  580. if err != nil {
  581. fmt.Println("failed to create session,", err)
  582. return
  583. }
  584. svc := elastictranscoder.New(sess)
  585. params := &elastictranscoder.ReadPipelineInput{
  586. Id: aws.String("Id"), // Required
  587. }
  588. resp, err := svc.ReadPipeline(params)
  589. if err != nil {
  590. // Print the error, cast err to awserr.Error to get the Code and
  591. // Message from an error.
  592. fmt.Println(err.Error())
  593. return
  594. }
  595. // Pretty-print the response data.
  596. fmt.Println(resp)
  597. }
  598. func ExampleElasticTranscoder_ReadPreset() {
  599. sess, err := session.NewSession()
  600. if err != nil {
  601. fmt.Println("failed to create session,", err)
  602. return
  603. }
  604. svc := elastictranscoder.New(sess)
  605. params := &elastictranscoder.ReadPresetInput{
  606. Id: aws.String("Id"), // Required
  607. }
  608. resp, err := svc.ReadPreset(params)
  609. if err != nil {
  610. // Print the error, cast err to awserr.Error to get the Code and
  611. // Message from an error.
  612. fmt.Println(err.Error())
  613. return
  614. }
  615. // Pretty-print the response data.
  616. fmt.Println(resp)
  617. }
  618. func ExampleElasticTranscoder_TestRole() {
  619. sess, err := session.NewSession()
  620. if err != nil {
  621. fmt.Println("failed to create session,", err)
  622. return
  623. }
  624. svc := elastictranscoder.New(sess)
  625. params := &elastictranscoder.TestRoleInput{
  626. InputBucket: aws.String("BucketName"), // Required
  627. OutputBucket: aws.String("BucketName"), // Required
  628. Role: aws.String("Role"), // Required
  629. Topics: []*string{ // Required
  630. aws.String("SnsTopic"), // Required
  631. // More values...
  632. },
  633. }
  634. resp, err := svc.TestRole(params)
  635. if err != nil {
  636. // Print the error, cast err to awserr.Error to get the Code and
  637. // Message from an error.
  638. fmt.Println(err.Error())
  639. return
  640. }
  641. // Pretty-print the response data.
  642. fmt.Println(resp)
  643. }
  644. func ExampleElasticTranscoder_UpdatePipeline() {
  645. sess, err := session.NewSession()
  646. if err != nil {
  647. fmt.Println("failed to create session,", err)
  648. return
  649. }
  650. svc := elastictranscoder.New(sess)
  651. params := &elastictranscoder.UpdatePipelineInput{
  652. Id: aws.String("Id"), // Required
  653. AwsKmsKeyArn: aws.String("KeyArn"),
  654. ContentConfig: &elastictranscoder.PipelineOutputConfig{
  655. Bucket: aws.String("BucketName"),
  656. Permissions: []*elastictranscoder.Permission{
  657. { // Required
  658. Access: []*string{
  659. aws.String("AccessControl"), // Required
  660. // More values...
  661. },
  662. Grantee: aws.String("Grantee"),
  663. GranteeType: aws.String("GranteeType"),
  664. },
  665. // More values...
  666. },
  667. StorageClass: aws.String("StorageClass"),
  668. },
  669. InputBucket: aws.String("BucketName"),
  670. Name: aws.String("Name"),
  671. Notifications: &elastictranscoder.Notifications{
  672. Completed: aws.String("SnsTopic"),
  673. Error: aws.String("SnsTopic"),
  674. Progressing: aws.String("SnsTopic"),
  675. Warning: aws.String("SnsTopic"),
  676. },
  677. Role: aws.String("Role"),
  678. ThumbnailConfig: &elastictranscoder.PipelineOutputConfig{
  679. Bucket: aws.String("BucketName"),
  680. Permissions: []*elastictranscoder.Permission{
  681. { // Required
  682. Access: []*string{
  683. aws.String("AccessControl"), // Required
  684. // More values...
  685. },
  686. Grantee: aws.String("Grantee"),
  687. GranteeType: aws.String("GranteeType"),
  688. },
  689. // More values...
  690. },
  691. StorageClass: aws.String("StorageClass"),
  692. },
  693. }
  694. resp, err := svc.UpdatePipeline(params)
  695. if err != nil {
  696. // Print the error, cast err to awserr.Error to get the Code and
  697. // Message from an error.
  698. fmt.Println(err.Error())
  699. return
  700. }
  701. // Pretty-print the response data.
  702. fmt.Println(resp)
  703. }
  704. func ExampleElasticTranscoder_UpdatePipelineNotifications() {
  705. sess, err := session.NewSession()
  706. if err != nil {
  707. fmt.Println("failed to create session,", err)
  708. return
  709. }
  710. svc := elastictranscoder.New(sess)
  711. params := &elastictranscoder.UpdatePipelineNotificationsInput{
  712. Id: aws.String("Id"), // Required
  713. Notifications: &elastictranscoder.Notifications{ // Required
  714. Completed: aws.String("SnsTopic"),
  715. Error: aws.String("SnsTopic"),
  716. Progressing: aws.String("SnsTopic"),
  717. Warning: aws.String("SnsTopic"),
  718. },
  719. }
  720. resp, err := svc.UpdatePipelineNotifications(params)
  721. if err != nil {
  722. // Print the error, cast err to awserr.Error to get the Code and
  723. // Message from an error.
  724. fmt.Println(err.Error())
  725. return
  726. }
  727. // Pretty-print the response data.
  728. fmt.Println(resp)
  729. }
  730. func ExampleElasticTranscoder_UpdatePipelineStatus() {
  731. sess, err := session.NewSession()
  732. if err != nil {
  733. fmt.Println("failed to create session,", err)
  734. return
  735. }
  736. svc := elastictranscoder.New(sess)
  737. params := &elastictranscoder.UpdatePipelineStatusInput{
  738. Id: aws.String("Id"), // Required
  739. Status: aws.String("PipelineStatus"), // Required
  740. }
  741. resp, err := svc.UpdatePipelineStatus(params)
  742. if err != nil {
  743. // Print the error, cast err to awserr.Error to get the Code and
  744. // Message from an error.
  745. fmt.Println(err.Error())
  746. return
  747. }
  748. // Pretty-print the response data.
  749. fmt.Println(resp)
  750. }