examples_test.go 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package apigateway_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/apigateway"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleAPIGateway_CreateApiKey() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := apigateway.New(sess)
  20. params := &apigateway.CreateApiKeyInput{
  21. Description: aws.String("String"),
  22. Enabled: aws.Bool(true),
  23. GenerateDistinctId: aws.Bool(true),
  24. Name: aws.String("String"),
  25. StageKeys: []*apigateway.StageKey{
  26. { // Required
  27. RestApiId: aws.String("String"),
  28. StageName: aws.String("String"),
  29. },
  30. // More values...
  31. },
  32. Value: aws.String("String"),
  33. }
  34. resp, err := svc.CreateApiKey(params)
  35. if err != nil {
  36. // Print the error, cast err to awserr.Error to get the Code and
  37. // Message from an error.
  38. fmt.Println(err.Error())
  39. return
  40. }
  41. // Pretty-print the response data.
  42. fmt.Println(resp)
  43. }
  44. func ExampleAPIGateway_CreateAuthorizer() {
  45. sess, err := session.NewSession()
  46. if err != nil {
  47. fmt.Println("failed to create session,", err)
  48. return
  49. }
  50. svc := apigateway.New(sess)
  51. params := &apigateway.CreateAuthorizerInput{
  52. IdentitySource: aws.String("String"), // Required
  53. Name: aws.String("String"), // Required
  54. RestApiId: aws.String("String"), // Required
  55. Type: aws.String("AuthorizerType"), // Required
  56. AuthType: aws.String("String"),
  57. AuthorizerCredentials: aws.String("String"),
  58. AuthorizerResultTtlInSeconds: aws.Int64(1),
  59. AuthorizerUri: aws.String("String"),
  60. IdentityValidationExpression: aws.String("String"),
  61. ProviderARNs: []*string{
  62. aws.String("ProviderARN"), // Required
  63. // More values...
  64. },
  65. }
  66. resp, err := svc.CreateAuthorizer(params)
  67. if err != nil {
  68. // Print the error, cast err to awserr.Error to get the Code and
  69. // Message from an error.
  70. fmt.Println(err.Error())
  71. return
  72. }
  73. // Pretty-print the response data.
  74. fmt.Println(resp)
  75. }
  76. func ExampleAPIGateway_CreateBasePathMapping() {
  77. sess, err := session.NewSession()
  78. if err != nil {
  79. fmt.Println("failed to create session,", err)
  80. return
  81. }
  82. svc := apigateway.New(sess)
  83. params := &apigateway.CreateBasePathMappingInput{
  84. DomainName: aws.String("String"), // Required
  85. RestApiId: aws.String("String"), // Required
  86. BasePath: aws.String("String"),
  87. Stage: aws.String("String"),
  88. }
  89. resp, err := svc.CreateBasePathMapping(params)
  90. if err != nil {
  91. // Print the error, cast err to awserr.Error to get the Code and
  92. // Message from an error.
  93. fmt.Println(err.Error())
  94. return
  95. }
  96. // Pretty-print the response data.
  97. fmt.Println(resp)
  98. }
  99. func ExampleAPIGateway_CreateDeployment() {
  100. sess, err := session.NewSession()
  101. if err != nil {
  102. fmt.Println("failed to create session,", err)
  103. return
  104. }
  105. svc := apigateway.New(sess)
  106. params := &apigateway.CreateDeploymentInput{
  107. RestApiId: aws.String("String"), // Required
  108. StageName: aws.String("String"), // Required
  109. CacheClusterEnabled: aws.Bool(true),
  110. CacheClusterSize: aws.String("CacheClusterSize"),
  111. Description: aws.String("String"),
  112. StageDescription: aws.String("String"),
  113. Variables: map[string]*string{
  114. "Key": aws.String("String"), // Required
  115. // More values...
  116. },
  117. }
  118. resp, err := svc.CreateDeployment(params)
  119. if err != nil {
  120. // Print the error, cast err to awserr.Error to get the Code and
  121. // Message from an error.
  122. fmt.Println(err.Error())
  123. return
  124. }
  125. // Pretty-print the response data.
  126. fmt.Println(resp)
  127. }
  128. func ExampleAPIGateway_CreateDomainName() {
  129. sess, err := session.NewSession()
  130. if err != nil {
  131. fmt.Println("failed to create session,", err)
  132. return
  133. }
  134. svc := apigateway.New(sess)
  135. params := &apigateway.CreateDomainNameInput{
  136. CertificateBody: aws.String("String"), // Required
  137. CertificateChain: aws.String("String"), // Required
  138. CertificateName: aws.String("String"), // Required
  139. CertificatePrivateKey: aws.String("String"), // Required
  140. DomainName: aws.String("String"), // Required
  141. }
  142. resp, err := svc.CreateDomainName(params)
  143. if err != nil {
  144. // Print the error, cast err to awserr.Error to get the Code and
  145. // Message from an error.
  146. fmt.Println(err.Error())
  147. return
  148. }
  149. // Pretty-print the response data.
  150. fmt.Println(resp)
  151. }
  152. func ExampleAPIGateway_CreateModel() {
  153. sess, err := session.NewSession()
  154. if err != nil {
  155. fmt.Println("failed to create session,", err)
  156. return
  157. }
  158. svc := apigateway.New(sess)
  159. params := &apigateway.CreateModelInput{
  160. ContentType: aws.String("String"), // Required
  161. Name: aws.String("String"), // Required
  162. RestApiId: aws.String("String"), // Required
  163. Description: aws.String("String"),
  164. Schema: aws.String("String"),
  165. }
  166. resp, err := svc.CreateModel(params)
  167. if err != nil {
  168. // Print the error, cast err to awserr.Error to get the Code and
  169. // Message from an error.
  170. fmt.Println(err.Error())
  171. return
  172. }
  173. // Pretty-print the response data.
  174. fmt.Println(resp)
  175. }
  176. func ExampleAPIGateway_CreateResource() {
  177. sess, err := session.NewSession()
  178. if err != nil {
  179. fmt.Println("failed to create session,", err)
  180. return
  181. }
  182. svc := apigateway.New(sess)
  183. params := &apigateway.CreateResourceInput{
  184. ParentId: aws.String("String"), // Required
  185. PathPart: aws.String("String"), // Required
  186. RestApiId: aws.String("String"), // Required
  187. }
  188. resp, err := svc.CreateResource(params)
  189. if err != nil {
  190. // Print the error, cast err to awserr.Error to get the Code and
  191. // Message from an error.
  192. fmt.Println(err.Error())
  193. return
  194. }
  195. // Pretty-print the response data.
  196. fmt.Println(resp)
  197. }
  198. func ExampleAPIGateway_CreateRestApi() {
  199. sess, err := session.NewSession()
  200. if err != nil {
  201. fmt.Println("failed to create session,", err)
  202. return
  203. }
  204. svc := apigateway.New(sess)
  205. params := &apigateway.CreateRestApiInput{
  206. Name: aws.String("String"), // Required
  207. CloneFrom: aws.String("String"),
  208. Description: aws.String("String"),
  209. }
  210. resp, err := svc.CreateRestApi(params)
  211. if err != nil {
  212. // Print the error, cast err to awserr.Error to get the Code and
  213. // Message from an error.
  214. fmt.Println(err.Error())
  215. return
  216. }
  217. // Pretty-print the response data.
  218. fmt.Println(resp)
  219. }
  220. func ExampleAPIGateway_CreateStage() {
  221. sess, err := session.NewSession()
  222. if err != nil {
  223. fmt.Println("failed to create session,", err)
  224. return
  225. }
  226. svc := apigateway.New(sess)
  227. params := &apigateway.CreateStageInput{
  228. DeploymentId: aws.String("String"), // Required
  229. RestApiId: aws.String("String"), // Required
  230. StageName: aws.String("String"), // Required
  231. CacheClusterEnabled: aws.Bool(true),
  232. CacheClusterSize: aws.String("CacheClusterSize"),
  233. Description: aws.String("String"),
  234. Variables: map[string]*string{
  235. "Key": aws.String("String"), // Required
  236. // More values...
  237. },
  238. }
  239. resp, err := svc.CreateStage(params)
  240. if err != nil {
  241. // Print the error, cast err to awserr.Error to get the Code and
  242. // Message from an error.
  243. fmt.Println(err.Error())
  244. return
  245. }
  246. // Pretty-print the response data.
  247. fmt.Println(resp)
  248. }
  249. func ExampleAPIGateway_CreateUsagePlan() {
  250. sess, err := session.NewSession()
  251. if err != nil {
  252. fmt.Println("failed to create session,", err)
  253. return
  254. }
  255. svc := apigateway.New(sess)
  256. params := &apigateway.CreateUsagePlanInput{
  257. Name: aws.String("String"), // Required
  258. ApiStages: []*apigateway.ApiStage{
  259. { // Required
  260. ApiId: aws.String("String"),
  261. Stage: aws.String("String"),
  262. },
  263. // More values...
  264. },
  265. Description: aws.String("String"),
  266. Quota: &apigateway.QuotaSettings{
  267. Limit: aws.Int64(1),
  268. Offset: aws.Int64(1),
  269. Period: aws.String("QuotaPeriodType"),
  270. },
  271. Throttle: &apigateway.ThrottleSettings{
  272. BurstLimit: aws.Int64(1),
  273. RateLimit: aws.Float64(1.0),
  274. },
  275. }
  276. resp, err := svc.CreateUsagePlan(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 ExampleAPIGateway_CreateUsagePlanKey() {
  287. sess, err := session.NewSession()
  288. if err != nil {
  289. fmt.Println("failed to create session,", err)
  290. return
  291. }
  292. svc := apigateway.New(sess)
  293. params := &apigateway.CreateUsagePlanKeyInput{
  294. KeyId: aws.String("String"), // Required
  295. KeyType: aws.String("String"), // Required
  296. UsagePlanId: aws.String("String"), // Required
  297. }
  298. resp, err := svc.CreateUsagePlanKey(params)
  299. if err != nil {
  300. // Print the error, cast err to awserr.Error to get the Code and
  301. // Message from an error.
  302. fmt.Println(err.Error())
  303. return
  304. }
  305. // Pretty-print the response data.
  306. fmt.Println(resp)
  307. }
  308. func ExampleAPIGateway_DeleteApiKey() {
  309. sess, err := session.NewSession()
  310. if err != nil {
  311. fmt.Println("failed to create session,", err)
  312. return
  313. }
  314. svc := apigateway.New(sess)
  315. params := &apigateway.DeleteApiKeyInput{
  316. ApiKey: aws.String("String"), // Required
  317. }
  318. resp, err := svc.DeleteApiKey(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 ExampleAPIGateway_DeleteAuthorizer() {
  329. sess, err := session.NewSession()
  330. if err != nil {
  331. fmt.Println("failed to create session,", err)
  332. return
  333. }
  334. svc := apigateway.New(sess)
  335. params := &apigateway.DeleteAuthorizerInput{
  336. AuthorizerId: aws.String("String"), // Required
  337. RestApiId: aws.String("String"), // Required
  338. }
  339. resp, err := svc.DeleteAuthorizer(params)
  340. if err != nil {
  341. // Print the error, cast err to awserr.Error to get the Code and
  342. // Message from an error.
  343. fmt.Println(err.Error())
  344. return
  345. }
  346. // Pretty-print the response data.
  347. fmt.Println(resp)
  348. }
  349. func ExampleAPIGateway_DeleteBasePathMapping() {
  350. sess, err := session.NewSession()
  351. if err != nil {
  352. fmt.Println("failed to create session,", err)
  353. return
  354. }
  355. svc := apigateway.New(sess)
  356. params := &apigateway.DeleteBasePathMappingInput{
  357. BasePath: aws.String("String"), // Required
  358. DomainName: aws.String("String"), // Required
  359. }
  360. resp, err := svc.DeleteBasePathMapping(params)
  361. if err != nil {
  362. // Print the error, cast err to awserr.Error to get the Code and
  363. // Message from an error.
  364. fmt.Println(err.Error())
  365. return
  366. }
  367. // Pretty-print the response data.
  368. fmt.Println(resp)
  369. }
  370. func ExampleAPIGateway_DeleteClientCertificate() {
  371. sess, err := session.NewSession()
  372. if err != nil {
  373. fmt.Println("failed to create session,", err)
  374. return
  375. }
  376. svc := apigateway.New(sess)
  377. params := &apigateway.DeleteClientCertificateInput{
  378. ClientCertificateId: aws.String("String"), // Required
  379. }
  380. resp, err := svc.DeleteClientCertificate(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 ExampleAPIGateway_DeleteDeployment() {
  391. sess, err := session.NewSession()
  392. if err != nil {
  393. fmt.Println("failed to create session,", err)
  394. return
  395. }
  396. svc := apigateway.New(sess)
  397. params := &apigateway.DeleteDeploymentInput{
  398. DeploymentId: aws.String("String"), // Required
  399. RestApiId: aws.String("String"), // Required
  400. }
  401. resp, err := svc.DeleteDeployment(params)
  402. if err != nil {
  403. // Print the error, cast err to awserr.Error to get the Code and
  404. // Message from an error.
  405. fmt.Println(err.Error())
  406. return
  407. }
  408. // Pretty-print the response data.
  409. fmt.Println(resp)
  410. }
  411. func ExampleAPIGateway_DeleteDomainName() {
  412. sess, err := session.NewSession()
  413. if err != nil {
  414. fmt.Println("failed to create session,", err)
  415. return
  416. }
  417. svc := apigateway.New(sess)
  418. params := &apigateway.DeleteDomainNameInput{
  419. DomainName: aws.String("String"), // Required
  420. }
  421. resp, err := svc.DeleteDomainName(params)
  422. if err != nil {
  423. // Print the error, cast err to awserr.Error to get the Code and
  424. // Message from an error.
  425. fmt.Println(err.Error())
  426. return
  427. }
  428. // Pretty-print the response data.
  429. fmt.Println(resp)
  430. }
  431. func ExampleAPIGateway_DeleteIntegration() {
  432. sess, err := session.NewSession()
  433. if err != nil {
  434. fmt.Println("failed to create session,", err)
  435. return
  436. }
  437. svc := apigateway.New(sess)
  438. params := &apigateway.DeleteIntegrationInput{
  439. HttpMethod: aws.String("String"), // Required
  440. ResourceId: aws.String("String"), // Required
  441. RestApiId: aws.String("String"), // Required
  442. }
  443. resp, err := svc.DeleteIntegration(params)
  444. if err != nil {
  445. // Print the error, cast err to awserr.Error to get the Code and
  446. // Message from an error.
  447. fmt.Println(err.Error())
  448. return
  449. }
  450. // Pretty-print the response data.
  451. fmt.Println(resp)
  452. }
  453. func ExampleAPIGateway_DeleteIntegrationResponse() {
  454. sess, err := session.NewSession()
  455. if err != nil {
  456. fmt.Println("failed to create session,", err)
  457. return
  458. }
  459. svc := apigateway.New(sess)
  460. params := &apigateway.DeleteIntegrationResponseInput{
  461. HttpMethod: aws.String("String"), // Required
  462. ResourceId: aws.String("String"), // Required
  463. RestApiId: aws.String("String"), // Required
  464. StatusCode: aws.String("StatusCode"), // Required
  465. }
  466. resp, err := svc.DeleteIntegrationResponse(params)
  467. if err != nil {
  468. // Print the error, cast err to awserr.Error to get the Code and
  469. // Message from an error.
  470. fmt.Println(err.Error())
  471. return
  472. }
  473. // Pretty-print the response data.
  474. fmt.Println(resp)
  475. }
  476. func ExampleAPIGateway_DeleteMethod() {
  477. sess, err := session.NewSession()
  478. if err != nil {
  479. fmt.Println("failed to create session,", err)
  480. return
  481. }
  482. svc := apigateway.New(sess)
  483. params := &apigateway.DeleteMethodInput{
  484. HttpMethod: aws.String("String"), // Required
  485. ResourceId: aws.String("String"), // Required
  486. RestApiId: aws.String("String"), // Required
  487. }
  488. resp, err := svc.DeleteMethod(params)
  489. if err != nil {
  490. // Print the error, cast err to awserr.Error to get the Code and
  491. // Message from an error.
  492. fmt.Println(err.Error())
  493. return
  494. }
  495. // Pretty-print the response data.
  496. fmt.Println(resp)
  497. }
  498. func ExampleAPIGateway_DeleteMethodResponse() {
  499. sess, err := session.NewSession()
  500. if err != nil {
  501. fmt.Println("failed to create session,", err)
  502. return
  503. }
  504. svc := apigateway.New(sess)
  505. params := &apigateway.DeleteMethodResponseInput{
  506. HttpMethod: aws.String("String"), // Required
  507. ResourceId: aws.String("String"), // Required
  508. RestApiId: aws.String("String"), // Required
  509. StatusCode: aws.String("StatusCode"), // Required
  510. }
  511. resp, err := svc.DeleteMethodResponse(params)
  512. if err != nil {
  513. // Print the error, cast err to awserr.Error to get the Code and
  514. // Message from an error.
  515. fmt.Println(err.Error())
  516. return
  517. }
  518. // Pretty-print the response data.
  519. fmt.Println(resp)
  520. }
  521. func ExampleAPIGateway_DeleteModel() {
  522. sess, err := session.NewSession()
  523. if err != nil {
  524. fmt.Println("failed to create session,", err)
  525. return
  526. }
  527. svc := apigateway.New(sess)
  528. params := &apigateway.DeleteModelInput{
  529. ModelName: aws.String("String"), // Required
  530. RestApiId: aws.String("String"), // Required
  531. }
  532. resp, err := svc.DeleteModel(params)
  533. if err != nil {
  534. // Print the error, cast err to awserr.Error to get the Code and
  535. // Message from an error.
  536. fmt.Println(err.Error())
  537. return
  538. }
  539. // Pretty-print the response data.
  540. fmt.Println(resp)
  541. }
  542. func ExampleAPIGateway_DeleteResource() {
  543. sess, err := session.NewSession()
  544. if err != nil {
  545. fmt.Println("failed to create session,", err)
  546. return
  547. }
  548. svc := apigateway.New(sess)
  549. params := &apigateway.DeleteResourceInput{
  550. ResourceId: aws.String("String"), // Required
  551. RestApiId: aws.String("String"), // Required
  552. }
  553. resp, err := svc.DeleteResource(params)
  554. if err != nil {
  555. // Print the error, cast err to awserr.Error to get the Code and
  556. // Message from an error.
  557. fmt.Println(err.Error())
  558. return
  559. }
  560. // Pretty-print the response data.
  561. fmt.Println(resp)
  562. }
  563. func ExampleAPIGateway_DeleteRestApi() {
  564. sess, err := session.NewSession()
  565. if err != nil {
  566. fmt.Println("failed to create session,", err)
  567. return
  568. }
  569. svc := apigateway.New(sess)
  570. params := &apigateway.DeleteRestApiInput{
  571. RestApiId: aws.String("String"), // Required
  572. }
  573. resp, err := svc.DeleteRestApi(params)
  574. if err != nil {
  575. // Print the error, cast err to awserr.Error to get the Code and
  576. // Message from an error.
  577. fmt.Println(err.Error())
  578. return
  579. }
  580. // Pretty-print the response data.
  581. fmt.Println(resp)
  582. }
  583. func ExampleAPIGateway_DeleteStage() {
  584. sess, err := session.NewSession()
  585. if err != nil {
  586. fmt.Println("failed to create session,", err)
  587. return
  588. }
  589. svc := apigateway.New(sess)
  590. params := &apigateway.DeleteStageInput{
  591. RestApiId: aws.String("String"), // Required
  592. StageName: aws.String("String"), // Required
  593. }
  594. resp, err := svc.DeleteStage(params)
  595. if err != nil {
  596. // Print the error, cast err to awserr.Error to get the Code and
  597. // Message from an error.
  598. fmt.Println(err.Error())
  599. return
  600. }
  601. // Pretty-print the response data.
  602. fmt.Println(resp)
  603. }
  604. func ExampleAPIGateway_DeleteUsagePlan() {
  605. sess, err := session.NewSession()
  606. if err != nil {
  607. fmt.Println("failed to create session,", err)
  608. return
  609. }
  610. svc := apigateway.New(sess)
  611. params := &apigateway.DeleteUsagePlanInput{
  612. UsagePlanId: aws.String("String"), // Required
  613. }
  614. resp, err := svc.DeleteUsagePlan(params)
  615. if err != nil {
  616. // Print the error, cast err to awserr.Error to get the Code and
  617. // Message from an error.
  618. fmt.Println(err.Error())
  619. return
  620. }
  621. // Pretty-print the response data.
  622. fmt.Println(resp)
  623. }
  624. func ExampleAPIGateway_DeleteUsagePlanKey() {
  625. sess, err := session.NewSession()
  626. if err != nil {
  627. fmt.Println("failed to create session,", err)
  628. return
  629. }
  630. svc := apigateway.New(sess)
  631. params := &apigateway.DeleteUsagePlanKeyInput{
  632. KeyId: aws.String("String"), // Required
  633. UsagePlanId: aws.String("String"), // Required
  634. }
  635. resp, err := svc.DeleteUsagePlanKey(params)
  636. if err != nil {
  637. // Print the error, cast err to awserr.Error to get the Code and
  638. // Message from an error.
  639. fmt.Println(err.Error())
  640. return
  641. }
  642. // Pretty-print the response data.
  643. fmt.Println(resp)
  644. }
  645. func ExampleAPIGateway_FlushStageAuthorizersCache() {
  646. sess, err := session.NewSession()
  647. if err != nil {
  648. fmt.Println("failed to create session,", err)
  649. return
  650. }
  651. svc := apigateway.New(sess)
  652. params := &apigateway.FlushStageAuthorizersCacheInput{
  653. RestApiId: aws.String("String"), // Required
  654. StageName: aws.String("String"), // Required
  655. }
  656. resp, err := svc.FlushStageAuthorizersCache(params)
  657. if err != nil {
  658. // Print the error, cast err to awserr.Error to get the Code and
  659. // Message from an error.
  660. fmt.Println(err.Error())
  661. return
  662. }
  663. // Pretty-print the response data.
  664. fmt.Println(resp)
  665. }
  666. func ExampleAPIGateway_FlushStageCache() {
  667. sess, err := session.NewSession()
  668. if err != nil {
  669. fmt.Println("failed to create session,", err)
  670. return
  671. }
  672. svc := apigateway.New(sess)
  673. params := &apigateway.FlushStageCacheInput{
  674. RestApiId: aws.String("String"), // Required
  675. StageName: aws.String("String"), // Required
  676. }
  677. resp, err := svc.FlushStageCache(params)
  678. if err != nil {
  679. // Print the error, cast err to awserr.Error to get the Code and
  680. // Message from an error.
  681. fmt.Println(err.Error())
  682. return
  683. }
  684. // Pretty-print the response data.
  685. fmt.Println(resp)
  686. }
  687. func ExampleAPIGateway_GenerateClientCertificate() {
  688. sess, err := session.NewSession()
  689. if err != nil {
  690. fmt.Println("failed to create session,", err)
  691. return
  692. }
  693. svc := apigateway.New(sess)
  694. params := &apigateway.GenerateClientCertificateInput{
  695. Description: aws.String("String"),
  696. }
  697. resp, err := svc.GenerateClientCertificate(params)
  698. if err != nil {
  699. // Print the error, cast err to awserr.Error to get the Code and
  700. // Message from an error.
  701. fmt.Println(err.Error())
  702. return
  703. }
  704. // Pretty-print the response data.
  705. fmt.Println(resp)
  706. }
  707. func ExampleAPIGateway_GetAccount() {
  708. sess, err := session.NewSession()
  709. if err != nil {
  710. fmt.Println("failed to create session,", err)
  711. return
  712. }
  713. svc := apigateway.New(sess)
  714. var params *apigateway.GetAccountInput
  715. resp, err := svc.GetAccount(params)
  716. if err != nil {
  717. // Print the error, cast err to awserr.Error to get the Code and
  718. // Message from an error.
  719. fmt.Println(err.Error())
  720. return
  721. }
  722. // Pretty-print the response data.
  723. fmt.Println(resp)
  724. }
  725. func ExampleAPIGateway_GetApiKey() {
  726. sess, err := session.NewSession()
  727. if err != nil {
  728. fmt.Println("failed to create session,", err)
  729. return
  730. }
  731. svc := apigateway.New(sess)
  732. params := &apigateway.GetApiKeyInput{
  733. ApiKey: aws.String("String"), // Required
  734. IncludeValue: aws.Bool(true),
  735. }
  736. resp, err := svc.GetApiKey(params)
  737. if err != nil {
  738. // Print the error, cast err to awserr.Error to get the Code and
  739. // Message from an error.
  740. fmt.Println(err.Error())
  741. return
  742. }
  743. // Pretty-print the response data.
  744. fmt.Println(resp)
  745. }
  746. func ExampleAPIGateway_GetApiKeys() {
  747. sess, err := session.NewSession()
  748. if err != nil {
  749. fmt.Println("failed to create session,", err)
  750. return
  751. }
  752. svc := apigateway.New(sess)
  753. params := &apigateway.GetApiKeysInput{
  754. IncludeValues: aws.Bool(true),
  755. Limit: aws.Int64(1),
  756. NameQuery: aws.String("String"),
  757. Position: aws.String("String"),
  758. }
  759. resp, err := svc.GetApiKeys(params)
  760. if err != nil {
  761. // Print the error, cast err to awserr.Error to get the Code and
  762. // Message from an error.
  763. fmt.Println(err.Error())
  764. return
  765. }
  766. // Pretty-print the response data.
  767. fmt.Println(resp)
  768. }
  769. func ExampleAPIGateway_GetAuthorizer() {
  770. sess, err := session.NewSession()
  771. if err != nil {
  772. fmt.Println("failed to create session,", err)
  773. return
  774. }
  775. svc := apigateway.New(sess)
  776. params := &apigateway.GetAuthorizerInput{
  777. AuthorizerId: aws.String("String"), // Required
  778. RestApiId: aws.String("String"), // Required
  779. }
  780. resp, err := svc.GetAuthorizer(params)
  781. if err != nil {
  782. // Print the error, cast err to awserr.Error to get the Code and
  783. // Message from an error.
  784. fmt.Println(err.Error())
  785. return
  786. }
  787. // Pretty-print the response data.
  788. fmt.Println(resp)
  789. }
  790. func ExampleAPIGateway_GetAuthorizers() {
  791. sess, err := session.NewSession()
  792. if err != nil {
  793. fmt.Println("failed to create session,", err)
  794. return
  795. }
  796. svc := apigateway.New(sess)
  797. params := &apigateway.GetAuthorizersInput{
  798. RestApiId: aws.String("String"), // Required
  799. Limit: aws.Int64(1),
  800. Position: aws.String("String"),
  801. }
  802. resp, err := svc.GetAuthorizers(params)
  803. if err != nil {
  804. // Print the error, cast err to awserr.Error to get the Code and
  805. // Message from an error.
  806. fmt.Println(err.Error())
  807. return
  808. }
  809. // Pretty-print the response data.
  810. fmt.Println(resp)
  811. }
  812. func ExampleAPIGateway_GetBasePathMapping() {
  813. sess, err := session.NewSession()
  814. if err != nil {
  815. fmt.Println("failed to create session,", err)
  816. return
  817. }
  818. svc := apigateway.New(sess)
  819. params := &apigateway.GetBasePathMappingInput{
  820. BasePath: aws.String("String"), // Required
  821. DomainName: aws.String("String"), // Required
  822. }
  823. resp, err := svc.GetBasePathMapping(params)
  824. if err != nil {
  825. // Print the error, cast err to awserr.Error to get the Code and
  826. // Message from an error.
  827. fmt.Println(err.Error())
  828. return
  829. }
  830. // Pretty-print the response data.
  831. fmt.Println(resp)
  832. }
  833. func ExampleAPIGateway_GetBasePathMappings() {
  834. sess, err := session.NewSession()
  835. if err != nil {
  836. fmt.Println("failed to create session,", err)
  837. return
  838. }
  839. svc := apigateway.New(sess)
  840. params := &apigateway.GetBasePathMappingsInput{
  841. DomainName: aws.String("String"), // Required
  842. Limit: aws.Int64(1),
  843. Position: aws.String("String"),
  844. }
  845. resp, err := svc.GetBasePathMappings(params)
  846. if err != nil {
  847. // Print the error, cast err to awserr.Error to get the Code and
  848. // Message from an error.
  849. fmt.Println(err.Error())
  850. return
  851. }
  852. // Pretty-print the response data.
  853. fmt.Println(resp)
  854. }
  855. func ExampleAPIGateway_GetClientCertificate() {
  856. sess, err := session.NewSession()
  857. if err != nil {
  858. fmt.Println("failed to create session,", err)
  859. return
  860. }
  861. svc := apigateway.New(sess)
  862. params := &apigateway.GetClientCertificateInput{
  863. ClientCertificateId: aws.String("String"), // Required
  864. }
  865. resp, err := svc.GetClientCertificate(params)
  866. if err != nil {
  867. // Print the error, cast err to awserr.Error to get the Code and
  868. // Message from an error.
  869. fmt.Println(err.Error())
  870. return
  871. }
  872. // Pretty-print the response data.
  873. fmt.Println(resp)
  874. }
  875. func ExampleAPIGateway_GetClientCertificates() {
  876. sess, err := session.NewSession()
  877. if err != nil {
  878. fmt.Println("failed to create session,", err)
  879. return
  880. }
  881. svc := apigateway.New(sess)
  882. params := &apigateway.GetClientCertificatesInput{
  883. Limit: aws.Int64(1),
  884. Position: aws.String("String"),
  885. }
  886. resp, err := svc.GetClientCertificates(params)
  887. if err != nil {
  888. // Print the error, cast err to awserr.Error to get the Code and
  889. // Message from an error.
  890. fmt.Println(err.Error())
  891. return
  892. }
  893. // Pretty-print the response data.
  894. fmt.Println(resp)
  895. }
  896. func ExampleAPIGateway_GetDeployment() {
  897. sess, err := session.NewSession()
  898. if err != nil {
  899. fmt.Println("failed to create session,", err)
  900. return
  901. }
  902. svc := apigateway.New(sess)
  903. params := &apigateway.GetDeploymentInput{
  904. DeploymentId: aws.String("String"), // Required
  905. RestApiId: aws.String("String"), // Required
  906. }
  907. resp, err := svc.GetDeployment(params)
  908. if err != nil {
  909. // Print the error, cast err to awserr.Error to get the Code and
  910. // Message from an error.
  911. fmt.Println(err.Error())
  912. return
  913. }
  914. // Pretty-print the response data.
  915. fmt.Println(resp)
  916. }
  917. func ExampleAPIGateway_GetDeployments() {
  918. sess, err := session.NewSession()
  919. if err != nil {
  920. fmt.Println("failed to create session,", err)
  921. return
  922. }
  923. svc := apigateway.New(sess)
  924. params := &apigateway.GetDeploymentsInput{
  925. RestApiId: aws.String("String"), // Required
  926. Limit: aws.Int64(1),
  927. Position: aws.String("String"),
  928. }
  929. resp, err := svc.GetDeployments(params)
  930. if err != nil {
  931. // Print the error, cast err to awserr.Error to get the Code and
  932. // Message from an error.
  933. fmt.Println(err.Error())
  934. return
  935. }
  936. // Pretty-print the response data.
  937. fmt.Println(resp)
  938. }
  939. func ExampleAPIGateway_GetDomainName() {
  940. sess, err := session.NewSession()
  941. if err != nil {
  942. fmt.Println("failed to create session,", err)
  943. return
  944. }
  945. svc := apigateway.New(sess)
  946. params := &apigateway.GetDomainNameInput{
  947. DomainName: aws.String("String"), // Required
  948. }
  949. resp, err := svc.GetDomainName(params)
  950. if err != nil {
  951. // Print the error, cast err to awserr.Error to get the Code and
  952. // Message from an error.
  953. fmt.Println(err.Error())
  954. return
  955. }
  956. // Pretty-print the response data.
  957. fmt.Println(resp)
  958. }
  959. func ExampleAPIGateway_GetDomainNames() {
  960. sess, err := session.NewSession()
  961. if err != nil {
  962. fmt.Println("failed to create session,", err)
  963. return
  964. }
  965. svc := apigateway.New(sess)
  966. params := &apigateway.GetDomainNamesInput{
  967. Limit: aws.Int64(1),
  968. Position: aws.String("String"),
  969. }
  970. resp, err := svc.GetDomainNames(params)
  971. if err != nil {
  972. // Print the error, cast err to awserr.Error to get the Code and
  973. // Message from an error.
  974. fmt.Println(err.Error())
  975. return
  976. }
  977. // Pretty-print the response data.
  978. fmt.Println(resp)
  979. }
  980. func ExampleAPIGateway_GetExport() {
  981. sess, err := session.NewSession()
  982. if err != nil {
  983. fmt.Println("failed to create session,", err)
  984. return
  985. }
  986. svc := apigateway.New(sess)
  987. params := &apigateway.GetExportInput{
  988. ExportType: aws.String("String"), // Required
  989. RestApiId: aws.String("String"), // Required
  990. StageName: aws.String("String"), // Required
  991. Accepts: aws.String("String"),
  992. Parameters: map[string]*string{
  993. "Key": aws.String("String"), // Required
  994. // More values...
  995. },
  996. }
  997. resp, err := svc.GetExport(params)
  998. if err != nil {
  999. // Print the error, cast err to awserr.Error to get the Code and
  1000. // Message from an error.
  1001. fmt.Println(err.Error())
  1002. return
  1003. }
  1004. // Pretty-print the response data.
  1005. fmt.Println(resp)
  1006. }
  1007. func ExampleAPIGateway_GetIntegration() {
  1008. sess, err := session.NewSession()
  1009. if err != nil {
  1010. fmt.Println("failed to create session,", err)
  1011. return
  1012. }
  1013. svc := apigateway.New(sess)
  1014. params := &apigateway.GetIntegrationInput{
  1015. HttpMethod: aws.String("String"), // Required
  1016. ResourceId: aws.String("String"), // Required
  1017. RestApiId: aws.String("String"), // Required
  1018. }
  1019. resp, err := svc.GetIntegration(params)
  1020. if err != nil {
  1021. // Print the error, cast err to awserr.Error to get the Code and
  1022. // Message from an error.
  1023. fmt.Println(err.Error())
  1024. return
  1025. }
  1026. // Pretty-print the response data.
  1027. fmt.Println(resp)
  1028. }
  1029. func ExampleAPIGateway_GetIntegrationResponse() {
  1030. sess, err := session.NewSession()
  1031. if err != nil {
  1032. fmt.Println("failed to create session,", err)
  1033. return
  1034. }
  1035. svc := apigateway.New(sess)
  1036. params := &apigateway.GetIntegrationResponseInput{
  1037. HttpMethod: aws.String("String"), // Required
  1038. ResourceId: aws.String("String"), // Required
  1039. RestApiId: aws.String("String"), // Required
  1040. StatusCode: aws.String("StatusCode"), // Required
  1041. }
  1042. resp, err := svc.GetIntegrationResponse(params)
  1043. if err != nil {
  1044. // Print the error, cast err to awserr.Error to get the Code and
  1045. // Message from an error.
  1046. fmt.Println(err.Error())
  1047. return
  1048. }
  1049. // Pretty-print the response data.
  1050. fmt.Println(resp)
  1051. }
  1052. func ExampleAPIGateway_GetMethod() {
  1053. sess, err := session.NewSession()
  1054. if err != nil {
  1055. fmt.Println("failed to create session,", err)
  1056. return
  1057. }
  1058. svc := apigateway.New(sess)
  1059. params := &apigateway.GetMethodInput{
  1060. HttpMethod: aws.String("String"), // Required
  1061. ResourceId: aws.String("String"), // Required
  1062. RestApiId: aws.String("String"), // Required
  1063. }
  1064. resp, err := svc.GetMethod(params)
  1065. if err != nil {
  1066. // Print the error, cast err to awserr.Error to get the Code and
  1067. // Message from an error.
  1068. fmt.Println(err.Error())
  1069. return
  1070. }
  1071. // Pretty-print the response data.
  1072. fmt.Println(resp)
  1073. }
  1074. func ExampleAPIGateway_GetMethodResponse() {
  1075. sess, err := session.NewSession()
  1076. if err != nil {
  1077. fmt.Println("failed to create session,", err)
  1078. return
  1079. }
  1080. svc := apigateway.New(sess)
  1081. params := &apigateway.GetMethodResponseInput{
  1082. HttpMethod: aws.String("String"), // Required
  1083. ResourceId: aws.String("String"), // Required
  1084. RestApiId: aws.String("String"), // Required
  1085. StatusCode: aws.String("StatusCode"), // Required
  1086. }
  1087. resp, err := svc.GetMethodResponse(params)
  1088. if err != nil {
  1089. // Print the error, cast err to awserr.Error to get the Code and
  1090. // Message from an error.
  1091. fmt.Println(err.Error())
  1092. return
  1093. }
  1094. // Pretty-print the response data.
  1095. fmt.Println(resp)
  1096. }
  1097. func ExampleAPIGateway_GetModel() {
  1098. sess, err := session.NewSession()
  1099. if err != nil {
  1100. fmt.Println("failed to create session,", err)
  1101. return
  1102. }
  1103. svc := apigateway.New(sess)
  1104. params := &apigateway.GetModelInput{
  1105. ModelName: aws.String("String"), // Required
  1106. RestApiId: aws.String("String"), // Required
  1107. Flatten: aws.Bool(true),
  1108. }
  1109. resp, err := svc.GetModel(params)
  1110. if err != nil {
  1111. // Print the error, cast err to awserr.Error to get the Code and
  1112. // Message from an error.
  1113. fmt.Println(err.Error())
  1114. return
  1115. }
  1116. // Pretty-print the response data.
  1117. fmt.Println(resp)
  1118. }
  1119. func ExampleAPIGateway_GetModelTemplate() {
  1120. sess, err := session.NewSession()
  1121. if err != nil {
  1122. fmt.Println("failed to create session,", err)
  1123. return
  1124. }
  1125. svc := apigateway.New(sess)
  1126. params := &apigateway.GetModelTemplateInput{
  1127. ModelName: aws.String("String"), // Required
  1128. RestApiId: aws.String("String"), // Required
  1129. }
  1130. resp, err := svc.GetModelTemplate(params)
  1131. if err != nil {
  1132. // Print the error, cast err to awserr.Error to get the Code and
  1133. // Message from an error.
  1134. fmt.Println(err.Error())
  1135. return
  1136. }
  1137. // Pretty-print the response data.
  1138. fmt.Println(resp)
  1139. }
  1140. func ExampleAPIGateway_GetModels() {
  1141. sess, err := session.NewSession()
  1142. if err != nil {
  1143. fmt.Println("failed to create session,", err)
  1144. return
  1145. }
  1146. svc := apigateway.New(sess)
  1147. params := &apigateway.GetModelsInput{
  1148. RestApiId: aws.String("String"), // Required
  1149. Limit: aws.Int64(1),
  1150. Position: aws.String("String"),
  1151. }
  1152. resp, err := svc.GetModels(params)
  1153. if err != nil {
  1154. // Print the error, cast err to awserr.Error to get the Code and
  1155. // Message from an error.
  1156. fmt.Println(err.Error())
  1157. return
  1158. }
  1159. // Pretty-print the response data.
  1160. fmt.Println(resp)
  1161. }
  1162. func ExampleAPIGateway_GetResource() {
  1163. sess, err := session.NewSession()
  1164. if err != nil {
  1165. fmt.Println("failed to create session,", err)
  1166. return
  1167. }
  1168. svc := apigateway.New(sess)
  1169. params := &apigateway.GetResourceInput{
  1170. ResourceId: aws.String("String"), // Required
  1171. RestApiId: aws.String("String"), // Required
  1172. }
  1173. resp, err := svc.GetResource(params)
  1174. if err != nil {
  1175. // Print the error, cast err to awserr.Error to get the Code and
  1176. // Message from an error.
  1177. fmt.Println(err.Error())
  1178. return
  1179. }
  1180. // Pretty-print the response data.
  1181. fmt.Println(resp)
  1182. }
  1183. func ExampleAPIGateway_GetResources() {
  1184. sess, err := session.NewSession()
  1185. if err != nil {
  1186. fmt.Println("failed to create session,", err)
  1187. return
  1188. }
  1189. svc := apigateway.New(sess)
  1190. params := &apigateway.GetResourcesInput{
  1191. RestApiId: aws.String("String"), // Required
  1192. Limit: aws.Int64(1),
  1193. Position: aws.String("String"),
  1194. }
  1195. resp, err := svc.GetResources(params)
  1196. if err != nil {
  1197. // Print the error, cast err to awserr.Error to get the Code and
  1198. // Message from an error.
  1199. fmt.Println(err.Error())
  1200. return
  1201. }
  1202. // Pretty-print the response data.
  1203. fmt.Println(resp)
  1204. }
  1205. func ExampleAPIGateway_GetRestApi() {
  1206. sess, err := session.NewSession()
  1207. if err != nil {
  1208. fmt.Println("failed to create session,", err)
  1209. return
  1210. }
  1211. svc := apigateway.New(sess)
  1212. params := &apigateway.GetRestApiInput{
  1213. RestApiId: aws.String("String"), // Required
  1214. }
  1215. resp, err := svc.GetRestApi(params)
  1216. if err != nil {
  1217. // Print the error, cast err to awserr.Error to get the Code and
  1218. // Message from an error.
  1219. fmt.Println(err.Error())
  1220. return
  1221. }
  1222. // Pretty-print the response data.
  1223. fmt.Println(resp)
  1224. }
  1225. func ExampleAPIGateway_GetRestApis() {
  1226. sess, err := session.NewSession()
  1227. if err != nil {
  1228. fmt.Println("failed to create session,", err)
  1229. return
  1230. }
  1231. svc := apigateway.New(sess)
  1232. params := &apigateway.GetRestApisInput{
  1233. Limit: aws.Int64(1),
  1234. Position: aws.String("String"),
  1235. }
  1236. resp, err := svc.GetRestApis(params)
  1237. if err != nil {
  1238. // Print the error, cast err to awserr.Error to get the Code and
  1239. // Message from an error.
  1240. fmt.Println(err.Error())
  1241. return
  1242. }
  1243. // Pretty-print the response data.
  1244. fmt.Println(resp)
  1245. }
  1246. func ExampleAPIGateway_GetSdk() {
  1247. sess, err := session.NewSession()
  1248. if err != nil {
  1249. fmt.Println("failed to create session,", err)
  1250. return
  1251. }
  1252. svc := apigateway.New(sess)
  1253. params := &apigateway.GetSdkInput{
  1254. RestApiId: aws.String("String"), // Required
  1255. SdkType: aws.String("String"), // Required
  1256. StageName: aws.String("String"), // Required
  1257. Parameters: map[string]*string{
  1258. "Key": aws.String("String"), // Required
  1259. // More values...
  1260. },
  1261. }
  1262. resp, err := svc.GetSdk(params)
  1263. if err != nil {
  1264. // Print the error, cast err to awserr.Error to get the Code and
  1265. // Message from an error.
  1266. fmt.Println(err.Error())
  1267. return
  1268. }
  1269. // Pretty-print the response data.
  1270. fmt.Println(resp)
  1271. }
  1272. func ExampleAPIGateway_GetStage() {
  1273. sess, err := session.NewSession()
  1274. if err != nil {
  1275. fmt.Println("failed to create session,", err)
  1276. return
  1277. }
  1278. svc := apigateway.New(sess)
  1279. params := &apigateway.GetStageInput{
  1280. RestApiId: aws.String("String"), // Required
  1281. StageName: aws.String("String"), // Required
  1282. }
  1283. resp, err := svc.GetStage(params)
  1284. if err != nil {
  1285. // Print the error, cast err to awserr.Error to get the Code and
  1286. // Message from an error.
  1287. fmt.Println(err.Error())
  1288. return
  1289. }
  1290. // Pretty-print the response data.
  1291. fmt.Println(resp)
  1292. }
  1293. func ExampleAPIGateway_GetStages() {
  1294. sess, err := session.NewSession()
  1295. if err != nil {
  1296. fmt.Println("failed to create session,", err)
  1297. return
  1298. }
  1299. svc := apigateway.New(sess)
  1300. params := &apigateway.GetStagesInput{
  1301. RestApiId: aws.String("String"), // Required
  1302. DeploymentId: aws.String("String"),
  1303. }
  1304. resp, err := svc.GetStages(params)
  1305. if err != nil {
  1306. // Print the error, cast err to awserr.Error to get the Code and
  1307. // Message from an error.
  1308. fmt.Println(err.Error())
  1309. return
  1310. }
  1311. // Pretty-print the response data.
  1312. fmt.Println(resp)
  1313. }
  1314. func ExampleAPIGateway_GetUsage() {
  1315. sess, err := session.NewSession()
  1316. if err != nil {
  1317. fmt.Println("failed to create session,", err)
  1318. return
  1319. }
  1320. svc := apigateway.New(sess)
  1321. params := &apigateway.GetUsageInput{
  1322. EndDate: aws.String("String"), // Required
  1323. StartDate: aws.String("String"), // Required
  1324. UsagePlanId: aws.String("String"), // Required
  1325. KeyId: aws.String("String"),
  1326. Limit: aws.Int64(1),
  1327. Position: aws.String("String"),
  1328. }
  1329. resp, err := svc.GetUsage(params)
  1330. if err != nil {
  1331. // Print the error, cast err to awserr.Error to get the Code and
  1332. // Message from an error.
  1333. fmt.Println(err.Error())
  1334. return
  1335. }
  1336. // Pretty-print the response data.
  1337. fmt.Println(resp)
  1338. }
  1339. func ExampleAPIGateway_GetUsagePlan() {
  1340. sess, err := session.NewSession()
  1341. if err != nil {
  1342. fmt.Println("failed to create session,", err)
  1343. return
  1344. }
  1345. svc := apigateway.New(sess)
  1346. params := &apigateway.GetUsagePlanInput{
  1347. UsagePlanId: aws.String("String"), // Required
  1348. }
  1349. resp, err := svc.GetUsagePlan(params)
  1350. if err != nil {
  1351. // Print the error, cast err to awserr.Error to get the Code and
  1352. // Message from an error.
  1353. fmt.Println(err.Error())
  1354. return
  1355. }
  1356. // Pretty-print the response data.
  1357. fmt.Println(resp)
  1358. }
  1359. func ExampleAPIGateway_GetUsagePlanKey() {
  1360. sess, err := session.NewSession()
  1361. if err != nil {
  1362. fmt.Println("failed to create session,", err)
  1363. return
  1364. }
  1365. svc := apigateway.New(sess)
  1366. params := &apigateway.GetUsagePlanKeyInput{
  1367. KeyId: aws.String("String"), // Required
  1368. UsagePlanId: aws.String("String"), // Required
  1369. }
  1370. resp, err := svc.GetUsagePlanKey(params)
  1371. if err != nil {
  1372. // Print the error, cast err to awserr.Error to get the Code and
  1373. // Message from an error.
  1374. fmt.Println(err.Error())
  1375. return
  1376. }
  1377. // Pretty-print the response data.
  1378. fmt.Println(resp)
  1379. }
  1380. func ExampleAPIGateway_GetUsagePlanKeys() {
  1381. sess, err := session.NewSession()
  1382. if err != nil {
  1383. fmt.Println("failed to create session,", err)
  1384. return
  1385. }
  1386. svc := apigateway.New(sess)
  1387. params := &apigateway.GetUsagePlanKeysInput{
  1388. UsagePlanId: aws.String("String"), // Required
  1389. Limit: aws.Int64(1),
  1390. NameQuery: aws.String("String"),
  1391. Position: aws.String("String"),
  1392. }
  1393. resp, err := svc.GetUsagePlanKeys(params)
  1394. if err != nil {
  1395. // Print the error, cast err to awserr.Error to get the Code and
  1396. // Message from an error.
  1397. fmt.Println(err.Error())
  1398. return
  1399. }
  1400. // Pretty-print the response data.
  1401. fmt.Println(resp)
  1402. }
  1403. func ExampleAPIGateway_GetUsagePlans() {
  1404. sess, err := session.NewSession()
  1405. if err != nil {
  1406. fmt.Println("failed to create session,", err)
  1407. return
  1408. }
  1409. svc := apigateway.New(sess)
  1410. params := &apigateway.GetUsagePlansInput{
  1411. KeyId: aws.String("String"),
  1412. Limit: aws.Int64(1),
  1413. Position: aws.String("String"),
  1414. }
  1415. resp, err := svc.GetUsagePlans(params)
  1416. if err != nil {
  1417. // Print the error, cast err to awserr.Error to get the Code and
  1418. // Message from an error.
  1419. fmt.Println(err.Error())
  1420. return
  1421. }
  1422. // Pretty-print the response data.
  1423. fmt.Println(resp)
  1424. }
  1425. func ExampleAPIGateway_ImportApiKeys() {
  1426. sess, err := session.NewSession()
  1427. if err != nil {
  1428. fmt.Println("failed to create session,", err)
  1429. return
  1430. }
  1431. svc := apigateway.New(sess)
  1432. params := &apigateway.ImportApiKeysInput{
  1433. Body: []byte("PAYLOAD"), // Required
  1434. Format: aws.String("ApiKeysFormat"), // Required
  1435. FailOnWarnings: aws.Bool(true),
  1436. }
  1437. resp, err := svc.ImportApiKeys(params)
  1438. if err != nil {
  1439. // Print the error, cast err to awserr.Error to get the Code and
  1440. // Message from an error.
  1441. fmt.Println(err.Error())
  1442. return
  1443. }
  1444. // Pretty-print the response data.
  1445. fmt.Println(resp)
  1446. }
  1447. func ExampleAPIGateway_ImportRestApi() {
  1448. sess, err := session.NewSession()
  1449. if err != nil {
  1450. fmt.Println("failed to create session,", err)
  1451. return
  1452. }
  1453. svc := apigateway.New(sess)
  1454. params := &apigateway.ImportRestApiInput{
  1455. Body: []byte("PAYLOAD"), // Required
  1456. FailOnWarnings: aws.Bool(true),
  1457. Parameters: map[string]*string{
  1458. "Key": aws.String("String"), // Required
  1459. // More values...
  1460. },
  1461. }
  1462. resp, err := svc.ImportRestApi(params)
  1463. if err != nil {
  1464. // Print the error, cast err to awserr.Error to get the Code and
  1465. // Message from an error.
  1466. fmt.Println(err.Error())
  1467. return
  1468. }
  1469. // Pretty-print the response data.
  1470. fmt.Println(resp)
  1471. }
  1472. func ExampleAPIGateway_PutIntegration() {
  1473. sess, err := session.NewSession()
  1474. if err != nil {
  1475. fmt.Println("failed to create session,", err)
  1476. return
  1477. }
  1478. svc := apigateway.New(sess)
  1479. params := &apigateway.PutIntegrationInput{
  1480. HttpMethod: aws.String("String"), // Required
  1481. ResourceId: aws.String("String"), // Required
  1482. RestApiId: aws.String("String"), // Required
  1483. Type: aws.String("IntegrationType"), // Required
  1484. CacheKeyParameters: []*string{
  1485. aws.String("String"), // Required
  1486. // More values...
  1487. },
  1488. CacheNamespace: aws.String("String"),
  1489. Credentials: aws.String("String"),
  1490. IntegrationHttpMethod: aws.String("String"),
  1491. PassthroughBehavior: aws.String("String"),
  1492. RequestParameters: map[string]*string{
  1493. "Key": aws.String("String"), // Required
  1494. // More values...
  1495. },
  1496. RequestTemplates: map[string]*string{
  1497. "Key": aws.String("String"), // Required
  1498. // More values...
  1499. },
  1500. Uri: aws.String("String"),
  1501. }
  1502. resp, err := svc.PutIntegration(params)
  1503. if err != nil {
  1504. // Print the error, cast err to awserr.Error to get the Code and
  1505. // Message from an error.
  1506. fmt.Println(err.Error())
  1507. return
  1508. }
  1509. // Pretty-print the response data.
  1510. fmt.Println(resp)
  1511. }
  1512. func ExampleAPIGateway_PutIntegrationResponse() {
  1513. sess, err := session.NewSession()
  1514. if err != nil {
  1515. fmt.Println("failed to create session,", err)
  1516. return
  1517. }
  1518. svc := apigateway.New(sess)
  1519. params := &apigateway.PutIntegrationResponseInput{
  1520. HttpMethod: aws.String("String"), // Required
  1521. ResourceId: aws.String("String"), // Required
  1522. RestApiId: aws.String("String"), // Required
  1523. StatusCode: aws.String("StatusCode"), // Required
  1524. ResponseParameters: map[string]*string{
  1525. "Key": aws.String("String"), // Required
  1526. // More values...
  1527. },
  1528. ResponseTemplates: map[string]*string{
  1529. "Key": aws.String("String"), // Required
  1530. // More values...
  1531. },
  1532. SelectionPattern: aws.String("String"),
  1533. }
  1534. resp, err := svc.PutIntegrationResponse(params)
  1535. if err != nil {
  1536. // Print the error, cast err to awserr.Error to get the Code and
  1537. // Message from an error.
  1538. fmt.Println(err.Error())
  1539. return
  1540. }
  1541. // Pretty-print the response data.
  1542. fmt.Println(resp)
  1543. }
  1544. func ExampleAPIGateway_PutMethod() {
  1545. sess, err := session.NewSession()
  1546. if err != nil {
  1547. fmt.Println("failed to create session,", err)
  1548. return
  1549. }
  1550. svc := apigateway.New(sess)
  1551. params := &apigateway.PutMethodInput{
  1552. AuthorizationType: aws.String("String"), // Required
  1553. HttpMethod: aws.String("String"), // Required
  1554. ResourceId: aws.String("String"), // Required
  1555. RestApiId: aws.String("String"), // Required
  1556. ApiKeyRequired: aws.Bool(true),
  1557. AuthorizerId: aws.String("String"),
  1558. RequestModels: map[string]*string{
  1559. "Key": aws.String("String"), // Required
  1560. // More values...
  1561. },
  1562. RequestParameters: map[string]*bool{
  1563. "Key": aws.Bool(true), // Required
  1564. // More values...
  1565. },
  1566. }
  1567. resp, err := svc.PutMethod(params)
  1568. if err != nil {
  1569. // Print the error, cast err to awserr.Error to get the Code and
  1570. // Message from an error.
  1571. fmt.Println(err.Error())
  1572. return
  1573. }
  1574. // Pretty-print the response data.
  1575. fmt.Println(resp)
  1576. }
  1577. func ExampleAPIGateway_PutMethodResponse() {
  1578. sess, err := session.NewSession()
  1579. if err != nil {
  1580. fmt.Println("failed to create session,", err)
  1581. return
  1582. }
  1583. svc := apigateway.New(sess)
  1584. params := &apigateway.PutMethodResponseInput{
  1585. HttpMethod: aws.String("String"), // Required
  1586. ResourceId: aws.String("String"), // Required
  1587. RestApiId: aws.String("String"), // Required
  1588. StatusCode: aws.String("StatusCode"), // Required
  1589. ResponseModels: map[string]*string{
  1590. "Key": aws.String("String"), // Required
  1591. // More values...
  1592. },
  1593. ResponseParameters: map[string]*bool{
  1594. "Key": aws.Bool(true), // Required
  1595. // More values...
  1596. },
  1597. }
  1598. resp, err := svc.PutMethodResponse(params)
  1599. if err != nil {
  1600. // Print the error, cast err to awserr.Error to get the Code and
  1601. // Message from an error.
  1602. fmt.Println(err.Error())
  1603. return
  1604. }
  1605. // Pretty-print the response data.
  1606. fmt.Println(resp)
  1607. }
  1608. func ExampleAPIGateway_PutRestApi() {
  1609. sess, err := session.NewSession()
  1610. if err != nil {
  1611. fmt.Println("failed to create session,", err)
  1612. return
  1613. }
  1614. svc := apigateway.New(sess)
  1615. params := &apigateway.PutRestApiInput{
  1616. Body: []byte("PAYLOAD"), // Required
  1617. RestApiId: aws.String("String"), // Required
  1618. FailOnWarnings: aws.Bool(true),
  1619. Mode: aws.String("PutMode"),
  1620. Parameters: map[string]*string{
  1621. "Key": aws.String("String"), // Required
  1622. // More values...
  1623. },
  1624. }
  1625. resp, err := svc.PutRestApi(params)
  1626. if err != nil {
  1627. // Print the error, cast err to awserr.Error to get the Code and
  1628. // Message from an error.
  1629. fmt.Println(err.Error())
  1630. return
  1631. }
  1632. // Pretty-print the response data.
  1633. fmt.Println(resp)
  1634. }
  1635. func ExampleAPIGateway_TestInvokeAuthorizer() {
  1636. sess, err := session.NewSession()
  1637. if err != nil {
  1638. fmt.Println("failed to create session,", err)
  1639. return
  1640. }
  1641. svc := apigateway.New(sess)
  1642. params := &apigateway.TestInvokeAuthorizerInput{
  1643. AuthorizerId: aws.String("String"), // Required
  1644. RestApiId: aws.String("String"), // Required
  1645. AdditionalContext: map[string]*string{
  1646. "Key": aws.String("String"), // Required
  1647. // More values...
  1648. },
  1649. Body: aws.String("String"),
  1650. Headers: map[string]*string{
  1651. "Key": aws.String("String"), // Required
  1652. // More values...
  1653. },
  1654. PathWithQueryString: aws.String("String"),
  1655. StageVariables: map[string]*string{
  1656. "Key": aws.String("String"), // Required
  1657. // More values...
  1658. },
  1659. }
  1660. resp, err := svc.TestInvokeAuthorizer(params)
  1661. if err != nil {
  1662. // Print the error, cast err to awserr.Error to get the Code and
  1663. // Message from an error.
  1664. fmt.Println(err.Error())
  1665. return
  1666. }
  1667. // Pretty-print the response data.
  1668. fmt.Println(resp)
  1669. }
  1670. func ExampleAPIGateway_TestInvokeMethod() {
  1671. sess, err := session.NewSession()
  1672. if err != nil {
  1673. fmt.Println("failed to create session,", err)
  1674. return
  1675. }
  1676. svc := apigateway.New(sess)
  1677. params := &apigateway.TestInvokeMethodInput{
  1678. HttpMethod: aws.String("String"), // Required
  1679. ResourceId: aws.String("String"), // Required
  1680. RestApiId: aws.String("String"), // Required
  1681. Body: aws.String("String"),
  1682. ClientCertificateId: aws.String("String"),
  1683. Headers: map[string]*string{
  1684. "Key": aws.String("String"), // Required
  1685. // More values...
  1686. },
  1687. PathWithQueryString: aws.String("String"),
  1688. StageVariables: map[string]*string{
  1689. "Key": aws.String("String"), // Required
  1690. // More values...
  1691. },
  1692. }
  1693. resp, err := svc.TestInvokeMethod(params)
  1694. if err != nil {
  1695. // Print the error, cast err to awserr.Error to get the Code and
  1696. // Message from an error.
  1697. fmt.Println(err.Error())
  1698. return
  1699. }
  1700. // Pretty-print the response data.
  1701. fmt.Println(resp)
  1702. }
  1703. func ExampleAPIGateway_UpdateAccount() {
  1704. sess, err := session.NewSession()
  1705. if err != nil {
  1706. fmt.Println("failed to create session,", err)
  1707. return
  1708. }
  1709. svc := apigateway.New(sess)
  1710. params := &apigateway.UpdateAccountInput{
  1711. PatchOperations: []*apigateway.PatchOperation{
  1712. { // Required
  1713. From: aws.String("String"),
  1714. Op: aws.String("Op"),
  1715. Path: aws.String("String"),
  1716. Value: aws.String("String"),
  1717. },
  1718. // More values...
  1719. },
  1720. }
  1721. resp, err := svc.UpdateAccount(params)
  1722. if err != nil {
  1723. // Print the error, cast err to awserr.Error to get the Code and
  1724. // Message from an error.
  1725. fmt.Println(err.Error())
  1726. return
  1727. }
  1728. // Pretty-print the response data.
  1729. fmt.Println(resp)
  1730. }
  1731. func ExampleAPIGateway_UpdateApiKey() {
  1732. sess, err := session.NewSession()
  1733. if err != nil {
  1734. fmt.Println("failed to create session,", err)
  1735. return
  1736. }
  1737. svc := apigateway.New(sess)
  1738. params := &apigateway.UpdateApiKeyInput{
  1739. ApiKey: aws.String("String"), // Required
  1740. PatchOperations: []*apigateway.PatchOperation{
  1741. { // Required
  1742. From: aws.String("String"),
  1743. Op: aws.String("Op"),
  1744. Path: aws.String("String"),
  1745. Value: aws.String("String"),
  1746. },
  1747. // More values...
  1748. },
  1749. }
  1750. resp, err := svc.UpdateApiKey(params)
  1751. if err != nil {
  1752. // Print the error, cast err to awserr.Error to get the Code and
  1753. // Message from an error.
  1754. fmt.Println(err.Error())
  1755. return
  1756. }
  1757. // Pretty-print the response data.
  1758. fmt.Println(resp)
  1759. }
  1760. func ExampleAPIGateway_UpdateAuthorizer() {
  1761. sess, err := session.NewSession()
  1762. if err != nil {
  1763. fmt.Println("failed to create session,", err)
  1764. return
  1765. }
  1766. svc := apigateway.New(sess)
  1767. params := &apigateway.UpdateAuthorizerInput{
  1768. AuthorizerId: aws.String("String"), // Required
  1769. RestApiId: aws.String("String"), // Required
  1770. PatchOperations: []*apigateway.PatchOperation{
  1771. { // Required
  1772. From: aws.String("String"),
  1773. Op: aws.String("Op"),
  1774. Path: aws.String("String"),
  1775. Value: aws.String("String"),
  1776. },
  1777. // More values...
  1778. },
  1779. }
  1780. resp, err := svc.UpdateAuthorizer(params)
  1781. if err != nil {
  1782. // Print the error, cast err to awserr.Error to get the Code and
  1783. // Message from an error.
  1784. fmt.Println(err.Error())
  1785. return
  1786. }
  1787. // Pretty-print the response data.
  1788. fmt.Println(resp)
  1789. }
  1790. func ExampleAPIGateway_UpdateBasePathMapping() {
  1791. sess, err := session.NewSession()
  1792. if err != nil {
  1793. fmt.Println("failed to create session,", err)
  1794. return
  1795. }
  1796. svc := apigateway.New(sess)
  1797. params := &apigateway.UpdateBasePathMappingInput{
  1798. BasePath: aws.String("String"), // Required
  1799. DomainName: aws.String("String"), // Required
  1800. PatchOperations: []*apigateway.PatchOperation{
  1801. { // Required
  1802. From: aws.String("String"),
  1803. Op: aws.String("Op"),
  1804. Path: aws.String("String"),
  1805. Value: aws.String("String"),
  1806. },
  1807. // More values...
  1808. },
  1809. }
  1810. resp, err := svc.UpdateBasePathMapping(params)
  1811. if err != nil {
  1812. // Print the error, cast err to awserr.Error to get the Code and
  1813. // Message from an error.
  1814. fmt.Println(err.Error())
  1815. return
  1816. }
  1817. // Pretty-print the response data.
  1818. fmt.Println(resp)
  1819. }
  1820. func ExampleAPIGateway_UpdateClientCertificate() {
  1821. sess, err := session.NewSession()
  1822. if err != nil {
  1823. fmt.Println("failed to create session,", err)
  1824. return
  1825. }
  1826. svc := apigateway.New(sess)
  1827. params := &apigateway.UpdateClientCertificateInput{
  1828. ClientCertificateId: aws.String("String"), // Required
  1829. PatchOperations: []*apigateway.PatchOperation{
  1830. { // Required
  1831. From: aws.String("String"),
  1832. Op: aws.String("Op"),
  1833. Path: aws.String("String"),
  1834. Value: aws.String("String"),
  1835. },
  1836. // More values...
  1837. },
  1838. }
  1839. resp, err := svc.UpdateClientCertificate(params)
  1840. if err != nil {
  1841. // Print the error, cast err to awserr.Error to get the Code and
  1842. // Message from an error.
  1843. fmt.Println(err.Error())
  1844. return
  1845. }
  1846. // Pretty-print the response data.
  1847. fmt.Println(resp)
  1848. }
  1849. func ExampleAPIGateway_UpdateDeployment() {
  1850. sess, err := session.NewSession()
  1851. if err != nil {
  1852. fmt.Println("failed to create session,", err)
  1853. return
  1854. }
  1855. svc := apigateway.New(sess)
  1856. params := &apigateway.UpdateDeploymentInput{
  1857. DeploymentId: aws.String("String"), // Required
  1858. RestApiId: aws.String("String"), // Required
  1859. PatchOperations: []*apigateway.PatchOperation{
  1860. { // Required
  1861. From: aws.String("String"),
  1862. Op: aws.String("Op"),
  1863. Path: aws.String("String"),
  1864. Value: aws.String("String"),
  1865. },
  1866. // More values...
  1867. },
  1868. }
  1869. resp, err := svc.UpdateDeployment(params)
  1870. if err != nil {
  1871. // Print the error, cast err to awserr.Error to get the Code and
  1872. // Message from an error.
  1873. fmt.Println(err.Error())
  1874. return
  1875. }
  1876. // Pretty-print the response data.
  1877. fmt.Println(resp)
  1878. }
  1879. func ExampleAPIGateway_UpdateDomainName() {
  1880. sess, err := session.NewSession()
  1881. if err != nil {
  1882. fmt.Println("failed to create session,", err)
  1883. return
  1884. }
  1885. svc := apigateway.New(sess)
  1886. params := &apigateway.UpdateDomainNameInput{
  1887. DomainName: aws.String("String"), // Required
  1888. PatchOperations: []*apigateway.PatchOperation{
  1889. { // Required
  1890. From: aws.String("String"),
  1891. Op: aws.String("Op"),
  1892. Path: aws.String("String"),
  1893. Value: aws.String("String"),
  1894. },
  1895. // More values...
  1896. },
  1897. }
  1898. resp, err := svc.UpdateDomainName(params)
  1899. if err != nil {
  1900. // Print the error, cast err to awserr.Error to get the Code and
  1901. // Message from an error.
  1902. fmt.Println(err.Error())
  1903. return
  1904. }
  1905. // Pretty-print the response data.
  1906. fmt.Println(resp)
  1907. }
  1908. func ExampleAPIGateway_UpdateIntegration() {
  1909. sess, err := session.NewSession()
  1910. if err != nil {
  1911. fmt.Println("failed to create session,", err)
  1912. return
  1913. }
  1914. svc := apigateway.New(sess)
  1915. params := &apigateway.UpdateIntegrationInput{
  1916. HttpMethod: aws.String("String"), // Required
  1917. ResourceId: aws.String("String"), // Required
  1918. RestApiId: aws.String("String"), // Required
  1919. PatchOperations: []*apigateway.PatchOperation{
  1920. { // Required
  1921. From: aws.String("String"),
  1922. Op: aws.String("Op"),
  1923. Path: aws.String("String"),
  1924. Value: aws.String("String"),
  1925. },
  1926. // More values...
  1927. },
  1928. }
  1929. resp, err := svc.UpdateIntegration(params)
  1930. if err != nil {
  1931. // Print the error, cast err to awserr.Error to get the Code and
  1932. // Message from an error.
  1933. fmt.Println(err.Error())
  1934. return
  1935. }
  1936. // Pretty-print the response data.
  1937. fmt.Println(resp)
  1938. }
  1939. func ExampleAPIGateway_UpdateIntegrationResponse() {
  1940. sess, err := session.NewSession()
  1941. if err != nil {
  1942. fmt.Println("failed to create session,", err)
  1943. return
  1944. }
  1945. svc := apigateway.New(sess)
  1946. params := &apigateway.UpdateIntegrationResponseInput{
  1947. HttpMethod: aws.String("String"), // Required
  1948. ResourceId: aws.String("String"), // Required
  1949. RestApiId: aws.String("String"), // Required
  1950. StatusCode: aws.String("StatusCode"), // Required
  1951. PatchOperations: []*apigateway.PatchOperation{
  1952. { // Required
  1953. From: aws.String("String"),
  1954. Op: aws.String("Op"),
  1955. Path: aws.String("String"),
  1956. Value: aws.String("String"),
  1957. },
  1958. // More values...
  1959. },
  1960. }
  1961. resp, err := svc.UpdateIntegrationResponse(params)
  1962. if err != nil {
  1963. // Print the error, cast err to awserr.Error to get the Code and
  1964. // Message from an error.
  1965. fmt.Println(err.Error())
  1966. return
  1967. }
  1968. // Pretty-print the response data.
  1969. fmt.Println(resp)
  1970. }
  1971. func ExampleAPIGateway_UpdateMethod() {
  1972. sess, err := session.NewSession()
  1973. if err != nil {
  1974. fmt.Println("failed to create session,", err)
  1975. return
  1976. }
  1977. svc := apigateway.New(sess)
  1978. params := &apigateway.UpdateMethodInput{
  1979. HttpMethod: aws.String("String"), // Required
  1980. ResourceId: aws.String("String"), // Required
  1981. RestApiId: aws.String("String"), // Required
  1982. PatchOperations: []*apigateway.PatchOperation{
  1983. { // Required
  1984. From: aws.String("String"),
  1985. Op: aws.String("Op"),
  1986. Path: aws.String("String"),
  1987. Value: aws.String("String"),
  1988. },
  1989. // More values...
  1990. },
  1991. }
  1992. resp, err := svc.UpdateMethod(params)
  1993. if err != nil {
  1994. // Print the error, cast err to awserr.Error to get the Code and
  1995. // Message from an error.
  1996. fmt.Println(err.Error())
  1997. return
  1998. }
  1999. // Pretty-print the response data.
  2000. fmt.Println(resp)
  2001. }
  2002. func ExampleAPIGateway_UpdateMethodResponse() {
  2003. sess, err := session.NewSession()
  2004. if err != nil {
  2005. fmt.Println("failed to create session,", err)
  2006. return
  2007. }
  2008. svc := apigateway.New(sess)
  2009. params := &apigateway.UpdateMethodResponseInput{
  2010. HttpMethod: aws.String("String"), // Required
  2011. ResourceId: aws.String("String"), // Required
  2012. RestApiId: aws.String("String"), // Required
  2013. StatusCode: aws.String("StatusCode"), // Required
  2014. PatchOperations: []*apigateway.PatchOperation{
  2015. { // Required
  2016. From: aws.String("String"),
  2017. Op: aws.String("Op"),
  2018. Path: aws.String("String"),
  2019. Value: aws.String("String"),
  2020. },
  2021. // More values...
  2022. },
  2023. }
  2024. resp, err := svc.UpdateMethodResponse(params)
  2025. if err != nil {
  2026. // Print the error, cast err to awserr.Error to get the Code and
  2027. // Message from an error.
  2028. fmt.Println(err.Error())
  2029. return
  2030. }
  2031. // Pretty-print the response data.
  2032. fmt.Println(resp)
  2033. }
  2034. func ExampleAPIGateway_UpdateModel() {
  2035. sess, err := session.NewSession()
  2036. if err != nil {
  2037. fmt.Println("failed to create session,", err)
  2038. return
  2039. }
  2040. svc := apigateway.New(sess)
  2041. params := &apigateway.UpdateModelInput{
  2042. ModelName: aws.String("String"), // Required
  2043. RestApiId: aws.String("String"), // Required
  2044. PatchOperations: []*apigateway.PatchOperation{
  2045. { // Required
  2046. From: aws.String("String"),
  2047. Op: aws.String("Op"),
  2048. Path: aws.String("String"),
  2049. Value: aws.String("String"),
  2050. },
  2051. // More values...
  2052. },
  2053. }
  2054. resp, err := svc.UpdateModel(params)
  2055. if err != nil {
  2056. // Print the error, cast err to awserr.Error to get the Code and
  2057. // Message from an error.
  2058. fmt.Println(err.Error())
  2059. return
  2060. }
  2061. // Pretty-print the response data.
  2062. fmt.Println(resp)
  2063. }
  2064. func ExampleAPIGateway_UpdateResource() {
  2065. sess, err := session.NewSession()
  2066. if err != nil {
  2067. fmt.Println("failed to create session,", err)
  2068. return
  2069. }
  2070. svc := apigateway.New(sess)
  2071. params := &apigateway.UpdateResourceInput{
  2072. ResourceId: aws.String("String"), // Required
  2073. RestApiId: aws.String("String"), // Required
  2074. PatchOperations: []*apigateway.PatchOperation{
  2075. { // Required
  2076. From: aws.String("String"),
  2077. Op: aws.String("Op"),
  2078. Path: aws.String("String"),
  2079. Value: aws.String("String"),
  2080. },
  2081. // More values...
  2082. },
  2083. }
  2084. resp, err := svc.UpdateResource(params)
  2085. if err != nil {
  2086. // Print the error, cast err to awserr.Error to get the Code and
  2087. // Message from an error.
  2088. fmt.Println(err.Error())
  2089. return
  2090. }
  2091. // Pretty-print the response data.
  2092. fmt.Println(resp)
  2093. }
  2094. func ExampleAPIGateway_UpdateRestApi() {
  2095. sess, err := session.NewSession()
  2096. if err != nil {
  2097. fmt.Println("failed to create session,", err)
  2098. return
  2099. }
  2100. svc := apigateway.New(sess)
  2101. params := &apigateway.UpdateRestApiInput{
  2102. RestApiId: aws.String("String"), // Required
  2103. PatchOperations: []*apigateway.PatchOperation{
  2104. { // Required
  2105. From: aws.String("String"),
  2106. Op: aws.String("Op"),
  2107. Path: aws.String("String"),
  2108. Value: aws.String("String"),
  2109. },
  2110. // More values...
  2111. },
  2112. }
  2113. resp, err := svc.UpdateRestApi(params)
  2114. if err != nil {
  2115. // Print the error, cast err to awserr.Error to get the Code and
  2116. // Message from an error.
  2117. fmt.Println(err.Error())
  2118. return
  2119. }
  2120. // Pretty-print the response data.
  2121. fmt.Println(resp)
  2122. }
  2123. func ExampleAPIGateway_UpdateStage() {
  2124. sess, err := session.NewSession()
  2125. if err != nil {
  2126. fmt.Println("failed to create session,", err)
  2127. return
  2128. }
  2129. svc := apigateway.New(sess)
  2130. params := &apigateway.UpdateStageInput{
  2131. RestApiId: aws.String("String"), // Required
  2132. StageName: aws.String("String"), // Required
  2133. PatchOperations: []*apigateway.PatchOperation{
  2134. { // Required
  2135. From: aws.String("String"),
  2136. Op: aws.String("Op"),
  2137. Path: aws.String("String"),
  2138. Value: aws.String("String"),
  2139. },
  2140. // More values...
  2141. },
  2142. }
  2143. resp, err := svc.UpdateStage(params)
  2144. if err != nil {
  2145. // Print the error, cast err to awserr.Error to get the Code and
  2146. // Message from an error.
  2147. fmt.Println(err.Error())
  2148. return
  2149. }
  2150. // Pretty-print the response data.
  2151. fmt.Println(resp)
  2152. }
  2153. func ExampleAPIGateway_UpdateUsage() {
  2154. sess, err := session.NewSession()
  2155. if err != nil {
  2156. fmt.Println("failed to create session,", err)
  2157. return
  2158. }
  2159. svc := apigateway.New(sess)
  2160. params := &apigateway.UpdateUsageInput{
  2161. KeyId: aws.String("String"), // Required
  2162. UsagePlanId: aws.String("String"), // Required
  2163. PatchOperations: []*apigateway.PatchOperation{
  2164. { // Required
  2165. From: aws.String("String"),
  2166. Op: aws.String("Op"),
  2167. Path: aws.String("String"),
  2168. Value: aws.String("String"),
  2169. },
  2170. // More values...
  2171. },
  2172. }
  2173. resp, err := svc.UpdateUsage(params)
  2174. if err != nil {
  2175. // Print the error, cast err to awserr.Error to get the Code and
  2176. // Message from an error.
  2177. fmt.Println(err.Error())
  2178. return
  2179. }
  2180. // Pretty-print the response data.
  2181. fmt.Println(resp)
  2182. }
  2183. func ExampleAPIGateway_UpdateUsagePlan() {
  2184. sess, err := session.NewSession()
  2185. if err != nil {
  2186. fmt.Println("failed to create session,", err)
  2187. return
  2188. }
  2189. svc := apigateway.New(sess)
  2190. params := &apigateway.UpdateUsagePlanInput{
  2191. UsagePlanId: aws.String("String"), // Required
  2192. PatchOperations: []*apigateway.PatchOperation{
  2193. { // Required
  2194. From: aws.String("String"),
  2195. Op: aws.String("Op"),
  2196. Path: aws.String("String"),
  2197. Value: aws.String("String"),
  2198. },
  2199. // More values...
  2200. },
  2201. }
  2202. resp, err := svc.UpdateUsagePlan(params)
  2203. if err != nil {
  2204. // Print the error, cast err to awserr.Error to get the Code and
  2205. // Message from an error.
  2206. fmt.Println(err.Error())
  2207. return
  2208. }
  2209. // Pretty-print the response data.
  2210. fmt.Println(resp)
  2211. }