examples_test.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package cloudsearch_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/cloudsearch"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleCloudSearch_BuildSuggesters() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := cloudsearch.New(sess)
  20. params := &cloudsearch.BuildSuggestersInput{
  21. DomainName: aws.String("DomainName"), // Required
  22. }
  23. resp, err := svc.BuildSuggesters(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 ExampleCloudSearch_CreateDomain() {
  34. sess, err := session.NewSession()
  35. if err != nil {
  36. fmt.Println("failed to create session,", err)
  37. return
  38. }
  39. svc := cloudsearch.New(sess)
  40. params := &cloudsearch.CreateDomainInput{
  41. DomainName: aws.String("DomainName"), // Required
  42. }
  43. resp, err := svc.CreateDomain(params)
  44. if err != nil {
  45. // Print the error, cast err to awserr.Error to get the Code and
  46. // Message from an error.
  47. fmt.Println(err.Error())
  48. return
  49. }
  50. // Pretty-print the response data.
  51. fmt.Println(resp)
  52. }
  53. func ExampleCloudSearch_DefineAnalysisScheme() {
  54. sess, err := session.NewSession()
  55. if err != nil {
  56. fmt.Println("failed to create session,", err)
  57. return
  58. }
  59. svc := cloudsearch.New(sess)
  60. params := &cloudsearch.DefineAnalysisSchemeInput{
  61. AnalysisScheme: &cloudsearch.AnalysisScheme{ // Required
  62. AnalysisSchemeLanguage: aws.String("AnalysisSchemeLanguage"), // Required
  63. AnalysisSchemeName: aws.String("StandardName"), // Required
  64. AnalysisOptions: &cloudsearch.AnalysisOptions{
  65. AlgorithmicStemming: aws.String("AlgorithmicStemming"),
  66. JapaneseTokenizationDictionary: aws.String("String"),
  67. StemmingDictionary: aws.String("String"),
  68. Stopwords: aws.String("String"),
  69. Synonyms: aws.String("String"),
  70. },
  71. },
  72. DomainName: aws.String("DomainName"), // Required
  73. }
  74. resp, err := svc.DefineAnalysisScheme(params)
  75. if err != nil {
  76. // Print the error, cast err to awserr.Error to get the Code and
  77. // Message from an error.
  78. fmt.Println(err.Error())
  79. return
  80. }
  81. // Pretty-print the response data.
  82. fmt.Println(resp)
  83. }
  84. func ExampleCloudSearch_DefineExpression() {
  85. sess, err := session.NewSession()
  86. if err != nil {
  87. fmt.Println("failed to create session,", err)
  88. return
  89. }
  90. svc := cloudsearch.New(sess)
  91. params := &cloudsearch.DefineExpressionInput{
  92. DomainName: aws.String("DomainName"), // Required
  93. Expression: &cloudsearch.Expression{ // Required
  94. ExpressionName: aws.String("StandardName"), // Required
  95. ExpressionValue: aws.String("ExpressionValue"), // Required
  96. },
  97. }
  98. resp, err := svc.DefineExpression(params)
  99. if err != nil {
  100. // Print the error, cast err to awserr.Error to get the Code and
  101. // Message from an error.
  102. fmt.Println(err.Error())
  103. return
  104. }
  105. // Pretty-print the response data.
  106. fmt.Println(resp)
  107. }
  108. func ExampleCloudSearch_DefineIndexField() {
  109. sess, err := session.NewSession()
  110. if err != nil {
  111. fmt.Println("failed to create session,", err)
  112. return
  113. }
  114. svc := cloudsearch.New(sess)
  115. params := &cloudsearch.DefineIndexFieldInput{
  116. DomainName: aws.String("DomainName"), // Required
  117. IndexField: &cloudsearch.IndexField{ // Required
  118. IndexFieldName: aws.String("DynamicFieldName"), // Required
  119. IndexFieldType: aws.String("IndexFieldType"), // Required
  120. DateArrayOptions: &cloudsearch.DateArrayOptions{
  121. DefaultValue: aws.String("FieldValue"),
  122. FacetEnabled: aws.Bool(true),
  123. ReturnEnabled: aws.Bool(true),
  124. SearchEnabled: aws.Bool(true),
  125. SourceFields: aws.String("FieldNameCommaList"),
  126. },
  127. DateOptions: &cloudsearch.DateOptions{
  128. DefaultValue: aws.String("FieldValue"),
  129. FacetEnabled: aws.Bool(true),
  130. ReturnEnabled: aws.Bool(true),
  131. SearchEnabled: aws.Bool(true),
  132. SortEnabled: aws.Bool(true),
  133. SourceField: aws.String("FieldName"),
  134. },
  135. DoubleArrayOptions: &cloudsearch.DoubleArrayOptions{
  136. DefaultValue: aws.Float64(1.0),
  137. FacetEnabled: aws.Bool(true),
  138. ReturnEnabled: aws.Bool(true),
  139. SearchEnabled: aws.Bool(true),
  140. SourceFields: aws.String("FieldNameCommaList"),
  141. },
  142. DoubleOptions: &cloudsearch.DoubleOptions{
  143. DefaultValue: aws.Float64(1.0),
  144. FacetEnabled: aws.Bool(true),
  145. ReturnEnabled: aws.Bool(true),
  146. SearchEnabled: aws.Bool(true),
  147. SortEnabled: aws.Bool(true),
  148. SourceField: aws.String("FieldName"),
  149. },
  150. IntArrayOptions: &cloudsearch.IntArrayOptions{
  151. DefaultValue: aws.Int64(1),
  152. FacetEnabled: aws.Bool(true),
  153. ReturnEnabled: aws.Bool(true),
  154. SearchEnabled: aws.Bool(true),
  155. SourceFields: aws.String("FieldNameCommaList"),
  156. },
  157. IntOptions: &cloudsearch.IntOptions{
  158. DefaultValue: aws.Int64(1),
  159. FacetEnabled: aws.Bool(true),
  160. ReturnEnabled: aws.Bool(true),
  161. SearchEnabled: aws.Bool(true),
  162. SortEnabled: aws.Bool(true),
  163. SourceField: aws.String("FieldName"),
  164. },
  165. LatLonOptions: &cloudsearch.LatLonOptions{
  166. DefaultValue: aws.String("FieldValue"),
  167. FacetEnabled: aws.Bool(true),
  168. ReturnEnabled: aws.Bool(true),
  169. SearchEnabled: aws.Bool(true),
  170. SortEnabled: aws.Bool(true),
  171. SourceField: aws.String("FieldName"),
  172. },
  173. LiteralArrayOptions: &cloudsearch.LiteralArrayOptions{
  174. DefaultValue: aws.String("FieldValue"),
  175. FacetEnabled: aws.Bool(true),
  176. ReturnEnabled: aws.Bool(true),
  177. SearchEnabled: aws.Bool(true),
  178. SourceFields: aws.String("FieldNameCommaList"),
  179. },
  180. LiteralOptions: &cloudsearch.LiteralOptions{
  181. DefaultValue: aws.String("FieldValue"),
  182. FacetEnabled: aws.Bool(true),
  183. ReturnEnabled: aws.Bool(true),
  184. SearchEnabled: aws.Bool(true),
  185. SortEnabled: aws.Bool(true),
  186. SourceField: aws.String("FieldName"),
  187. },
  188. TextArrayOptions: &cloudsearch.TextArrayOptions{
  189. AnalysisScheme: aws.String("Word"),
  190. DefaultValue: aws.String("FieldValue"),
  191. HighlightEnabled: aws.Bool(true),
  192. ReturnEnabled: aws.Bool(true),
  193. SourceFields: aws.String("FieldNameCommaList"),
  194. },
  195. TextOptions: &cloudsearch.TextOptions{
  196. AnalysisScheme: aws.String("Word"),
  197. DefaultValue: aws.String("FieldValue"),
  198. HighlightEnabled: aws.Bool(true),
  199. ReturnEnabled: aws.Bool(true),
  200. SortEnabled: aws.Bool(true),
  201. SourceField: aws.String("FieldName"),
  202. },
  203. },
  204. }
  205. resp, err := svc.DefineIndexField(params)
  206. if err != nil {
  207. // Print the error, cast err to awserr.Error to get the Code and
  208. // Message from an error.
  209. fmt.Println(err.Error())
  210. return
  211. }
  212. // Pretty-print the response data.
  213. fmt.Println(resp)
  214. }
  215. func ExampleCloudSearch_DefineSuggester() {
  216. sess, err := session.NewSession()
  217. if err != nil {
  218. fmt.Println("failed to create session,", err)
  219. return
  220. }
  221. svc := cloudsearch.New(sess)
  222. params := &cloudsearch.DefineSuggesterInput{
  223. DomainName: aws.String("DomainName"), // Required
  224. Suggester: &cloudsearch.Suggester{ // Required
  225. DocumentSuggesterOptions: &cloudsearch.DocumentSuggesterOptions{ // Required
  226. SourceField: aws.String("FieldName"), // Required
  227. FuzzyMatching: aws.String("SuggesterFuzzyMatching"),
  228. SortExpression: aws.String("String"),
  229. },
  230. SuggesterName: aws.String("StandardName"), // Required
  231. },
  232. }
  233. resp, err := svc.DefineSuggester(params)
  234. if err != nil {
  235. // Print the error, cast err to awserr.Error to get the Code and
  236. // Message from an error.
  237. fmt.Println(err.Error())
  238. return
  239. }
  240. // Pretty-print the response data.
  241. fmt.Println(resp)
  242. }
  243. func ExampleCloudSearch_DeleteAnalysisScheme() {
  244. sess, err := session.NewSession()
  245. if err != nil {
  246. fmt.Println("failed to create session,", err)
  247. return
  248. }
  249. svc := cloudsearch.New(sess)
  250. params := &cloudsearch.DeleteAnalysisSchemeInput{
  251. AnalysisSchemeName: aws.String("StandardName"), // Required
  252. DomainName: aws.String("DomainName"), // Required
  253. }
  254. resp, err := svc.DeleteAnalysisScheme(params)
  255. if err != nil {
  256. // Print the error, cast err to awserr.Error to get the Code and
  257. // Message from an error.
  258. fmt.Println(err.Error())
  259. return
  260. }
  261. // Pretty-print the response data.
  262. fmt.Println(resp)
  263. }
  264. func ExampleCloudSearch_DeleteDomain() {
  265. sess, err := session.NewSession()
  266. if err != nil {
  267. fmt.Println("failed to create session,", err)
  268. return
  269. }
  270. svc := cloudsearch.New(sess)
  271. params := &cloudsearch.DeleteDomainInput{
  272. DomainName: aws.String("DomainName"), // Required
  273. }
  274. resp, err := svc.DeleteDomain(params)
  275. if err != nil {
  276. // Print the error, cast err to awserr.Error to get the Code and
  277. // Message from an error.
  278. fmt.Println(err.Error())
  279. return
  280. }
  281. // Pretty-print the response data.
  282. fmt.Println(resp)
  283. }
  284. func ExampleCloudSearch_DeleteExpression() {
  285. sess, err := session.NewSession()
  286. if err != nil {
  287. fmt.Println("failed to create session,", err)
  288. return
  289. }
  290. svc := cloudsearch.New(sess)
  291. params := &cloudsearch.DeleteExpressionInput{
  292. DomainName: aws.String("DomainName"), // Required
  293. ExpressionName: aws.String("StandardName"), // Required
  294. }
  295. resp, err := svc.DeleteExpression(params)
  296. if err != nil {
  297. // Print the error, cast err to awserr.Error to get the Code and
  298. // Message from an error.
  299. fmt.Println(err.Error())
  300. return
  301. }
  302. // Pretty-print the response data.
  303. fmt.Println(resp)
  304. }
  305. func ExampleCloudSearch_DeleteIndexField() {
  306. sess, err := session.NewSession()
  307. if err != nil {
  308. fmt.Println("failed to create session,", err)
  309. return
  310. }
  311. svc := cloudsearch.New(sess)
  312. params := &cloudsearch.DeleteIndexFieldInput{
  313. DomainName: aws.String("DomainName"), // Required
  314. IndexFieldName: aws.String("DynamicFieldName"), // Required
  315. }
  316. resp, err := svc.DeleteIndexField(params)
  317. if err != nil {
  318. // Print the error, cast err to awserr.Error to get the Code and
  319. // Message from an error.
  320. fmt.Println(err.Error())
  321. return
  322. }
  323. // Pretty-print the response data.
  324. fmt.Println(resp)
  325. }
  326. func ExampleCloudSearch_DeleteSuggester() {
  327. sess, err := session.NewSession()
  328. if err != nil {
  329. fmt.Println("failed to create session,", err)
  330. return
  331. }
  332. svc := cloudsearch.New(sess)
  333. params := &cloudsearch.DeleteSuggesterInput{
  334. DomainName: aws.String("DomainName"), // Required
  335. SuggesterName: aws.String("StandardName"), // Required
  336. }
  337. resp, err := svc.DeleteSuggester(params)
  338. if err != nil {
  339. // Print the error, cast err to awserr.Error to get the Code and
  340. // Message from an error.
  341. fmt.Println(err.Error())
  342. return
  343. }
  344. // Pretty-print the response data.
  345. fmt.Println(resp)
  346. }
  347. func ExampleCloudSearch_DescribeAnalysisSchemes() {
  348. sess, err := session.NewSession()
  349. if err != nil {
  350. fmt.Println("failed to create session,", err)
  351. return
  352. }
  353. svc := cloudsearch.New(sess)
  354. params := &cloudsearch.DescribeAnalysisSchemesInput{
  355. DomainName: aws.String("DomainName"), // Required
  356. AnalysisSchemeNames: []*string{
  357. aws.String("StandardName"), // Required
  358. // More values...
  359. },
  360. Deployed: aws.Bool(true),
  361. }
  362. resp, err := svc.DescribeAnalysisSchemes(params)
  363. if err != nil {
  364. // Print the error, cast err to awserr.Error to get the Code and
  365. // Message from an error.
  366. fmt.Println(err.Error())
  367. return
  368. }
  369. // Pretty-print the response data.
  370. fmt.Println(resp)
  371. }
  372. func ExampleCloudSearch_DescribeAvailabilityOptions() {
  373. sess, err := session.NewSession()
  374. if err != nil {
  375. fmt.Println("failed to create session,", err)
  376. return
  377. }
  378. svc := cloudsearch.New(sess)
  379. params := &cloudsearch.DescribeAvailabilityOptionsInput{
  380. DomainName: aws.String("DomainName"), // Required
  381. Deployed: aws.Bool(true),
  382. }
  383. resp, err := svc.DescribeAvailabilityOptions(params)
  384. if err != nil {
  385. // Print the error, cast err to awserr.Error to get the Code and
  386. // Message from an error.
  387. fmt.Println(err.Error())
  388. return
  389. }
  390. // Pretty-print the response data.
  391. fmt.Println(resp)
  392. }
  393. func ExampleCloudSearch_DescribeDomains() {
  394. sess, err := session.NewSession()
  395. if err != nil {
  396. fmt.Println("failed to create session,", err)
  397. return
  398. }
  399. svc := cloudsearch.New(sess)
  400. params := &cloudsearch.DescribeDomainsInput{
  401. DomainNames: []*string{
  402. aws.String("DomainName"), // Required
  403. // More values...
  404. },
  405. }
  406. resp, err := svc.DescribeDomains(params)
  407. if err != nil {
  408. // Print the error, cast err to awserr.Error to get the Code and
  409. // Message from an error.
  410. fmt.Println(err.Error())
  411. return
  412. }
  413. // Pretty-print the response data.
  414. fmt.Println(resp)
  415. }
  416. func ExampleCloudSearch_DescribeExpressions() {
  417. sess, err := session.NewSession()
  418. if err != nil {
  419. fmt.Println("failed to create session,", err)
  420. return
  421. }
  422. svc := cloudsearch.New(sess)
  423. params := &cloudsearch.DescribeExpressionsInput{
  424. DomainName: aws.String("DomainName"), // Required
  425. Deployed: aws.Bool(true),
  426. ExpressionNames: []*string{
  427. aws.String("StandardName"), // Required
  428. // More values...
  429. },
  430. }
  431. resp, err := svc.DescribeExpressions(params)
  432. if err != nil {
  433. // Print the error, cast err to awserr.Error to get the Code and
  434. // Message from an error.
  435. fmt.Println(err.Error())
  436. return
  437. }
  438. // Pretty-print the response data.
  439. fmt.Println(resp)
  440. }
  441. func ExampleCloudSearch_DescribeIndexFields() {
  442. sess, err := session.NewSession()
  443. if err != nil {
  444. fmt.Println("failed to create session,", err)
  445. return
  446. }
  447. svc := cloudsearch.New(sess)
  448. params := &cloudsearch.DescribeIndexFieldsInput{
  449. DomainName: aws.String("DomainName"), // Required
  450. Deployed: aws.Bool(true),
  451. FieldNames: []*string{
  452. aws.String("DynamicFieldName"), // Required
  453. // More values...
  454. },
  455. }
  456. resp, err := svc.DescribeIndexFields(params)
  457. if err != nil {
  458. // Print the error, cast err to awserr.Error to get the Code and
  459. // Message from an error.
  460. fmt.Println(err.Error())
  461. return
  462. }
  463. // Pretty-print the response data.
  464. fmt.Println(resp)
  465. }
  466. func ExampleCloudSearch_DescribeScalingParameters() {
  467. sess, err := session.NewSession()
  468. if err != nil {
  469. fmt.Println("failed to create session,", err)
  470. return
  471. }
  472. svc := cloudsearch.New(sess)
  473. params := &cloudsearch.DescribeScalingParametersInput{
  474. DomainName: aws.String("DomainName"), // Required
  475. }
  476. resp, err := svc.DescribeScalingParameters(params)
  477. if err != nil {
  478. // Print the error, cast err to awserr.Error to get the Code and
  479. // Message from an error.
  480. fmt.Println(err.Error())
  481. return
  482. }
  483. // Pretty-print the response data.
  484. fmt.Println(resp)
  485. }
  486. func ExampleCloudSearch_DescribeServiceAccessPolicies() {
  487. sess, err := session.NewSession()
  488. if err != nil {
  489. fmt.Println("failed to create session,", err)
  490. return
  491. }
  492. svc := cloudsearch.New(sess)
  493. params := &cloudsearch.DescribeServiceAccessPoliciesInput{
  494. DomainName: aws.String("DomainName"), // Required
  495. Deployed: aws.Bool(true),
  496. }
  497. resp, err := svc.DescribeServiceAccessPolicies(params)
  498. if err != nil {
  499. // Print the error, cast err to awserr.Error to get the Code and
  500. // Message from an error.
  501. fmt.Println(err.Error())
  502. return
  503. }
  504. // Pretty-print the response data.
  505. fmt.Println(resp)
  506. }
  507. func ExampleCloudSearch_DescribeSuggesters() {
  508. sess, err := session.NewSession()
  509. if err != nil {
  510. fmt.Println("failed to create session,", err)
  511. return
  512. }
  513. svc := cloudsearch.New(sess)
  514. params := &cloudsearch.DescribeSuggestersInput{
  515. DomainName: aws.String("DomainName"), // Required
  516. Deployed: aws.Bool(true),
  517. SuggesterNames: []*string{
  518. aws.String("StandardName"), // Required
  519. // More values...
  520. },
  521. }
  522. resp, err := svc.DescribeSuggesters(params)
  523. if err != nil {
  524. // Print the error, cast err to awserr.Error to get the Code and
  525. // Message from an error.
  526. fmt.Println(err.Error())
  527. return
  528. }
  529. // Pretty-print the response data.
  530. fmt.Println(resp)
  531. }
  532. func ExampleCloudSearch_IndexDocuments() {
  533. sess, err := session.NewSession()
  534. if err != nil {
  535. fmt.Println("failed to create session,", err)
  536. return
  537. }
  538. svc := cloudsearch.New(sess)
  539. params := &cloudsearch.IndexDocumentsInput{
  540. DomainName: aws.String("DomainName"), // Required
  541. }
  542. resp, err := svc.IndexDocuments(params)
  543. if err != nil {
  544. // Print the error, cast err to awserr.Error to get the Code and
  545. // Message from an error.
  546. fmt.Println(err.Error())
  547. return
  548. }
  549. // Pretty-print the response data.
  550. fmt.Println(resp)
  551. }
  552. func ExampleCloudSearch_ListDomainNames() {
  553. sess, err := session.NewSession()
  554. if err != nil {
  555. fmt.Println("failed to create session,", err)
  556. return
  557. }
  558. svc := cloudsearch.New(sess)
  559. var params *cloudsearch.ListDomainNamesInput
  560. resp, err := svc.ListDomainNames(params)
  561. if err != nil {
  562. // Print the error, cast err to awserr.Error to get the Code and
  563. // Message from an error.
  564. fmt.Println(err.Error())
  565. return
  566. }
  567. // Pretty-print the response data.
  568. fmt.Println(resp)
  569. }
  570. func ExampleCloudSearch_UpdateAvailabilityOptions() {
  571. sess, err := session.NewSession()
  572. if err != nil {
  573. fmt.Println("failed to create session,", err)
  574. return
  575. }
  576. svc := cloudsearch.New(sess)
  577. params := &cloudsearch.UpdateAvailabilityOptionsInput{
  578. DomainName: aws.String("DomainName"), // Required
  579. MultiAZ: aws.Bool(true), // Required
  580. }
  581. resp, err := svc.UpdateAvailabilityOptions(params)
  582. if err != nil {
  583. // Print the error, cast err to awserr.Error to get the Code and
  584. // Message from an error.
  585. fmt.Println(err.Error())
  586. return
  587. }
  588. // Pretty-print the response data.
  589. fmt.Println(resp)
  590. }
  591. func ExampleCloudSearch_UpdateScalingParameters() {
  592. sess, err := session.NewSession()
  593. if err != nil {
  594. fmt.Println("failed to create session,", err)
  595. return
  596. }
  597. svc := cloudsearch.New(sess)
  598. params := &cloudsearch.UpdateScalingParametersInput{
  599. DomainName: aws.String("DomainName"), // Required
  600. ScalingParameters: &cloudsearch.ScalingParameters{ // Required
  601. DesiredInstanceType: aws.String("PartitionInstanceType"),
  602. DesiredPartitionCount: aws.Int64(1),
  603. DesiredReplicationCount: aws.Int64(1),
  604. },
  605. }
  606. resp, err := svc.UpdateScalingParameters(params)
  607. if err != nil {
  608. // Print the error, cast err to awserr.Error to get the Code and
  609. // Message from an error.
  610. fmt.Println(err.Error())
  611. return
  612. }
  613. // Pretty-print the response data.
  614. fmt.Println(resp)
  615. }
  616. func ExampleCloudSearch_UpdateServiceAccessPolicies() {
  617. sess, err := session.NewSession()
  618. if err != nil {
  619. fmt.Println("failed to create session,", err)
  620. return
  621. }
  622. svc := cloudsearch.New(sess)
  623. params := &cloudsearch.UpdateServiceAccessPoliciesInput{
  624. AccessPolicies: aws.String("PolicyDocument"), // Required
  625. DomainName: aws.String("DomainName"), // Required
  626. }
  627. resp, err := svc.UpdateServiceAccessPolicies(params)
  628. if err != nil {
  629. // Print the error, cast err to awserr.Error to get the Code and
  630. // Message from an error.
  631. fmt.Println(err.Error())
  632. return
  633. }
  634. // Pretty-print the response data.
  635. fmt.Println(resp)
  636. }