api.go 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package simpledb
  3. import (
  4. "fmt"
  5. "github.com/aws/aws-sdk-go/aws"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/private/protocol"
  9. "github.com/aws/aws-sdk-go/private/protocol/query"
  10. )
  11. const opBatchDeleteAttributes = "BatchDeleteAttributes"
  12. // BatchDeleteAttributesRequest generates a "aws/request.Request" representing the
  13. // client's request for the BatchDeleteAttributes operation. The "output" return
  14. // value will be populated with the request's response once the request completes
  15. // successfully.
  16. //
  17. // Use "Send" method on the returned Request to send the API call to the service.
  18. // the "output" return value is not valid until after Send returns without error.
  19. //
  20. // See BatchDeleteAttributes for more information on using the BatchDeleteAttributes
  21. // API call, and error handling.
  22. //
  23. // This method is useful when you want to inject custom logic or configuration
  24. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  25. //
  26. //
  27. // // Example sending a request using the BatchDeleteAttributesRequest method.
  28. // req, resp := client.BatchDeleteAttributesRequest(params)
  29. //
  30. // err := req.Send()
  31. // if err == nil { // resp is now filled
  32. // fmt.Println(resp)
  33. // }
  34. func (c *SimpleDB) BatchDeleteAttributesRequest(input *BatchDeleteAttributesInput) (req *request.Request, output *BatchDeleteAttributesOutput) {
  35. op := &request.Operation{
  36. Name: opBatchDeleteAttributes,
  37. HTTPMethod: "POST",
  38. HTTPPath: "/",
  39. }
  40. if input == nil {
  41. input = &BatchDeleteAttributesInput{}
  42. }
  43. output = &BatchDeleteAttributesOutput{}
  44. req = c.newRequest(op, input, output)
  45. req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  46. return
  47. }
  48. // BatchDeleteAttributes API operation for Amazon SimpleDB.
  49. //
  50. // Performs multiple DeleteAttributes operations in a single call, which reduces
  51. // round trips and latencies. This enables Amazon SimpleDB to optimize requests,
  52. // which generally yields better throughput.
  53. //
  54. // If you specify BatchDeleteAttributes without attributes or values, all the
  55. // attributes for the item are deleted.
  56. //
  57. // BatchDeleteAttributes is an idempotent operation; running it multiple times
  58. // on the same item or attribute doesn't result in an error.
  59. //
  60. // The BatchDeleteAttributes operation succeeds or fails in its entirety. There
  61. // are no partial deletes. You can execute multiple BatchDeleteAttributes operations
  62. // and other operations in parallel. However, large numbers of concurrent BatchDeleteAttributes
  63. // calls can result in Service Unavailable (503) responses.
  64. //
  65. // This operation is vulnerable to exceeding the maximum URL size when making
  66. // a REST request using the HTTP GET method.
  67. //
  68. // This operation does not support conditions using Expected.X.Name, Expected.X.Value,
  69. // or Expected.X.Exists.
  70. //
  71. // The following limitations are enforced for this operation: 1 MB request size
  72. //
  73. // 25 item limit per BatchDeleteAttributes operation
  74. //
  75. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  76. // with awserr.Error's Code and Message methods to get detailed information about
  77. // the error.
  78. //
  79. // See the AWS API reference guide for Amazon SimpleDB's
  80. // API operation BatchDeleteAttributes for usage and error information.
  81. func (c *SimpleDB) BatchDeleteAttributes(input *BatchDeleteAttributesInput) (*BatchDeleteAttributesOutput, error) {
  82. req, out := c.BatchDeleteAttributesRequest(input)
  83. return out, req.Send()
  84. }
  85. // BatchDeleteAttributesWithContext is the same as BatchDeleteAttributes with the addition of
  86. // the ability to pass a context and additional request options.
  87. //
  88. // See BatchDeleteAttributes for details on how to use this API operation.
  89. //
  90. // The context must be non-nil and will be used for request cancellation. If
  91. // the context is nil a panic will occur. In the future the SDK may create
  92. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  93. // for more information on using Contexts.
  94. func (c *SimpleDB) BatchDeleteAttributesWithContext(ctx aws.Context, input *BatchDeleteAttributesInput, opts ...request.Option) (*BatchDeleteAttributesOutput, error) {
  95. req, out := c.BatchDeleteAttributesRequest(input)
  96. req.SetContext(ctx)
  97. req.ApplyOptions(opts...)
  98. return out, req.Send()
  99. }
  100. const opBatchPutAttributes = "BatchPutAttributes"
  101. // BatchPutAttributesRequest generates a "aws/request.Request" representing the
  102. // client's request for the BatchPutAttributes operation. The "output" return
  103. // value will be populated with the request's response once the request completes
  104. // successfully.
  105. //
  106. // Use "Send" method on the returned Request to send the API call to the service.
  107. // the "output" return value is not valid until after Send returns without error.
  108. //
  109. // See BatchPutAttributes for more information on using the BatchPutAttributes
  110. // API call, and error handling.
  111. //
  112. // This method is useful when you want to inject custom logic or configuration
  113. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  114. //
  115. //
  116. // // Example sending a request using the BatchPutAttributesRequest method.
  117. // req, resp := client.BatchPutAttributesRequest(params)
  118. //
  119. // err := req.Send()
  120. // if err == nil { // resp is now filled
  121. // fmt.Println(resp)
  122. // }
  123. func (c *SimpleDB) BatchPutAttributesRequest(input *BatchPutAttributesInput) (req *request.Request, output *BatchPutAttributesOutput) {
  124. op := &request.Operation{
  125. Name: opBatchPutAttributes,
  126. HTTPMethod: "POST",
  127. HTTPPath: "/",
  128. }
  129. if input == nil {
  130. input = &BatchPutAttributesInput{}
  131. }
  132. output = &BatchPutAttributesOutput{}
  133. req = c.newRequest(op, input, output)
  134. req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  135. return
  136. }
  137. // BatchPutAttributes API operation for Amazon SimpleDB.
  138. //
  139. // The BatchPutAttributes operation creates or replaces attributes within one
  140. // or more items. By using this operation, the client can perform multiple PutAttribute
  141. // operation with a single call. This helps yield savings in round trips and
  142. // latencies, enabling Amazon SimpleDB to optimize requests and generally produce
  143. // better throughput.
  144. //
  145. // The client may specify the item name with the Item.X.ItemName parameter.
  146. // The client may specify new attributes using a combination of the Item.X.Attribute.Y.Name
  147. // and Item.X.Attribute.Y.Value parameters. The client may specify the first
  148. // attribute for the first item using the parameters Item.0.Attribute.0.Name
  149. // and Item.0.Attribute.0.Value, and for the second attribute for the first
  150. // item by the parameters Item.0.Attribute.1.Name and Item.0.Attribute.1.Value,
  151. // and so on.
  152. //
  153. // Attributes are uniquely identified within an item by their name/value combination.
  154. // For example, a single item can have the attributes { "first_name", "first_value"
  155. // } and { "first_name", "second_value" }. However, it cannot have two attribute
  156. // instances where both the Item.X.Attribute.Y.Name and Item.X.Attribute.Y.Value
  157. // are the same.
  158. //
  159. // Optionally, the requester can supply the Replace parameter for each individual
  160. // value. Setting this value to true will cause the new attribute values to
  161. // replace the existing attribute values. For example, if an item I has the
  162. // attributes { 'a', '1' }, { 'b', '2'} and { 'b', '3' } and the requester does
  163. // a BatchPutAttributes of {'I', 'b', '4' } with the Replace parameter set to
  164. // true, the final attributes of the item will be { 'a', '1' } and { 'b', '4'
  165. // }, replacing the previous values of the 'b' attribute with the new value.
  166. //
  167. // You cannot specify an empty string as an item or as an attribute name. The
  168. // BatchPutAttributes operation succeeds or fails in its entirety. There are
  169. // no partial puts. This operation is vulnerable to exceeding the maximum URL size when making
  170. // a REST request using the HTTP GET method. This operation does not support
  171. // conditions using Expected.X.Name, Expected.X.Value, or Expected.X.Exists.
  172. // You can execute multiple BatchPutAttributes operations and other operations
  173. // in parallel. However, large numbers of concurrent BatchPutAttributes calls
  174. // can result in Service Unavailable (503) responses.
  175. //
  176. // The following limitations are enforced for this operation: 256 attribute
  177. // name-value pairs per item
  178. // 1 MB request size
  179. // 1 billion attributes per domain
  180. // 10 GB of total user data storage per domain
  181. // 25 item limit per BatchPutAttributes operation
  182. //
  183. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  184. // with awserr.Error's Code and Message methods to get detailed information about
  185. // the error.
  186. //
  187. // See the AWS API reference guide for Amazon SimpleDB's
  188. // API operation BatchPutAttributes for usage and error information.
  189. //
  190. // Returned Error Codes:
  191. // * ErrCodeDuplicateItemName "DuplicateItemName"
  192. // The item name was specified more than once.
  193. //
  194. // * ErrCodeInvalidParameterValue "InvalidParameterValue"
  195. // The value for a parameter is invalid.
  196. //
  197. // * ErrCodeMissingParameter "MissingParameter"
  198. // The request must contain the specified missing parameter.
  199. //
  200. // * ErrCodeNoSuchDomain "NoSuchDomain"
  201. // The specified domain does not exist.
  202. //
  203. // * ErrCodeNumberItemAttributesExceeded "NumberItemAttributesExceeded"
  204. // Too many attributes in this item.
  205. //
  206. // * ErrCodeNumberDomainAttributesExceeded "NumberDomainAttributesExceeded"
  207. // Too many attributes in this domain.
  208. //
  209. // * ErrCodeNumberDomainBytesExceeded "NumberDomainBytesExceeded"
  210. // Too many bytes in this domain.
  211. //
  212. // * ErrCodeNumberSubmittedItemsExceeded "NumberSubmittedItemsExceeded"
  213. // Too many items exist in a single call.
  214. //
  215. // * ErrCodeNumberSubmittedAttributesExceeded "NumberSubmittedAttributesExceeded"
  216. // Too many attributes exist in a single call.
  217. //
  218. func (c *SimpleDB) BatchPutAttributes(input *BatchPutAttributesInput) (*BatchPutAttributesOutput, error) {
  219. req, out := c.BatchPutAttributesRequest(input)
  220. return out, req.Send()
  221. }
  222. // BatchPutAttributesWithContext is the same as BatchPutAttributes with the addition of
  223. // the ability to pass a context and additional request options.
  224. //
  225. // See BatchPutAttributes for details on how to use this API operation.
  226. //
  227. // The context must be non-nil and will be used for request cancellation. If
  228. // the context is nil a panic will occur. In the future the SDK may create
  229. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  230. // for more information on using Contexts.
  231. func (c *SimpleDB) BatchPutAttributesWithContext(ctx aws.Context, input *BatchPutAttributesInput, opts ...request.Option) (*BatchPutAttributesOutput, error) {
  232. req, out := c.BatchPutAttributesRequest(input)
  233. req.SetContext(ctx)
  234. req.ApplyOptions(opts...)
  235. return out, req.Send()
  236. }
  237. const opCreateDomain = "CreateDomain"
  238. // CreateDomainRequest generates a "aws/request.Request" representing the
  239. // client's request for the CreateDomain operation. The "output" return
  240. // value will be populated with the request's response once the request completes
  241. // successfully.
  242. //
  243. // Use "Send" method on the returned Request to send the API call to the service.
  244. // the "output" return value is not valid until after Send returns without error.
  245. //
  246. // See CreateDomain for more information on using the CreateDomain
  247. // API call, and error handling.
  248. //
  249. // This method is useful when you want to inject custom logic or configuration
  250. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  251. //
  252. //
  253. // // Example sending a request using the CreateDomainRequest method.
  254. // req, resp := client.CreateDomainRequest(params)
  255. //
  256. // err := req.Send()
  257. // if err == nil { // resp is now filled
  258. // fmt.Println(resp)
  259. // }
  260. func (c *SimpleDB) CreateDomainRequest(input *CreateDomainInput) (req *request.Request, output *CreateDomainOutput) {
  261. op := &request.Operation{
  262. Name: opCreateDomain,
  263. HTTPMethod: "POST",
  264. HTTPPath: "/",
  265. }
  266. if input == nil {
  267. input = &CreateDomainInput{}
  268. }
  269. output = &CreateDomainOutput{}
  270. req = c.newRequest(op, input, output)
  271. req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  272. return
  273. }
  274. // CreateDomain API operation for Amazon SimpleDB.
  275. //
  276. // The CreateDomain operation creates a new domain. The domain name should be
  277. // unique among the domains associated with the Access Key ID provided in the
  278. // request. The CreateDomain operation may take 10 or more seconds to complete.
  279. //
  280. // CreateDomain is an idempotent operation; running it multiple times using
  281. // the same domain name will not result in an error response. The client can create up to 100 domains per account.
  282. //
  283. // If the client requires additional domains, go to http://aws.amazon.com/contact-us/simpledb-limit-request/
  284. // (http://aws.amazon.com/contact-us/simpledb-limit-request/).
  285. //
  286. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  287. // with awserr.Error's Code and Message methods to get detailed information about
  288. // the error.
  289. //
  290. // See the AWS API reference guide for Amazon SimpleDB's
  291. // API operation CreateDomain for usage and error information.
  292. //
  293. // Returned Error Codes:
  294. // * ErrCodeInvalidParameterValue "InvalidParameterValue"
  295. // The value for a parameter is invalid.
  296. //
  297. // * ErrCodeMissingParameter "MissingParameter"
  298. // The request must contain the specified missing parameter.
  299. //
  300. // * ErrCodeNumberDomainsExceeded "NumberDomainsExceeded"
  301. // Too many domains exist per this account.
  302. //
  303. func (c *SimpleDB) CreateDomain(input *CreateDomainInput) (*CreateDomainOutput, error) {
  304. req, out := c.CreateDomainRequest(input)
  305. return out, req.Send()
  306. }
  307. // CreateDomainWithContext is the same as CreateDomain with the addition of
  308. // the ability to pass a context and additional request options.
  309. //
  310. // See CreateDomain for details on how to use this API operation.
  311. //
  312. // The context must be non-nil and will be used for request cancellation. If
  313. // the context is nil a panic will occur. In the future the SDK may create
  314. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  315. // for more information on using Contexts.
  316. func (c *SimpleDB) CreateDomainWithContext(ctx aws.Context, input *CreateDomainInput, opts ...request.Option) (*CreateDomainOutput, error) {
  317. req, out := c.CreateDomainRequest(input)
  318. req.SetContext(ctx)
  319. req.ApplyOptions(opts...)
  320. return out, req.Send()
  321. }
  322. const opDeleteAttributes = "DeleteAttributes"
  323. // DeleteAttributesRequest generates a "aws/request.Request" representing the
  324. // client's request for the DeleteAttributes operation. The "output" return
  325. // value will be populated with the request's response once the request completes
  326. // successfully.
  327. //
  328. // Use "Send" method on the returned Request to send the API call to the service.
  329. // the "output" return value is not valid until after Send returns without error.
  330. //
  331. // See DeleteAttributes for more information on using the DeleteAttributes
  332. // API call, and error handling.
  333. //
  334. // This method is useful when you want to inject custom logic or configuration
  335. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  336. //
  337. //
  338. // // Example sending a request using the DeleteAttributesRequest method.
  339. // req, resp := client.DeleteAttributesRequest(params)
  340. //
  341. // err := req.Send()
  342. // if err == nil { // resp is now filled
  343. // fmt.Println(resp)
  344. // }
  345. func (c *SimpleDB) DeleteAttributesRequest(input *DeleteAttributesInput) (req *request.Request, output *DeleteAttributesOutput) {
  346. op := &request.Operation{
  347. Name: opDeleteAttributes,
  348. HTTPMethod: "POST",
  349. HTTPPath: "/",
  350. }
  351. if input == nil {
  352. input = &DeleteAttributesInput{}
  353. }
  354. output = &DeleteAttributesOutput{}
  355. req = c.newRequest(op, input, output)
  356. req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  357. return
  358. }
  359. // DeleteAttributes API operation for Amazon SimpleDB.
  360. //
  361. // Deletes one or more attributes associated with an item. If all attributes
  362. // of the item are deleted, the item is deleted.
  363. //
  364. // If DeleteAttributes is called without being passed any attributes or values
  365. // specified, all the attributes for the item are deleted. DeleteAttributes is an idempotent operation; running it multiple times on
  366. // the same item or attribute does not result in an error response.
  367. //
  368. // Because Amazon SimpleDB makes multiple copies of item data and uses an eventual
  369. // consistency update model, performing a GetAttributes or Select operation
  370. // (read) immediately after a DeleteAttributes or PutAttributes operation (write)
  371. // might not return updated item data.
  372. //
  373. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  374. // with awserr.Error's Code and Message methods to get detailed information about
  375. // the error.
  376. //
  377. // See the AWS API reference guide for Amazon SimpleDB's
  378. // API operation DeleteAttributes for usage and error information.
  379. //
  380. // Returned Error Codes:
  381. // * ErrCodeInvalidParameterValue "InvalidParameterValue"
  382. // The value for a parameter is invalid.
  383. //
  384. // * ErrCodeMissingParameter "MissingParameter"
  385. // The request must contain the specified missing parameter.
  386. //
  387. // * ErrCodeNoSuchDomain "NoSuchDomain"
  388. // The specified domain does not exist.
  389. //
  390. // * ErrCodeAttributeDoesNotExist "AttributeDoesNotExist"
  391. // The specified attribute does not exist.
  392. //
  393. func (c *SimpleDB) DeleteAttributes(input *DeleteAttributesInput) (*DeleteAttributesOutput, error) {
  394. req, out := c.DeleteAttributesRequest(input)
  395. return out, req.Send()
  396. }
  397. // DeleteAttributesWithContext is the same as DeleteAttributes with the addition of
  398. // the ability to pass a context and additional request options.
  399. //
  400. // See DeleteAttributes for details on how to use this API operation.
  401. //
  402. // The context must be non-nil and will be used for request cancellation. If
  403. // the context is nil a panic will occur. In the future the SDK may create
  404. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  405. // for more information on using Contexts.
  406. func (c *SimpleDB) DeleteAttributesWithContext(ctx aws.Context, input *DeleteAttributesInput, opts ...request.Option) (*DeleteAttributesOutput, error) {
  407. req, out := c.DeleteAttributesRequest(input)
  408. req.SetContext(ctx)
  409. req.ApplyOptions(opts...)
  410. return out, req.Send()
  411. }
  412. const opDeleteDomain = "DeleteDomain"
  413. // DeleteDomainRequest generates a "aws/request.Request" representing the
  414. // client's request for the DeleteDomain operation. The "output" return
  415. // value will be populated with the request's response once the request completes
  416. // successfully.
  417. //
  418. // Use "Send" method on the returned Request to send the API call to the service.
  419. // the "output" return value is not valid until after Send returns without error.
  420. //
  421. // See DeleteDomain for more information on using the DeleteDomain
  422. // API call, and error handling.
  423. //
  424. // This method is useful when you want to inject custom logic or configuration
  425. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  426. //
  427. //
  428. // // Example sending a request using the DeleteDomainRequest method.
  429. // req, resp := client.DeleteDomainRequest(params)
  430. //
  431. // err := req.Send()
  432. // if err == nil { // resp is now filled
  433. // fmt.Println(resp)
  434. // }
  435. func (c *SimpleDB) DeleteDomainRequest(input *DeleteDomainInput) (req *request.Request, output *DeleteDomainOutput) {
  436. op := &request.Operation{
  437. Name: opDeleteDomain,
  438. HTTPMethod: "POST",
  439. HTTPPath: "/",
  440. }
  441. if input == nil {
  442. input = &DeleteDomainInput{}
  443. }
  444. output = &DeleteDomainOutput{}
  445. req = c.newRequest(op, input, output)
  446. req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  447. return
  448. }
  449. // DeleteDomain API operation for Amazon SimpleDB.
  450. //
  451. // The DeleteDomain operation deletes a domain. Any items (and their attributes)
  452. // in the domain are deleted as well. The DeleteDomain operation might take
  453. // 10 or more seconds to complete.
  454. //
  455. // Running DeleteDomain on a domain that does not exist or running the function
  456. // multiple times using the same domain name will not result in an error response.
  457. //
  458. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  459. // with awserr.Error's Code and Message methods to get detailed information about
  460. // the error.
  461. //
  462. // See the AWS API reference guide for Amazon SimpleDB's
  463. // API operation DeleteDomain for usage and error information.
  464. //
  465. // Returned Error Codes:
  466. // * ErrCodeMissingParameter "MissingParameter"
  467. // The request must contain the specified missing parameter.
  468. //
  469. func (c *SimpleDB) DeleteDomain(input *DeleteDomainInput) (*DeleteDomainOutput, error) {
  470. req, out := c.DeleteDomainRequest(input)
  471. return out, req.Send()
  472. }
  473. // DeleteDomainWithContext is the same as DeleteDomain with the addition of
  474. // the ability to pass a context and additional request options.
  475. //
  476. // See DeleteDomain for details on how to use this API operation.
  477. //
  478. // The context must be non-nil and will be used for request cancellation. If
  479. // the context is nil a panic will occur. In the future the SDK may create
  480. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  481. // for more information on using Contexts.
  482. func (c *SimpleDB) DeleteDomainWithContext(ctx aws.Context, input *DeleteDomainInput, opts ...request.Option) (*DeleteDomainOutput, error) {
  483. req, out := c.DeleteDomainRequest(input)
  484. req.SetContext(ctx)
  485. req.ApplyOptions(opts...)
  486. return out, req.Send()
  487. }
  488. const opDomainMetadata = "DomainMetadata"
  489. // DomainMetadataRequest generates a "aws/request.Request" representing the
  490. // client's request for the DomainMetadata operation. The "output" return
  491. // value will be populated with the request's response once the request completes
  492. // successfully.
  493. //
  494. // Use "Send" method on the returned Request to send the API call to the service.
  495. // the "output" return value is not valid until after Send returns without error.
  496. //
  497. // See DomainMetadata for more information on using the DomainMetadata
  498. // API call, and error handling.
  499. //
  500. // This method is useful when you want to inject custom logic or configuration
  501. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  502. //
  503. //
  504. // // Example sending a request using the DomainMetadataRequest method.
  505. // req, resp := client.DomainMetadataRequest(params)
  506. //
  507. // err := req.Send()
  508. // if err == nil { // resp is now filled
  509. // fmt.Println(resp)
  510. // }
  511. func (c *SimpleDB) DomainMetadataRequest(input *DomainMetadataInput) (req *request.Request, output *DomainMetadataOutput) {
  512. op := &request.Operation{
  513. Name: opDomainMetadata,
  514. HTTPMethod: "POST",
  515. HTTPPath: "/",
  516. }
  517. if input == nil {
  518. input = &DomainMetadataInput{}
  519. }
  520. output = &DomainMetadataOutput{}
  521. req = c.newRequest(op, input, output)
  522. return
  523. }
  524. // DomainMetadata API operation for Amazon SimpleDB.
  525. //
  526. // Returns information about the domain, including when the domain was created,
  527. // the number of items and attributes in the domain, and the size of the attribute
  528. // names and values.
  529. //
  530. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  531. // with awserr.Error's Code and Message methods to get detailed information about
  532. // the error.
  533. //
  534. // See the AWS API reference guide for Amazon SimpleDB's
  535. // API operation DomainMetadata for usage and error information.
  536. //
  537. // Returned Error Codes:
  538. // * ErrCodeMissingParameter "MissingParameter"
  539. // The request must contain the specified missing parameter.
  540. //
  541. // * ErrCodeNoSuchDomain "NoSuchDomain"
  542. // The specified domain does not exist.
  543. //
  544. func (c *SimpleDB) DomainMetadata(input *DomainMetadataInput) (*DomainMetadataOutput, error) {
  545. req, out := c.DomainMetadataRequest(input)
  546. return out, req.Send()
  547. }
  548. // DomainMetadataWithContext is the same as DomainMetadata with the addition of
  549. // the ability to pass a context and additional request options.
  550. //
  551. // See DomainMetadata for details on how to use this API operation.
  552. //
  553. // The context must be non-nil and will be used for request cancellation. If
  554. // the context is nil a panic will occur. In the future the SDK may create
  555. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  556. // for more information on using Contexts.
  557. func (c *SimpleDB) DomainMetadataWithContext(ctx aws.Context, input *DomainMetadataInput, opts ...request.Option) (*DomainMetadataOutput, error) {
  558. req, out := c.DomainMetadataRequest(input)
  559. req.SetContext(ctx)
  560. req.ApplyOptions(opts...)
  561. return out, req.Send()
  562. }
  563. const opGetAttributes = "GetAttributes"
  564. // GetAttributesRequest generates a "aws/request.Request" representing the
  565. // client's request for the GetAttributes operation. The "output" return
  566. // value will be populated with the request's response once the request completes
  567. // successfully.
  568. //
  569. // Use "Send" method on the returned Request to send the API call to the service.
  570. // the "output" return value is not valid until after Send returns without error.
  571. //
  572. // See GetAttributes for more information on using the GetAttributes
  573. // API call, and error handling.
  574. //
  575. // This method is useful when you want to inject custom logic or configuration
  576. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  577. //
  578. //
  579. // // Example sending a request using the GetAttributesRequest method.
  580. // req, resp := client.GetAttributesRequest(params)
  581. //
  582. // err := req.Send()
  583. // if err == nil { // resp is now filled
  584. // fmt.Println(resp)
  585. // }
  586. func (c *SimpleDB) GetAttributesRequest(input *GetAttributesInput) (req *request.Request, output *GetAttributesOutput) {
  587. op := &request.Operation{
  588. Name: opGetAttributes,
  589. HTTPMethod: "POST",
  590. HTTPPath: "/",
  591. }
  592. if input == nil {
  593. input = &GetAttributesInput{}
  594. }
  595. output = &GetAttributesOutput{}
  596. req = c.newRequest(op, input, output)
  597. return
  598. }
  599. // GetAttributes API operation for Amazon SimpleDB.
  600. //
  601. // Returns all of the attributes associated with the specified item. Optionally,
  602. // the attributes returned can be limited to one or more attributes by specifying
  603. // an attribute name parameter.
  604. //
  605. // If the item does not exist on the replica that was accessed for this operation,
  606. // an empty set is returned. The system does not return an error as it cannot
  607. // guarantee the item does not exist on other replicas.
  608. //
  609. // If GetAttributes is called without being passed any attribute names, all
  610. // the attributes for the item are returned.
  611. //
  612. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  613. // with awserr.Error's Code and Message methods to get detailed information about
  614. // the error.
  615. //
  616. // See the AWS API reference guide for Amazon SimpleDB's
  617. // API operation GetAttributes for usage and error information.
  618. //
  619. // Returned Error Codes:
  620. // * ErrCodeInvalidParameterValue "InvalidParameterValue"
  621. // The value for a parameter is invalid.
  622. //
  623. // * ErrCodeMissingParameter "MissingParameter"
  624. // The request must contain the specified missing parameter.
  625. //
  626. // * ErrCodeNoSuchDomain "NoSuchDomain"
  627. // The specified domain does not exist.
  628. //
  629. func (c *SimpleDB) GetAttributes(input *GetAttributesInput) (*GetAttributesOutput, error) {
  630. req, out := c.GetAttributesRequest(input)
  631. return out, req.Send()
  632. }
  633. // GetAttributesWithContext is the same as GetAttributes with the addition of
  634. // the ability to pass a context and additional request options.
  635. //
  636. // See GetAttributes for details on how to use this API operation.
  637. //
  638. // The context must be non-nil and will be used for request cancellation. If
  639. // the context is nil a panic will occur. In the future the SDK may create
  640. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  641. // for more information on using Contexts.
  642. func (c *SimpleDB) GetAttributesWithContext(ctx aws.Context, input *GetAttributesInput, opts ...request.Option) (*GetAttributesOutput, error) {
  643. req, out := c.GetAttributesRequest(input)
  644. req.SetContext(ctx)
  645. req.ApplyOptions(opts...)
  646. return out, req.Send()
  647. }
  648. const opListDomains = "ListDomains"
  649. // ListDomainsRequest generates a "aws/request.Request" representing the
  650. // client's request for the ListDomains operation. The "output" return
  651. // value will be populated with the request's response once the request completes
  652. // successfully.
  653. //
  654. // Use "Send" method on the returned Request to send the API call to the service.
  655. // the "output" return value is not valid until after Send returns without error.
  656. //
  657. // See ListDomains for more information on using the ListDomains
  658. // API call, and error handling.
  659. //
  660. // This method is useful when you want to inject custom logic or configuration
  661. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  662. //
  663. //
  664. // // Example sending a request using the ListDomainsRequest method.
  665. // req, resp := client.ListDomainsRequest(params)
  666. //
  667. // err := req.Send()
  668. // if err == nil { // resp is now filled
  669. // fmt.Println(resp)
  670. // }
  671. func (c *SimpleDB) ListDomainsRequest(input *ListDomainsInput) (req *request.Request, output *ListDomainsOutput) {
  672. op := &request.Operation{
  673. Name: opListDomains,
  674. HTTPMethod: "POST",
  675. HTTPPath: "/",
  676. Paginator: &request.Paginator{
  677. InputTokens: []string{"NextToken"},
  678. OutputTokens: []string{"NextToken"},
  679. LimitToken: "MaxNumberOfDomains",
  680. TruncationToken: "",
  681. },
  682. }
  683. if input == nil {
  684. input = &ListDomainsInput{}
  685. }
  686. output = &ListDomainsOutput{}
  687. req = c.newRequest(op, input, output)
  688. return
  689. }
  690. // ListDomains API operation for Amazon SimpleDB.
  691. //
  692. // The ListDomains operation lists all domains associated with the Access Key
  693. // ID. It returns domain names up to the limit set by MaxNumberOfDomains (#MaxNumberOfDomains).
  694. // A NextToken (#NextToken) is returned if there are more than MaxNumberOfDomains
  695. // domains. Calling ListDomains successive times with the NextToken provided
  696. // by the operation returns up to MaxNumberOfDomains more domain names with
  697. // each successive operation call.
  698. //
  699. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  700. // with awserr.Error's Code and Message methods to get detailed information about
  701. // the error.
  702. //
  703. // See the AWS API reference guide for Amazon SimpleDB's
  704. // API operation ListDomains for usage and error information.
  705. //
  706. // Returned Error Codes:
  707. // * ErrCodeInvalidParameterValue "InvalidParameterValue"
  708. // The value for a parameter is invalid.
  709. //
  710. // * ErrCodeInvalidNextToken "InvalidNextToken"
  711. // The specified NextToken is not valid.
  712. //
  713. func (c *SimpleDB) ListDomains(input *ListDomainsInput) (*ListDomainsOutput, error) {
  714. req, out := c.ListDomainsRequest(input)
  715. return out, req.Send()
  716. }
  717. // ListDomainsWithContext is the same as ListDomains with the addition of
  718. // the ability to pass a context and additional request options.
  719. //
  720. // See ListDomains for details on how to use this API operation.
  721. //
  722. // The context must be non-nil and will be used for request cancellation. If
  723. // the context is nil a panic will occur. In the future the SDK may create
  724. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  725. // for more information on using Contexts.
  726. func (c *SimpleDB) ListDomainsWithContext(ctx aws.Context, input *ListDomainsInput, opts ...request.Option) (*ListDomainsOutput, error) {
  727. req, out := c.ListDomainsRequest(input)
  728. req.SetContext(ctx)
  729. req.ApplyOptions(opts...)
  730. return out, req.Send()
  731. }
  732. // ListDomainsPages iterates over the pages of a ListDomains operation,
  733. // calling the "fn" function with the response data for each page. To stop
  734. // iterating, return false from the fn function.
  735. //
  736. // See ListDomains method for more information on how to use this operation.
  737. //
  738. // Note: This operation can generate multiple requests to a service.
  739. //
  740. // // Example iterating over at most 3 pages of a ListDomains operation.
  741. // pageNum := 0
  742. // err := client.ListDomainsPages(params,
  743. // func(page *ListDomainsOutput, lastPage bool) bool {
  744. // pageNum++
  745. // fmt.Println(page)
  746. // return pageNum <= 3
  747. // })
  748. //
  749. func (c *SimpleDB) ListDomainsPages(input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool) error {
  750. return c.ListDomainsPagesWithContext(aws.BackgroundContext(), input, fn)
  751. }
  752. // ListDomainsPagesWithContext same as ListDomainsPages except
  753. // it takes a Context and allows setting request options on the pages.
  754. //
  755. // The context must be non-nil and will be used for request cancellation. If
  756. // the context is nil a panic will occur. In the future the SDK may create
  757. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  758. // for more information on using Contexts.
  759. func (c *SimpleDB) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool, opts ...request.Option) error {
  760. p := request.Pagination{
  761. NewRequest: func() (*request.Request, error) {
  762. var inCpy *ListDomainsInput
  763. if input != nil {
  764. tmp := *input
  765. inCpy = &tmp
  766. }
  767. req, _ := c.ListDomainsRequest(inCpy)
  768. req.SetContext(ctx)
  769. req.ApplyOptions(opts...)
  770. return req, nil
  771. },
  772. }
  773. cont := true
  774. for p.Next() && cont {
  775. cont = fn(p.Page().(*ListDomainsOutput), !p.HasNextPage())
  776. }
  777. return p.Err()
  778. }
  779. const opPutAttributes = "PutAttributes"
  780. // PutAttributesRequest generates a "aws/request.Request" representing the
  781. // client's request for the PutAttributes operation. The "output" return
  782. // value will be populated with the request's response once the request completes
  783. // successfully.
  784. //
  785. // Use "Send" method on the returned Request to send the API call to the service.
  786. // the "output" return value is not valid until after Send returns without error.
  787. //
  788. // See PutAttributes for more information on using the PutAttributes
  789. // API call, and error handling.
  790. //
  791. // This method is useful when you want to inject custom logic or configuration
  792. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  793. //
  794. //
  795. // // Example sending a request using the PutAttributesRequest method.
  796. // req, resp := client.PutAttributesRequest(params)
  797. //
  798. // err := req.Send()
  799. // if err == nil { // resp is now filled
  800. // fmt.Println(resp)
  801. // }
  802. func (c *SimpleDB) PutAttributesRequest(input *PutAttributesInput) (req *request.Request, output *PutAttributesOutput) {
  803. op := &request.Operation{
  804. Name: opPutAttributes,
  805. HTTPMethod: "POST",
  806. HTTPPath: "/",
  807. }
  808. if input == nil {
  809. input = &PutAttributesInput{}
  810. }
  811. output = &PutAttributesOutput{}
  812. req = c.newRequest(op, input, output)
  813. req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  814. return
  815. }
  816. // PutAttributes API operation for Amazon SimpleDB.
  817. //
  818. // The PutAttributes operation creates or replaces attributes in an item. The
  819. // client may specify new attributes using a combination of the Attribute.X.Name
  820. // and Attribute.X.Value parameters. The client specifies the first attribute
  821. // by the parameters Attribute.0.Name and Attribute.0.Value, the second attribute
  822. // by the parameters Attribute.1.Name and Attribute.1.Value, and so on.
  823. //
  824. // Attributes are uniquely identified in an item by their name/value combination.
  825. // For example, a single item can have the attributes { "first_name", "first_value"
  826. // } and { "first_name", second_value" }. However, it cannot have two attribute
  827. // instances where both the Attribute.X.Name and Attribute.X.Value are the same.
  828. //
  829. // Optionally, the requestor can supply the Replace parameter for each individual
  830. // attribute. Setting this value to true causes the new attribute value to replace
  831. // the existing attribute value(s). For example, if an item has the attributes
  832. // { 'a', '1' }, { 'b', '2'} and { 'b', '3' } and the requestor calls PutAttributes
  833. // using the attributes { 'b', '4' } with the Replace parameter set to true,
  834. // the final attributes of the item are changed to { 'a', '1' } and { 'b', '4'
  835. // }, which replaces the previous values of the 'b' attribute with the new value.
  836. //
  837. // Using PutAttributes to replace attribute values that do not exist will not
  838. // result in an error response. You cannot specify an empty string as an attribute name.
  839. //
  840. // Because Amazon SimpleDB makes multiple copies of client data and uses an
  841. // eventual consistency update model, an immediate GetAttributes or Select operation
  842. // (read) immediately after a PutAttributes or DeleteAttributes operation (write)
  843. // might not return the updated data.
  844. //
  845. // The following limitations are enforced for this operation: 256 total attribute
  846. // name-value pairs per item
  847. // One billion attributes per domain
  848. // 10 GB of total user data storage per domain
  849. //
  850. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  851. // with awserr.Error's Code and Message methods to get detailed information about
  852. // the error.
  853. //
  854. // See the AWS API reference guide for Amazon SimpleDB's
  855. // API operation PutAttributes for usage and error information.
  856. //
  857. // Returned Error Codes:
  858. // * ErrCodeInvalidParameterValue "InvalidParameterValue"
  859. // The value for a parameter is invalid.
  860. //
  861. // * ErrCodeMissingParameter "MissingParameter"
  862. // The request must contain the specified missing parameter.
  863. //
  864. // * ErrCodeNoSuchDomain "NoSuchDomain"
  865. // The specified domain does not exist.
  866. //
  867. // * ErrCodeNumberDomainAttributesExceeded "NumberDomainAttributesExceeded"
  868. // Too many attributes in this domain.
  869. //
  870. // * ErrCodeNumberDomainBytesExceeded "NumberDomainBytesExceeded"
  871. // Too many bytes in this domain.
  872. //
  873. // * ErrCodeNumberItemAttributesExceeded "NumberItemAttributesExceeded"
  874. // Too many attributes in this item.
  875. //
  876. // * ErrCodeAttributeDoesNotExist "AttributeDoesNotExist"
  877. // The specified attribute does not exist.
  878. //
  879. func (c *SimpleDB) PutAttributes(input *PutAttributesInput) (*PutAttributesOutput, error) {
  880. req, out := c.PutAttributesRequest(input)
  881. return out, req.Send()
  882. }
  883. // PutAttributesWithContext is the same as PutAttributes with the addition of
  884. // the ability to pass a context and additional request options.
  885. //
  886. // See PutAttributes for details on how to use this API operation.
  887. //
  888. // The context must be non-nil and will be used for request cancellation. If
  889. // the context is nil a panic will occur. In the future the SDK may create
  890. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  891. // for more information on using Contexts.
  892. func (c *SimpleDB) PutAttributesWithContext(ctx aws.Context, input *PutAttributesInput, opts ...request.Option) (*PutAttributesOutput, error) {
  893. req, out := c.PutAttributesRequest(input)
  894. req.SetContext(ctx)
  895. req.ApplyOptions(opts...)
  896. return out, req.Send()
  897. }
  898. const opSelect = "Select"
  899. // SelectRequest generates a "aws/request.Request" representing the
  900. // client's request for the Select operation. The "output" return
  901. // value will be populated with the request's response once the request completes
  902. // successfully.
  903. //
  904. // Use "Send" method on the returned Request to send the API call to the service.
  905. // the "output" return value is not valid until after Send returns without error.
  906. //
  907. // See Select for more information on using the Select
  908. // API call, and error handling.
  909. //
  910. // This method is useful when you want to inject custom logic or configuration
  911. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  912. //
  913. //
  914. // // Example sending a request using the SelectRequest method.
  915. // req, resp := client.SelectRequest(params)
  916. //
  917. // err := req.Send()
  918. // if err == nil { // resp is now filled
  919. // fmt.Println(resp)
  920. // }
  921. func (c *SimpleDB) SelectRequest(input *SelectInput) (req *request.Request, output *SelectOutput) {
  922. op := &request.Operation{
  923. Name: opSelect,
  924. HTTPMethod: "POST",
  925. HTTPPath: "/",
  926. Paginator: &request.Paginator{
  927. InputTokens: []string{"NextToken"},
  928. OutputTokens: []string{"NextToken"},
  929. LimitToken: "",
  930. TruncationToken: "",
  931. },
  932. }
  933. if input == nil {
  934. input = &SelectInput{}
  935. }
  936. output = &SelectOutput{}
  937. req = c.newRequest(op, input, output)
  938. return
  939. }
  940. // Select API operation for Amazon SimpleDB.
  941. //
  942. // The Select operation returns a set of attributes for ItemNames that match
  943. // the select expression. Select is similar to the standard SQL SELECT statement.
  944. //
  945. // The total size of the response cannot exceed 1 MB in total size. Amazon SimpleDB
  946. // automatically adjusts the number of items returned per page to enforce this
  947. // limit. For example, if the client asks to retrieve 2500 items, but each individual
  948. // item is 10 kB in size, the system returns 100 items and an appropriate NextToken
  949. // so the client can access the next page of results.
  950. //
  951. // For information on how to construct select expressions, see Using Select
  952. // to Create Amazon SimpleDB Queries in the Developer Guide.
  953. //
  954. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  955. // with awserr.Error's Code and Message methods to get detailed information about
  956. // the error.
  957. //
  958. // See the AWS API reference guide for Amazon SimpleDB's
  959. // API operation Select for usage and error information.
  960. //
  961. // Returned Error Codes:
  962. // * ErrCodeInvalidParameterValue "InvalidParameterValue"
  963. // The value for a parameter is invalid.
  964. //
  965. // * ErrCodeInvalidNextToken "InvalidNextToken"
  966. // The specified NextToken is not valid.
  967. //
  968. // * ErrCodeInvalidNumberPredicates "InvalidNumberPredicates"
  969. // Too many predicates exist in the query expression.
  970. //
  971. // * ErrCodeInvalidNumberValueTests "InvalidNumberValueTests"
  972. // Too many predicates exist in the query expression.
  973. //
  974. // * ErrCodeInvalidQueryExpression "InvalidQueryExpression"
  975. // The specified query expression syntax is not valid.
  976. //
  977. // * ErrCodeMissingParameter "MissingParameter"
  978. // The request must contain the specified missing parameter.
  979. //
  980. // * ErrCodeNoSuchDomain "NoSuchDomain"
  981. // The specified domain does not exist.
  982. //
  983. // * ErrCodeRequestTimeout "RequestTimeout"
  984. // A timeout occurred when attempting to query the specified domain with specified
  985. // query expression.
  986. //
  987. // * ErrCodeTooManyRequestedAttributes "TooManyRequestedAttributes"
  988. // Too many attributes requested.
  989. //
  990. func (c *SimpleDB) Select(input *SelectInput) (*SelectOutput, error) {
  991. req, out := c.SelectRequest(input)
  992. return out, req.Send()
  993. }
  994. // SelectWithContext is the same as Select with the addition of
  995. // the ability to pass a context and additional request options.
  996. //
  997. // See Select for details on how to use this API operation.
  998. //
  999. // The context must be non-nil and will be used for request cancellation. If
  1000. // the context is nil a panic will occur. In the future the SDK may create
  1001. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1002. // for more information on using Contexts.
  1003. func (c *SimpleDB) SelectWithContext(ctx aws.Context, input *SelectInput, opts ...request.Option) (*SelectOutput, error) {
  1004. req, out := c.SelectRequest(input)
  1005. req.SetContext(ctx)
  1006. req.ApplyOptions(opts...)
  1007. return out, req.Send()
  1008. }
  1009. // SelectPages iterates over the pages of a Select operation,
  1010. // calling the "fn" function with the response data for each page. To stop
  1011. // iterating, return false from the fn function.
  1012. //
  1013. // See Select method for more information on how to use this operation.
  1014. //
  1015. // Note: This operation can generate multiple requests to a service.
  1016. //
  1017. // // Example iterating over at most 3 pages of a Select operation.
  1018. // pageNum := 0
  1019. // err := client.SelectPages(params,
  1020. // func(page *SelectOutput, lastPage bool) bool {
  1021. // pageNum++
  1022. // fmt.Println(page)
  1023. // return pageNum <= 3
  1024. // })
  1025. //
  1026. func (c *SimpleDB) SelectPages(input *SelectInput, fn func(*SelectOutput, bool) bool) error {
  1027. return c.SelectPagesWithContext(aws.BackgroundContext(), input, fn)
  1028. }
  1029. // SelectPagesWithContext same as SelectPages except
  1030. // it takes a Context and allows setting request options on the pages.
  1031. //
  1032. // The context must be non-nil and will be used for request cancellation. If
  1033. // the context is nil a panic will occur. In the future the SDK may create
  1034. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1035. // for more information on using Contexts.
  1036. func (c *SimpleDB) SelectPagesWithContext(ctx aws.Context, input *SelectInput, fn func(*SelectOutput, bool) bool, opts ...request.Option) error {
  1037. p := request.Pagination{
  1038. NewRequest: func() (*request.Request, error) {
  1039. var inCpy *SelectInput
  1040. if input != nil {
  1041. tmp := *input
  1042. inCpy = &tmp
  1043. }
  1044. req, _ := c.SelectRequest(inCpy)
  1045. req.SetContext(ctx)
  1046. req.ApplyOptions(opts...)
  1047. return req, nil
  1048. },
  1049. }
  1050. cont := true
  1051. for p.Next() && cont {
  1052. cont = fn(p.Page().(*SelectOutput), !p.HasNextPage())
  1053. }
  1054. return p.Err()
  1055. }
  1056. type Attribute struct {
  1057. _ struct{} `type:"structure"`
  1058. AlternateNameEncoding *string `type:"string"`
  1059. AlternateValueEncoding *string `type:"string"`
  1060. // The name of the attribute.
  1061. //
  1062. // Name is a required field
  1063. Name *string `type:"string" required:"true"`
  1064. // The value of the attribute.
  1065. //
  1066. // Value is a required field
  1067. Value *string `type:"string" required:"true"`
  1068. }
  1069. // String returns the string representation
  1070. func (s Attribute) String() string {
  1071. return awsutil.Prettify(s)
  1072. }
  1073. // GoString returns the string representation
  1074. func (s Attribute) GoString() string {
  1075. return s.String()
  1076. }
  1077. // SetAlternateNameEncoding sets the AlternateNameEncoding field's value.
  1078. func (s *Attribute) SetAlternateNameEncoding(v string) *Attribute {
  1079. s.AlternateNameEncoding = &v
  1080. return s
  1081. }
  1082. // SetAlternateValueEncoding sets the AlternateValueEncoding field's value.
  1083. func (s *Attribute) SetAlternateValueEncoding(v string) *Attribute {
  1084. s.AlternateValueEncoding = &v
  1085. return s
  1086. }
  1087. // SetName sets the Name field's value.
  1088. func (s *Attribute) SetName(v string) *Attribute {
  1089. s.Name = &v
  1090. return s
  1091. }
  1092. // SetValue sets the Value field's value.
  1093. func (s *Attribute) SetValue(v string) *Attribute {
  1094. s.Value = &v
  1095. return s
  1096. }
  1097. type BatchDeleteAttributesInput struct {
  1098. _ struct{} `type:"structure"`
  1099. // The name of the domain in which the attributes are being deleted.
  1100. //
  1101. // DomainName is a required field
  1102. DomainName *string `type:"string" required:"true"`
  1103. // A list of items on which to perform the operation.
  1104. //
  1105. // Items is a required field
  1106. Items []*DeletableItem `locationNameList:"Item" type:"list" flattened:"true" required:"true"`
  1107. }
  1108. // String returns the string representation
  1109. func (s BatchDeleteAttributesInput) String() string {
  1110. return awsutil.Prettify(s)
  1111. }
  1112. // GoString returns the string representation
  1113. func (s BatchDeleteAttributesInput) GoString() string {
  1114. return s.String()
  1115. }
  1116. // Validate inspects the fields of the type to determine if they are valid.
  1117. func (s *BatchDeleteAttributesInput) Validate() error {
  1118. invalidParams := request.ErrInvalidParams{Context: "BatchDeleteAttributesInput"}
  1119. if s.DomainName == nil {
  1120. invalidParams.Add(request.NewErrParamRequired("DomainName"))
  1121. }
  1122. if s.Items == nil {
  1123. invalidParams.Add(request.NewErrParamRequired("Items"))
  1124. }
  1125. if s.Items != nil {
  1126. for i, v := range s.Items {
  1127. if v == nil {
  1128. continue
  1129. }
  1130. if err := v.Validate(); err != nil {
  1131. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams))
  1132. }
  1133. }
  1134. }
  1135. if invalidParams.Len() > 0 {
  1136. return invalidParams
  1137. }
  1138. return nil
  1139. }
  1140. // SetDomainName sets the DomainName field's value.
  1141. func (s *BatchDeleteAttributesInput) SetDomainName(v string) *BatchDeleteAttributesInput {
  1142. s.DomainName = &v
  1143. return s
  1144. }
  1145. // SetItems sets the Items field's value.
  1146. func (s *BatchDeleteAttributesInput) SetItems(v []*DeletableItem) *BatchDeleteAttributesInput {
  1147. s.Items = v
  1148. return s
  1149. }
  1150. type BatchDeleteAttributesOutput struct {
  1151. _ struct{} `type:"structure"`
  1152. }
  1153. // String returns the string representation
  1154. func (s BatchDeleteAttributesOutput) String() string {
  1155. return awsutil.Prettify(s)
  1156. }
  1157. // GoString returns the string representation
  1158. func (s BatchDeleteAttributesOutput) GoString() string {
  1159. return s.String()
  1160. }
  1161. type BatchPutAttributesInput struct {
  1162. _ struct{} `type:"structure"`
  1163. // The name of the domain in which the attributes are being stored.
  1164. //
  1165. // DomainName is a required field
  1166. DomainName *string `type:"string" required:"true"`
  1167. // A list of items on which to perform the operation.
  1168. //
  1169. // Items is a required field
  1170. Items []*ReplaceableItem `locationNameList:"Item" type:"list" flattened:"true" required:"true"`
  1171. }
  1172. // String returns the string representation
  1173. func (s BatchPutAttributesInput) String() string {
  1174. return awsutil.Prettify(s)
  1175. }
  1176. // GoString returns the string representation
  1177. func (s BatchPutAttributesInput) GoString() string {
  1178. return s.String()
  1179. }
  1180. // Validate inspects the fields of the type to determine if they are valid.
  1181. func (s *BatchPutAttributesInput) Validate() error {
  1182. invalidParams := request.ErrInvalidParams{Context: "BatchPutAttributesInput"}
  1183. if s.DomainName == nil {
  1184. invalidParams.Add(request.NewErrParamRequired("DomainName"))
  1185. }
  1186. if s.Items == nil {
  1187. invalidParams.Add(request.NewErrParamRequired("Items"))
  1188. }
  1189. if s.Items != nil {
  1190. for i, v := range s.Items {
  1191. if v == nil {
  1192. continue
  1193. }
  1194. if err := v.Validate(); err != nil {
  1195. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams))
  1196. }
  1197. }
  1198. }
  1199. if invalidParams.Len() > 0 {
  1200. return invalidParams
  1201. }
  1202. return nil
  1203. }
  1204. // SetDomainName sets the DomainName field's value.
  1205. func (s *BatchPutAttributesInput) SetDomainName(v string) *BatchPutAttributesInput {
  1206. s.DomainName = &v
  1207. return s
  1208. }
  1209. // SetItems sets the Items field's value.
  1210. func (s *BatchPutAttributesInput) SetItems(v []*ReplaceableItem) *BatchPutAttributesInput {
  1211. s.Items = v
  1212. return s
  1213. }
  1214. type BatchPutAttributesOutput struct {
  1215. _ struct{} `type:"structure"`
  1216. }
  1217. // String returns the string representation
  1218. func (s BatchPutAttributesOutput) String() string {
  1219. return awsutil.Prettify(s)
  1220. }
  1221. // GoString returns the string representation
  1222. func (s BatchPutAttributesOutput) GoString() string {
  1223. return s.String()
  1224. }
  1225. type CreateDomainInput struct {
  1226. _ struct{} `type:"structure"`
  1227. // The name of the domain to create. The name can range between 3 and 255 characters
  1228. // and can contain the following characters: a-z, A-Z, 0-9, '_', '-', and '.'.
  1229. //
  1230. // DomainName is a required field
  1231. DomainName *string `type:"string" required:"true"`
  1232. }
  1233. // String returns the string representation
  1234. func (s CreateDomainInput) String() string {
  1235. return awsutil.Prettify(s)
  1236. }
  1237. // GoString returns the string representation
  1238. func (s CreateDomainInput) GoString() string {
  1239. return s.String()
  1240. }
  1241. // Validate inspects the fields of the type to determine if they are valid.
  1242. func (s *CreateDomainInput) Validate() error {
  1243. invalidParams := request.ErrInvalidParams{Context: "CreateDomainInput"}
  1244. if s.DomainName == nil {
  1245. invalidParams.Add(request.NewErrParamRequired("DomainName"))
  1246. }
  1247. if invalidParams.Len() > 0 {
  1248. return invalidParams
  1249. }
  1250. return nil
  1251. }
  1252. // SetDomainName sets the DomainName field's value.
  1253. func (s *CreateDomainInput) SetDomainName(v string) *CreateDomainInput {
  1254. s.DomainName = &v
  1255. return s
  1256. }
  1257. type CreateDomainOutput struct {
  1258. _ struct{} `type:"structure"`
  1259. }
  1260. // String returns the string representation
  1261. func (s CreateDomainOutput) String() string {
  1262. return awsutil.Prettify(s)
  1263. }
  1264. // GoString returns the string representation
  1265. func (s CreateDomainOutput) GoString() string {
  1266. return s.String()
  1267. }
  1268. type DeletableAttribute struct {
  1269. _ struct{} `type:"structure"`
  1270. // The name of the attribute.
  1271. //
  1272. // Name is a required field
  1273. Name *string `type:"string" required:"true"`
  1274. // The value of the attribute.
  1275. Value *string `type:"string"`
  1276. }
  1277. // String returns the string representation
  1278. func (s DeletableAttribute) String() string {
  1279. return awsutil.Prettify(s)
  1280. }
  1281. // GoString returns the string representation
  1282. func (s DeletableAttribute) GoString() string {
  1283. return s.String()
  1284. }
  1285. // Validate inspects the fields of the type to determine if they are valid.
  1286. func (s *DeletableAttribute) Validate() error {
  1287. invalidParams := request.ErrInvalidParams{Context: "DeletableAttribute"}
  1288. if s.Name == nil {
  1289. invalidParams.Add(request.NewErrParamRequired("Name"))
  1290. }
  1291. if invalidParams.Len() > 0 {
  1292. return invalidParams
  1293. }
  1294. return nil
  1295. }
  1296. // SetName sets the Name field's value.
  1297. func (s *DeletableAttribute) SetName(v string) *DeletableAttribute {
  1298. s.Name = &v
  1299. return s
  1300. }
  1301. // SetValue sets the Value field's value.
  1302. func (s *DeletableAttribute) SetValue(v string) *DeletableAttribute {
  1303. s.Value = &v
  1304. return s
  1305. }
  1306. type DeletableItem struct {
  1307. _ struct{} `type:"structure"`
  1308. Attributes []*DeletableAttribute `locationNameList:"Attribute" type:"list" flattened:"true"`
  1309. // Name is a required field
  1310. Name *string `locationName:"ItemName" type:"string" required:"true"`
  1311. }
  1312. // String returns the string representation
  1313. func (s DeletableItem) String() string {
  1314. return awsutil.Prettify(s)
  1315. }
  1316. // GoString returns the string representation
  1317. func (s DeletableItem) GoString() string {
  1318. return s.String()
  1319. }
  1320. // Validate inspects the fields of the type to determine if they are valid.
  1321. func (s *DeletableItem) Validate() error {
  1322. invalidParams := request.ErrInvalidParams{Context: "DeletableItem"}
  1323. if s.Name == nil {
  1324. invalidParams.Add(request.NewErrParamRequired("Name"))
  1325. }
  1326. if s.Attributes != nil {
  1327. for i, v := range s.Attributes {
  1328. if v == nil {
  1329. continue
  1330. }
  1331. if err := v.Validate(); err != nil {
  1332. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams))
  1333. }
  1334. }
  1335. }
  1336. if invalidParams.Len() > 0 {
  1337. return invalidParams
  1338. }
  1339. return nil
  1340. }
  1341. // SetAttributes sets the Attributes field's value.
  1342. func (s *DeletableItem) SetAttributes(v []*DeletableAttribute) *DeletableItem {
  1343. s.Attributes = v
  1344. return s
  1345. }
  1346. // SetName sets the Name field's value.
  1347. func (s *DeletableItem) SetName(v string) *DeletableItem {
  1348. s.Name = &v
  1349. return s
  1350. }
  1351. type DeleteAttributesInput struct {
  1352. _ struct{} `type:"structure"`
  1353. // A list of Attributes. Similar to columns on a spreadsheet, attributes represent
  1354. // categories of data that can be assigned to items.
  1355. Attributes []*DeletableAttribute `locationNameList:"Attribute" type:"list" flattened:"true"`
  1356. // The name of the domain in which to perform the operation.
  1357. //
  1358. // DomainName is a required field
  1359. DomainName *string `type:"string" required:"true"`
  1360. // The update condition which, if specified, determines whether the specified
  1361. // attributes will be deleted or not. The update condition must be satisfied
  1362. // in order for this request to be processed and the attributes to be deleted.
  1363. Expected *UpdateCondition `type:"structure"`
  1364. // The name of the item. Similar to rows on a spreadsheet, items represent individual
  1365. // objects that contain one or more value-attribute pairs.
  1366. //
  1367. // ItemName is a required field
  1368. ItemName *string `type:"string" required:"true"`
  1369. }
  1370. // String returns the string representation
  1371. func (s DeleteAttributesInput) String() string {
  1372. return awsutil.Prettify(s)
  1373. }
  1374. // GoString returns the string representation
  1375. func (s DeleteAttributesInput) GoString() string {
  1376. return s.String()
  1377. }
  1378. // Validate inspects the fields of the type to determine if they are valid.
  1379. func (s *DeleteAttributesInput) Validate() error {
  1380. invalidParams := request.ErrInvalidParams{Context: "DeleteAttributesInput"}
  1381. if s.DomainName == nil {
  1382. invalidParams.Add(request.NewErrParamRequired("DomainName"))
  1383. }
  1384. if s.ItemName == nil {
  1385. invalidParams.Add(request.NewErrParamRequired("ItemName"))
  1386. }
  1387. if s.Attributes != nil {
  1388. for i, v := range s.Attributes {
  1389. if v == nil {
  1390. continue
  1391. }
  1392. if err := v.Validate(); err != nil {
  1393. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams))
  1394. }
  1395. }
  1396. }
  1397. if invalidParams.Len() > 0 {
  1398. return invalidParams
  1399. }
  1400. return nil
  1401. }
  1402. // SetAttributes sets the Attributes field's value.
  1403. func (s *DeleteAttributesInput) SetAttributes(v []*DeletableAttribute) *DeleteAttributesInput {
  1404. s.Attributes = v
  1405. return s
  1406. }
  1407. // SetDomainName sets the DomainName field's value.
  1408. func (s *DeleteAttributesInput) SetDomainName(v string) *DeleteAttributesInput {
  1409. s.DomainName = &v
  1410. return s
  1411. }
  1412. // SetExpected sets the Expected field's value.
  1413. func (s *DeleteAttributesInput) SetExpected(v *UpdateCondition) *DeleteAttributesInput {
  1414. s.Expected = v
  1415. return s
  1416. }
  1417. // SetItemName sets the ItemName field's value.
  1418. func (s *DeleteAttributesInput) SetItemName(v string) *DeleteAttributesInput {
  1419. s.ItemName = &v
  1420. return s
  1421. }
  1422. type DeleteAttributesOutput struct {
  1423. _ struct{} `type:"structure"`
  1424. }
  1425. // String returns the string representation
  1426. func (s DeleteAttributesOutput) String() string {
  1427. return awsutil.Prettify(s)
  1428. }
  1429. // GoString returns the string representation
  1430. func (s DeleteAttributesOutput) GoString() string {
  1431. return s.String()
  1432. }
  1433. type DeleteDomainInput struct {
  1434. _ struct{} `type:"structure"`
  1435. // The name of the domain to delete.
  1436. //
  1437. // DomainName is a required field
  1438. DomainName *string `type:"string" required:"true"`
  1439. }
  1440. // String returns the string representation
  1441. func (s DeleteDomainInput) String() string {
  1442. return awsutil.Prettify(s)
  1443. }
  1444. // GoString returns the string representation
  1445. func (s DeleteDomainInput) GoString() string {
  1446. return s.String()
  1447. }
  1448. // Validate inspects the fields of the type to determine if they are valid.
  1449. func (s *DeleteDomainInput) Validate() error {
  1450. invalidParams := request.ErrInvalidParams{Context: "DeleteDomainInput"}
  1451. if s.DomainName == nil {
  1452. invalidParams.Add(request.NewErrParamRequired("DomainName"))
  1453. }
  1454. if invalidParams.Len() > 0 {
  1455. return invalidParams
  1456. }
  1457. return nil
  1458. }
  1459. // SetDomainName sets the DomainName field's value.
  1460. func (s *DeleteDomainInput) SetDomainName(v string) *DeleteDomainInput {
  1461. s.DomainName = &v
  1462. return s
  1463. }
  1464. type DeleteDomainOutput struct {
  1465. _ struct{} `type:"structure"`
  1466. }
  1467. // String returns the string representation
  1468. func (s DeleteDomainOutput) String() string {
  1469. return awsutil.Prettify(s)
  1470. }
  1471. // GoString returns the string representation
  1472. func (s DeleteDomainOutput) GoString() string {
  1473. return s.String()
  1474. }
  1475. type DomainMetadataInput struct {
  1476. _ struct{} `type:"structure"`
  1477. // The name of the domain for which to display the metadata of.
  1478. //
  1479. // DomainName is a required field
  1480. DomainName *string `type:"string" required:"true"`
  1481. }
  1482. // String returns the string representation
  1483. func (s DomainMetadataInput) String() string {
  1484. return awsutil.Prettify(s)
  1485. }
  1486. // GoString returns the string representation
  1487. func (s DomainMetadataInput) GoString() string {
  1488. return s.String()
  1489. }
  1490. // Validate inspects the fields of the type to determine if they are valid.
  1491. func (s *DomainMetadataInput) Validate() error {
  1492. invalidParams := request.ErrInvalidParams{Context: "DomainMetadataInput"}
  1493. if s.DomainName == nil {
  1494. invalidParams.Add(request.NewErrParamRequired("DomainName"))
  1495. }
  1496. if invalidParams.Len() > 0 {
  1497. return invalidParams
  1498. }
  1499. return nil
  1500. }
  1501. // SetDomainName sets the DomainName field's value.
  1502. func (s *DomainMetadataInput) SetDomainName(v string) *DomainMetadataInput {
  1503. s.DomainName = &v
  1504. return s
  1505. }
  1506. type DomainMetadataOutput struct {
  1507. _ struct{} `type:"structure"`
  1508. // The number of unique attribute names in the domain.
  1509. AttributeNameCount *int64 `type:"integer"`
  1510. // The total size of all unique attribute names in the domain, in bytes.
  1511. AttributeNamesSizeBytes *int64 `type:"long"`
  1512. // The number of all attribute name/value pairs in the domain.
  1513. AttributeValueCount *int64 `type:"integer"`
  1514. // The total size of all attribute values in the domain, in bytes.
  1515. AttributeValuesSizeBytes *int64 `type:"long"`
  1516. // The number of all items in the domain.
  1517. ItemCount *int64 `type:"integer"`
  1518. // The total size of all item names in the domain, in bytes.
  1519. ItemNamesSizeBytes *int64 `type:"long"`
  1520. // The data and time when metadata was calculated, in Epoch (UNIX) seconds.
  1521. Timestamp *int64 `type:"integer"`
  1522. }
  1523. // String returns the string representation
  1524. func (s DomainMetadataOutput) String() string {
  1525. return awsutil.Prettify(s)
  1526. }
  1527. // GoString returns the string representation
  1528. func (s DomainMetadataOutput) GoString() string {
  1529. return s.String()
  1530. }
  1531. // SetAttributeNameCount sets the AttributeNameCount field's value.
  1532. func (s *DomainMetadataOutput) SetAttributeNameCount(v int64) *DomainMetadataOutput {
  1533. s.AttributeNameCount = &v
  1534. return s
  1535. }
  1536. // SetAttributeNamesSizeBytes sets the AttributeNamesSizeBytes field's value.
  1537. func (s *DomainMetadataOutput) SetAttributeNamesSizeBytes(v int64) *DomainMetadataOutput {
  1538. s.AttributeNamesSizeBytes = &v
  1539. return s
  1540. }
  1541. // SetAttributeValueCount sets the AttributeValueCount field's value.
  1542. func (s *DomainMetadataOutput) SetAttributeValueCount(v int64) *DomainMetadataOutput {
  1543. s.AttributeValueCount = &v
  1544. return s
  1545. }
  1546. // SetAttributeValuesSizeBytes sets the AttributeValuesSizeBytes field's value.
  1547. func (s *DomainMetadataOutput) SetAttributeValuesSizeBytes(v int64) *DomainMetadataOutput {
  1548. s.AttributeValuesSizeBytes = &v
  1549. return s
  1550. }
  1551. // SetItemCount sets the ItemCount field's value.
  1552. func (s *DomainMetadataOutput) SetItemCount(v int64) *DomainMetadataOutput {
  1553. s.ItemCount = &v
  1554. return s
  1555. }
  1556. // SetItemNamesSizeBytes sets the ItemNamesSizeBytes field's value.
  1557. func (s *DomainMetadataOutput) SetItemNamesSizeBytes(v int64) *DomainMetadataOutput {
  1558. s.ItemNamesSizeBytes = &v
  1559. return s
  1560. }
  1561. // SetTimestamp sets the Timestamp field's value.
  1562. func (s *DomainMetadataOutput) SetTimestamp(v int64) *DomainMetadataOutput {
  1563. s.Timestamp = &v
  1564. return s
  1565. }
  1566. type GetAttributesInput struct {
  1567. _ struct{} `type:"structure"`
  1568. // The names of the attributes.
  1569. AttributeNames []*string `locationNameList:"AttributeName" type:"list" flattened:"true"`
  1570. // Determines whether or not strong consistency should be enforced when data
  1571. // is read from SimpleDB. If true
  1572. ConsistentRead *bool `type:"boolean"`
  1573. // The name of the domain in which to perform the operation.
  1574. //
  1575. // DomainName is a required field
  1576. DomainName *string `type:"string" required:"true"`
  1577. // The name of the item.
  1578. //
  1579. // ItemName is a required field
  1580. ItemName *string `type:"string" required:"true"`
  1581. }
  1582. // String returns the string representation
  1583. func (s GetAttributesInput) String() string {
  1584. return awsutil.Prettify(s)
  1585. }
  1586. // GoString returns the string representation
  1587. func (s GetAttributesInput) GoString() string {
  1588. return s.String()
  1589. }
  1590. // Validate inspects the fields of the type to determine if they are valid.
  1591. func (s *GetAttributesInput) Validate() error {
  1592. invalidParams := request.ErrInvalidParams{Context: "GetAttributesInput"}
  1593. if s.DomainName == nil {
  1594. invalidParams.Add(request.NewErrParamRequired("DomainName"))
  1595. }
  1596. if s.ItemName == nil {
  1597. invalidParams.Add(request.NewErrParamRequired("ItemName"))
  1598. }
  1599. if invalidParams.Len() > 0 {
  1600. return invalidParams
  1601. }
  1602. return nil
  1603. }
  1604. // SetAttributeNames sets the AttributeNames field's value.
  1605. func (s *GetAttributesInput) SetAttributeNames(v []*string) *GetAttributesInput {
  1606. s.AttributeNames = v
  1607. return s
  1608. }
  1609. // SetConsistentRead sets the ConsistentRead field's value.
  1610. func (s *GetAttributesInput) SetConsistentRead(v bool) *GetAttributesInput {
  1611. s.ConsistentRead = &v
  1612. return s
  1613. }
  1614. // SetDomainName sets the DomainName field's value.
  1615. func (s *GetAttributesInput) SetDomainName(v string) *GetAttributesInput {
  1616. s.DomainName = &v
  1617. return s
  1618. }
  1619. // SetItemName sets the ItemName field's value.
  1620. func (s *GetAttributesInput) SetItemName(v string) *GetAttributesInput {
  1621. s.ItemName = &v
  1622. return s
  1623. }
  1624. type GetAttributesOutput struct {
  1625. _ struct{} `type:"structure"`
  1626. // The list of attributes returned by the operation.
  1627. Attributes []*Attribute `locationNameList:"Attribute" type:"list" flattened:"true"`
  1628. }
  1629. // String returns the string representation
  1630. func (s GetAttributesOutput) String() string {
  1631. return awsutil.Prettify(s)
  1632. }
  1633. // GoString returns the string representation
  1634. func (s GetAttributesOutput) GoString() string {
  1635. return s.String()
  1636. }
  1637. // SetAttributes sets the Attributes field's value.
  1638. func (s *GetAttributesOutput) SetAttributes(v []*Attribute) *GetAttributesOutput {
  1639. s.Attributes = v
  1640. return s
  1641. }
  1642. type Item struct {
  1643. _ struct{} `type:"structure"`
  1644. AlternateNameEncoding *string `type:"string"`
  1645. // A list of attributes.
  1646. //
  1647. // Attributes is a required field
  1648. Attributes []*Attribute `locationNameList:"Attribute" type:"list" flattened:"true" required:"true"`
  1649. // The name of the item.
  1650. //
  1651. // Name is a required field
  1652. Name *string `type:"string" required:"true"`
  1653. }
  1654. // String returns the string representation
  1655. func (s Item) String() string {
  1656. return awsutil.Prettify(s)
  1657. }
  1658. // GoString returns the string representation
  1659. func (s Item) GoString() string {
  1660. return s.String()
  1661. }
  1662. // SetAlternateNameEncoding sets the AlternateNameEncoding field's value.
  1663. func (s *Item) SetAlternateNameEncoding(v string) *Item {
  1664. s.AlternateNameEncoding = &v
  1665. return s
  1666. }
  1667. // SetAttributes sets the Attributes field's value.
  1668. func (s *Item) SetAttributes(v []*Attribute) *Item {
  1669. s.Attributes = v
  1670. return s
  1671. }
  1672. // SetName sets the Name field's value.
  1673. func (s *Item) SetName(v string) *Item {
  1674. s.Name = &v
  1675. return s
  1676. }
  1677. type ListDomainsInput struct {
  1678. _ struct{} `type:"structure"`
  1679. // The maximum number of domain names you want returned. The range is 1 to 100.
  1680. // The default setting is 100.
  1681. MaxNumberOfDomains *int64 `type:"integer"`
  1682. // A string informing Amazon SimpleDB where to start the next list of domain
  1683. // names.
  1684. NextToken *string `type:"string"`
  1685. }
  1686. // String returns the string representation
  1687. func (s ListDomainsInput) String() string {
  1688. return awsutil.Prettify(s)
  1689. }
  1690. // GoString returns the string representation
  1691. func (s ListDomainsInput) GoString() string {
  1692. return s.String()
  1693. }
  1694. // SetMaxNumberOfDomains sets the MaxNumberOfDomains field's value.
  1695. func (s *ListDomainsInput) SetMaxNumberOfDomains(v int64) *ListDomainsInput {
  1696. s.MaxNumberOfDomains = &v
  1697. return s
  1698. }
  1699. // SetNextToken sets the NextToken field's value.
  1700. func (s *ListDomainsInput) SetNextToken(v string) *ListDomainsInput {
  1701. s.NextToken = &v
  1702. return s
  1703. }
  1704. type ListDomainsOutput struct {
  1705. _ struct{} `type:"structure"`
  1706. // A list of domain names that match the expression.
  1707. DomainNames []*string `locationNameList:"DomainName" type:"list" flattened:"true"`
  1708. // An opaque token indicating that there are more domains than the specified
  1709. // MaxNumberOfDomains
  1710. NextToken *string `type:"string"`
  1711. }
  1712. // String returns the string representation
  1713. func (s ListDomainsOutput) String() string {
  1714. return awsutil.Prettify(s)
  1715. }
  1716. // GoString returns the string representation
  1717. func (s ListDomainsOutput) GoString() string {
  1718. return s.String()
  1719. }
  1720. // SetDomainNames sets the DomainNames field's value.
  1721. func (s *ListDomainsOutput) SetDomainNames(v []*string) *ListDomainsOutput {
  1722. s.DomainNames = v
  1723. return s
  1724. }
  1725. // SetNextToken sets the NextToken field's value.
  1726. func (s *ListDomainsOutput) SetNextToken(v string) *ListDomainsOutput {
  1727. s.NextToken = &v
  1728. return s
  1729. }
  1730. type PutAttributesInput struct {
  1731. _ struct{} `type:"structure"`
  1732. // The list of attributes.
  1733. //
  1734. // Attributes is a required field
  1735. Attributes []*ReplaceableAttribute `locationNameList:"Attribute" type:"list" flattened:"true" required:"true"`
  1736. // The name of the domain in which to perform the operation.
  1737. //
  1738. // DomainName is a required field
  1739. DomainName *string `type:"string" required:"true"`
  1740. // The update condition which, if specified, determines whether the specified
  1741. // attributes will be updated or not. The update condition must be satisfied
  1742. // in order for this request to be processed and the attributes to be updated.
  1743. Expected *UpdateCondition `type:"structure"`
  1744. // The name of the item.
  1745. //
  1746. // ItemName is a required field
  1747. ItemName *string `type:"string" required:"true"`
  1748. }
  1749. // String returns the string representation
  1750. func (s PutAttributesInput) String() string {
  1751. return awsutil.Prettify(s)
  1752. }
  1753. // GoString returns the string representation
  1754. func (s PutAttributesInput) GoString() string {
  1755. return s.String()
  1756. }
  1757. // Validate inspects the fields of the type to determine if they are valid.
  1758. func (s *PutAttributesInput) Validate() error {
  1759. invalidParams := request.ErrInvalidParams{Context: "PutAttributesInput"}
  1760. if s.Attributes == nil {
  1761. invalidParams.Add(request.NewErrParamRequired("Attributes"))
  1762. }
  1763. if s.DomainName == nil {
  1764. invalidParams.Add(request.NewErrParamRequired("DomainName"))
  1765. }
  1766. if s.ItemName == nil {
  1767. invalidParams.Add(request.NewErrParamRequired("ItemName"))
  1768. }
  1769. if s.Attributes != nil {
  1770. for i, v := range s.Attributes {
  1771. if v == nil {
  1772. continue
  1773. }
  1774. if err := v.Validate(); err != nil {
  1775. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams))
  1776. }
  1777. }
  1778. }
  1779. if invalidParams.Len() > 0 {
  1780. return invalidParams
  1781. }
  1782. return nil
  1783. }
  1784. // SetAttributes sets the Attributes field's value.
  1785. func (s *PutAttributesInput) SetAttributes(v []*ReplaceableAttribute) *PutAttributesInput {
  1786. s.Attributes = v
  1787. return s
  1788. }
  1789. // SetDomainName sets the DomainName field's value.
  1790. func (s *PutAttributesInput) SetDomainName(v string) *PutAttributesInput {
  1791. s.DomainName = &v
  1792. return s
  1793. }
  1794. // SetExpected sets the Expected field's value.
  1795. func (s *PutAttributesInput) SetExpected(v *UpdateCondition) *PutAttributesInput {
  1796. s.Expected = v
  1797. return s
  1798. }
  1799. // SetItemName sets the ItemName field's value.
  1800. func (s *PutAttributesInput) SetItemName(v string) *PutAttributesInput {
  1801. s.ItemName = &v
  1802. return s
  1803. }
  1804. type PutAttributesOutput struct {
  1805. _ struct{} `type:"structure"`
  1806. }
  1807. // String returns the string representation
  1808. func (s PutAttributesOutput) String() string {
  1809. return awsutil.Prettify(s)
  1810. }
  1811. // GoString returns the string representation
  1812. func (s PutAttributesOutput) GoString() string {
  1813. return s.String()
  1814. }
  1815. type ReplaceableAttribute struct {
  1816. _ struct{} `type:"structure"`
  1817. // The name of the replaceable attribute.
  1818. //
  1819. // Name is a required field
  1820. Name *string `type:"string" required:"true"`
  1821. // A flag specifying whether or not to replace the attribute/value pair or to
  1822. // add a new attribute/value pair. The default setting is false
  1823. Replace *bool `type:"boolean"`
  1824. // The value of the replaceable attribute.
  1825. //
  1826. // Value is a required field
  1827. Value *string `type:"string" required:"true"`
  1828. }
  1829. // String returns the string representation
  1830. func (s ReplaceableAttribute) String() string {
  1831. return awsutil.Prettify(s)
  1832. }
  1833. // GoString returns the string representation
  1834. func (s ReplaceableAttribute) GoString() string {
  1835. return s.String()
  1836. }
  1837. // Validate inspects the fields of the type to determine if they are valid.
  1838. func (s *ReplaceableAttribute) Validate() error {
  1839. invalidParams := request.ErrInvalidParams{Context: "ReplaceableAttribute"}
  1840. if s.Name == nil {
  1841. invalidParams.Add(request.NewErrParamRequired("Name"))
  1842. }
  1843. if s.Value == nil {
  1844. invalidParams.Add(request.NewErrParamRequired("Value"))
  1845. }
  1846. if invalidParams.Len() > 0 {
  1847. return invalidParams
  1848. }
  1849. return nil
  1850. }
  1851. // SetName sets the Name field's value.
  1852. func (s *ReplaceableAttribute) SetName(v string) *ReplaceableAttribute {
  1853. s.Name = &v
  1854. return s
  1855. }
  1856. // SetReplace sets the Replace field's value.
  1857. func (s *ReplaceableAttribute) SetReplace(v bool) *ReplaceableAttribute {
  1858. s.Replace = &v
  1859. return s
  1860. }
  1861. // SetValue sets the Value field's value.
  1862. func (s *ReplaceableAttribute) SetValue(v string) *ReplaceableAttribute {
  1863. s.Value = &v
  1864. return s
  1865. }
  1866. type ReplaceableItem struct {
  1867. _ struct{} `type:"structure"`
  1868. // The list of attributes for a replaceable item.
  1869. //
  1870. // Attributes is a required field
  1871. Attributes []*ReplaceableAttribute `locationNameList:"Attribute" type:"list" flattened:"true" required:"true"`
  1872. // The name of the replaceable item.
  1873. //
  1874. // Name is a required field
  1875. Name *string `locationName:"ItemName" type:"string" required:"true"`
  1876. }
  1877. // String returns the string representation
  1878. func (s ReplaceableItem) String() string {
  1879. return awsutil.Prettify(s)
  1880. }
  1881. // GoString returns the string representation
  1882. func (s ReplaceableItem) GoString() string {
  1883. return s.String()
  1884. }
  1885. // Validate inspects the fields of the type to determine if they are valid.
  1886. func (s *ReplaceableItem) Validate() error {
  1887. invalidParams := request.ErrInvalidParams{Context: "ReplaceableItem"}
  1888. if s.Attributes == nil {
  1889. invalidParams.Add(request.NewErrParamRequired("Attributes"))
  1890. }
  1891. if s.Name == nil {
  1892. invalidParams.Add(request.NewErrParamRequired("Name"))
  1893. }
  1894. if s.Attributes != nil {
  1895. for i, v := range s.Attributes {
  1896. if v == nil {
  1897. continue
  1898. }
  1899. if err := v.Validate(); err != nil {
  1900. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams))
  1901. }
  1902. }
  1903. }
  1904. if invalidParams.Len() > 0 {
  1905. return invalidParams
  1906. }
  1907. return nil
  1908. }
  1909. // SetAttributes sets the Attributes field's value.
  1910. func (s *ReplaceableItem) SetAttributes(v []*ReplaceableAttribute) *ReplaceableItem {
  1911. s.Attributes = v
  1912. return s
  1913. }
  1914. // SetName sets the Name field's value.
  1915. func (s *ReplaceableItem) SetName(v string) *ReplaceableItem {
  1916. s.Name = &v
  1917. return s
  1918. }
  1919. type SelectInput struct {
  1920. _ struct{} `type:"structure"`
  1921. // Determines whether or not strong consistency should be enforced when data
  1922. // is read from SimpleDB. If true
  1923. ConsistentRead *bool `type:"boolean"`
  1924. // A string informing Amazon SimpleDB where to start the next list of ItemNames
  1925. NextToken *string `type:"string"`
  1926. // The expression used to query the domain.
  1927. //
  1928. // SelectExpression is a required field
  1929. SelectExpression *string `type:"string" required:"true"`
  1930. }
  1931. // String returns the string representation
  1932. func (s SelectInput) String() string {
  1933. return awsutil.Prettify(s)
  1934. }
  1935. // GoString returns the string representation
  1936. func (s SelectInput) GoString() string {
  1937. return s.String()
  1938. }
  1939. // Validate inspects the fields of the type to determine if they are valid.
  1940. func (s *SelectInput) Validate() error {
  1941. invalidParams := request.ErrInvalidParams{Context: "SelectInput"}
  1942. if s.SelectExpression == nil {
  1943. invalidParams.Add(request.NewErrParamRequired("SelectExpression"))
  1944. }
  1945. if invalidParams.Len() > 0 {
  1946. return invalidParams
  1947. }
  1948. return nil
  1949. }
  1950. // SetConsistentRead sets the ConsistentRead field's value.
  1951. func (s *SelectInput) SetConsistentRead(v bool) *SelectInput {
  1952. s.ConsistentRead = &v
  1953. return s
  1954. }
  1955. // SetNextToken sets the NextToken field's value.
  1956. func (s *SelectInput) SetNextToken(v string) *SelectInput {
  1957. s.NextToken = &v
  1958. return s
  1959. }
  1960. // SetSelectExpression sets the SelectExpression field's value.
  1961. func (s *SelectInput) SetSelectExpression(v string) *SelectInput {
  1962. s.SelectExpression = &v
  1963. return s
  1964. }
  1965. type SelectOutput struct {
  1966. _ struct{} `type:"structure"`
  1967. // A list of items that match the select expression.
  1968. Items []*Item `locationNameList:"Item" type:"list" flattened:"true"`
  1969. // An opaque token indicating that more items than MaxNumberOfItems
  1970. NextToken *string `type:"string"`
  1971. }
  1972. // String returns the string representation
  1973. func (s SelectOutput) String() string {
  1974. return awsutil.Prettify(s)
  1975. }
  1976. // GoString returns the string representation
  1977. func (s SelectOutput) GoString() string {
  1978. return s.String()
  1979. }
  1980. // SetItems sets the Items field's value.
  1981. func (s *SelectOutput) SetItems(v []*Item) *SelectOutput {
  1982. s.Items = v
  1983. return s
  1984. }
  1985. // SetNextToken sets the NextToken field's value.
  1986. func (s *SelectOutput) SetNextToken(v string) *SelectOutput {
  1987. s.NextToken = &v
  1988. return s
  1989. }
  1990. // Specifies the conditions under which data should be updated. If an update
  1991. // condition is specified for a request, the data will only be updated if the
  1992. // condition is satisfied. For example, if an attribute with a specific name
  1993. // and value exists, or if a specific attribute doesn't exist.
  1994. type UpdateCondition struct {
  1995. _ struct{} `type:"structure"`
  1996. // A value specifying whether or not the specified attribute must exist with
  1997. // the specified value in order for the update condition to be satisfied. Specify
  1998. // true if the attribute must exist for the update condition to be satisfied.
  1999. // Specify false if the attribute should not exist in order for the update condition
  2000. // to be satisfied.
  2001. Exists *bool `type:"boolean"`
  2002. // The name of the attribute involved in the condition.
  2003. Name *string `type:"string"`
  2004. // The value of an attribute. This value can only be specified when the Exists
  2005. // parameter is equal to true.
  2006. Value *string `type:"string"`
  2007. }
  2008. // String returns the string representation
  2009. func (s UpdateCondition) String() string {
  2010. return awsutil.Prettify(s)
  2011. }
  2012. // GoString returns the string representation
  2013. func (s UpdateCondition) GoString() string {
  2014. return s.String()
  2015. }
  2016. // SetExists sets the Exists field's value.
  2017. func (s *UpdateCondition) SetExists(v bool) *UpdateCondition {
  2018. s.Exists = &v
  2019. return s
  2020. }
  2021. // SetName sets the Name field's value.
  2022. func (s *UpdateCondition) SetName(v string) *UpdateCondition {
  2023. s.Name = &v
  2024. return s
  2025. }
  2026. // SetValue sets the Value field's value.
  2027. func (s *UpdateCondition) SetValue(v string) *UpdateCondition {
  2028. s.Value = &v
  2029. return s
  2030. }