api.go 274 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package dynamodb provides a client for Amazon DynamoDB.
  3. package dynamodb
  4. import (
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws/awsutil"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. )
  10. const opBatchGetItem = "BatchGetItem"
  11. // BatchGetItemRequest generates a "aws/request.Request" representing the
  12. // client's request for the BatchGetItem operation. The "output" return
  13. // value can be used to capture response data after the request's "Send" method
  14. // is called.
  15. //
  16. // Creating a request object using this method should be used when you want to inject
  17. // custom logic into the request's lifecycle using a custom handler, or if you want to
  18. // access properties on the request object before or after sending the request. If
  19. // you just want the service response, call the BatchGetItem method directly
  20. // instead.
  21. //
  22. // Note: You must call the "Send" method on the returned request object in order
  23. // to execute the request.
  24. //
  25. // // Example sending a request using the BatchGetItemRequest method.
  26. // req, resp := client.BatchGetItemRequest(params)
  27. //
  28. // err := req.Send()
  29. // if err == nil { // resp is now filled
  30. // fmt.Println(resp)
  31. // }
  32. //
  33. func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.Request, output *BatchGetItemOutput) {
  34. op := &request.Operation{
  35. Name: opBatchGetItem,
  36. HTTPMethod: "POST",
  37. HTTPPath: "/",
  38. Paginator: &request.Paginator{
  39. InputTokens: []string{"RequestItems"},
  40. OutputTokens: []string{"UnprocessedKeys"},
  41. LimitToken: "",
  42. TruncationToken: "",
  43. },
  44. }
  45. if input == nil {
  46. input = &BatchGetItemInput{}
  47. }
  48. req = c.newRequest(op, input, output)
  49. output = &BatchGetItemOutput{}
  50. req.Data = output
  51. return
  52. }
  53. // The BatchGetItem operation returns the attributes of one or more items from
  54. // one or more tables. You identify requested items by primary key.
  55. //
  56. // A single operation can retrieve up to 16 MB of data, which can contain as
  57. // many as 100 items. BatchGetItem will return a partial result if the response
  58. // size limit is exceeded, the table's provisioned throughput is exceeded, or
  59. // an internal processing failure occurs. If a partial result is returned, the
  60. // operation returns a value for UnprocessedKeys. You can use this value to
  61. // retry the operation starting with the next item to get.
  62. //
  63. // If you request more than 100 items BatchGetItem will return a ValidationException
  64. // with the message "Too many items requested for the BatchGetItem call".
  65. //
  66. // For example, if you ask to retrieve 100 items, but each individual item
  67. // is 300 KB in size, the system returns 52 items (so as not to exceed the 16
  68. // MB limit). It also returns an appropriate UnprocessedKeys value so you can
  69. // get the next page of results. If desired, your application can include its
  70. // own logic to assemble the pages of results into one data set.
  71. //
  72. // If none of the items can be processed due to insufficient provisioned throughput
  73. // on all of the tables in the request, then BatchGetItem will return a ProvisionedThroughputExceededException.
  74. // If at least one of the items is successfully processed, then BatchGetItem
  75. // completes successfully, while returning the keys of the unread items in UnprocessedKeys.
  76. //
  77. // If DynamoDB returns any unprocessed items, you should retry the batch operation
  78. // on those items. However, we strongly recommend that you use an exponential
  79. // backoff algorithm. If you retry the batch operation immediately, the underlying
  80. // read or write requests can still fail due to throttling on the individual
  81. // tables. If you delay the batch operation using exponential backoff, the individual
  82. // requests in the batch are much more likely to succeed.
  83. //
  84. // For more information, see Batch Operations and Error Handling (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations)
  85. // in the Amazon DynamoDB Developer Guide.
  86. //
  87. // By default, BatchGetItem performs eventually consistent reads on every
  88. // table in the request. If you want strongly consistent reads instead, you
  89. // can set ConsistentRead to true for any or all tables.
  90. //
  91. // In order to minimize response latency, BatchGetItem retrieves items in parallel.
  92. //
  93. // When designing your application, keep in mind that DynamoDB does not return
  94. // items in any particular order. To help parse the response by item, include
  95. // the primary key values for the items in your request in the AttributesToGet
  96. // parameter.
  97. //
  98. // If a requested item does not exist, it is not returned in the result. Requests
  99. // for nonexistent items consume the minimum read capacity units according to
  100. // the type of read. For more information, see Capacity Units Calculations (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations)
  101. // in the Amazon DynamoDB Developer Guide.
  102. func (c *DynamoDB) BatchGetItem(input *BatchGetItemInput) (*BatchGetItemOutput, error) {
  103. req, out := c.BatchGetItemRequest(input)
  104. err := req.Send()
  105. return out, err
  106. }
  107. // BatchGetItemPages iterates over the pages of a BatchGetItem operation,
  108. // calling the "fn" function with the response data for each page. To stop
  109. // iterating, return false from the fn function.
  110. //
  111. // See BatchGetItem method for more information on how to use this operation.
  112. //
  113. // Note: This operation can generate multiple requests to a service.
  114. //
  115. // // Example iterating over at most 3 pages of a BatchGetItem operation.
  116. // pageNum := 0
  117. // err := client.BatchGetItemPages(params,
  118. // func(page *BatchGetItemOutput, lastPage bool) bool {
  119. // pageNum++
  120. // fmt.Println(page)
  121. // return pageNum <= 3
  122. // })
  123. //
  124. func (c *DynamoDB) BatchGetItemPages(input *BatchGetItemInput, fn func(p *BatchGetItemOutput, lastPage bool) (shouldContinue bool)) error {
  125. page, _ := c.BatchGetItemRequest(input)
  126. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  127. return page.EachPage(func(p interface{}, lastPage bool) bool {
  128. return fn(p.(*BatchGetItemOutput), lastPage)
  129. })
  130. }
  131. const opBatchWriteItem = "BatchWriteItem"
  132. // BatchWriteItemRequest generates a "aws/request.Request" representing the
  133. // client's request for the BatchWriteItem operation. The "output" return
  134. // value can be used to capture response data after the request's "Send" method
  135. // is called.
  136. //
  137. // Creating a request object using this method should be used when you want to inject
  138. // custom logic into the request's lifecycle using a custom handler, or if you want to
  139. // access properties on the request object before or after sending the request. If
  140. // you just want the service response, call the BatchWriteItem method directly
  141. // instead.
  142. //
  143. // Note: You must call the "Send" method on the returned request object in order
  144. // to execute the request.
  145. //
  146. // // Example sending a request using the BatchWriteItemRequest method.
  147. // req, resp := client.BatchWriteItemRequest(params)
  148. //
  149. // err := req.Send()
  150. // if err == nil { // resp is now filled
  151. // fmt.Println(resp)
  152. // }
  153. //
  154. func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *request.Request, output *BatchWriteItemOutput) {
  155. op := &request.Operation{
  156. Name: opBatchWriteItem,
  157. HTTPMethod: "POST",
  158. HTTPPath: "/",
  159. }
  160. if input == nil {
  161. input = &BatchWriteItemInput{}
  162. }
  163. req = c.newRequest(op, input, output)
  164. output = &BatchWriteItemOutput{}
  165. req.Data = output
  166. return
  167. }
  168. // The BatchWriteItem operation puts or deletes multiple items in one or more
  169. // tables. A single call to BatchWriteItem can write up to 16 MB of data, which
  170. // can comprise as many as 25 put or delete requests. Individual items to be
  171. // written can be as large as 400 KB.
  172. //
  173. // BatchWriteItem cannot update items. To update items, use the UpdateItem
  174. // API.
  175. //
  176. // The individual PutItem and DeleteItem operations specified in BatchWriteItem
  177. // are atomic; however BatchWriteItem as a whole is not. If any requested operations
  178. // fail because the table's provisioned throughput is exceeded or an internal
  179. // processing failure occurs, the failed operations are returned in the UnprocessedItems
  180. // response parameter. You can investigate and optionally resend the requests.
  181. // Typically, you would call BatchWriteItem in a loop. Each iteration would
  182. // check for unprocessed items and submit a new BatchWriteItem request with
  183. // those unprocessed items until all items have been processed.
  184. //
  185. // Note that if none of the items can be processed due to insufficient provisioned
  186. // throughput on all of the tables in the request, then BatchWriteItem will
  187. // return a ProvisionedThroughputExceededException.
  188. //
  189. // If DynamoDB returns any unprocessed items, you should retry the batch operation
  190. // on those items. However, we strongly recommend that you use an exponential
  191. // backoff algorithm. If you retry the batch operation immediately, the underlying
  192. // read or write requests can still fail due to throttling on the individual
  193. // tables. If you delay the batch operation using exponential backoff, the individual
  194. // requests in the batch are much more likely to succeed.
  195. //
  196. // For more information, see Batch Operations and Error Handling (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations)
  197. // in the Amazon DynamoDB Developer Guide.
  198. //
  199. // With BatchWriteItem, you can efficiently write or delete large amounts
  200. // of data, such as from Amazon Elastic MapReduce (EMR), or copy data from another
  201. // database into DynamoDB. In order to improve performance with these large-scale
  202. // operations, BatchWriteItem does not behave in the same way as individual
  203. // PutItem and DeleteItem calls would. For example, you cannot specify conditions
  204. // on individual put and delete requests, and BatchWriteItem does not return
  205. // deleted items in the response.
  206. //
  207. // If you use a programming language that supports concurrency, you can use
  208. // threads to write items in parallel. Your application must include the necessary
  209. // logic to manage the threads. With languages that don't support threading,
  210. // you must update or delete the specified items one at a time. In both situations,
  211. // BatchWriteItem provides an alternative where the API performs the specified
  212. // put and delete operations in parallel, giving you the power of the thread
  213. // pool approach without having to introduce complexity into your application.
  214. //
  215. // Parallel processing reduces latency, but each specified put and delete request
  216. // consumes the same number of write capacity units whether it is processed
  217. // in parallel or not. Delete operations on nonexistent items consume one write
  218. // capacity unit.
  219. //
  220. // If one or more of the following is true, DynamoDB rejects the entire batch
  221. // write operation:
  222. //
  223. // One or more tables specified in the BatchWriteItem request does not exist.
  224. //
  225. // Primary key attributes specified on an item in the request do not match
  226. // those in the corresponding table's primary key schema.
  227. //
  228. // You try to perform multiple operations on the same item in the same BatchWriteItem
  229. // request. For example, you cannot put and delete the same item in the same
  230. // BatchWriteItem request.
  231. //
  232. // There are more than 25 requests in the batch.
  233. //
  234. // Any individual item in a batch exceeds 400 KB.
  235. //
  236. // The total request size exceeds 16 MB.
  237. func (c *DynamoDB) BatchWriteItem(input *BatchWriteItemInput) (*BatchWriteItemOutput, error) {
  238. req, out := c.BatchWriteItemRequest(input)
  239. err := req.Send()
  240. return out, err
  241. }
  242. const opCreateTable = "CreateTable"
  243. // CreateTableRequest generates a "aws/request.Request" representing the
  244. // client's request for the CreateTable operation. The "output" return
  245. // value can be used to capture response data after the request's "Send" method
  246. // is called.
  247. //
  248. // Creating a request object using this method should be used when you want to inject
  249. // custom logic into the request's lifecycle using a custom handler, or if you want to
  250. // access properties on the request object before or after sending the request. If
  251. // you just want the service response, call the CreateTable method directly
  252. // instead.
  253. //
  254. // Note: You must call the "Send" method on the returned request object in order
  255. // to execute the request.
  256. //
  257. // // Example sending a request using the CreateTableRequest method.
  258. // req, resp := client.CreateTableRequest(params)
  259. //
  260. // err := req.Send()
  261. // if err == nil { // resp is now filled
  262. // fmt.Println(resp)
  263. // }
  264. //
  265. func (c *DynamoDB) CreateTableRequest(input *CreateTableInput) (req *request.Request, output *CreateTableOutput) {
  266. op := &request.Operation{
  267. Name: opCreateTable,
  268. HTTPMethod: "POST",
  269. HTTPPath: "/",
  270. }
  271. if input == nil {
  272. input = &CreateTableInput{}
  273. }
  274. req = c.newRequest(op, input, output)
  275. output = &CreateTableOutput{}
  276. req.Data = output
  277. return
  278. }
  279. // The CreateTable operation adds a new table to your account. In an AWS account,
  280. // table names must be unique within each region. That is, you can have two
  281. // tables with same name if you create the tables in different regions.
  282. //
  283. // CreateTable is an asynchronous operation. Upon receiving a CreateTable
  284. // request, DynamoDB immediately returns a response with a TableStatus of CREATING.
  285. // After the table is created, DynamoDB sets the TableStatus to ACTIVE. You
  286. // can perform read and write operations only on an ACTIVE table.
  287. //
  288. // You can optionally define secondary indexes on the new table, as part of
  289. // the CreateTable operation. If you want to create multiple tables with secondary
  290. // indexes on them, you must create the tables sequentially. Only one table
  291. // with secondary indexes can be in the CREATING state at any given time.
  292. //
  293. // You can use the DescribeTable API to check the table status.
  294. func (c *DynamoDB) CreateTable(input *CreateTableInput) (*CreateTableOutput, error) {
  295. req, out := c.CreateTableRequest(input)
  296. err := req.Send()
  297. return out, err
  298. }
  299. const opDeleteItem = "DeleteItem"
  300. // DeleteItemRequest generates a "aws/request.Request" representing the
  301. // client's request for the DeleteItem operation. The "output" return
  302. // value can be used to capture response data after the request's "Send" method
  303. // is called.
  304. //
  305. // Creating a request object using this method should be used when you want to inject
  306. // custom logic into the request's lifecycle using a custom handler, or if you want to
  307. // access properties on the request object before or after sending the request. If
  308. // you just want the service response, call the DeleteItem method directly
  309. // instead.
  310. //
  311. // Note: You must call the "Send" method on the returned request object in order
  312. // to execute the request.
  313. //
  314. // // Example sending a request using the DeleteItemRequest method.
  315. // req, resp := client.DeleteItemRequest(params)
  316. //
  317. // err := req.Send()
  318. // if err == nil { // resp is now filled
  319. // fmt.Println(resp)
  320. // }
  321. //
  322. func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) (req *request.Request, output *DeleteItemOutput) {
  323. op := &request.Operation{
  324. Name: opDeleteItem,
  325. HTTPMethod: "POST",
  326. HTTPPath: "/",
  327. }
  328. if input == nil {
  329. input = &DeleteItemInput{}
  330. }
  331. req = c.newRequest(op, input, output)
  332. output = &DeleteItemOutput{}
  333. req.Data = output
  334. return
  335. }
  336. // Deletes a single item in a table by primary key. You can perform a conditional
  337. // delete operation that deletes the item if it exists, or if it has an expected
  338. // attribute value.
  339. //
  340. // In addition to deleting an item, you can also return the item's attribute
  341. // values in the same operation, using the ReturnValues parameter.
  342. //
  343. // Unless you specify conditions, the DeleteItem is an idempotent operation;
  344. // running it multiple times on the same item or attribute does not result in
  345. // an error response.
  346. //
  347. // Conditional deletes are useful for deleting items only if specific conditions
  348. // are met. If those conditions are met, DynamoDB performs the delete. Otherwise,
  349. // the item is not deleted.
  350. func (c *DynamoDB) DeleteItem(input *DeleteItemInput) (*DeleteItemOutput, error) {
  351. req, out := c.DeleteItemRequest(input)
  352. err := req.Send()
  353. return out, err
  354. }
  355. const opDeleteTable = "DeleteTable"
  356. // DeleteTableRequest generates a "aws/request.Request" representing the
  357. // client's request for the DeleteTable operation. The "output" return
  358. // value can be used to capture response data after the request's "Send" method
  359. // is called.
  360. //
  361. // Creating a request object using this method should be used when you want to inject
  362. // custom logic into the request's lifecycle using a custom handler, or if you want to
  363. // access properties on the request object before or after sending the request. If
  364. // you just want the service response, call the DeleteTable method directly
  365. // instead.
  366. //
  367. // Note: You must call the "Send" method on the returned request object in order
  368. // to execute the request.
  369. //
  370. // // Example sending a request using the DeleteTableRequest method.
  371. // req, resp := client.DeleteTableRequest(params)
  372. //
  373. // err := req.Send()
  374. // if err == nil { // resp is now filled
  375. // fmt.Println(resp)
  376. // }
  377. //
  378. func (c *DynamoDB) DeleteTableRequest(input *DeleteTableInput) (req *request.Request, output *DeleteTableOutput) {
  379. op := &request.Operation{
  380. Name: opDeleteTable,
  381. HTTPMethod: "POST",
  382. HTTPPath: "/",
  383. }
  384. if input == nil {
  385. input = &DeleteTableInput{}
  386. }
  387. req = c.newRequest(op, input, output)
  388. output = &DeleteTableOutput{}
  389. req.Data = output
  390. return
  391. }
  392. // The DeleteTable operation deletes a table and all of its items. After a DeleteTable
  393. // request, the specified table is in the DELETING state until DynamoDB completes
  394. // the deletion. If the table is in the ACTIVE state, you can delete it. If
  395. // a table is in CREATING or UPDATING states, then DynamoDB returns a ResourceInUseException.
  396. // If the specified table does not exist, DynamoDB returns a ResourceNotFoundException.
  397. // If table is already in the DELETING state, no error is returned.
  398. //
  399. // DynamoDB might continue to accept data read and write operations, such
  400. // as GetItem and PutItem, on a table in the DELETING state until the table
  401. // deletion is complete.
  402. //
  403. // When you delete a table, any indexes on that table are also deleted.
  404. //
  405. // If you have DynamoDB Streams enabled on the table, then the corresponding
  406. // stream on that table goes into the DISABLED state, and the stream is automatically
  407. // deleted after 24 hours.
  408. //
  409. // Use the DescribeTable API to check the status of the table.
  410. func (c *DynamoDB) DeleteTable(input *DeleteTableInput) (*DeleteTableOutput, error) {
  411. req, out := c.DeleteTableRequest(input)
  412. err := req.Send()
  413. return out, err
  414. }
  415. const opDescribeLimits = "DescribeLimits"
  416. // DescribeLimitsRequest generates a "aws/request.Request" representing the
  417. // client's request for the DescribeLimits operation. The "output" return
  418. // value can be used to capture response data after the request's "Send" method
  419. // is called.
  420. //
  421. // Creating a request object using this method should be used when you want to inject
  422. // custom logic into the request's lifecycle using a custom handler, or if you want to
  423. // access properties on the request object before or after sending the request. If
  424. // you just want the service response, call the DescribeLimits method directly
  425. // instead.
  426. //
  427. // Note: You must call the "Send" method on the returned request object in order
  428. // to execute the request.
  429. //
  430. // // Example sending a request using the DescribeLimitsRequest method.
  431. // req, resp := client.DescribeLimitsRequest(params)
  432. //
  433. // err := req.Send()
  434. // if err == nil { // resp is now filled
  435. // fmt.Println(resp)
  436. // }
  437. //
  438. func (c *DynamoDB) DescribeLimitsRequest(input *DescribeLimitsInput) (req *request.Request, output *DescribeLimitsOutput) {
  439. op := &request.Operation{
  440. Name: opDescribeLimits,
  441. HTTPMethod: "POST",
  442. HTTPPath: "/",
  443. }
  444. if input == nil {
  445. input = &DescribeLimitsInput{}
  446. }
  447. req = c.newRequest(op, input, output)
  448. output = &DescribeLimitsOutput{}
  449. req.Data = output
  450. return
  451. }
  452. // Returns the current provisioned-capacity limits for your AWS account in a
  453. // region, both for the region as a whole and for any one DynamoDB table that
  454. // you create there.
  455. //
  456. // When you establish an AWS account, the account has initial limits on the
  457. // maximum read capacity units and write capacity units that you can provision
  458. // across all of your DynamoDB tables in a given region. Also, there are per-table
  459. // limits that apply when you create a table there. For more information, see
  460. // Limits (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
  461. // page in the Amazon DynamoDB Developer Guide.
  462. //
  463. // Although you can increase these limits by filing a case at AWS Support Center
  464. // (https://console.aws.amazon.com/support/home#/), obtaining the increase is
  465. // not instantaneous. The DescribeLimits API lets you write code to compare
  466. // the capacity you are currently using to those limits imposed by your account
  467. // so that you have enough time to apply for an increase before you hit a limit.
  468. //
  469. // For example, you could use one of the AWS SDKs to do the following:
  470. //
  471. // Call DescribeLimits for a particular region to obtain your current account
  472. // limits on provisioned capacity there.
  473. //
  474. // Create a variable to hold the aggregate read capacity units provisioned
  475. // for all your tables in that region, and one to hold the aggregate write capacity
  476. // units. Zero them both.
  477. //
  478. // Call ListTables to obtain a list of all your DynamoDB tables.
  479. //
  480. // For each table name listed by ListTables, do the following:
  481. //
  482. // Call DescribeTable with the table name.
  483. //
  484. // Use the data returned by DescribeTable to add the read capacity units and
  485. // write capacity units provisioned for the table itself to your variables.
  486. //
  487. // If the table has one or more global secondary indexes (GSIs), loop over
  488. // these GSIs and add their provisioned capacity values to your variables as
  489. // well.
  490. //
  491. // Report the account limits for that region returned by DescribeLimits,
  492. // along with the total current provisioned capacity levels you have calculated.
  493. //
  494. // This will let you see whether you are getting close to your account-level
  495. // limits.
  496. //
  497. // The per-table limits apply only when you are creating a new table. They
  498. // restrict the sum of the provisioned capacity of the new table itself and
  499. // all its global secondary indexes.
  500. //
  501. // For existing tables and their GSIs, DynamoDB will not let you increase provisioned
  502. // capacity extremely rapidly, but the only upper limit that applies is that
  503. // the aggregate provisioned capacity over all your tables and GSIs cannot exceed
  504. // either of the per-account limits.
  505. //
  506. // DescribeLimits should only be called periodically. You can expect throttling
  507. // errors if you call it more than once in a minute.
  508. //
  509. // The DescribeLimits Request element has no content.
  510. func (c *DynamoDB) DescribeLimits(input *DescribeLimitsInput) (*DescribeLimitsOutput, error) {
  511. req, out := c.DescribeLimitsRequest(input)
  512. err := req.Send()
  513. return out, err
  514. }
  515. const opDescribeTable = "DescribeTable"
  516. // DescribeTableRequest generates a "aws/request.Request" representing the
  517. // client's request for the DescribeTable operation. The "output" return
  518. // value can be used to capture response data after the request's "Send" method
  519. // is called.
  520. //
  521. // Creating a request object using this method should be used when you want to inject
  522. // custom logic into the request's lifecycle using a custom handler, or if you want to
  523. // access properties on the request object before or after sending the request. If
  524. // you just want the service response, call the DescribeTable method directly
  525. // instead.
  526. //
  527. // Note: You must call the "Send" method on the returned request object in order
  528. // to execute the request.
  529. //
  530. // // Example sending a request using the DescribeTableRequest method.
  531. // req, resp := client.DescribeTableRequest(params)
  532. //
  533. // err := req.Send()
  534. // if err == nil { // resp is now filled
  535. // fmt.Println(resp)
  536. // }
  537. //
  538. func (c *DynamoDB) DescribeTableRequest(input *DescribeTableInput) (req *request.Request, output *DescribeTableOutput) {
  539. op := &request.Operation{
  540. Name: opDescribeTable,
  541. HTTPMethod: "POST",
  542. HTTPPath: "/",
  543. }
  544. if input == nil {
  545. input = &DescribeTableInput{}
  546. }
  547. req = c.newRequest(op, input, output)
  548. output = &DescribeTableOutput{}
  549. req.Data = output
  550. return
  551. }
  552. // Returns information about the table, including the current status of the
  553. // table, when it was created, the primary key schema, and any indexes on the
  554. // table.
  555. //
  556. // If you issue a DescribeTable request immediately after a CreateTable request,
  557. // DynamoDB might return a ResourceNotFoundException. This is because DescribeTable
  558. // uses an eventually consistent query, and the metadata for your table might
  559. // not be available at that moment. Wait for a few seconds, and then try the
  560. // DescribeTable request again.
  561. func (c *DynamoDB) DescribeTable(input *DescribeTableInput) (*DescribeTableOutput, error) {
  562. req, out := c.DescribeTableRequest(input)
  563. err := req.Send()
  564. return out, err
  565. }
  566. const opGetItem = "GetItem"
  567. // GetItemRequest generates a "aws/request.Request" representing the
  568. // client's request for the GetItem operation. The "output" return
  569. // value can be used to capture response data after the request's "Send" method
  570. // is called.
  571. //
  572. // Creating a request object using this method should be used when you want to inject
  573. // custom logic into the request's lifecycle using a custom handler, or if you want to
  574. // access properties on the request object before or after sending the request. If
  575. // you just want the service response, call the GetItem method directly
  576. // instead.
  577. //
  578. // Note: You must call the "Send" method on the returned request object in order
  579. // to execute the request.
  580. //
  581. // // Example sending a request using the GetItemRequest method.
  582. // req, resp := client.GetItemRequest(params)
  583. //
  584. // err := req.Send()
  585. // if err == nil { // resp is now filled
  586. // fmt.Println(resp)
  587. // }
  588. //
  589. func (c *DynamoDB) GetItemRequest(input *GetItemInput) (req *request.Request, output *GetItemOutput) {
  590. op := &request.Operation{
  591. Name: opGetItem,
  592. HTTPMethod: "POST",
  593. HTTPPath: "/",
  594. }
  595. if input == nil {
  596. input = &GetItemInput{}
  597. }
  598. req = c.newRequest(op, input, output)
  599. output = &GetItemOutput{}
  600. req.Data = output
  601. return
  602. }
  603. // The GetItem operation returns a set of attributes for the item with the given
  604. // primary key. If there is no matching item, GetItem does not return any data.
  605. //
  606. // GetItem provides an eventually consistent read by default. If your application
  607. // requires a strongly consistent read, set ConsistentRead to true. Although
  608. // a strongly consistent read might take more time than an eventually consistent
  609. // read, it always returns the last updated value.
  610. func (c *DynamoDB) GetItem(input *GetItemInput) (*GetItemOutput, error) {
  611. req, out := c.GetItemRequest(input)
  612. err := req.Send()
  613. return out, err
  614. }
  615. const opListTables = "ListTables"
  616. // ListTablesRequest generates a "aws/request.Request" representing the
  617. // client's request for the ListTables operation. The "output" return
  618. // value can be used to capture response data after the request's "Send" method
  619. // is called.
  620. //
  621. // Creating a request object using this method should be used when you want to inject
  622. // custom logic into the request's lifecycle using a custom handler, or if you want to
  623. // access properties on the request object before or after sending the request. If
  624. // you just want the service response, call the ListTables method directly
  625. // instead.
  626. //
  627. // Note: You must call the "Send" method on the returned request object in order
  628. // to execute the request.
  629. //
  630. // // Example sending a request using the ListTablesRequest method.
  631. // req, resp := client.ListTablesRequest(params)
  632. //
  633. // err := req.Send()
  634. // if err == nil { // resp is now filled
  635. // fmt.Println(resp)
  636. // }
  637. //
  638. func (c *DynamoDB) ListTablesRequest(input *ListTablesInput) (req *request.Request, output *ListTablesOutput) {
  639. op := &request.Operation{
  640. Name: opListTables,
  641. HTTPMethod: "POST",
  642. HTTPPath: "/",
  643. Paginator: &request.Paginator{
  644. InputTokens: []string{"ExclusiveStartTableName"},
  645. OutputTokens: []string{"LastEvaluatedTableName"},
  646. LimitToken: "Limit",
  647. TruncationToken: "",
  648. },
  649. }
  650. if input == nil {
  651. input = &ListTablesInput{}
  652. }
  653. req = c.newRequest(op, input, output)
  654. output = &ListTablesOutput{}
  655. req.Data = output
  656. return
  657. }
  658. // Returns an array of table names associated with the current account and endpoint.
  659. // The output from ListTables is paginated, with each page returning a maximum
  660. // of 100 table names.
  661. func (c *DynamoDB) ListTables(input *ListTablesInput) (*ListTablesOutput, error) {
  662. req, out := c.ListTablesRequest(input)
  663. err := req.Send()
  664. return out, err
  665. }
  666. // ListTablesPages iterates over the pages of a ListTables operation,
  667. // calling the "fn" function with the response data for each page. To stop
  668. // iterating, return false from the fn function.
  669. //
  670. // See ListTables method for more information on how to use this operation.
  671. //
  672. // Note: This operation can generate multiple requests to a service.
  673. //
  674. // // Example iterating over at most 3 pages of a ListTables operation.
  675. // pageNum := 0
  676. // err := client.ListTablesPages(params,
  677. // func(page *ListTablesOutput, lastPage bool) bool {
  678. // pageNum++
  679. // fmt.Println(page)
  680. // return pageNum <= 3
  681. // })
  682. //
  683. func (c *DynamoDB) ListTablesPages(input *ListTablesInput, fn func(p *ListTablesOutput, lastPage bool) (shouldContinue bool)) error {
  684. page, _ := c.ListTablesRequest(input)
  685. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  686. return page.EachPage(func(p interface{}, lastPage bool) bool {
  687. return fn(p.(*ListTablesOutput), lastPage)
  688. })
  689. }
  690. const opPutItem = "PutItem"
  691. // PutItemRequest generates a "aws/request.Request" representing the
  692. // client's request for the PutItem operation. The "output" return
  693. // value can be used to capture response data after the request's "Send" method
  694. // is called.
  695. //
  696. // Creating a request object using this method should be used when you want to inject
  697. // custom logic into the request's lifecycle using a custom handler, or if you want to
  698. // access properties on the request object before or after sending the request. If
  699. // you just want the service response, call the PutItem method directly
  700. // instead.
  701. //
  702. // Note: You must call the "Send" method on the returned request object in order
  703. // to execute the request.
  704. //
  705. // // Example sending a request using the PutItemRequest method.
  706. // req, resp := client.PutItemRequest(params)
  707. //
  708. // err := req.Send()
  709. // if err == nil { // resp is now filled
  710. // fmt.Println(resp)
  711. // }
  712. //
  713. func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, output *PutItemOutput) {
  714. op := &request.Operation{
  715. Name: opPutItem,
  716. HTTPMethod: "POST",
  717. HTTPPath: "/",
  718. }
  719. if input == nil {
  720. input = &PutItemInput{}
  721. }
  722. req = c.newRequest(op, input, output)
  723. output = &PutItemOutput{}
  724. req.Data = output
  725. return
  726. }
  727. // Creates a new item, or replaces an old item with a new item. If an item that
  728. // has the same primary key as the new item already exists in the specified
  729. // table, the new item completely replaces the existing item. You can perform
  730. // a conditional put operation (add a new item if one with the specified primary
  731. // key doesn't exist), or replace an existing item if it has certain attribute
  732. // values.
  733. //
  734. // In addition to putting an item, you can also return the item's attribute
  735. // values in the same operation, using the ReturnValues parameter.
  736. //
  737. // When you add an item, the primary key attribute(s) are the only required
  738. // attributes. Attribute values cannot be null. String and Binary type attributes
  739. // must have lengths greater than zero. Set type attributes cannot be empty.
  740. // Requests with empty values will be rejected with a ValidationException exception.
  741. //
  742. // You can request that PutItem return either a copy of the original item (before
  743. // the update) or a copy of the updated item (after the update). For more information,
  744. // see the ReturnValues description below.
  745. //
  746. // To prevent a new item from replacing an existing item, use a conditional
  747. // expression that contains the attribute_not_exists function with the name
  748. // of the attribute being used as the partition key for the table. Since every
  749. // record must contain that attribute, the attribute_not_exists function will
  750. // only succeed if no matching item exists.
  751. //
  752. // For more information about using this API, see Working with Items (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html)
  753. // in the Amazon DynamoDB Developer Guide.
  754. func (c *DynamoDB) PutItem(input *PutItemInput) (*PutItemOutput, error) {
  755. req, out := c.PutItemRequest(input)
  756. err := req.Send()
  757. return out, err
  758. }
  759. const opQuery = "Query"
  760. // QueryRequest generates a "aws/request.Request" representing the
  761. // client's request for the Query operation. The "output" return
  762. // value can be used to capture response data after the request's "Send" method
  763. // is called.
  764. //
  765. // Creating a request object using this method should be used when you want to inject
  766. // custom logic into the request's lifecycle using a custom handler, or if you want to
  767. // access properties on the request object before or after sending the request. If
  768. // you just want the service response, call the Query method directly
  769. // instead.
  770. //
  771. // Note: You must call the "Send" method on the returned request object in order
  772. // to execute the request.
  773. //
  774. // // Example sending a request using the QueryRequest method.
  775. // req, resp := client.QueryRequest(params)
  776. //
  777. // err := req.Send()
  778. // if err == nil { // resp is now filled
  779. // fmt.Println(resp)
  780. // }
  781. //
  782. func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output *QueryOutput) {
  783. op := &request.Operation{
  784. Name: opQuery,
  785. HTTPMethod: "POST",
  786. HTTPPath: "/",
  787. Paginator: &request.Paginator{
  788. InputTokens: []string{"ExclusiveStartKey"},
  789. OutputTokens: []string{"LastEvaluatedKey"},
  790. LimitToken: "Limit",
  791. TruncationToken: "",
  792. },
  793. }
  794. if input == nil {
  795. input = &QueryInput{}
  796. }
  797. req = c.newRequest(op, input, output)
  798. output = &QueryOutput{}
  799. req.Data = output
  800. return
  801. }
  802. // A Query operation uses the primary key of a table or a secondary index to
  803. // directly access items from that table or index.
  804. //
  805. // Use the KeyConditionExpression parameter to provide a specific value for
  806. // the partition key. The Query operation will return all of the items from
  807. // the table or index with that partition key value. You can optionally narrow
  808. // the scope of the Query operation by specifying a sort key value and a comparison
  809. // operator in KeyConditionExpression. You can use the ScanIndexForward parameter
  810. // to get results in forward or reverse order, by sort key.
  811. //
  812. // Queries that do not return results consume the minimum number of read capacity
  813. // units for that type of read operation.
  814. //
  815. // If the total number of items meeting the query criteria exceeds the result
  816. // set size limit of 1 MB, the query stops and results are returned to the user
  817. // with the LastEvaluatedKey element to continue the query in a subsequent operation.
  818. // Unlike a Scan operation, a Query operation never returns both an empty result
  819. // set and a LastEvaluatedKey value. LastEvaluatedKey is only provided if you
  820. // have used the Limit parameter, or if the result set exceeds 1 MB (prior to
  821. // applying a filter).
  822. //
  823. // You can query a table, a local secondary index, or a global secondary index.
  824. // For a query on a table or on a local secondary index, you can set the ConsistentRead
  825. // parameter to true and obtain a strongly consistent result. Global secondary
  826. // indexes support eventually consistent reads only, so do not specify ConsistentRead
  827. // when querying a global secondary index.
  828. func (c *DynamoDB) Query(input *QueryInput) (*QueryOutput, error) {
  829. req, out := c.QueryRequest(input)
  830. err := req.Send()
  831. return out, err
  832. }
  833. // QueryPages iterates over the pages of a Query operation,
  834. // calling the "fn" function with the response data for each page. To stop
  835. // iterating, return false from the fn function.
  836. //
  837. // See Query method for more information on how to use this operation.
  838. //
  839. // Note: This operation can generate multiple requests to a service.
  840. //
  841. // // Example iterating over at most 3 pages of a Query operation.
  842. // pageNum := 0
  843. // err := client.QueryPages(params,
  844. // func(page *QueryOutput, lastPage bool) bool {
  845. // pageNum++
  846. // fmt.Println(page)
  847. // return pageNum <= 3
  848. // })
  849. //
  850. func (c *DynamoDB) QueryPages(input *QueryInput, fn func(p *QueryOutput, lastPage bool) (shouldContinue bool)) error {
  851. page, _ := c.QueryRequest(input)
  852. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  853. return page.EachPage(func(p interface{}, lastPage bool) bool {
  854. return fn(p.(*QueryOutput), lastPage)
  855. })
  856. }
  857. const opScan = "Scan"
  858. // ScanRequest generates a "aws/request.Request" representing the
  859. // client's request for the Scan operation. The "output" return
  860. // value can be used to capture response data after the request's "Send" method
  861. // is called.
  862. //
  863. // Creating a request object using this method should be used when you want to inject
  864. // custom logic into the request's lifecycle using a custom handler, or if you want to
  865. // access properties on the request object before or after sending the request. If
  866. // you just want the service response, call the Scan method directly
  867. // instead.
  868. //
  869. // Note: You must call the "Send" method on the returned request object in order
  870. // to execute the request.
  871. //
  872. // // Example sending a request using the ScanRequest method.
  873. // req, resp := client.ScanRequest(params)
  874. //
  875. // err := req.Send()
  876. // if err == nil { // resp is now filled
  877. // fmt.Println(resp)
  878. // }
  879. //
  880. func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output *ScanOutput) {
  881. op := &request.Operation{
  882. Name: opScan,
  883. HTTPMethod: "POST",
  884. HTTPPath: "/",
  885. Paginator: &request.Paginator{
  886. InputTokens: []string{"ExclusiveStartKey"},
  887. OutputTokens: []string{"LastEvaluatedKey"},
  888. LimitToken: "Limit",
  889. TruncationToken: "",
  890. },
  891. }
  892. if input == nil {
  893. input = &ScanInput{}
  894. }
  895. req = c.newRequest(op, input, output)
  896. output = &ScanOutput{}
  897. req.Data = output
  898. return
  899. }
  900. // The Scan operation returns one or more items and item attributes by accessing
  901. // every item in a table or a secondary index. To have DynamoDB return fewer
  902. // items, you can provide a ScanFilter operation.
  903. //
  904. // If the total number of scanned items exceeds the maximum data set size limit
  905. // of 1 MB, the scan stops and results are returned to the user as a LastEvaluatedKey
  906. // value to continue the scan in a subsequent operation. The results also include
  907. // the number of items exceeding the limit. A scan can result in no table data
  908. // meeting the filter criteria.
  909. //
  910. // By default, Scan operations proceed sequentially; however, for faster performance
  911. // on a large table or secondary index, applications can request a parallel
  912. // Scan operation by providing the Segment and TotalSegments parameters. For
  913. // more information, see Parallel Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#QueryAndScanParallelScan)
  914. // in the Amazon DynamoDB Developer Guide.
  915. //
  916. // By default, Scan uses eventually consistent reads when accessing the data
  917. // in a table; therefore, the result set might not include the changes to data
  918. // in the table immediately before the operation began. If you need a consistent
  919. // copy of the data, as of the time that the Scan begins, you can set the ConsistentRead
  920. // parameter to true.
  921. func (c *DynamoDB) Scan(input *ScanInput) (*ScanOutput, error) {
  922. req, out := c.ScanRequest(input)
  923. err := req.Send()
  924. return out, err
  925. }
  926. // ScanPages iterates over the pages of a Scan operation,
  927. // calling the "fn" function with the response data for each page. To stop
  928. // iterating, return false from the fn function.
  929. //
  930. // See Scan method for more information on how to use this operation.
  931. //
  932. // Note: This operation can generate multiple requests to a service.
  933. //
  934. // // Example iterating over at most 3 pages of a Scan operation.
  935. // pageNum := 0
  936. // err := client.ScanPages(params,
  937. // func(page *ScanOutput, lastPage bool) bool {
  938. // pageNum++
  939. // fmt.Println(page)
  940. // return pageNum <= 3
  941. // })
  942. //
  943. func (c *DynamoDB) ScanPages(input *ScanInput, fn func(p *ScanOutput, lastPage bool) (shouldContinue bool)) error {
  944. page, _ := c.ScanRequest(input)
  945. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  946. return page.EachPage(func(p interface{}, lastPage bool) bool {
  947. return fn(p.(*ScanOutput), lastPage)
  948. })
  949. }
  950. const opUpdateItem = "UpdateItem"
  951. // UpdateItemRequest generates a "aws/request.Request" representing the
  952. // client's request for the UpdateItem operation. The "output" return
  953. // value can be used to capture response data after the request's "Send" method
  954. // is called.
  955. //
  956. // Creating a request object using this method should be used when you want to inject
  957. // custom logic into the request's lifecycle using a custom handler, or if you want to
  958. // access properties on the request object before or after sending the request. If
  959. // you just want the service response, call the UpdateItem method directly
  960. // instead.
  961. //
  962. // Note: You must call the "Send" method on the returned request object in order
  963. // to execute the request.
  964. //
  965. // // Example sending a request using the UpdateItemRequest method.
  966. // req, resp := client.UpdateItemRequest(params)
  967. //
  968. // err := req.Send()
  969. // if err == nil { // resp is now filled
  970. // fmt.Println(resp)
  971. // }
  972. //
  973. func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Request, output *UpdateItemOutput) {
  974. op := &request.Operation{
  975. Name: opUpdateItem,
  976. HTTPMethod: "POST",
  977. HTTPPath: "/",
  978. }
  979. if input == nil {
  980. input = &UpdateItemInput{}
  981. }
  982. req = c.newRequest(op, input, output)
  983. output = &UpdateItemOutput{}
  984. req.Data = output
  985. return
  986. }
  987. // Edits an existing item's attributes, or adds a new item to the table if it
  988. // does not already exist. You can put, delete, or add attribute values. You
  989. // can also perform a conditional update on an existing item (insert a new attribute
  990. // name-value pair if it doesn't exist, or replace an existing name-value pair
  991. // if it has certain expected attribute values).
  992. //
  993. // You can also return the item's attribute values in the same UpdateItem operation
  994. // using the ReturnValues parameter.
  995. func (c *DynamoDB) UpdateItem(input *UpdateItemInput) (*UpdateItemOutput, error) {
  996. req, out := c.UpdateItemRequest(input)
  997. err := req.Send()
  998. return out, err
  999. }
  1000. const opUpdateTable = "UpdateTable"
  1001. // UpdateTableRequest generates a "aws/request.Request" representing the
  1002. // client's request for the UpdateTable operation. The "output" return
  1003. // value can be used to capture response data after the request's "Send" method
  1004. // is called.
  1005. //
  1006. // Creating a request object using this method should be used when you want to inject
  1007. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1008. // access properties on the request object before or after sending the request. If
  1009. // you just want the service response, call the UpdateTable method directly
  1010. // instead.
  1011. //
  1012. // Note: You must call the "Send" method on the returned request object in order
  1013. // to execute the request.
  1014. //
  1015. // // Example sending a request using the UpdateTableRequest method.
  1016. // req, resp := client.UpdateTableRequest(params)
  1017. //
  1018. // err := req.Send()
  1019. // if err == nil { // resp is now filled
  1020. // fmt.Println(resp)
  1021. // }
  1022. //
  1023. func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) (req *request.Request, output *UpdateTableOutput) {
  1024. op := &request.Operation{
  1025. Name: opUpdateTable,
  1026. HTTPMethod: "POST",
  1027. HTTPPath: "/",
  1028. }
  1029. if input == nil {
  1030. input = &UpdateTableInput{}
  1031. }
  1032. req = c.newRequest(op, input, output)
  1033. output = &UpdateTableOutput{}
  1034. req.Data = output
  1035. return
  1036. }
  1037. // Modifies the provisioned throughput settings, global secondary indexes, or
  1038. // DynamoDB Streams settings for a given table.
  1039. //
  1040. // You can only perform one of the following operations at once:
  1041. //
  1042. // Modify the provisioned throughput settings of the table.
  1043. //
  1044. // Enable or disable Streams on the table.
  1045. //
  1046. // Remove a global secondary index from the table.
  1047. //
  1048. // Create a new global secondary index on the table. Once the index begins
  1049. // backfilling, you can use UpdateTable to perform other operations.
  1050. //
  1051. // UpdateTable is an asynchronous operation; while it is executing, the
  1052. // table status changes from ACTIVE to UPDATING. While it is UPDATING, you cannot
  1053. // issue another UpdateTable request. When the table returns to the ACTIVE state,
  1054. // the UpdateTable operation is complete.
  1055. func (c *DynamoDB) UpdateTable(input *UpdateTableInput) (*UpdateTableOutput, error) {
  1056. req, out := c.UpdateTableRequest(input)
  1057. err := req.Send()
  1058. return out, err
  1059. }
  1060. // Represents an attribute for describing the key schema for the table and indexes.
  1061. type AttributeDefinition struct {
  1062. _ struct{} `type:"structure"`
  1063. // A name for the attribute.
  1064. AttributeName *string `min:"1" type:"string" required:"true"`
  1065. // The data type for the attribute, where:
  1066. //
  1067. // S - the attribute is of type String
  1068. //
  1069. // N - the attribute is of type Number
  1070. //
  1071. // B - the attribute is of type Binary
  1072. AttributeType *string `type:"string" required:"true" enum:"ScalarAttributeType"`
  1073. }
  1074. // String returns the string representation
  1075. func (s AttributeDefinition) String() string {
  1076. return awsutil.Prettify(s)
  1077. }
  1078. // GoString returns the string representation
  1079. func (s AttributeDefinition) GoString() string {
  1080. return s.String()
  1081. }
  1082. // Validate inspects the fields of the type to determine if they are valid.
  1083. func (s *AttributeDefinition) Validate() error {
  1084. invalidParams := request.ErrInvalidParams{Context: "AttributeDefinition"}
  1085. if s.AttributeName == nil {
  1086. invalidParams.Add(request.NewErrParamRequired("AttributeName"))
  1087. }
  1088. if s.AttributeName != nil && len(*s.AttributeName) < 1 {
  1089. invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1))
  1090. }
  1091. if s.AttributeType == nil {
  1092. invalidParams.Add(request.NewErrParamRequired("AttributeType"))
  1093. }
  1094. if invalidParams.Len() > 0 {
  1095. return invalidParams
  1096. }
  1097. return nil
  1098. }
  1099. // Represents the data for an attribute. You can set one, and only one, of the
  1100. // elements.
  1101. //
  1102. // Each attribute in an item is a name-value pair. An attribute can be single-valued
  1103. // or multi-valued set. For example, a book item can have title and authors
  1104. // attributes. Each book has one title but can have many authors. The multi-valued
  1105. // attribute is a set; duplicate values are not allowed.
  1106. type AttributeValue struct {
  1107. _ struct{} `type:"structure"`
  1108. // A Binary data type.
  1109. //
  1110. // B is automatically base64 encoded/decoded by the SDK.
  1111. B []byte `type:"blob"`
  1112. // A Boolean data type.
  1113. BOOL *bool `type:"boolean"`
  1114. // A Binary Set data type.
  1115. BS [][]byte `type:"list"`
  1116. // A List of attribute values.
  1117. L []*AttributeValue `type:"list"`
  1118. // A Map of attribute values.
  1119. M map[string]*AttributeValue `type:"map"`
  1120. // A Number data type.
  1121. N *string `type:"string"`
  1122. // A Number Set data type.
  1123. NS []*string `type:"list"`
  1124. // A Null data type.
  1125. NULL *bool `type:"boolean"`
  1126. // A String data type.
  1127. S *string `type:"string"`
  1128. // A String Set data type.
  1129. SS []*string `type:"list"`
  1130. }
  1131. // String returns the string representation
  1132. func (s AttributeValue) String() string {
  1133. return awsutil.Prettify(s)
  1134. }
  1135. // GoString returns the string representation
  1136. func (s AttributeValue) GoString() string {
  1137. return s.String()
  1138. }
  1139. // For the UpdateItem operation, represents the attributes to be modified, the
  1140. // action to perform on each, and the new value for each.
  1141. //
  1142. // You cannot use UpdateItem to update any primary key attributes. Instead,
  1143. // you will need to delete the item, and then use PutItem to create a new item
  1144. // with new attributes.
  1145. //
  1146. // Attribute values cannot be null; string and binary type attributes must
  1147. // have lengths greater than zero; and set type attributes must not be empty.
  1148. // Requests with empty values will be rejected with a ValidationException exception.
  1149. type AttributeValueUpdate struct {
  1150. _ struct{} `type:"structure"`
  1151. // Specifies how to perform the update. Valid values are PUT (default), DELETE,
  1152. // and ADD. The behavior depends on whether the specified primary key already
  1153. // exists in the table.
  1154. //
  1155. // If an item with the specified Key is found in the table:
  1156. //
  1157. // PUT - Adds the specified attribute to the item. If the attribute already
  1158. // exists, it is replaced by the new value.
  1159. //
  1160. // DELETE - If no value is specified, the attribute and its value are removed
  1161. // from the item. The data type of the specified value must match the existing
  1162. // value's data type.
  1163. //
  1164. // If a set of values is specified, then those values are subtracted from the
  1165. // old set. For example, if the attribute value was the set [a,b,c] and the
  1166. // DELETE action specified [a,c], then the final attribute value would be [b].
  1167. // Specifying an empty set is an error.
  1168. //
  1169. // ADD - If the attribute does not already exist, then the attribute and
  1170. // its values are added to the item. If the attribute does exist, then the behavior
  1171. // of ADD depends on the data type of the attribute:
  1172. //
  1173. // If the existing attribute is a number, and if Value is also a number,
  1174. // then the Value is mathematically added to the existing attribute. If Value
  1175. // is a negative number, then it is subtracted from the existing attribute.
  1176. //
  1177. // If you use ADD to increment or decrement a number value for an item that
  1178. // doesn't exist before the update, DynamoDB uses 0 as the initial value.
  1179. //
  1180. // In addition, if you use ADD to update an existing item, and intend to increment
  1181. // or decrement an attribute value which does not yet exist, DynamoDB uses 0
  1182. // as the initial value. For example, suppose that the item you want to update
  1183. // does not yet have an attribute named itemcount, but you decide to ADD the
  1184. // number 3 to this attribute anyway, even though it currently does not exist.
  1185. // DynamoDB will create the itemcount attribute, set its initial value to 0,
  1186. // and finally add 3 to it. The result will be a new itemcount attribute in
  1187. // the item, with a value of 3.
  1188. //
  1189. // If the existing data type is a set, and if the Value is also a set, then
  1190. // the Value is added to the existing set. (This is a set operation, not mathematical
  1191. // addition.) For example, if the attribute value was the set [1,2], and the
  1192. // ADD action specified [3], then the final attribute value would be [1,2,3].
  1193. // An error occurs if an Add action is specified for a set attribute and the
  1194. // attribute type specified does not match the existing set type.
  1195. //
  1196. // Both sets must have the same primitive data type. For example, if the existing
  1197. // data type is a set of strings, the Value must also be a set of strings. The
  1198. // same holds true for number sets and binary sets.
  1199. //
  1200. // This action is only valid for an existing attribute whose data type is
  1201. // number or is a set. Do not use ADD for any other data types.
  1202. //
  1203. // If no item with the specified Key is found:
  1204. //
  1205. // PUT - DynamoDB creates a new item with the specified primary key, and
  1206. // then adds the attribute.
  1207. //
  1208. // DELETE - Nothing happens; there is no attribute to delete.
  1209. //
  1210. // ADD - DynamoDB creates an item with the supplied primary key and number
  1211. // (or set of numbers) for the attribute value. The only data types allowed
  1212. // are number and number set; no other data types can be specified.
  1213. Action *string `type:"string" enum:"AttributeAction"`
  1214. // Represents the data for an attribute. You can set one, and only one, of the
  1215. // elements.
  1216. //
  1217. // Each attribute in an item is a name-value pair. An attribute can be single-valued
  1218. // or multi-valued set. For example, a book item can have title and authors
  1219. // attributes. Each book has one title but can have many authors. The multi-valued
  1220. // attribute is a set; duplicate values are not allowed.
  1221. Value *AttributeValue `type:"structure"`
  1222. }
  1223. // String returns the string representation
  1224. func (s AttributeValueUpdate) String() string {
  1225. return awsutil.Prettify(s)
  1226. }
  1227. // GoString returns the string representation
  1228. func (s AttributeValueUpdate) GoString() string {
  1229. return s.String()
  1230. }
  1231. // Represents the input of a BatchGetItem operation.
  1232. type BatchGetItemInput struct {
  1233. _ struct{} `type:"structure"`
  1234. // A map of one or more table names and, for each table, a map that describes
  1235. // one or more items to retrieve from that table. Each table name can be used
  1236. // only once per BatchGetItem request.
  1237. //
  1238. // Each element in the map of items to retrieve consists of the following:
  1239. //
  1240. // ConsistentRead - If true, a strongly consistent read is used; if false
  1241. // (the default), an eventually consistent read is used.
  1242. //
  1243. // ExpressionAttributeNames - One or more substitution tokens for attribute
  1244. // names in the ProjectionExpression parameter. The following are some use cases
  1245. // for using ExpressionAttributeNames:
  1246. //
  1247. // To access an attribute whose name conflicts with a DynamoDB reserved word.
  1248. //
  1249. // To create a placeholder for repeating occurrences of an attribute name
  1250. // in an expression.
  1251. //
  1252. // To prevent special characters in an attribute name from being misinterpreted
  1253. // in an expression.
  1254. //
  1255. // Use the # character in an expression to dereference an attribute name.
  1256. // For example, consider the following attribute name:
  1257. //
  1258. // Percentile
  1259. //
  1260. // The name of this attribute conflicts with a reserved word, so it cannot
  1261. // be used directly in an expression. (For the complete list of reserved words,
  1262. // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
  1263. // in the Amazon DynamoDB Developer Guide). To work around this, you could specify
  1264. // the following for ExpressionAttributeNames:
  1265. //
  1266. // {"#P":"Percentile"}
  1267. //
  1268. // You could then use this substitution in an expression, as in this example:
  1269. //
  1270. // #P = :val
  1271. //
  1272. // Tokens that begin with the : character are expression attribute values,
  1273. // which are placeholders for the actual value at runtime.
  1274. //
  1275. // For more information on expression attribute names, see Accessing Item
  1276. // Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  1277. // in the Amazon DynamoDB Developer Guide.
  1278. //
  1279. // Keys - An array of primary key attribute values that define specific
  1280. // items in the table. For each primary key, you must provide all of the key
  1281. // attributes. For example, with a simple primary key, you only need to provide
  1282. // the partition key value. For a composite key, you must provide both the partition
  1283. // key value and the sort key value.
  1284. //
  1285. // ProjectionExpression - A string that identifies one or more attributes
  1286. // to retrieve from the table. These attributes can include scalars, sets, or
  1287. // elements of a JSON document. The attributes in the expression must be separated
  1288. // by commas.
  1289. //
  1290. // If no attribute names are specified, then all attributes will be returned.
  1291. // If any of the requested attributes are not found, they will not appear in
  1292. // the result.
  1293. //
  1294. // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  1295. // in the Amazon DynamoDB Developer Guide.
  1296. //
  1297. // AttributesToGet -
  1298. //
  1299. // This is a legacy parameter, for backward compatibility. New applications
  1300. // should use ProjectionExpression instead. Do not combine legacy parameters
  1301. // and expression parameters in a single API call; otherwise, DynamoDB will
  1302. // return a ValidationException exception.
  1303. //
  1304. // This parameter allows you to retrieve attributes of type List or Map; however,
  1305. // it cannot retrieve individual elements within a List or a Map.
  1306. //
  1307. // The names of one or more attributes to retrieve. If no attribute names
  1308. // are provided, then all attributes will be returned. If any of the requested
  1309. // attributes are not found, they will not appear in the result.
  1310. //
  1311. // Note that AttributesToGet has no effect on provisioned throughput consumption.
  1312. // DynamoDB determines capacity units consumed based on item size, not on the
  1313. // amount of data that is returned to an application.
  1314. RequestItems map[string]*KeysAndAttributes `min:"1" type:"map" required:"true"`
  1315. // Determines the level of detail about provisioned throughput consumption that
  1316. // is returned in the response:
  1317. //
  1318. // INDEXES - The response includes the aggregate ConsumedCapacity for the
  1319. // operation, together with ConsumedCapacity for each table and secondary index
  1320. // that was accessed.
  1321. //
  1322. // Note that some operations, such as GetItem and BatchGetItem, do not access
  1323. // any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity
  1324. // information for table(s).
  1325. //
  1326. // TOTAL - The response includes only the aggregate ConsumedCapacity for
  1327. // the operation.
  1328. //
  1329. // NONE - No ConsumedCapacity details are included in the response.
  1330. ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
  1331. }
  1332. // String returns the string representation
  1333. func (s BatchGetItemInput) String() string {
  1334. return awsutil.Prettify(s)
  1335. }
  1336. // GoString returns the string representation
  1337. func (s BatchGetItemInput) GoString() string {
  1338. return s.String()
  1339. }
  1340. // Validate inspects the fields of the type to determine if they are valid.
  1341. func (s *BatchGetItemInput) Validate() error {
  1342. invalidParams := request.ErrInvalidParams{Context: "BatchGetItemInput"}
  1343. if s.RequestItems == nil {
  1344. invalidParams.Add(request.NewErrParamRequired("RequestItems"))
  1345. }
  1346. if s.RequestItems != nil && len(s.RequestItems) < 1 {
  1347. invalidParams.Add(request.NewErrParamMinLen("RequestItems", 1))
  1348. }
  1349. if s.RequestItems != nil {
  1350. for i, v := range s.RequestItems {
  1351. if v == nil {
  1352. continue
  1353. }
  1354. if err := v.Validate(); err != nil {
  1355. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RequestItems", i), err.(request.ErrInvalidParams))
  1356. }
  1357. }
  1358. }
  1359. if invalidParams.Len() > 0 {
  1360. return invalidParams
  1361. }
  1362. return nil
  1363. }
  1364. // Represents the output of a BatchGetItem operation.
  1365. type BatchGetItemOutput struct {
  1366. _ struct{} `type:"structure"`
  1367. // The read capacity units consumed by the operation.
  1368. //
  1369. // Each element consists of:
  1370. //
  1371. // TableName - The table that consumed the provisioned throughput.
  1372. //
  1373. // CapacityUnits - The total number of capacity units consumed.
  1374. ConsumedCapacity []*ConsumedCapacity `type:"list"`
  1375. // A map of table name to a list of items. Each object in Responses consists
  1376. // of a table name, along with a map of attribute data consisting of the data
  1377. // type and attribute value.
  1378. Responses map[string][]map[string]*AttributeValue `type:"map"`
  1379. // A map of tables and their respective keys that were not processed with the
  1380. // current response. The UnprocessedKeys value is in the same form as RequestItems,
  1381. // so the value can be provided directly to a subsequent BatchGetItem operation.
  1382. // For more information, see RequestItems in the Request Parameters section.
  1383. //
  1384. // Each element consists of:
  1385. //
  1386. // Keys - An array of primary key attribute values that define specific
  1387. // items in the table.
  1388. //
  1389. // AttributesToGet - One or more attributes to be retrieved from the table
  1390. // or index. By default, all attributes are returned. If a requested attribute
  1391. // is not found, it does not appear in the result.
  1392. //
  1393. // ConsistentRead - The consistency of a read operation. If set to true,
  1394. // then a strongly consistent read is used; otherwise, an eventually consistent
  1395. // read is used.
  1396. //
  1397. // If there are no unprocessed keys remaining, the response contains an empty
  1398. // UnprocessedKeys map.
  1399. UnprocessedKeys map[string]*KeysAndAttributes `min:"1" type:"map"`
  1400. }
  1401. // String returns the string representation
  1402. func (s BatchGetItemOutput) String() string {
  1403. return awsutil.Prettify(s)
  1404. }
  1405. // GoString returns the string representation
  1406. func (s BatchGetItemOutput) GoString() string {
  1407. return s.String()
  1408. }
  1409. // Represents the input of a BatchWriteItem operation.
  1410. type BatchWriteItemInput struct {
  1411. _ struct{} `type:"structure"`
  1412. // A map of one or more table names and, for each table, a list of operations
  1413. // to be performed (DeleteRequest or PutRequest). Each element in the map consists
  1414. // of the following:
  1415. //
  1416. // DeleteRequest - Perform a DeleteItem operation on the specified item.
  1417. // The item to be deleted is identified by a Key subelement:
  1418. //
  1419. // Key - A map of primary key attribute values that uniquely identify the
  1420. // ! item. Each entry in this map consists of an attribute name and an attribute
  1421. // value. For each primary key, you must provide all of the key attributes.
  1422. // For example, with a simple primary key, you only need to provide a value
  1423. // for the partition key. For a composite primary key, you must provide values
  1424. // for both the partition key and the sort key.
  1425. //
  1426. // PutRequest - Perform a PutItem operation on the specified item. The
  1427. // item to be put is identified by an Item subelement:
  1428. //
  1429. // Item - A map of attributes and their values. Each entry in this map consists
  1430. // of an attribute name and an attribute value. Attribute values must not be
  1431. // null; string and binary type attributes must have lengths greater than zero;
  1432. // and set type attributes must not be empty. Requests that contain empty values
  1433. // will be rejected with a ValidationException exception.
  1434. //
  1435. // If you specify any attributes that are part of an index key, then the data
  1436. // types for those attributes must match those of the schema in the table's
  1437. // attribute definition.
  1438. RequestItems map[string][]*WriteRequest `min:"1" type:"map" required:"true"`
  1439. // Determines the level of detail about provisioned throughput consumption that
  1440. // is returned in the response:
  1441. //
  1442. // INDEXES - The response includes the aggregate ConsumedCapacity for the
  1443. // operation, together with ConsumedCapacity for each table and secondary index
  1444. // that was accessed.
  1445. //
  1446. // Note that some operations, such as GetItem and BatchGetItem, do not access
  1447. // any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity
  1448. // information for table(s).
  1449. //
  1450. // TOTAL - The response includes only the aggregate ConsumedCapacity for
  1451. // the operation.
  1452. //
  1453. // NONE - No ConsumedCapacity details are included in the response.
  1454. ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
  1455. // Determines whether item collection metrics are returned. If set to SIZE,
  1456. // the response includes statistics about item collections, if any, that were
  1457. // modified during the operation are returned in the response. If set to NONE
  1458. // (the default), no statistics are returned.
  1459. ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"`
  1460. }
  1461. // String returns the string representation
  1462. func (s BatchWriteItemInput) String() string {
  1463. return awsutil.Prettify(s)
  1464. }
  1465. // GoString returns the string representation
  1466. func (s BatchWriteItemInput) GoString() string {
  1467. return s.String()
  1468. }
  1469. // Validate inspects the fields of the type to determine if they are valid.
  1470. func (s *BatchWriteItemInput) Validate() error {
  1471. invalidParams := request.ErrInvalidParams{Context: "BatchWriteItemInput"}
  1472. if s.RequestItems == nil {
  1473. invalidParams.Add(request.NewErrParamRequired("RequestItems"))
  1474. }
  1475. if s.RequestItems != nil && len(s.RequestItems) < 1 {
  1476. invalidParams.Add(request.NewErrParamMinLen("RequestItems", 1))
  1477. }
  1478. if invalidParams.Len() > 0 {
  1479. return invalidParams
  1480. }
  1481. return nil
  1482. }
  1483. // Represents the output of a BatchWriteItem operation.
  1484. type BatchWriteItemOutput struct {
  1485. _ struct{} `type:"structure"`
  1486. // The capacity units consumed by the operation.
  1487. //
  1488. // Each element consists of:
  1489. //
  1490. // TableName - The table that consumed the provisioned throughput.
  1491. //
  1492. // CapacityUnits - The total number of capacity units consumed.
  1493. ConsumedCapacity []*ConsumedCapacity `type:"list"`
  1494. // A list of tables that were processed by BatchWriteItem and, for each table,
  1495. // information about any item collections that were affected by individual DeleteItem
  1496. // or PutItem operations.
  1497. //
  1498. // Each entry consists of the following subelements:
  1499. //
  1500. // ItemCollectionKey - The partition key value of the item collection. This
  1501. // is the same as the partition key value of the item.
  1502. //
  1503. // SizeEstimateRange - An estimate of item collection size, expressed in
  1504. // GB. This is a two-element array containing a lower bound and an upper bound
  1505. // for the estimate. The estimate includes the size of all the items in the
  1506. // table, plus the size of all attributes projected into all of the local secondary
  1507. // indexes on the table. Use this estimate to measure whether a local secondary
  1508. // index is approaching its size limit.
  1509. //
  1510. // The estimate is subject to change over time; therefore, do not rely on the
  1511. // precision or accuracy of the estimate.
  1512. ItemCollectionMetrics map[string][]*ItemCollectionMetrics `type:"map"`
  1513. // A map of tables and requests against those tables that were not processed.
  1514. // The UnprocessedItems value is in the same form as RequestItems, so you can
  1515. // provide this value directly to a subsequent BatchGetItem operation. For more
  1516. // information, see RequestItems in the Request Parameters section.
  1517. //
  1518. // Each UnprocessedItems entry consists of a table name and, for that table,
  1519. // a list of operations to perform (DeleteRequest or PutRequest).
  1520. //
  1521. // DeleteRequest - Perform a DeleteItem operation on the specified item.
  1522. // The item to be deleted is identified by a Key subelement:
  1523. //
  1524. // Key - A map of primary key attribute values that uniquely identify the
  1525. // item. Each entry in this map consists of an attribute name and an attribute
  1526. // value.
  1527. //
  1528. // PutRequest - Perform a PutItem operation on the specified item. The
  1529. // item to be put is identified by an Item subelement:
  1530. //
  1531. // Item - A map of attributes and their values. Each entry in this map consists
  1532. // of an attribute name and an attribute value. Attribute values must not be
  1533. // null; string and binary type attributes must have lengths greater than zero;
  1534. // and set type attributes must not be empty. Requests that contain empty values
  1535. // will be rejected with a ValidationException exception.
  1536. //
  1537. // If you specify any attributes that are part of an index key, then the data
  1538. // types for those attributes must match those of the schema in the table's
  1539. // attribute definition.
  1540. //
  1541. // If there are no unprocessed items remaining, the response contains an
  1542. // empty UnprocessedItems map.
  1543. UnprocessedItems map[string][]*WriteRequest `min:"1" type:"map"`
  1544. }
  1545. // String returns the string representation
  1546. func (s BatchWriteItemOutput) String() string {
  1547. return awsutil.Prettify(s)
  1548. }
  1549. // GoString returns the string representation
  1550. func (s BatchWriteItemOutput) GoString() string {
  1551. return s.String()
  1552. }
  1553. // Represents the amount of provisioned throughput capacity consumed on a table
  1554. // or an index.
  1555. type Capacity struct {
  1556. _ struct{} `type:"structure"`
  1557. // The total number of capacity units consumed on a table or an index.
  1558. CapacityUnits *float64 `type:"double"`
  1559. }
  1560. // String returns the string representation
  1561. func (s Capacity) String() string {
  1562. return awsutil.Prettify(s)
  1563. }
  1564. // GoString returns the string representation
  1565. func (s Capacity) GoString() string {
  1566. return s.String()
  1567. }
  1568. // Represents the selection criteria for a Query or Scan operation:
  1569. //
  1570. // For a Query operation, Condition is used for specifying the KeyConditions
  1571. // to use when querying a table or an index. For KeyConditions, only the following
  1572. // comparison operators are supported:
  1573. //
  1574. // EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN
  1575. //
  1576. // Condition is also used in a QueryFilter, which evaluates the query results
  1577. // and returns only the desired values.
  1578. //
  1579. // For a Scan operation, Condition is used in a ScanFilter, which evaluates
  1580. // the scan results and returns only the desired values.
  1581. type Condition struct {
  1582. _ struct{} `type:"structure"`
  1583. // One or more values to evaluate against the supplied attribute. The number
  1584. // of values in the list depends on the ComparisonOperator being used.
  1585. //
  1586. // For type Number, value comparisons are numeric.
  1587. //
  1588. // String value comparisons for greater than, equals, or less than are based
  1589. // on ASCII character code values. For example, a is greater than A, and a is
  1590. // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
  1591. // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  1592. //
  1593. // For Binary, DynamoDB treats each byte of the binary data as unsigned when
  1594. // it compares binary values.
  1595. AttributeValueList []*AttributeValue `type:"list"`
  1596. // A comparator for evaluating attributes. For example, equals, greater than,
  1597. // less than, etc.
  1598. //
  1599. // The following comparison operators are available:
  1600. //
  1601. // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS
  1602. // | BEGINS_WITH | IN | BETWEEN
  1603. //
  1604. // The following are descriptions of each comparison operator.
  1605. //
  1606. // EQ : Equal. EQ is supported for all datatypes, including lists and maps.
  1607. //
  1608. // AttributeValueList can contain only one AttributeValue element of type
  1609. // String, Number, Binary, String Set, Number Set, or Binary Set. If an item
  1610. // contains an AttributeValue element of a different type than the one provided
  1611. // in the request, the value does not match. For example, {"S":"6"} does not
  1612. // equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  1613. //
  1614. // NE : Not equal. NE is supported for all datatypes, including lists and
  1615. // maps.
  1616. //
  1617. // AttributeValueList can contain only one AttributeValue of type String,
  1618. // Number, Binary, String Set, Number Set, or Binary Set. If an item contains
  1619. // an AttributeValue of a different type than the one provided in the request,
  1620. // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}.
  1621. // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  1622. //
  1623. // LE : Less than or equal.
  1624. //
  1625. // AttributeValueList can contain only one AttributeValue element of type
  1626. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  1627. // element of a different type than the one provided in the request, the value
  1628. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  1629. // does not compare to {"NS":["6", "2", "1"]}.
  1630. //
  1631. // LT : Less than.
  1632. //
  1633. // AttributeValueList can contain only one AttributeValue of type String,
  1634. // Number, or Binary (not a set type). If an item contains an AttributeValue
  1635. // element of a different type than the one provided in the request, the value
  1636. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  1637. // does not compare to {"NS":["6", "2", "1"]}.
  1638. //
  1639. // GE : Greater than or equal.
  1640. //
  1641. // AttributeValueList can contain only one AttributeValue element of type
  1642. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  1643. // element of a different type than the one provided in the request, the value
  1644. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  1645. // does not compare to {"NS":["6", "2", "1"]}.
  1646. //
  1647. // GT : Greater than.
  1648. //
  1649. // AttributeValueList can contain only one AttributeValue element of type
  1650. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  1651. // element of a different type than the one provided in the request, the value
  1652. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  1653. // does not compare to {"NS":["6", "2", "1"]}.
  1654. //
  1655. // NOT_NULL : The attribute exists. NOT_NULL is supported for all datatypes,
  1656. // including lists and maps.
  1657. //
  1658. // This operator tests for the existence of an attribute, not its data type.
  1659. // If the data type of attribute "a" is null, and you evaluate it using NOT_NULL,
  1660. // the result is a Boolean true. This result is because the attribute "a" exists;
  1661. // its data type is not relevant to the NOT_NULL comparison operator.
  1662. //
  1663. // NULL : The attribute does not exist. NULL is supported for all datatypes,
  1664. // including lists and maps.
  1665. //
  1666. // This operator tests for the nonexistence of an attribute, not its data
  1667. // type. If the data type of attribute "a" is null, and you evaluate it using
  1668. // NULL, the result is a Boolean false. This is because the attribute "a" exists;
  1669. // its data type is not relevant to the NULL comparison operator.
  1670. //
  1671. // CONTAINS : Checks for a subsequence, or value in a set.
  1672. //
  1673. // AttributeValueList can contain only one AttributeValue element of type
  1674. // String, Number, or Binary (not a set type). If the target attribute of the
  1675. // comparison is of type String, then the operator checks for a substring match.
  1676. // If the target attribute of the comparison is of type Binary, then the operator
  1677. // looks for a subsequence of the target that matches the input. If the target
  1678. // attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator
  1679. // evaluates to true if it finds an exact match with any member of the set.
  1680. //
  1681. // CONTAINS is supported for lists: When evaluating "a CONTAINS b", "a" can
  1682. // be a list; however, "b" cannot be a set, a map, or a list.
  1683. //
  1684. // NOT_CONTAINS : Checks for absence of a subsequence, or absence of a value
  1685. // in a set.
  1686. //
  1687. // AttributeValueList can contain only one AttributeValue element of type
  1688. // String, Number, or Binary (not a set type). If the target attribute of the
  1689. // comparison is a String, then the operator checks for the absence of a substring
  1690. // match. If the target attribute of the comparison is Binary, then the operator
  1691. // checks for the absence of a subsequence of the target that matches the input.
  1692. // If the target attribute of the comparison is a set ("SS", "NS", or "BS"),
  1693. // then the operator evaluates to true if it does not find an exact match with
  1694. // any member of the set.
  1695. //
  1696. // NOT_CONTAINS is supported for lists: When evaluating "a NOT CONTAINS b",
  1697. // "a" can be a list; however, "b" cannot be a set, a map, or a list.
  1698. //
  1699. // BEGINS_WITH : Checks for a prefix.
  1700. //
  1701. // AttributeValueList can contain only one AttributeValue of type String or
  1702. // Binary (not a Number or a set type). The target attribute of the comparison
  1703. // must be of type String or Binary (not a Number or a set type).
  1704. //
  1705. // IN : Checks for matching elements within two sets.
  1706. //
  1707. // AttributeValueList can contain one or more AttributeValue elements of type
  1708. // String, Number, or Binary (not a set type). These attributes are compared
  1709. // against an existing set type attribute of an item. If any elements of the
  1710. // input set are present in the item attribute, the expression evaluates to
  1711. // true.
  1712. //
  1713. // BETWEEN : Greater than or equal to the first value, and less than or
  1714. // equal to the second value.
  1715. //
  1716. // AttributeValueList must contain two AttributeValue elements of the same
  1717. // type, either String, Number, or Binary (not a set type). A target attribute
  1718. // matches if the target value is greater than, or equal to, the first element
  1719. // and less than, or equal to, the second element. If an item contains an AttributeValue
  1720. // element of a different type than the one provided in the request, the value
  1721. // does not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,
  1722. // {"N":"6"} does not compare to {"NS":["6", "2", "1"]}
  1723. //
  1724. // For usage examples of AttributeValueList and ComparisonOperator, see Legacy
  1725. // Conditional Parameters (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html)
  1726. // in the Amazon DynamoDB Developer Guide.
  1727. ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"`
  1728. }
  1729. // String returns the string representation
  1730. func (s Condition) String() string {
  1731. return awsutil.Prettify(s)
  1732. }
  1733. // GoString returns the string representation
  1734. func (s Condition) GoString() string {
  1735. return s.String()
  1736. }
  1737. // Validate inspects the fields of the type to determine if they are valid.
  1738. func (s *Condition) Validate() error {
  1739. invalidParams := request.ErrInvalidParams{Context: "Condition"}
  1740. if s.ComparisonOperator == nil {
  1741. invalidParams.Add(request.NewErrParamRequired("ComparisonOperator"))
  1742. }
  1743. if invalidParams.Len() > 0 {
  1744. return invalidParams
  1745. }
  1746. return nil
  1747. }
  1748. // The capacity units consumed by an operation. The data returned includes the
  1749. // total provisioned throughput consumed, along with statistics for the table
  1750. // and any indexes involved in the operation. ConsumedCapacity is only returned
  1751. // if the request asked for it. For more information, see Provisioned Throughput
  1752. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
  1753. // in the Amazon DynamoDB Developer Guide.
  1754. type ConsumedCapacity struct {
  1755. _ struct{} `type:"structure"`
  1756. // The total number of capacity units consumed by the operation.
  1757. CapacityUnits *float64 `type:"double"`
  1758. // The amount of throughput consumed on each global index affected by the operation.
  1759. GlobalSecondaryIndexes map[string]*Capacity `type:"map"`
  1760. // The amount of throughput consumed on each local index affected by the operation.
  1761. LocalSecondaryIndexes map[string]*Capacity `type:"map"`
  1762. // The amount of throughput consumed on the table affected by the operation.
  1763. Table *Capacity `type:"structure"`
  1764. // The name of the table that was affected by the operation.
  1765. TableName *string `min:"3" type:"string"`
  1766. }
  1767. // String returns the string representation
  1768. func (s ConsumedCapacity) String() string {
  1769. return awsutil.Prettify(s)
  1770. }
  1771. // GoString returns the string representation
  1772. func (s ConsumedCapacity) GoString() string {
  1773. return s.String()
  1774. }
  1775. // Represents a new global secondary index to be added to an existing table.
  1776. type CreateGlobalSecondaryIndexAction struct {
  1777. _ struct{} `type:"structure"`
  1778. // The name of the global secondary index to be created.
  1779. IndexName *string `min:"3" type:"string" required:"true"`
  1780. // The key schema for the global secondary index.
  1781. KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"`
  1782. // Represents attributes that are copied (projected) from the table into an
  1783. // index. These are in addition to the primary key attributes and index key
  1784. // attributes, which are automatically projected.
  1785. Projection *Projection `type:"structure" required:"true"`
  1786. // Represents the provisioned throughput settings for a specified table or index.
  1787. // The settings can be modified using the UpdateTable operation.
  1788. //
  1789. // For current minimum and maximum provisioned throughput values, see Limits
  1790. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
  1791. // in the Amazon DynamoDB Developer Guide.
  1792. ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"`
  1793. }
  1794. // String returns the string representation
  1795. func (s CreateGlobalSecondaryIndexAction) String() string {
  1796. return awsutil.Prettify(s)
  1797. }
  1798. // GoString returns the string representation
  1799. func (s CreateGlobalSecondaryIndexAction) GoString() string {
  1800. return s.String()
  1801. }
  1802. // Validate inspects the fields of the type to determine if they are valid.
  1803. func (s *CreateGlobalSecondaryIndexAction) Validate() error {
  1804. invalidParams := request.ErrInvalidParams{Context: "CreateGlobalSecondaryIndexAction"}
  1805. if s.IndexName == nil {
  1806. invalidParams.Add(request.NewErrParamRequired("IndexName"))
  1807. }
  1808. if s.IndexName != nil && len(*s.IndexName) < 3 {
  1809. invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
  1810. }
  1811. if s.KeySchema == nil {
  1812. invalidParams.Add(request.NewErrParamRequired("KeySchema"))
  1813. }
  1814. if s.KeySchema != nil && len(s.KeySchema) < 1 {
  1815. invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1))
  1816. }
  1817. if s.Projection == nil {
  1818. invalidParams.Add(request.NewErrParamRequired("Projection"))
  1819. }
  1820. if s.ProvisionedThroughput == nil {
  1821. invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
  1822. }
  1823. if s.KeySchema != nil {
  1824. for i, v := range s.KeySchema {
  1825. if v == nil {
  1826. continue
  1827. }
  1828. if err := v.Validate(); err != nil {
  1829. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams))
  1830. }
  1831. }
  1832. }
  1833. if s.Projection != nil {
  1834. if err := s.Projection.Validate(); err != nil {
  1835. invalidParams.AddNested("Projection", err.(request.ErrInvalidParams))
  1836. }
  1837. }
  1838. if s.ProvisionedThroughput != nil {
  1839. if err := s.ProvisionedThroughput.Validate(); err != nil {
  1840. invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
  1841. }
  1842. }
  1843. if invalidParams.Len() > 0 {
  1844. return invalidParams
  1845. }
  1846. return nil
  1847. }
  1848. // Represents the input of a CreateTable operation.
  1849. type CreateTableInput struct {
  1850. _ struct{} `type:"structure"`
  1851. // An array of attributes that describe the key schema for the table and indexes.
  1852. AttributeDefinitions []*AttributeDefinition `type:"list" required:"true"`
  1853. // One or more global secondary indexes (the maximum is five) to be created
  1854. // on the table. Each global secondary index in the array includes the following:
  1855. //
  1856. // IndexName - The name of the global secondary index. Must be unique only
  1857. // for this table.
  1858. //
  1859. // KeySchema - Specifies the key schema for the global secondary index.
  1860. //
  1861. // Projection - Specifies attributes that are copied (projected) from the
  1862. // table into the index. These are in addition to the primary key attributes
  1863. // and index key attributes, which are automatically projected. Each attribute
  1864. // specification is composed of:
  1865. //
  1866. // ProjectionType - One of the following:
  1867. //
  1868. // KEYS_ONLY - Only the index and primary keys are projected into the index.
  1869. //
  1870. // INCLUDE - Only the specified table attributes are projected into the
  1871. // index. The list of projected attributes are in NonKeyAttributes.
  1872. //
  1873. // ALL - All of the table attributes are projected into the index.
  1874. //
  1875. // NonKeyAttributes - A list of one or more non-key attribute names that
  1876. // are projected into the secondary index. The total count of attributes provided
  1877. // in NonKeyAttributes, summed across all of the secondary indexes, must not
  1878. // exceed 20. If you project the same attribute into two different indexes,
  1879. // this counts as two distinct attributes when determining the total.
  1880. //
  1881. // ProvisionedThroughput - The provisioned throughput settings for the
  1882. // global secondary index, consisting of read and write capacity units.
  1883. GlobalSecondaryIndexes []*GlobalSecondaryIndex `type:"list"`
  1884. // Specifies the attributes that make up the primary key for a table or an index.
  1885. // The attributes in KeySchema must also be defined in the AttributeDefinitions
  1886. // array. For more information, see Data Model (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html)
  1887. // in the Amazon DynamoDB Developer Guide.
  1888. //
  1889. // Each KeySchemaElement in the array is composed of:
  1890. //
  1891. // AttributeName - The name of this key attribute.
  1892. //
  1893. // KeyType - The role that the key attribute will assume:
  1894. //
  1895. // HASH - partition key
  1896. //
  1897. // RANGE - sort key
  1898. //
  1899. // The partition key of an item is also known as its hash attribute. The
  1900. // term "hash attribute" derives from DynamoDB' usage of an internal hash function
  1901. // to evenly distribute data items across partitions, based on their partition
  1902. // key values.
  1903. //
  1904. // The sort key of an item is also known as its range attribute. The term "range
  1905. // attribute" derives from the way DynamoDB stores items with the same partition
  1906. // key physically close together, in sorted order by the sort key value.
  1907. //
  1908. // For a simple primary key (partition key), you must provide exactly one
  1909. // element with a KeyType of HASH.
  1910. //
  1911. // For a composite primary key (partition key and sort key), you must provide
  1912. // exactly two elements, in this order: The first element must have a KeyType
  1913. // of HASH, and the second element must have a KeyType of RANGE.
  1914. //
  1915. // For more information, see Specifying the Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key)
  1916. // in the Amazon DynamoDB Developer Guide.
  1917. KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"`
  1918. // One or more local secondary indexes (the maximum is five) to be created on
  1919. // the table. Each index is scoped to a given partition key value. There is
  1920. // a 10 GB size limit per partition key value; otherwise, the size of a local
  1921. // secondary index is unconstrained.
  1922. //
  1923. // Each local secondary index in the array includes the following:
  1924. //
  1925. // IndexName - The name of the local secondary index. Must be unique only
  1926. // for this table.
  1927. //
  1928. // KeySchema - Specifies the key schema for the local secondary index.
  1929. // The key schema must begin with the same partition key as the table.
  1930. //
  1931. // Projection - Specifies attributes that are copied (projected) from the
  1932. // table into the index. These are in addition to the primary key attributes
  1933. // and index key attributes, which are automatically projected. Each attribute
  1934. // specification is composed of:
  1935. //
  1936. // ProjectionType - One of the following:
  1937. //
  1938. // KEYS_ONLY - Only the index and primary keys are projected into the index.
  1939. //
  1940. // INCLUDE - Only the specified table attributes are projected into the
  1941. // index. The list of projected attributes are in NonKeyAttributes.
  1942. //
  1943. // ALL - All of the table attributes are projected into the index.
  1944. //
  1945. // NonKeyAttributes - A list of one or more non-key attribute names that
  1946. // are projected into the secondary index. The total count of attributes provided
  1947. // in NonKeyAttributes, summed across all of the secondary indexes, must not
  1948. // exceed 20. If you project the same attribute into two different indexes,
  1949. // this counts as two distinct attributes when determining the total.
  1950. LocalSecondaryIndexes []*LocalSecondaryIndex `type:"list"`
  1951. // Represents the provisioned throughput settings for a specified table or index.
  1952. // The settings can be modified using the UpdateTable operation.
  1953. //
  1954. // For current minimum and maximum provisioned throughput values, see Limits
  1955. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
  1956. // in the Amazon DynamoDB Developer Guide.
  1957. ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"`
  1958. // The settings for DynamoDB Streams on the table. These settings consist of:
  1959. //
  1960. // StreamEnabled - Indicates whether Streams is to be enabled (true) or
  1961. // disabled (false).
  1962. //
  1963. // StreamViewType - When an item in the table is modified, StreamViewType
  1964. // determines what information is written to the table's stream. Valid values
  1965. // for StreamViewType are:
  1966. //
  1967. // KEYS_ONLY - Only the key attributes of the modified item are written
  1968. // to the stream.
  1969. //
  1970. // NEW_IMAGE - The entire item, as it appears after it was modified, is
  1971. // written to the stream.
  1972. //
  1973. // OLD_IMAGE - The entire item, as it appeared before it was modified, is
  1974. // written to the stream.
  1975. //
  1976. // NEW_AND_OLD_IMAGES - Both the new and the old item images of the item
  1977. // are written to the stream.
  1978. StreamSpecification *StreamSpecification `type:"structure"`
  1979. // The name of the table to create.
  1980. TableName *string `min:"3" type:"string" required:"true"`
  1981. }
  1982. // String returns the string representation
  1983. func (s CreateTableInput) String() string {
  1984. return awsutil.Prettify(s)
  1985. }
  1986. // GoString returns the string representation
  1987. func (s CreateTableInput) GoString() string {
  1988. return s.String()
  1989. }
  1990. // Validate inspects the fields of the type to determine if they are valid.
  1991. func (s *CreateTableInput) Validate() error {
  1992. invalidParams := request.ErrInvalidParams{Context: "CreateTableInput"}
  1993. if s.AttributeDefinitions == nil {
  1994. invalidParams.Add(request.NewErrParamRequired("AttributeDefinitions"))
  1995. }
  1996. if s.KeySchema == nil {
  1997. invalidParams.Add(request.NewErrParamRequired("KeySchema"))
  1998. }
  1999. if s.KeySchema != nil && len(s.KeySchema) < 1 {
  2000. invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1))
  2001. }
  2002. if s.ProvisionedThroughput == nil {
  2003. invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
  2004. }
  2005. if s.TableName == nil {
  2006. invalidParams.Add(request.NewErrParamRequired("TableName"))
  2007. }
  2008. if s.TableName != nil && len(*s.TableName) < 3 {
  2009. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  2010. }
  2011. if s.AttributeDefinitions != nil {
  2012. for i, v := range s.AttributeDefinitions {
  2013. if v == nil {
  2014. continue
  2015. }
  2016. if err := v.Validate(); err != nil {
  2017. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AttributeDefinitions", i), err.(request.ErrInvalidParams))
  2018. }
  2019. }
  2020. }
  2021. if s.GlobalSecondaryIndexes != nil {
  2022. for i, v := range s.GlobalSecondaryIndexes {
  2023. if v == nil {
  2024. continue
  2025. }
  2026. if err := v.Validate(); err != nil {
  2027. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexes", i), err.(request.ErrInvalidParams))
  2028. }
  2029. }
  2030. }
  2031. if s.KeySchema != nil {
  2032. for i, v := range s.KeySchema {
  2033. if v == nil {
  2034. continue
  2035. }
  2036. if err := v.Validate(); err != nil {
  2037. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams))
  2038. }
  2039. }
  2040. }
  2041. if s.LocalSecondaryIndexes != nil {
  2042. for i, v := range s.LocalSecondaryIndexes {
  2043. if v == nil {
  2044. continue
  2045. }
  2046. if err := v.Validate(); err != nil {
  2047. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LocalSecondaryIndexes", i), err.(request.ErrInvalidParams))
  2048. }
  2049. }
  2050. }
  2051. if s.ProvisionedThroughput != nil {
  2052. if err := s.ProvisionedThroughput.Validate(); err != nil {
  2053. invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
  2054. }
  2055. }
  2056. if invalidParams.Len() > 0 {
  2057. return invalidParams
  2058. }
  2059. return nil
  2060. }
  2061. // Represents the output of a CreateTable operation.
  2062. type CreateTableOutput struct {
  2063. _ struct{} `type:"structure"`
  2064. // Represents the properties of a table.
  2065. TableDescription *TableDescription `type:"structure"`
  2066. }
  2067. // String returns the string representation
  2068. func (s CreateTableOutput) String() string {
  2069. return awsutil.Prettify(s)
  2070. }
  2071. // GoString returns the string representation
  2072. func (s CreateTableOutput) GoString() string {
  2073. return s.String()
  2074. }
  2075. // Represents a global secondary index to be deleted from an existing table.
  2076. type DeleteGlobalSecondaryIndexAction struct {
  2077. _ struct{} `type:"structure"`
  2078. // The name of the global secondary index to be deleted.
  2079. IndexName *string `min:"3" type:"string" required:"true"`
  2080. }
  2081. // String returns the string representation
  2082. func (s DeleteGlobalSecondaryIndexAction) String() string {
  2083. return awsutil.Prettify(s)
  2084. }
  2085. // GoString returns the string representation
  2086. func (s DeleteGlobalSecondaryIndexAction) GoString() string {
  2087. return s.String()
  2088. }
  2089. // Validate inspects the fields of the type to determine if they are valid.
  2090. func (s *DeleteGlobalSecondaryIndexAction) Validate() error {
  2091. invalidParams := request.ErrInvalidParams{Context: "DeleteGlobalSecondaryIndexAction"}
  2092. if s.IndexName == nil {
  2093. invalidParams.Add(request.NewErrParamRequired("IndexName"))
  2094. }
  2095. if s.IndexName != nil && len(*s.IndexName) < 3 {
  2096. invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
  2097. }
  2098. if invalidParams.Len() > 0 {
  2099. return invalidParams
  2100. }
  2101. return nil
  2102. }
  2103. // Represents the input of a DeleteItem operation.
  2104. type DeleteItemInput struct {
  2105. _ struct{} `type:"structure"`
  2106. // A condition that must be satisfied in order for a conditional DeleteItem
  2107. // to succeed.
  2108. //
  2109. // An expression can contain any of the following:
  2110. //
  2111. // Functions: attribute_exists | attribute_not_exists | attribute_type |
  2112. // contains | begins_with | size
  2113. //
  2114. // These function names are case-sensitive.
  2115. //
  2116. // Comparison operators: = | &#x3C;&#x3E; | &#x3C; | &#x3E; | &#x3C;= |
  2117. // &#x3E;= | BETWEEN | IN
  2118. //
  2119. // Logical operators: AND | OR | NOT
  2120. //
  2121. // For more information on condition expressions, see Specifying Conditions
  2122. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
  2123. // in the Amazon DynamoDB Developer Guide.
  2124. //
  2125. // ConditionExpression replaces the legacy ConditionalOperator and Expected
  2126. // parameters.
  2127. ConditionExpression *string `type:"string"`
  2128. // This is a legacy parameter, for backward compatibility. New applications
  2129. // should use ConditionExpression instead. Do not combine legacy parameters
  2130. // and expression parameters in a single API call; otherwise, DynamoDB will
  2131. // return a ValidationException exception.
  2132. //
  2133. // A logical operator to apply to the conditions in the Expected map:
  2134. //
  2135. // AND - If all of the conditions evaluate to true, then the entire map
  2136. // evaluates to true.
  2137. //
  2138. // OR - If at least one of the conditions evaluate to true, then the entire
  2139. // map evaluates to true.
  2140. //
  2141. // If you omit ConditionalOperator, then AND is the default.
  2142. //
  2143. // The operation will succeed only if the entire map evaluates to true.
  2144. //
  2145. // This parameter does not support attributes of type List or Map.
  2146. ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
  2147. // This is a legacy parameter, for backward compatibility. New applications
  2148. // should use ConditionExpression instead. Do not combine legacy parameters
  2149. // and expression parameters in a single API call; otherwise, DynamoDB will
  2150. // return a ValidationException exception.
  2151. //
  2152. // A map of attribute/condition pairs. Expected provides a conditional block
  2153. // for the DeleteItem operation.
  2154. //
  2155. // Each element of Expected consists of an attribute name, a comparison operator,
  2156. // and one or more values. DynamoDB compares the attribute with the value(s)
  2157. // you supplied, using the comparison operator. For each Expected element, the
  2158. // result of the evaluation is either true or false.
  2159. //
  2160. // If you specify more than one element in the Expected map, then by default
  2161. // all of the conditions must evaluate to true. In other words, the conditions
  2162. // are ANDed together. (You can use the ConditionalOperator parameter to OR
  2163. // the conditions instead. If you do this, then at least one of the conditions
  2164. // must evaluate to true, rather than all of them.)
  2165. //
  2166. // If the Expected map evaluates to true, then the conditional operation succeeds;
  2167. // otherwise, it fails.
  2168. //
  2169. // Expected contains the following:
  2170. //
  2171. // AttributeValueList - One or more values to evaluate against the supplied
  2172. // attribute. The number of values in the list depends on the ComparisonOperator
  2173. // being used.
  2174. //
  2175. // For type Number, value comparisons are numeric.
  2176. //
  2177. // String value comparisons for greater than, equals, or less than are based
  2178. // on ASCII character code values. For example, a is greater than A, and a is
  2179. // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
  2180. // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  2181. //
  2182. // For type Binary, DynamoDB treats each byte of the binary data as unsigned
  2183. // when it compares binary values.
  2184. //
  2185. // ComparisonOperator - A comparator for evaluating attributes in the AttributeValueList.
  2186. // When performing the comparison, DynamoDB uses strongly consistent reads.
  2187. //
  2188. // The following comparison operators are available:
  2189. //
  2190. // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS
  2191. // | BEGINS_WITH | IN | BETWEEN
  2192. //
  2193. // The following are descriptions of each comparison operator.
  2194. //
  2195. // EQ : Equal. EQ is supported for all datatypes, including lists and maps.
  2196. //
  2197. // AttributeValueList can contain only one AttributeValue element of type
  2198. // String, Number, Binary, String Set, Number Set, or Binary Set. If an item
  2199. // contains an AttributeValue element of a different type than the one provided
  2200. // in the request, the value does not match. For example, {"S":"6"} does not
  2201. // equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  2202. //
  2203. // NE : Not equal. NE is supported for all datatypes, including lists and
  2204. // maps.
  2205. //
  2206. // AttributeValueList can contain only one AttributeValue of type String,
  2207. // Number, Binary, String Set, Number Set, or Binary Set. If an item contains
  2208. // an AttributeValue of a different type than the one provided in the request,
  2209. // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}.
  2210. // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  2211. //
  2212. // LE : Less than or equal.
  2213. //
  2214. // AttributeValueList can contain only one AttributeValue element of type
  2215. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  2216. // element of a different type than the one provided in the request, the value
  2217. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  2218. // does not compare to {"NS":["6", "2", "1"]}.
  2219. //
  2220. // LT : Less than.
  2221. //
  2222. // AttributeValueList can contain only one AttributeValue of type String,
  2223. // Number, or Binary (not a set type). If an item contains an AttributeValue
  2224. // element of a different type than the one provided in the request, the value
  2225. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  2226. // does not compare to {"NS":["6", "2", "1"]}.
  2227. //
  2228. // GE : Greater than or equal.
  2229. //
  2230. // AttributeValueList can contain only one AttributeValue element of type
  2231. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  2232. // element of a different type than the one provided in the request, the value
  2233. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  2234. // does not compare to {"NS":["6", "2", "1"]}.
  2235. //
  2236. // GT : Greater than.
  2237. //
  2238. // AttributeValueList can contain only one AttributeValue element of type
  2239. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  2240. // element of a different type than the one provided in the request, the value
  2241. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  2242. // does not compare to {"NS":["6", "2", "1"]}.
  2243. //
  2244. // NOT_NULL : The attribute exists. NOT_NULL is supported for all datatypes,
  2245. // including lists and maps.
  2246. //
  2247. // This operator tests for the existence of an attribute, not its data type.
  2248. // If the data type of attribute "a" is null, and you evaluate it using NOT_NULL,
  2249. // the result is a Boolean true. This result is because the attribute "a" exists;
  2250. // its data type is not relevant to the NOT_NULL comparison operator.
  2251. //
  2252. // NULL : The attribute does not exist. NULL is supported for all datatypes,
  2253. // including lists and maps.
  2254. //
  2255. // This operator tests for the nonexistence of an attribute, not its data
  2256. // type. If the data type of attribute "a" is null, and you evaluate it using
  2257. // NULL, the result is a Boolean false. This is because the attribute "a" exists;
  2258. // its data type is not relevant to the NULL comparison operator.
  2259. //
  2260. // CONTAINS : Checks for a subsequence, or value in a set.
  2261. //
  2262. // AttributeValueList can contain only one AttributeValue element of type
  2263. // String, Number, or Binary (not a set type). If the target attribute of the
  2264. // comparison is of type String, then the operator checks for a substring match.
  2265. // If the target attribute of the comparison is of type Binary, then the operator
  2266. // looks for a subsequence of the target that matches the input. If the target
  2267. // attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator
  2268. // evaluates to true if it finds an exact match with any member of the set.
  2269. //
  2270. // CONTAINS is supported for lists: When evaluating "a CONTAINS b", "a" can
  2271. // be a list; however, "b" cannot be a set, a map, or a list.
  2272. //
  2273. // NOT_CONTAINS : Checks for absence of a subsequence, or absence of a value
  2274. // in a set.
  2275. //
  2276. // AttributeValueList can contain only one AttributeValue element of type
  2277. // String, Number, or Binary (not a set type). If the target attribute of the
  2278. // comparison is a String, then the operator checks for the absence of a substring
  2279. // match. If the target attribute of the comparison is Binary, then the operator
  2280. // checks for the absence of a subsequence of the target that matches the input.
  2281. // If the target attribute of the comparison is a set ("SS", "NS", or "BS"),
  2282. // then the operator evaluates to true if it does not find an exact match with
  2283. // any member of the set.
  2284. //
  2285. // NOT_CONTAINS is supported for lists: When evaluating "a NOT CONTAINS b",
  2286. // "a" can be a list; however, "b" cannot be a set, a map, or a list.
  2287. //
  2288. // BEGINS_WITH : Checks for a prefix.
  2289. //
  2290. // AttributeValueList can contain only one AttributeValue of type String or
  2291. // Binary (not a Number or a set type). The target attribute of the comparison
  2292. // must be of type String or Binary (not a Number or a set type).
  2293. //
  2294. // IN : Checks for matching elements within two sets.
  2295. //
  2296. // AttributeValueList can contain one or more AttributeValue elements of type
  2297. // String, Number, or Binary (not a set type). These attributes are compared
  2298. // against an existing set type attribute of an item. If any elements of the
  2299. // input set are present in the item attribute, the expression evaluates to
  2300. // true.
  2301. //
  2302. // BETWEEN : Greater than or equal to the first value, and less than or
  2303. // equal to the second value.
  2304. //
  2305. // AttributeValueList must contain two AttributeValue elements of the same
  2306. // type, either String, Number, or Binary (not a set type). A target attribute
  2307. // matches if the target value is greater than, or equal to, the first element
  2308. // and less than, or equal to, the second element. If an item contains an AttributeValue
  2309. // element of a different type than the one provided in the request, the value
  2310. // does not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,
  2311. // {"N":"6"} does not compare to {"NS":["6", "2", "1"]}
  2312. //
  2313. // For usage examples of AttributeValueList and ComparisonOperator, see
  2314. // Legacy Conditional Parameters (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html)
  2315. // in the Amazon DynamoDB Developer Guide.
  2316. //
  2317. // For backward compatibility with previous DynamoDB releases, the following
  2318. // parameters can be used instead of AttributeValueList and ComparisonOperator:
  2319. //
  2320. // Value - A value for DynamoDB to compare with an attribute.
  2321. //
  2322. // Exists - A Boolean value that causes DynamoDB to evaluate the value before
  2323. // attempting the conditional operation:
  2324. //
  2325. // If Exists is true, DynamoDB will check to see if that attribute value
  2326. // already exists in the table. If it is found, then the condition evaluates
  2327. // to true; otherwise the condition evaluate to false.
  2328. //
  2329. // If Exists is false, DynamoDB assumes that the attribute value does not
  2330. // exist in the table. If in fact the value does not exist, then the assumption
  2331. // is valid and the condition evaluates to true. If the value is found, despite
  2332. // the assumption that it does not exist, the condition evaluates to false.
  2333. //
  2334. // Note that the default value for Exists is true.
  2335. //
  2336. // The Value and Exists parameters are incompatible with AttributeValueList
  2337. // and ComparisonOperator. Note that if you use both sets of parameters at once,
  2338. // DynamoDB will return a ValidationException exception.
  2339. //
  2340. // This parameter does not support attributes of type List or Map.
  2341. Expected map[string]*ExpectedAttributeValue `type:"map"`
  2342. // One or more substitution tokens for attribute names in an expression. The
  2343. // following are some use cases for using ExpressionAttributeNames:
  2344. //
  2345. // To access an attribute whose name conflicts with a DynamoDB reserved word.
  2346. //
  2347. // To create a placeholder for repeating occurrences of an attribute name
  2348. // in an expression.
  2349. //
  2350. // To prevent special characters in an attribute name from being misinterpreted
  2351. // in an expression.
  2352. //
  2353. // Use the # character in an expression to dereference an attribute name.
  2354. // For example, consider the following attribute name:
  2355. //
  2356. // Percentile
  2357. //
  2358. // The name of this attribute conflicts with a reserved word, so it cannot
  2359. // be used directly in an expression. (For the complete list of reserved words,
  2360. // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
  2361. // in the Amazon DynamoDB Developer Guide). To work around this, you could specify
  2362. // the following for ExpressionAttributeNames:
  2363. //
  2364. // {"#P":"Percentile"}
  2365. //
  2366. // You could then use this substitution in an expression, as in this example:
  2367. //
  2368. // #P = :val
  2369. //
  2370. // Tokens that begin with the : character are expression attribute values,
  2371. // which are placeholders for the actual value at runtime.
  2372. //
  2373. // For more information on expression attribute names, see Accessing Item
  2374. // Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  2375. // in the Amazon DynamoDB Developer Guide.
  2376. ExpressionAttributeNames map[string]*string `type:"map"`
  2377. // One or more values that can be substituted in an expression.
  2378. //
  2379. // Use the : (colon) character in an expression to dereference an attribute
  2380. // value. For example, suppose that you wanted to check whether the value of
  2381. // the ProductStatus attribute was one of the following:
  2382. //
  2383. // Available | Backordered | Discontinued
  2384. //
  2385. // You would first need to specify ExpressionAttributeValues as follows:
  2386. //
  2387. // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"}
  2388. // }
  2389. //
  2390. // You could then use these values in an expression, such as this:
  2391. //
  2392. // ProductStatus IN (:avail, :back, :disc)
  2393. //
  2394. // For more information on expression attribute values, see Specifying Conditions
  2395. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
  2396. // in the Amazon DynamoDB Developer Guide.
  2397. ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
  2398. // A map of attribute names to AttributeValue objects, representing the primary
  2399. // key of the item to delete.
  2400. //
  2401. // For the primary key, you must provide all of the attributes. For example,
  2402. // with a simple primary key, you only need to provide a value for the partition
  2403. // key. For a composite primary key, you must provide values for both the partition
  2404. // key and the sort key.
  2405. Key map[string]*AttributeValue `type:"map" required:"true"`
  2406. // Determines the level of detail about provisioned throughput consumption that
  2407. // is returned in the response:
  2408. //
  2409. // INDEXES - The response includes the aggregate ConsumedCapacity for the
  2410. // operation, together with ConsumedCapacity for each table and secondary index
  2411. // that was accessed.
  2412. //
  2413. // Note that some operations, such as GetItem and BatchGetItem, do not access
  2414. // any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity
  2415. // information for table(s).
  2416. //
  2417. // TOTAL - The response includes only the aggregate ConsumedCapacity for
  2418. // the operation.
  2419. //
  2420. // NONE - No ConsumedCapacity details are included in the response.
  2421. ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
  2422. // Determines whether item collection metrics are returned. If set to SIZE,
  2423. // the response includes statistics about item collections, if any, that were
  2424. // modified during the operation are returned in the response. If set to NONE
  2425. // (the default), no statistics are returned.
  2426. ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"`
  2427. // Use ReturnValues if you want to get the item attributes as they appeared
  2428. // before they were deleted. For DeleteItem, the valid values are:
  2429. //
  2430. // NONE - If ReturnValues is not specified, or if its value is NONE, then
  2431. // nothing is returned. (This setting is the default for ReturnValues.)
  2432. //
  2433. // ALL_OLD - The content of the old item is returned.
  2434. //
  2435. // The ReturnValues parameter is used by several DynamoDB operations; however,
  2436. // DeleteItem does not recognize any values other than NONE or ALL_OLD.
  2437. ReturnValues *string `type:"string" enum:"ReturnValue"`
  2438. // The name of the table from which to delete the item.
  2439. TableName *string `min:"3" type:"string" required:"true"`
  2440. }
  2441. // String returns the string representation
  2442. func (s DeleteItemInput) String() string {
  2443. return awsutil.Prettify(s)
  2444. }
  2445. // GoString returns the string representation
  2446. func (s DeleteItemInput) GoString() string {
  2447. return s.String()
  2448. }
  2449. // Validate inspects the fields of the type to determine if they are valid.
  2450. func (s *DeleteItemInput) Validate() error {
  2451. invalidParams := request.ErrInvalidParams{Context: "DeleteItemInput"}
  2452. if s.Key == nil {
  2453. invalidParams.Add(request.NewErrParamRequired("Key"))
  2454. }
  2455. if s.TableName == nil {
  2456. invalidParams.Add(request.NewErrParamRequired("TableName"))
  2457. }
  2458. if s.TableName != nil && len(*s.TableName) < 3 {
  2459. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  2460. }
  2461. if invalidParams.Len() > 0 {
  2462. return invalidParams
  2463. }
  2464. return nil
  2465. }
  2466. // Represents the output of a DeleteItem operation.
  2467. type DeleteItemOutput struct {
  2468. _ struct{} `type:"structure"`
  2469. // A map of attribute names to AttributeValue objects, representing the item
  2470. // as it appeared before the DeleteItem operation. This map appears in the response
  2471. // only if ReturnValues was specified as ALL_OLD in the request.
  2472. Attributes map[string]*AttributeValue `type:"map"`
  2473. // The capacity units consumed by an operation. The data returned includes the
  2474. // total provisioned throughput consumed, along with statistics for the table
  2475. // and any indexes involved in the operation. ConsumedCapacity is only returned
  2476. // if the request asked for it. For more information, see Provisioned Throughput
  2477. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
  2478. // in the Amazon DynamoDB Developer Guide.
  2479. ConsumedCapacity *ConsumedCapacity `type:"structure"`
  2480. // Information about item collections, if any, that were affected by the operation.
  2481. // ItemCollectionMetrics is only returned if the request asked for it. If the
  2482. // table does not have any local secondary indexes, this information is not
  2483. // returned in the response.
  2484. //
  2485. // Each ItemCollectionMetrics element consists of:
  2486. //
  2487. // ItemCollectionKey - The partition key value of the item collection. This
  2488. // is the same as the partition key value of the item itself.
  2489. //
  2490. // SizeEstimateRange - An estimate of item collection size, in gigabytes.
  2491. // This value is a two-element array containing a lower bound and an upper bound
  2492. // for the estimate. The estimate includes the size of all the items in the
  2493. // table, plus the size of all attributes projected into all of the local secondary
  2494. // indexes on that table. Use this estimate to measure whether a local secondary
  2495. // index is approaching its size limit.
  2496. //
  2497. // The estimate is subject to change over time; therefore, do not rely on the
  2498. // precision or accuracy of the estimate.
  2499. ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"`
  2500. }
  2501. // String returns the string representation
  2502. func (s DeleteItemOutput) String() string {
  2503. return awsutil.Prettify(s)
  2504. }
  2505. // GoString returns the string representation
  2506. func (s DeleteItemOutput) GoString() string {
  2507. return s.String()
  2508. }
  2509. // Represents a request to perform a DeleteItem operation on an item.
  2510. type DeleteRequest struct {
  2511. _ struct{} `type:"structure"`
  2512. // A map of attribute name to attribute values, representing the primary key
  2513. // of the item to delete. All of the table's primary key attributes must be
  2514. // specified, and their data types must match those of the table's key schema.
  2515. Key map[string]*AttributeValue `type:"map" required:"true"`
  2516. }
  2517. // String returns the string representation
  2518. func (s DeleteRequest) String() string {
  2519. return awsutil.Prettify(s)
  2520. }
  2521. // GoString returns the string representation
  2522. func (s DeleteRequest) GoString() string {
  2523. return s.String()
  2524. }
  2525. // Represents the input of a DeleteTable operation.
  2526. type DeleteTableInput struct {
  2527. _ struct{} `type:"structure"`
  2528. // The name of the table to delete.
  2529. TableName *string `min:"3" type:"string" required:"true"`
  2530. }
  2531. // String returns the string representation
  2532. func (s DeleteTableInput) String() string {
  2533. return awsutil.Prettify(s)
  2534. }
  2535. // GoString returns the string representation
  2536. func (s DeleteTableInput) GoString() string {
  2537. return s.String()
  2538. }
  2539. // Validate inspects the fields of the type to determine if they are valid.
  2540. func (s *DeleteTableInput) Validate() error {
  2541. invalidParams := request.ErrInvalidParams{Context: "DeleteTableInput"}
  2542. if s.TableName == nil {
  2543. invalidParams.Add(request.NewErrParamRequired("TableName"))
  2544. }
  2545. if s.TableName != nil && len(*s.TableName) < 3 {
  2546. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  2547. }
  2548. if invalidParams.Len() > 0 {
  2549. return invalidParams
  2550. }
  2551. return nil
  2552. }
  2553. // Represents the output of a DeleteTable operation.
  2554. type DeleteTableOutput struct {
  2555. _ struct{} `type:"structure"`
  2556. // Represents the properties of a table.
  2557. TableDescription *TableDescription `type:"structure"`
  2558. }
  2559. // String returns the string representation
  2560. func (s DeleteTableOutput) String() string {
  2561. return awsutil.Prettify(s)
  2562. }
  2563. // GoString returns the string representation
  2564. func (s DeleteTableOutput) GoString() string {
  2565. return s.String()
  2566. }
  2567. // Represents the input of a DescribeLimits operation. Has no content.
  2568. type DescribeLimitsInput struct {
  2569. _ struct{} `type:"structure"`
  2570. }
  2571. // String returns the string representation
  2572. func (s DescribeLimitsInput) String() string {
  2573. return awsutil.Prettify(s)
  2574. }
  2575. // GoString returns the string representation
  2576. func (s DescribeLimitsInput) GoString() string {
  2577. return s.String()
  2578. }
  2579. // Represents the output of a DescribeLimits operation.
  2580. type DescribeLimitsOutput struct {
  2581. _ struct{} `type:"structure"`
  2582. // The maximum total read capacity units that your account allows you to provision
  2583. // across all of your tables in this region.
  2584. AccountMaxReadCapacityUnits *int64 `min:"1" type:"long"`
  2585. // The maximum total write capacity units that your account allows you to provision
  2586. // across all of your tables in this region.
  2587. AccountMaxWriteCapacityUnits *int64 `min:"1" type:"long"`
  2588. // The maximum read capacity units that your account allows you to provision
  2589. // for a new table that you are creating in this region, including the read
  2590. // capacity units provisioned for its global secondary indexes (GSIs).
  2591. TableMaxReadCapacityUnits *int64 `min:"1" type:"long"`
  2592. // The maximum write capacity units that your account allows you to provision
  2593. // for a new table that you are creating in this region, including the write
  2594. // capacity units provisioned for its global secondary indexes (GSIs).
  2595. TableMaxWriteCapacityUnits *int64 `min:"1" type:"long"`
  2596. }
  2597. // String returns the string representation
  2598. func (s DescribeLimitsOutput) String() string {
  2599. return awsutil.Prettify(s)
  2600. }
  2601. // GoString returns the string representation
  2602. func (s DescribeLimitsOutput) GoString() string {
  2603. return s.String()
  2604. }
  2605. // Represents the input of a DescribeTable operation.
  2606. type DescribeTableInput struct {
  2607. _ struct{} `type:"structure"`
  2608. // The name of the table to describe.
  2609. TableName *string `min:"3" type:"string" required:"true"`
  2610. }
  2611. // String returns the string representation
  2612. func (s DescribeTableInput) String() string {
  2613. return awsutil.Prettify(s)
  2614. }
  2615. // GoString returns the string representation
  2616. func (s DescribeTableInput) GoString() string {
  2617. return s.String()
  2618. }
  2619. // Validate inspects the fields of the type to determine if they are valid.
  2620. func (s *DescribeTableInput) Validate() error {
  2621. invalidParams := request.ErrInvalidParams{Context: "DescribeTableInput"}
  2622. if s.TableName == nil {
  2623. invalidParams.Add(request.NewErrParamRequired("TableName"))
  2624. }
  2625. if s.TableName != nil && len(*s.TableName) < 3 {
  2626. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  2627. }
  2628. if invalidParams.Len() > 0 {
  2629. return invalidParams
  2630. }
  2631. return nil
  2632. }
  2633. // Represents the output of a DescribeTable operation.
  2634. type DescribeTableOutput struct {
  2635. _ struct{} `type:"structure"`
  2636. // Represents the properties of a table.
  2637. Table *TableDescription `type:"structure"`
  2638. }
  2639. // String returns the string representation
  2640. func (s DescribeTableOutput) String() string {
  2641. return awsutil.Prettify(s)
  2642. }
  2643. // GoString returns the string representation
  2644. func (s DescribeTableOutput) GoString() string {
  2645. return s.String()
  2646. }
  2647. // Represents a condition to be compared with an attribute value. This condition
  2648. // can be used with DeleteItem, PutItem or UpdateItem operations; if the comparison
  2649. // evaluates to true, the operation succeeds; if not, the operation fails. You
  2650. // can use ExpectedAttributeValue in one of two different ways:
  2651. //
  2652. // Use AttributeValueList to specify one or more values to compare against
  2653. // an attribute. Use ComparisonOperator to specify how you want to perform the
  2654. // comparison. If the comparison evaluates to true, then the conditional operation
  2655. // succeeds.
  2656. //
  2657. // Use Value to specify a value that DynamoDB will compare against an attribute.
  2658. // If the values match, then ExpectedAttributeValue evaluates to true and the
  2659. // conditional operation succeeds. Optionally, you can also set Exists to false,
  2660. // indicating that you do not expect to find the attribute value in the table.
  2661. // In this case, the conditional operation succeeds only if the comparison evaluates
  2662. // to false.
  2663. //
  2664. // Value and Exists are incompatible with AttributeValueList and ComparisonOperator.
  2665. // Note that if you use both sets of parameters at once, DynamoDB will return
  2666. // a ValidationException exception.
  2667. type ExpectedAttributeValue struct {
  2668. _ struct{} `type:"structure"`
  2669. // One or more values to evaluate against the supplied attribute. The number
  2670. // of values in the list depends on the ComparisonOperator being used.
  2671. //
  2672. // For type Number, value comparisons are numeric.
  2673. //
  2674. // String value comparisons for greater than, equals, or less than are based
  2675. // on ASCII character code values. For example, a is greater than A, and a is
  2676. // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
  2677. // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  2678. //
  2679. // For Binary, DynamoDB treats each byte of the binary data as unsigned when
  2680. // it compares binary values.
  2681. //
  2682. // For information on specifying data types in JSON, see JSON Data Format (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html)
  2683. // in the Amazon DynamoDB Developer Guide.
  2684. AttributeValueList []*AttributeValue `type:"list"`
  2685. // A comparator for evaluating attributes in the AttributeValueList. For example,
  2686. // equals, greater than, less than, etc.
  2687. //
  2688. // The following comparison operators are available:
  2689. //
  2690. // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS
  2691. // | BEGINS_WITH | IN | BETWEEN
  2692. //
  2693. // The following are descriptions of each comparison operator.
  2694. //
  2695. // EQ : Equal. EQ is supported for all datatypes, including lists and maps.
  2696. //
  2697. // AttributeValueList can contain only one AttributeValue element of type
  2698. // String, Number, Binary, String Set, Number Set, or Binary Set. If an item
  2699. // contains an AttributeValue element of a different type than the one provided
  2700. // in the request, the value does not match. For example, {"S":"6"} does not
  2701. // equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  2702. //
  2703. // NE : Not equal. NE is supported for all datatypes, including lists and
  2704. // maps.
  2705. //
  2706. // AttributeValueList can contain only one AttributeValue of type String,
  2707. // Number, Binary, String Set, Number Set, or Binary Set. If an item contains
  2708. // an AttributeValue of a different type than the one provided in the request,
  2709. // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}.
  2710. // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  2711. //
  2712. // LE : Less than or equal.
  2713. //
  2714. // AttributeValueList can contain only one AttributeValue element of type
  2715. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  2716. // element of a different type than the one provided in the request, the value
  2717. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  2718. // does not compare to {"NS":["6", "2", "1"]}.
  2719. //
  2720. // LT : Less than.
  2721. //
  2722. // AttributeValueList can contain only one AttributeValue of type String,
  2723. // Number, or Binary (not a set type). If an item contains an AttributeValue
  2724. // element of a different type than the one provided in the request, the value
  2725. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  2726. // does not compare to {"NS":["6", "2", "1"]}.
  2727. //
  2728. // GE : Greater than or equal.
  2729. //
  2730. // AttributeValueList can contain only one AttributeValue element of type
  2731. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  2732. // element of a different type than the one provided in the request, the value
  2733. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  2734. // does not compare to {"NS":["6", "2", "1"]}.
  2735. //
  2736. // GT : Greater than.
  2737. //
  2738. // AttributeValueList can contain only one AttributeValue element of type
  2739. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  2740. // element of a different type than the one provided in the request, the value
  2741. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  2742. // does not compare to {"NS":["6", "2", "1"]}.
  2743. //
  2744. // NOT_NULL : The attribute exists. NOT_NULL is supported for all datatypes,
  2745. // including lists and maps.
  2746. //
  2747. // This operator tests for the existence of an attribute, not its data type.
  2748. // If the data type of attribute "a" is null, and you evaluate it using NOT_NULL,
  2749. // the result is a Boolean true. This result is because the attribute "a" exists;
  2750. // its data type is not relevant to the NOT_NULL comparison operator.
  2751. //
  2752. // NULL : The attribute does not exist. NULL is supported for all datatypes,
  2753. // including lists and maps.
  2754. //
  2755. // This operator tests for the nonexistence of an attribute, not its data
  2756. // type. If the data type of attribute "a" is null, and you evaluate it using
  2757. // NULL, the result is a Boolean false. This is because the attribute "a" exists;
  2758. // its data type is not relevant to the NULL comparison operator.
  2759. //
  2760. // CONTAINS : Checks for a subsequence, or value in a set.
  2761. //
  2762. // AttributeValueList can contain only one AttributeValue element of type
  2763. // String, Number, or Binary (not a set type). If the target attribute of the
  2764. // comparison is of type String, then the operator checks for a substring match.
  2765. // If the target attribute of the comparison is of type Binary, then the operator
  2766. // looks for a subsequence of the target that matches the input. If the target
  2767. // attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator
  2768. // evaluates to true if it finds an exact match with any member of the set.
  2769. //
  2770. // CONTAINS is supported for lists: When evaluating "a CONTAINS b", "a" can
  2771. // be a list; however, "b" cannot be a set, a map, or a list.
  2772. //
  2773. // NOT_CONTAINS : Checks for absence of a subsequence, or absence of a value
  2774. // in a set.
  2775. //
  2776. // AttributeValueList can contain only one AttributeValue element of type
  2777. // String, Number, or Binary (not a set type). If the target attribute of the
  2778. // comparison is a String, then the operator checks for the absence of a substring
  2779. // match. If the target attribute of the comparison is Binary, then the operator
  2780. // checks for the absence of a subsequence of the target that matches the input.
  2781. // If the target attribute of the comparison is a set ("SS", "NS", or "BS"),
  2782. // then the operator evaluates to true if it does not find an exact match with
  2783. // any member of the set.
  2784. //
  2785. // NOT_CONTAINS is supported for lists: When evaluating "a NOT CONTAINS b",
  2786. // "a" can be a list; however, "b" cannot be a set, a map, or a list.
  2787. //
  2788. // BEGINS_WITH : Checks for a prefix.
  2789. //
  2790. // AttributeValueList can contain only one AttributeValue of type String or
  2791. // Binary (not a Number or a set type). The target attribute of the comparison
  2792. // must be of type String or Binary (not a Number or a set type).
  2793. //
  2794. // IN : Checks for matching elements within two sets.
  2795. //
  2796. // AttributeValueList can contain one or more AttributeValue elements of type
  2797. // String, Number, or Binary (not a set type). These attributes are compared
  2798. // against an existing set type attribute of an item. If any elements of the
  2799. // input set are present in the item attribute, the expression evaluates to
  2800. // true.
  2801. //
  2802. // BETWEEN : Greater than or equal to the first value, and less than or
  2803. // equal to the second value.
  2804. //
  2805. // AttributeValueList must contain two AttributeValue elements of the same
  2806. // type, either String, Number, or Binary (not a set type). A target attribute
  2807. // matches if the target value is greater than, or equal to, the first element
  2808. // and less than, or equal to, the second element. If an item contains an AttributeValue
  2809. // element of a different type than the one provided in the request, the value
  2810. // does not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,
  2811. // {"N":"6"} does not compare to {"NS":["6", "2", "1"]}
  2812. ComparisonOperator *string `type:"string" enum:"ComparisonOperator"`
  2813. // Causes DynamoDB to evaluate the value before attempting a conditional operation:
  2814. //
  2815. // If Exists is true, DynamoDB will check to see if that attribute value
  2816. // already exists in the table. If it is found, then the operation succeeds.
  2817. // If it is not found, the operation fails with a ConditionalCheckFailedException.
  2818. //
  2819. // If Exists is false, DynamoDB assumes that the attribute value does not
  2820. // exist in the table. If in fact the value does not exist, then the assumption
  2821. // is valid and the operation succeeds. If the value is found, despite the assumption
  2822. // that it does not exist, the operation fails with a ConditionalCheckFailedException.
  2823. //
  2824. // The default setting for Exists is true. If you supply a Value all by itself,
  2825. // DynamoDB assumes the attribute exists: You don't have to set Exists to true,
  2826. // because it is implied.
  2827. //
  2828. // DynamoDB returns a ValidationException if:
  2829. //
  2830. // Exists is true but there is no Value to check. (You expect a value to
  2831. // exist, but don't specify what that value is.)
  2832. //
  2833. // Exists is false but you also provide a Value. (You cannot expect an attribute
  2834. // to have a value, while also expecting it not to exist.)
  2835. Exists *bool `type:"boolean"`
  2836. // Represents the data for an attribute. You can set one, and only one, of the
  2837. // elements.
  2838. //
  2839. // Each attribute in an item is a name-value pair. An attribute can be single-valued
  2840. // or multi-valued set. For example, a book item can have title and authors
  2841. // attributes. Each book has one title but can have many authors. The multi-valued
  2842. // attribute is a set; duplicate values are not allowed.
  2843. Value *AttributeValue `type:"structure"`
  2844. }
  2845. // String returns the string representation
  2846. func (s ExpectedAttributeValue) String() string {
  2847. return awsutil.Prettify(s)
  2848. }
  2849. // GoString returns the string representation
  2850. func (s ExpectedAttributeValue) GoString() string {
  2851. return s.String()
  2852. }
  2853. // Represents the input of a GetItem operation.
  2854. type GetItemInput struct {
  2855. _ struct{} `type:"structure"`
  2856. // This is a legacy parameter, for backward compatibility. New applications
  2857. // should use ProjectionExpression instead. Do not combine legacy parameters
  2858. // and expression parameters in a single API call; otherwise, DynamoDB will
  2859. // return a ValidationException exception.
  2860. //
  2861. // This parameter allows you to retrieve attributes of type List or Map; however,
  2862. // it cannot retrieve individual elements within a List or a Map.
  2863. //
  2864. // The names of one or more attributes to retrieve. If no attribute names
  2865. // are provided, then all attributes will be returned. If any of the requested
  2866. // attributes are not found, they will not appear in the result.
  2867. //
  2868. // Note that AttributesToGet has no effect on provisioned throughput consumption.
  2869. // DynamoDB determines capacity units consumed based on item size, not on the
  2870. // amount of data that is returned to an application.
  2871. AttributesToGet []*string `min:"1" type:"list"`
  2872. // Determines the read consistency model: If set to true, then the operation
  2873. // uses strongly consistent reads; otherwise, the operation uses eventually
  2874. // consistent reads.
  2875. ConsistentRead *bool `type:"boolean"`
  2876. // One or more substitution tokens for attribute names in an expression. The
  2877. // following are some use cases for using ExpressionAttributeNames:
  2878. //
  2879. // To access an attribute whose name conflicts with a DynamoDB reserved word.
  2880. //
  2881. // To create a placeholder for repeating occurrences of an attribute name
  2882. // in an expression.
  2883. //
  2884. // To prevent special characters in an attribute name from being misinterpreted
  2885. // in an expression.
  2886. //
  2887. // Use the # character in an expression to dereference an attribute name.
  2888. // For example, consider the following attribute name:
  2889. //
  2890. // Percentile
  2891. //
  2892. // The name of this attribute conflicts with a reserved word, so it cannot
  2893. // be used directly in an expression. (For the complete list of reserved words,
  2894. // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
  2895. // in the Amazon DynamoDB Developer Guide). To work around this, you could specify
  2896. // the following for ExpressionAttributeNames:
  2897. //
  2898. // {"#P":"Percentile"}
  2899. //
  2900. // You could then use this substitution in an expression, as in this example:
  2901. //
  2902. // #P = :val
  2903. //
  2904. // Tokens that begin with the : character are expression attribute values,
  2905. // which are placeholders for the actual value at runtime.
  2906. //
  2907. // For more information on expression attribute names, see Accessing Item
  2908. // Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  2909. // in the Amazon DynamoDB Developer Guide.
  2910. ExpressionAttributeNames map[string]*string `type:"map"`
  2911. // A map of attribute names to AttributeValue objects, representing the primary
  2912. // key of the item to retrieve.
  2913. //
  2914. // For the primary key, you must provide all of the attributes. For example,
  2915. // with a simple primary key, you only need to provide a value for the partition
  2916. // key. For a composite primary key, you must provide values for both the partition
  2917. // key and the sort key.
  2918. Key map[string]*AttributeValue `type:"map" required:"true"`
  2919. // A string that identifies one or more attributes to retrieve from the table.
  2920. // These attributes can include scalars, sets, or elements of a JSON document.
  2921. // The attributes in the expression must be separated by commas.
  2922. //
  2923. // If no attribute names are specified, then all attributes will be returned.
  2924. // If any of the requested attributes are not found, they will not appear in
  2925. // the result.
  2926. //
  2927. // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  2928. // in the Amazon DynamoDB Developer Guide.
  2929. //
  2930. // ProjectionExpression replaces the legacy AttributesToGet parameter.
  2931. ProjectionExpression *string `type:"string"`
  2932. // Determines the level of detail about provisioned throughput consumption that
  2933. // is returned in the response:
  2934. //
  2935. // INDEXES - The response includes the aggregate ConsumedCapacity for the
  2936. // operation, together with ConsumedCapacity for each table and secondary index
  2937. // that was accessed.
  2938. //
  2939. // Note that some operations, such as GetItem and BatchGetItem, do not access
  2940. // any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity
  2941. // information for table(s).
  2942. //
  2943. // TOTAL - The response includes only the aggregate ConsumedCapacity for
  2944. // the operation.
  2945. //
  2946. // NONE - No ConsumedCapacity details are included in the response.
  2947. ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
  2948. // The name of the table containing the requested item.
  2949. TableName *string `min:"3" type:"string" required:"true"`
  2950. }
  2951. // String returns the string representation
  2952. func (s GetItemInput) String() string {
  2953. return awsutil.Prettify(s)
  2954. }
  2955. // GoString returns the string representation
  2956. func (s GetItemInput) GoString() string {
  2957. return s.String()
  2958. }
  2959. // Validate inspects the fields of the type to determine if they are valid.
  2960. func (s *GetItemInput) Validate() error {
  2961. invalidParams := request.ErrInvalidParams{Context: "GetItemInput"}
  2962. if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 {
  2963. invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1))
  2964. }
  2965. if s.Key == nil {
  2966. invalidParams.Add(request.NewErrParamRequired("Key"))
  2967. }
  2968. if s.TableName == nil {
  2969. invalidParams.Add(request.NewErrParamRequired("TableName"))
  2970. }
  2971. if s.TableName != nil && len(*s.TableName) < 3 {
  2972. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  2973. }
  2974. if invalidParams.Len() > 0 {
  2975. return invalidParams
  2976. }
  2977. return nil
  2978. }
  2979. // Represents the output of a GetItem operation.
  2980. type GetItemOutput struct {
  2981. _ struct{} `type:"structure"`
  2982. // The capacity units consumed by an operation. The data returned includes the
  2983. // total provisioned throughput consumed, along with statistics for the table
  2984. // and any indexes involved in the operation. ConsumedCapacity is only returned
  2985. // if the request asked for it. For more information, see Provisioned Throughput
  2986. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
  2987. // in the Amazon DynamoDB Developer Guide.
  2988. ConsumedCapacity *ConsumedCapacity `type:"structure"`
  2989. // A map of attribute names to AttributeValue objects, as specified by AttributesToGet.
  2990. Item map[string]*AttributeValue `type:"map"`
  2991. }
  2992. // String returns the string representation
  2993. func (s GetItemOutput) String() string {
  2994. return awsutil.Prettify(s)
  2995. }
  2996. // GoString returns the string representation
  2997. func (s GetItemOutput) GoString() string {
  2998. return s.String()
  2999. }
  3000. // Represents the properties of a global secondary index.
  3001. type GlobalSecondaryIndex struct {
  3002. _ struct{} `type:"structure"`
  3003. // The name of the global secondary index. The name must be unique among all
  3004. // other indexes on this table.
  3005. IndexName *string `min:"3" type:"string" required:"true"`
  3006. // The complete key schema for a global secondary index, which consists of one
  3007. // or more pairs of attribute names and key types:
  3008. //
  3009. // HASH - partition key
  3010. //
  3011. // RANGE - sort key
  3012. //
  3013. // The partition key of an item is also known as its hash attribute. The
  3014. // term "hash attribute" derives from DynamoDB' usage of an internal hash function
  3015. // to evenly distribute data items across partitions, based on their partition
  3016. // key values.
  3017. //
  3018. // The sort key of an item is also known as its range attribute. The term "range
  3019. // attribute" derives from the way DynamoDB stores items with the same partition
  3020. // key physically close together, in sorted order by the sort key value.
  3021. KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"`
  3022. // Represents attributes that are copied (projected) from the table into an
  3023. // index. These are in addition to the primary key attributes and index key
  3024. // attributes, which are automatically projected.
  3025. Projection *Projection `type:"structure" required:"true"`
  3026. // Represents the provisioned throughput settings for a specified table or index.
  3027. // The settings can be modified using the UpdateTable operation.
  3028. //
  3029. // For current minimum and maximum provisioned throughput values, see Limits
  3030. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
  3031. // in the Amazon DynamoDB Developer Guide.
  3032. ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"`
  3033. }
  3034. // String returns the string representation
  3035. func (s GlobalSecondaryIndex) String() string {
  3036. return awsutil.Prettify(s)
  3037. }
  3038. // GoString returns the string representation
  3039. func (s GlobalSecondaryIndex) GoString() string {
  3040. return s.String()
  3041. }
  3042. // Validate inspects the fields of the type to determine if they are valid.
  3043. func (s *GlobalSecondaryIndex) Validate() error {
  3044. invalidParams := request.ErrInvalidParams{Context: "GlobalSecondaryIndex"}
  3045. if s.IndexName == nil {
  3046. invalidParams.Add(request.NewErrParamRequired("IndexName"))
  3047. }
  3048. if s.IndexName != nil && len(*s.IndexName) < 3 {
  3049. invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
  3050. }
  3051. if s.KeySchema == nil {
  3052. invalidParams.Add(request.NewErrParamRequired("KeySchema"))
  3053. }
  3054. if s.KeySchema != nil && len(s.KeySchema) < 1 {
  3055. invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1))
  3056. }
  3057. if s.Projection == nil {
  3058. invalidParams.Add(request.NewErrParamRequired("Projection"))
  3059. }
  3060. if s.ProvisionedThroughput == nil {
  3061. invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
  3062. }
  3063. if s.KeySchema != nil {
  3064. for i, v := range s.KeySchema {
  3065. if v == nil {
  3066. continue
  3067. }
  3068. if err := v.Validate(); err != nil {
  3069. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams))
  3070. }
  3071. }
  3072. }
  3073. if s.Projection != nil {
  3074. if err := s.Projection.Validate(); err != nil {
  3075. invalidParams.AddNested("Projection", err.(request.ErrInvalidParams))
  3076. }
  3077. }
  3078. if s.ProvisionedThroughput != nil {
  3079. if err := s.ProvisionedThroughput.Validate(); err != nil {
  3080. invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
  3081. }
  3082. }
  3083. if invalidParams.Len() > 0 {
  3084. return invalidParams
  3085. }
  3086. return nil
  3087. }
  3088. // Represents the properties of a global secondary index.
  3089. type GlobalSecondaryIndexDescription struct {
  3090. _ struct{} `type:"structure"`
  3091. // Indicates whether the index is currently backfilling. Backfilling is the
  3092. // process of reading items from the table and determining whether they can
  3093. // be added to the index. (Not all items will qualify: For example, a partition
  3094. // key cannot have any duplicate values.) If an item can be added to the index,
  3095. // DynamoDB will do so. After all items have been processed, the backfilling
  3096. // operation is complete and Backfilling is false.
  3097. //
  3098. // For indexes that were created during a CreateTable operation, the Backfilling
  3099. // attribute does not appear in the DescribeTable output.
  3100. Backfilling *bool `type:"boolean"`
  3101. // The Amazon Resource Name (ARN) that uniquely identifies the index.
  3102. IndexArn *string `type:"string"`
  3103. // The name of the global secondary index.
  3104. IndexName *string `min:"3" type:"string"`
  3105. // The total size of the specified index, in bytes. DynamoDB updates this value
  3106. // approximately every six hours. Recent changes might not be reflected in this
  3107. // value.
  3108. IndexSizeBytes *int64 `type:"long"`
  3109. // The current state of the global secondary index:
  3110. //
  3111. // CREATING - The index is being created.
  3112. //
  3113. // UPDATING - The index is being updated.
  3114. //
  3115. // DELETING - The index is being deleted.
  3116. //
  3117. // ACTIVE - The index is ready for use.
  3118. IndexStatus *string `type:"string" enum:"IndexStatus"`
  3119. // The number of items in the specified index. DynamoDB updates this value approximately
  3120. // every six hours. Recent changes might not be reflected in this value.
  3121. ItemCount *int64 `type:"long"`
  3122. // The complete key schema for a global secondary index, which consists of one
  3123. // or more pairs of attribute names and key types:
  3124. //
  3125. // HASH - partition key
  3126. //
  3127. // RANGE - sort key
  3128. //
  3129. // The partition key of an item is also known as its hash attribute. The
  3130. // term "hash attribute" derives from DynamoDB' usage of an internal hash function
  3131. // to evenly distribute data items across partitions, based on their partition
  3132. // key values.
  3133. //
  3134. // The sort key of an item is also known as its range attribute. The term "range
  3135. // attribute" derives from the way DynamoDB stores items with the same partition
  3136. // key physically close together, in sorted order by the sort key value.
  3137. KeySchema []*KeySchemaElement `min:"1" type:"list"`
  3138. // Represents attributes that are copied (projected) from the table into an
  3139. // index. These are in addition to the primary key attributes and index key
  3140. // attributes, which are automatically projected.
  3141. Projection *Projection `type:"structure"`
  3142. // Represents the provisioned throughput settings for the table, consisting
  3143. // of read and write capacity units, along with data about increases and decreases.
  3144. ProvisionedThroughput *ProvisionedThroughputDescription `type:"structure"`
  3145. }
  3146. // String returns the string representation
  3147. func (s GlobalSecondaryIndexDescription) String() string {
  3148. return awsutil.Prettify(s)
  3149. }
  3150. // GoString returns the string representation
  3151. func (s GlobalSecondaryIndexDescription) GoString() string {
  3152. return s.String()
  3153. }
  3154. // Represents one of the following:
  3155. //
  3156. // A new global secondary index to be added to an existing table.
  3157. //
  3158. // New provisioned throughput parameters for an existing global secondary
  3159. // index.
  3160. //
  3161. // An existing global secondary index to be removed from an existing table.
  3162. type GlobalSecondaryIndexUpdate struct {
  3163. _ struct{} `type:"structure"`
  3164. // The parameters required for creating a global secondary index on an existing
  3165. // table:
  3166. //
  3167. // IndexName
  3168. //
  3169. // KeySchema
  3170. //
  3171. // AttributeDefinitions
  3172. //
  3173. // Projection
  3174. //
  3175. // ProvisionedThroughput
  3176. Create *CreateGlobalSecondaryIndexAction `type:"structure"`
  3177. // The name of an existing global secondary index to be removed.
  3178. Delete *DeleteGlobalSecondaryIndexAction `type:"structure"`
  3179. // The name of an existing global secondary index, along with new provisioned
  3180. // throughput settings to be applied to that index.
  3181. Update *UpdateGlobalSecondaryIndexAction `type:"structure"`
  3182. }
  3183. // String returns the string representation
  3184. func (s GlobalSecondaryIndexUpdate) String() string {
  3185. return awsutil.Prettify(s)
  3186. }
  3187. // GoString returns the string representation
  3188. func (s GlobalSecondaryIndexUpdate) GoString() string {
  3189. return s.String()
  3190. }
  3191. // Validate inspects the fields of the type to determine if they are valid.
  3192. func (s *GlobalSecondaryIndexUpdate) Validate() error {
  3193. invalidParams := request.ErrInvalidParams{Context: "GlobalSecondaryIndexUpdate"}
  3194. if s.Create != nil {
  3195. if err := s.Create.Validate(); err != nil {
  3196. invalidParams.AddNested("Create", err.(request.ErrInvalidParams))
  3197. }
  3198. }
  3199. if s.Delete != nil {
  3200. if err := s.Delete.Validate(); err != nil {
  3201. invalidParams.AddNested("Delete", err.(request.ErrInvalidParams))
  3202. }
  3203. }
  3204. if s.Update != nil {
  3205. if err := s.Update.Validate(); err != nil {
  3206. invalidParams.AddNested("Update", err.(request.ErrInvalidParams))
  3207. }
  3208. }
  3209. if invalidParams.Len() > 0 {
  3210. return invalidParams
  3211. }
  3212. return nil
  3213. }
  3214. // Information about item collections, if any, that were affected by the operation.
  3215. // ItemCollectionMetrics is only returned if the request asked for it. If the
  3216. // table does not have any local secondary indexes, this information is not
  3217. // returned in the response.
  3218. type ItemCollectionMetrics struct {
  3219. _ struct{} `type:"structure"`
  3220. // The partition key value of the item collection. This value is the same as
  3221. // the partition key value of the item.
  3222. ItemCollectionKey map[string]*AttributeValue `type:"map"`
  3223. // An estimate of item collection size, in gigabytes. This value is a two-element
  3224. // array containing a lower bound and an upper bound for the estimate. The estimate
  3225. // includes the size of all the items in the table, plus the size of all attributes
  3226. // projected into all of the local secondary indexes on that table. Use this
  3227. // estimate to measure whether a local secondary index is approaching its size
  3228. // limit.
  3229. //
  3230. // The estimate is subject to change over time; therefore, do not rely on the
  3231. // precision or accuracy of the estimate.
  3232. SizeEstimateRangeGB []*float64 `type:"list"`
  3233. }
  3234. // String returns the string representation
  3235. func (s ItemCollectionMetrics) String() string {
  3236. return awsutil.Prettify(s)
  3237. }
  3238. // GoString returns the string representation
  3239. func (s ItemCollectionMetrics) GoString() string {
  3240. return s.String()
  3241. }
  3242. // Represents a single element of a key schema. A key schema specifies the attributes
  3243. // that make up the primary key of a table, or the key attributes of an index.
  3244. //
  3245. // A KeySchemaElement represents exactly one attribute of the primary key.
  3246. // For example, a simple primary key would be represented by one KeySchemaElement
  3247. // (for the partition key). A composite primary key would require one KeySchemaElement
  3248. // for the partition key, and another KeySchemaElement for the sort key.
  3249. //
  3250. // A KeySchemaElement must be a scalar, top-level attribute (not a nested attribute).
  3251. // The data type must be one of String, Number, or Binary. The attribute cannot
  3252. // be nested within a List or a Map.
  3253. type KeySchemaElement struct {
  3254. _ struct{} `type:"structure"`
  3255. // The name of a key attribute.
  3256. AttributeName *string `min:"1" type:"string" required:"true"`
  3257. // The role that this key attribute will assume:
  3258. //
  3259. // HASH - partition key
  3260. //
  3261. // RANGE - sort key
  3262. //
  3263. // The partition key of an item is also known as its hash attribute. The
  3264. // term "hash attribute" derives from DynamoDB' usage of an internal hash function
  3265. // to evenly distribute data items across partitions, based on their partition
  3266. // key values.
  3267. //
  3268. // The sort key of an item is also known as its range attribute. The term "range
  3269. // attribute" derives from the way DynamoDB stores items with the same partition
  3270. // key physically close together, in sorted order by the sort key value.
  3271. KeyType *string `type:"string" required:"true" enum:"KeyType"`
  3272. }
  3273. // String returns the string representation
  3274. func (s KeySchemaElement) String() string {
  3275. return awsutil.Prettify(s)
  3276. }
  3277. // GoString returns the string representation
  3278. func (s KeySchemaElement) GoString() string {
  3279. return s.String()
  3280. }
  3281. // Validate inspects the fields of the type to determine if they are valid.
  3282. func (s *KeySchemaElement) Validate() error {
  3283. invalidParams := request.ErrInvalidParams{Context: "KeySchemaElement"}
  3284. if s.AttributeName == nil {
  3285. invalidParams.Add(request.NewErrParamRequired("AttributeName"))
  3286. }
  3287. if s.AttributeName != nil && len(*s.AttributeName) < 1 {
  3288. invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1))
  3289. }
  3290. if s.KeyType == nil {
  3291. invalidParams.Add(request.NewErrParamRequired("KeyType"))
  3292. }
  3293. if invalidParams.Len() > 0 {
  3294. return invalidParams
  3295. }
  3296. return nil
  3297. }
  3298. // Represents a set of primary keys and, for each key, the attributes to retrieve
  3299. // from the table.
  3300. //
  3301. // For each primary key, you must provide all of the key attributes. For example,
  3302. // with a simple primary key, you only need to provide the partition key. For
  3303. // a composite primary key, you must provide both the partition key and the
  3304. // sort key.
  3305. type KeysAndAttributes struct {
  3306. _ struct{} `type:"structure"`
  3307. // One or more attributes to retrieve from the table or index. If no attribute
  3308. // names are specified then all attributes will be returned. If any of the specified
  3309. // attributes are not found, they will not appear in the result.
  3310. AttributesToGet []*string `min:"1" type:"list"`
  3311. // The consistency of a read operation. If set to true, then a strongly consistent
  3312. // read is used; otherwise, an eventually consistent read is used.
  3313. ConsistentRead *bool `type:"boolean"`
  3314. // One or more substitution tokens for attribute names in an expression. The
  3315. // following are some use cases for using ExpressionAttributeNames:
  3316. //
  3317. // To access an attribute whose name conflicts with a DynamoDB reserved word.
  3318. //
  3319. // To create a placeholder for repeating occurrences of an attribute name
  3320. // in an expression.
  3321. //
  3322. // To prevent special characters in an attribute name from being misinterpreted
  3323. // in an expression.
  3324. //
  3325. // Use the # character in an expression to dereference an attribute name.
  3326. // For example, consider the following attribute name:
  3327. //
  3328. // Percentile
  3329. //
  3330. // The name of this attribute conflicts with a reserved word, so it cannot
  3331. // be used directly in an expression. (For the complete list of reserved words,
  3332. // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
  3333. // in the Amazon DynamoDB Developer Guide). To work around this, you could specify
  3334. // the following for ExpressionAttributeNames:
  3335. //
  3336. // {"#P":"Percentile"}
  3337. //
  3338. // You could then use this substitution in an expression, as in this example:
  3339. //
  3340. // #P = :val
  3341. //
  3342. // Tokens that begin with the : character are expression attribute values,
  3343. // which are placeholders for the actual value at runtime.
  3344. //
  3345. // For more information on expression attribute names, see Accessing Item
  3346. // Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  3347. // in the Amazon DynamoDB Developer Guide.
  3348. ExpressionAttributeNames map[string]*string `type:"map"`
  3349. // The primary key attribute values that define the items and the attributes
  3350. // associated with the items.
  3351. Keys []map[string]*AttributeValue `min:"1" type:"list" required:"true"`
  3352. // A string that identifies one or more attributes to retrieve from the table.
  3353. // These attributes can include scalars, sets, or elements of a JSON document.
  3354. // The attributes in the ProjectionExpression must be separated by commas.
  3355. //
  3356. // If no attribute names are specified, then all attributes will be returned.
  3357. // If any of the requested attributes are not found, they will not appear in
  3358. // the result.
  3359. //
  3360. // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  3361. // in the Amazon DynamoDB Developer Guide.
  3362. //
  3363. // ProjectionExpression replaces the legacy AttributesToGet parameter.
  3364. ProjectionExpression *string `type:"string"`
  3365. }
  3366. // String returns the string representation
  3367. func (s KeysAndAttributes) String() string {
  3368. return awsutil.Prettify(s)
  3369. }
  3370. // GoString returns the string representation
  3371. func (s KeysAndAttributes) GoString() string {
  3372. return s.String()
  3373. }
  3374. // Validate inspects the fields of the type to determine if they are valid.
  3375. func (s *KeysAndAttributes) Validate() error {
  3376. invalidParams := request.ErrInvalidParams{Context: "KeysAndAttributes"}
  3377. if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 {
  3378. invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1))
  3379. }
  3380. if s.Keys == nil {
  3381. invalidParams.Add(request.NewErrParamRequired("Keys"))
  3382. }
  3383. if s.Keys != nil && len(s.Keys) < 1 {
  3384. invalidParams.Add(request.NewErrParamMinLen("Keys", 1))
  3385. }
  3386. if invalidParams.Len() > 0 {
  3387. return invalidParams
  3388. }
  3389. return nil
  3390. }
  3391. // Represents the input of a ListTables operation.
  3392. type ListTablesInput struct {
  3393. _ struct{} `type:"structure"`
  3394. // The first table name that this operation will evaluate. Use the value that
  3395. // was returned for LastEvaluatedTableName in a previous operation, so that
  3396. // you can obtain the next page of results.
  3397. ExclusiveStartTableName *string `min:"3" type:"string"`
  3398. // A maximum number of table names to return. If this parameter is not specified,
  3399. // the limit is 100.
  3400. Limit *int64 `min:"1" type:"integer"`
  3401. }
  3402. // String returns the string representation
  3403. func (s ListTablesInput) String() string {
  3404. return awsutil.Prettify(s)
  3405. }
  3406. // GoString returns the string representation
  3407. func (s ListTablesInput) GoString() string {
  3408. return s.String()
  3409. }
  3410. // Validate inspects the fields of the type to determine if they are valid.
  3411. func (s *ListTablesInput) Validate() error {
  3412. invalidParams := request.ErrInvalidParams{Context: "ListTablesInput"}
  3413. if s.ExclusiveStartTableName != nil && len(*s.ExclusiveStartTableName) < 3 {
  3414. invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartTableName", 3))
  3415. }
  3416. if s.Limit != nil && *s.Limit < 1 {
  3417. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  3418. }
  3419. if invalidParams.Len() > 0 {
  3420. return invalidParams
  3421. }
  3422. return nil
  3423. }
  3424. // Represents the output of a ListTables operation.
  3425. type ListTablesOutput struct {
  3426. _ struct{} `type:"structure"`
  3427. // The name of the last table in the current page of results. Use this value
  3428. // as the ExclusiveStartTableName in a new request to obtain the next page of
  3429. // results, until all the table names are returned.
  3430. //
  3431. // If you do not receive a LastEvaluatedTableName value in the response, this
  3432. // means that there are no more table names to be retrieved.
  3433. LastEvaluatedTableName *string `min:"3" type:"string"`
  3434. // The names of the tables associated with the current account at the current
  3435. // endpoint. The maximum size of this array is 100.
  3436. //
  3437. // If LastEvaluatedTableName also appears in the output, you can use this value
  3438. // as the ExclusiveStartTableName parameter in a subsequent ListTables request
  3439. // and obtain the next page of results.
  3440. TableNames []*string `type:"list"`
  3441. }
  3442. // String returns the string representation
  3443. func (s ListTablesOutput) String() string {
  3444. return awsutil.Prettify(s)
  3445. }
  3446. // GoString returns the string representation
  3447. func (s ListTablesOutput) GoString() string {
  3448. return s.String()
  3449. }
  3450. // Represents the properties of a local secondary index.
  3451. type LocalSecondaryIndex struct {
  3452. _ struct{} `type:"structure"`
  3453. // The name of the local secondary index. The name must be unique among all
  3454. // other indexes on this table.
  3455. IndexName *string `min:"3" type:"string" required:"true"`
  3456. // The complete key schema for the local secondary index, consisting of one
  3457. // or more pairs of attribute names and key types:
  3458. //
  3459. // HASH - partition key
  3460. //
  3461. // RANGE - sort key
  3462. //
  3463. // The partition key of an item is also known as its hash attribute. The
  3464. // term "hash attribute" derives from DynamoDB' usage of an internal hash function
  3465. // to evenly distribute data items across partitions, based on their partition
  3466. // key values.
  3467. //
  3468. // The sort key of an item is also known as its range attribute. The term "range
  3469. // attribute" derives from the way DynamoDB stores items with the same partition
  3470. // key physically close together, in sorted order by the sort key value.
  3471. KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"`
  3472. // Represents attributes that are copied (projected) from the table into an
  3473. // index. These are in addition to the primary key attributes and index key
  3474. // attributes, which are automatically projected.
  3475. Projection *Projection `type:"structure" required:"true"`
  3476. }
  3477. // String returns the string representation
  3478. func (s LocalSecondaryIndex) String() string {
  3479. return awsutil.Prettify(s)
  3480. }
  3481. // GoString returns the string representation
  3482. func (s LocalSecondaryIndex) GoString() string {
  3483. return s.String()
  3484. }
  3485. // Validate inspects the fields of the type to determine if they are valid.
  3486. func (s *LocalSecondaryIndex) Validate() error {
  3487. invalidParams := request.ErrInvalidParams{Context: "LocalSecondaryIndex"}
  3488. if s.IndexName == nil {
  3489. invalidParams.Add(request.NewErrParamRequired("IndexName"))
  3490. }
  3491. if s.IndexName != nil && len(*s.IndexName) < 3 {
  3492. invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
  3493. }
  3494. if s.KeySchema == nil {
  3495. invalidParams.Add(request.NewErrParamRequired("KeySchema"))
  3496. }
  3497. if s.KeySchema != nil && len(s.KeySchema) < 1 {
  3498. invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1))
  3499. }
  3500. if s.Projection == nil {
  3501. invalidParams.Add(request.NewErrParamRequired("Projection"))
  3502. }
  3503. if s.KeySchema != nil {
  3504. for i, v := range s.KeySchema {
  3505. if v == nil {
  3506. continue
  3507. }
  3508. if err := v.Validate(); err != nil {
  3509. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams))
  3510. }
  3511. }
  3512. }
  3513. if s.Projection != nil {
  3514. if err := s.Projection.Validate(); err != nil {
  3515. invalidParams.AddNested("Projection", err.(request.ErrInvalidParams))
  3516. }
  3517. }
  3518. if invalidParams.Len() > 0 {
  3519. return invalidParams
  3520. }
  3521. return nil
  3522. }
  3523. // Represents the properties of a local secondary index.
  3524. type LocalSecondaryIndexDescription struct {
  3525. _ struct{} `type:"structure"`
  3526. // The Amazon Resource Name (ARN) that uniquely identifies the index.
  3527. IndexArn *string `type:"string"`
  3528. // Represents the name of the local secondary index.
  3529. IndexName *string `min:"3" type:"string"`
  3530. // The total size of the specified index, in bytes. DynamoDB updates this value
  3531. // approximately every six hours. Recent changes might not be reflected in this
  3532. // value.
  3533. IndexSizeBytes *int64 `type:"long"`
  3534. // The number of items in the specified index. DynamoDB updates this value approximately
  3535. // every six hours. Recent changes might not be reflected in this value.
  3536. ItemCount *int64 `type:"long"`
  3537. // The complete key schema for the local secondary index, consisting of one
  3538. // or more pairs of attribute names and key types:
  3539. //
  3540. // HASH - partition key
  3541. //
  3542. // RANGE - sort key
  3543. //
  3544. // The partition key of an item is also known as its hash attribute. The
  3545. // term "hash attribute" derives from DynamoDB' usage of an internal hash function
  3546. // to evenly distribute data items across partitions, based on their partition
  3547. // key values.
  3548. //
  3549. // The sort key of an item is also known as its range attribute. The term "range
  3550. // attribute" derives from the way DynamoDB stores items with the same partition
  3551. // key physically close together, in sorted order by the sort key value.
  3552. KeySchema []*KeySchemaElement `min:"1" type:"list"`
  3553. // Represents attributes that are copied (projected) from the table into an
  3554. // index. These are in addition to the primary key attributes and index key
  3555. // attributes, which are automatically projected.
  3556. Projection *Projection `type:"structure"`
  3557. }
  3558. // String returns the string representation
  3559. func (s LocalSecondaryIndexDescription) String() string {
  3560. return awsutil.Prettify(s)
  3561. }
  3562. // GoString returns the string representation
  3563. func (s LocalSecondaryIndexDescription) GoString() string {
  3564. return s.String()
  3565. }
  3566. // Represents attributes that are copied (projected) from the table into an
  3567. // index. These are in addition to the primary key attributes and index key
  3568. // attributes, which are automatically projected.
  3569. type Projection struct {
  3570. _ struct{} `type:"structure"`
  3571. // Represents the non-key attribute names which will be projected into the index.
  3572. //
  3573. // For local secondary indexes, the total count of NonKeyAttributes summed
  3574. // across all of the local secondary indexes, must not exceed 20. If you project
  3575. // the same attribute into two different indexes, this counts as two distinct
  3576. // attributes when determining the total.
  3577. NonKeyAttributes []*string `min:"1" type:"list"`
  3578. // The set of attributes that are projected into the index:
  3579. //
  3580. // KEYS_ONLY - Only the index and primary keys are projected into the index.
  3581. //
  3582. // INCLUDE - Only the specified table attributes are projected into the
  3583. // index. The list of projected attributes are in NonKeyAttributes.
  3584. //
  3585. // ALL - All of the table attributes are projected into the index.
  3586. ProjectionType *string `type:"string" enum:"ProjectionType"`
  3587. }
  3588. // String returns the string representation
  3589. func (s Projection) String() string {
  3590. return awsutil.Prettify(s)
  3591. }
  3592. // GoString returns the string representation
  3593. func (s Projection) GoString() string {
  3594. return s.String()
  3595. }
  3596. // Validate inspects the fields of the type to determine if they are valid.
  3597. func (s *Projection) Validate() error {
  3598. invalidParams := request.ErrInvalidParams{Context: "Projection"}
  3599. if s.NonKeyAttributes != nil && len(s.NonKeyAttributes) < 1 {
  3600. invalidParams.Add(request.NewErrParamMinLen("NonKeyAttributes", 1))
  3601. }
  3602. if invalidParams.Len() > 0 {
  3603. return invalidParams
  3604. }
  3605. return nil
  3606. }
  3607. // Represents the provisioned throughput settings for a specified table or index.
  3608. // The settings can be modified using the UpdateTable operation.
  3609. //
  3610. // For current minimum and maximum provisioned throughput values, see Limits
  3611. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
  3612. // in the Amazon DynamoDB Developer Guide.
  3613. type ProvisionedThroughput struct {
  3614. _ struct{} `type:"structure"`
  3615. // The maximum number of strongly consistent reads consumed per second before
  3616. // DynamoDB returns a ThrottlingException. For more information, see Specifying
  3617. // Read and Write Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
  3618. // in the Amazon DynamoDB Developer Guide.
  3619. ReadCapacityUnits *int64 `min:"1" type:"long" required:"true"`
  3620. // The maximum number of writes consumed per second before DynamoDB returns
  3621. // a ThrottlingException. For more information, see Specifying Read and Write
  3622. // Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
  3623. // in the Amazon DynamoDB Developer Guide.
  3624. WriteCapacityUnits *int64 `min:"1" type:"long" required:"true"`
  3625. }
  3626. // String returns the string representation
  3627. func (s ProvisionedThroughput) String() string {
  3628. return awsutil.Prettify(s)
  3629. }
  3630. // GoString returns the string representation
  3631. func (s ProvisionedThroughput) GoString() string {
  3632. return s.String()
  3633. }
  3634. // Validate inspects the fields of the type to determine if they are valid.
  3635. func (s *ProvisionedThroughput) Validate() error {
  3636. invalidParams := request.ErrInvalidParams{Context: "ProvisionedThroughput"}
  3637. if s.ReadCapacityUnits == nil {
  3638. invalidParams.Add(request.NewErrParamRequired("ReadCapacityUnits"))
  3639. }
  3640. if s.ReadCapacityUnits != nil && *s.ReadCapacityUnits < 1 {
  3641. invalidParams.Add(request.NewErrParamMinValue("ReadCapacityUnits", 1))
  3642. }
  3643. if s.WriteCapacityUnits == nil {
  3644. invalidParams.Add(request.NewErrParamRequired("WriteCapacityUnits"))
  3645. }
  3646. if s.WriteCapacityUnits != nil && *s.WriteCapacityUnits < 1 {
  3647. invalidParams.Add(request.NewErrParamMinValue("WriteCapacityUnits", 1))
  3648. }
  3649. if invalidParams.Len() > 0 {
  3650. return invalidParams
  3651. }
  3652. return nil
  3653. }
  3654. // Represents the provisioned throughput settings for the table, consisting
  3655. // of read and write capacity units, along with data about increases and decreases.
  3656. type ProvisionedThroughputDescription struct {
  3657. _ struct{} `type:"structure"`
  3658. // The date and time of the last provisioned throughput decrease for this table.
  3659. LastDecreaseDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  3660. // The date and time of the last provisioned throughput increase for this table.
  3661. LastIncreaseDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  3662. // The number of provisioned throughput decreases for this table during this
  3663. // UTC calendar day. For current maximums on provisioned throughput decreases,
  3664. // see Limits (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
  3665. // in the Amazon DynamoDB Developer Guide.
  3666. NumberOfDecreasesToday *int64 `min:"1" type:"long"`
  3667. // The maximum number of strongly consistent reads consumed per second before
  3668. // DynamoDB returns a ThrottlingException. Eventually consistent reads require
  3669. // less effort than strongly consistent reads, so a setting of 50 ReadCapacityUnits
  3670. // per second provides 100 eventually consistent ReadCapacityUnits per second.
  3671. ReadCapacityUnits *int64 `min:"1" type:"long"`
  3672. // The maximum number of writes consumed per second before DynamoDB returns
  3673. // a ThrottlingException.
  3674. WriteCapacityUnits *int64 `min:"1" type:"long"`
  3675. }
  3676. // String returns the string representation
  3677. func (s ProvisionedThroughputDescription) String() string {
  3678. return awsutil.Prettify(s)
  3679. }
  3680. // GoString returns the string representation
  3681. func (s ProvisionedThroughputDescription) GoString() string {
  3682. return s.String()
  3683. }
  3684. // Represents the input of a PutItem operation.
  3685. type PutItemInput struct {
  3686. _ struct{} `type:"structure"`
  3687. // A condition that must be satisfied in order for a conditional PutItem operation
  3688. // to succeed.
  3689. //
  3690. // An expression can contain any of the following:
  3691. //
  3692. // Functions: attribute_exists | attribute_not_exists | attribute_type |
  3693. // contains | begins_with | size
  3694. //
  3695. // These function names are case-sensitive.
  3696. //
  3697. // Comparison operators: = | &#x3C;&#x3E; | &#x3C; | &#x3E; | &#x3C;= |
  3698. // &#x3E;= | BETWEEN | IN
  3699. //
  3700. // Logical operators: AND | OR | NOT
  3701. //
  3702. // For more information on condition expressions, see Specifying Conditions
  3703. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
  3704. // in the Amazon DynamoDB Developer Guide.
  3705. //
  3706. // ConditionExpression replaces the legacy ConditionalOperator and Expected
  3707. // parameters.
  3708. ConditionExpression *string `type:"string"`
  3709. // This is a legacy parameter, for backward compatibility. New applications
  3710. // should use ConditionExpression instead. Do not combine legacy parameters
  3711. // and expression parameters in a single API call; otherwise, DynamoDB will
  3712. // return a ValidationException exception.
  3713. //
  3714. // A logical operator to apply to the conditions in the Expected map:
  3715. //
  3716. // AND - If all of the conditions evaluate to true, then the entire map
  3717. // evaluates to true.
  3718. //
  3719. // OR - If at least one of the conditions evaluate to true, then the entire
  3720. // map evaluates to true.
  3721. //
  3722. // If you omit ConditionalOperator, then AND is the default.
  3723. //
  3724. // The operation will succeed only if the entire map evaluates to true.
  3725. //
  3726. // This parameter does not support attributes of type List or Map.
  3727. ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
  3728. // This is a legacy parameter, for backward compatibility. New applications
  3729. // should use ConditionExpression instead. Do not combine legacy parameters
  3730. // and expression parameters in a single API call; otherwise, DynamoDB will
  3731. // return a ValidationException exception.
  3732. //
  3733. // A map of attribute/condition pairs. Expected provides a conditional block
  3734. // for the PutItem operation.
  3735. //
  3736. // This parameter does not support attributes of type List or Map.
  3737. //
  3738. // Each element of Expected consists of an attribute name, a comparison operator,
  3739. // and one or more values. DynamoDB compares the attribute with the value(s)
  3740. // you supplied, using the comparison operator. For each Expected element, the
  3741. // result of the evaluation is either true or false.
  3742. //
  3743. // If you specify more than one element in the Expected map, then by default
  3744. // all of the conditions must evaluate to true. In other words, the conditions
  3745. // are ANDed together. (You can use the ConditionalOperator parameter to OR
  3746. // the conditions instead. If you do this, then at least one of the conditions
  3747. // must evaluate to true, rather than all of them.)
  3748. //
  3749. // If the Expected map evaluates to true, then the conditional operation succeeds;
  3750. // otherwise, it fails.
  3751. //
  3752. // Expected contains the following:
  3753. //
  3754. // AttributeValueList - One or more values to evaluate against the supplied
  3755. // attribute. The number of values in the list depends on the ComparisonOperator
  3756. // being used.
  3757. //
  3758. // For type Number, value comparisons are numeric.
  3759. //
  3760. // String value comparisons for greater than, equals, or less than are based
  3761. // on ASCII character code values. For example, a is greater than A, and a is
  3762. // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
  3763. // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  3764. //
  3765. // For type Binary, DynamoDB treats each byte of the binary data as unsigned
  3766. // when it compares binary values.
  3767. //
  3768. // ComparisonOperator - A comparator for evaluating attributes in the AttributeValueList.
  3769. // When performing the comparison, DynamoDB uses strongly consistent reads.
  3770. //
  3771. // The following comparison operators are available:
  3772. //
  3773. // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS
  3774. // | BEGINS_WITH | IN | BETWEEN
  3775. //
  3776. // The following are descriptions of each comparison operator.
  3777. //
  3778. // EQ : Equal. EQ is supported for all datatypes, including lists and maps.
  3779. //
  3780. // AttributeValueList can contain only one AttributeValue element of type
  3781. // String, Number, Binary, String Set, Number Set, or Binary Set. If an item
  3782. // contains an AttributeValue element of a different type than the one provided
  3783. // in the request, the value does not match. For example, {"S":"6"} does not
  3784. // equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  3785. //
  3786. // NE : Not equal. NE is supported for all datatypes, including lists and
  3787. // maps.
  3788. //
  3789. // AttributeValueList can contain only one AttributeValue of type String,
  3790. // Number, Binary, String Set, Number Set, or Binary Set. If an item contains
  3791. // an AttributeValue of a different type than the one provided in the request,
  3792. // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}.
  3793. // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  3794. //
  3795. // LE : Less than or equal.
  3796. //
  3797. // AttributeValueList can contain only one AttributeValue element of type
  3798. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  3799. // element of a different type than the one provided in the request, the value
  3800. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  3801. // does not compare to {"NS":["6", "2", "1"]}.
  3802. //
  3803. // LT : Less than.
  3804. //
  3805. // AttributeValueList can contain only one AttributeValue of type String,
  3806. // Number, or Binary (not a set type). If an item contains an AttributeValue
  3807. // element of a different type than the one provided in the request, the value
  3808. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  3809. // does not compare to {"NS":["6", "2", "1"]}.
  3810. //
  3811. // GE : Greater than or equal.
  3812. //
  3813. // AttributeValueList can contain only one AttributeValue element of type
  3814. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  3815. // element of a different type than the one provided in the request, the value
  3816. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  3817. // does not compare to {"NS":["6", "2", "1"]}.
  3818. //
  3819. // GT : Greater than.
  3820. //
  3821. // AttributeValueList can contain only one AttributeValue element of type
  3822. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  3823. // element of a different type than the one provided in the request, the value
  3824. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  3825. // does not compare to {"NS":["6", "2", "1"]}.
  3826. //
  3827. // NOT_NULL : The attribute exists. NOT_NULL is supported for all datatypes,
  3828. // including lists and maps.
  3829. //
  3830. // This operator tests for the existence of an attribute, not its data type.
  3831. // If the data type of attribute "a" is null, and you evaluate it using NOT_NULL,
  3832. // the result is a Boolean true. This result is because the attribute "a" exists;
  3833. // its data type is not relevant to the NOT_NULL comparison operator.
  3834. //
  3835. // NULL : The attribute does not exist. NULL is supported for all datatypes,
  3836. // including lists and maps.
  3837. //
  3838. // This operator tests for the nonexistence of an attribute, not its data
  3839. // type. If the data type of attribute "a" is null, and you evaluate it using
  3840. // NULL, the result is a Boolean false. This is because the attribute "a" exists;
  3841. // its data type is not relevant to the NULL comparison operator.
  3842. //
  3843. // CONTAINS : Checks for a subsequence, or value in a set.
  3844. //
  3845. // AttributeValueList can contain only one AttributeValue element of type
  3846. // String, Number, or Binary (not a set type). If the target attribute of the
  3847. // comparison is of type String, then the operator checks for a substring match.
  3848. // If the target attribute of the comparison is of type Binary, then the operator
  3849. // looks for a subsequence of the target that matches the input. If the target
  3850. // attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator
  3851. // evaluates to true if it finds an exact match with any member of the set.
  3852. //
  3853. // CONTAINS is supported for lists: When evaluating "a CONTAINS b", "a" can
  3854. // be a list; however, "b" cannot be a set, a map, or a list.
  3855. //
  3856. // NOT_CONTAINS : Checks for absence of a subsequence, or absence of a value
  3857. // in a set.
  3858. //
  3859. // AttributeValueList can contain only one AttributeValue element of type
  3860. // String, Number, or Binary (not a set type). If the target attribute of the
  3861. // comparison is a String, then the operator checks for the absence of a substring
  3862. // match. If the target attribute of the comparison is Binary, then the operator
  3863. // checks for the absence of a subsequence of the target that matches the input.
  3864. // If the target attribute of the comparison is a set ("SS", "NS", or "BS"),
  3865. // then the operator evaluates to true if it does not find an exact match with
  3866. // any member of the set.
  3867. //
  3868. // NOT_CONTAINS is supported for lists: When evaluating "a NOT CONTAINS b",
  3869. // "a" can be a list; however, "b" cannot be a set, a map, or a list.
  3870. //
  3871. // BEGINS_WITH : Checks for a prefix.
  3872. //
  3873. // AttributeValueList can contain only one AttributeValue of type String or
  3874. // Binary (not a Number or a set type). The target attribute of the comparison
  3875. // must be of type String or Binary (not a Number or a set type).
  3876. //
  3877. // IN : Checks for matching elements within two sets.
  3878. //
  3879. // AttributeValueList can contain one or more AttributeValue elements of type
  3880. // String, Number, or Binary (not a set type). These attributes are compared
  3881. // against an existing set type attribute of an item. If any elements of the
  3882. // input set are present in the item attribute, the expression evaluates to
  3883. // true.
  3884. //
  3885. // BETWEEN : Greater than or equal to the first value, and less than or
  3886. // equal to the second value.
  3887. //
  3888. // AttributeValueList must contain two AttributeValue elements of the same
  3889. // type, either String, Number, or Binary (not a set type). A target attribute
  3890. // matches if the target value is greater than, or equal to, the first element
  3891. // and less than, or equal to, the second element. If an item contains an AttributeValue
  3892. // element of a different type than the one provided in the request, the value
  3893. // does not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,
  3894. // {"N":"6"} does not compare to {"NS":["6", "2", "1"]}
  3895. //
  3896. // For usage examples of AttributeValueList and ComparisonOperator, see
  3897. // Legacy Conditional Parameters (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html)
  3898. // in the Amazon DynamoDB Developer Guide.
  3899. //
  3900. // For backward compatibility with previous DynamoDB releases, the following
  3901. // parameters can be used instead of AttributeValueList and ComparisonOperator:
  3902. //
  3903. // Value - A value for DynamoDB to compare with an attribute.
  3904. //
  3905. // Exists - A Boolean value that causes DynamoDB to evaluate the value before
  3906. // attempting the conditional operation:
  3907. //
  3908. // If Exists is true, DynamoDB will check to see if that attribute value
  3909. // already exists in the table. If it is found, then the condition evaluates
  3910. // to true; otherwise the condition evaluate to false.
  3911. //
  3912. // If Exists is false, DynamoDB assumes that the attribute value does not
  3913. // exist in the table. If in fact the value does not exist, then the assumption
  3914. // is valid and the condition evaluates to true. If the value is found, despite
  3915. // the assumption that it does not exist, the condition evaluates to false.
  3916. //
  3917. // Note that the default value for Exists is true.
  3918. //
  3919. // The Value and Exists parameters are incompatible with AttributeValueList
  3920. // and ComparisonOperator. Note that if you use both sets of parameters at once,
  3921. // DynamoDB will return a ValidationException exception.
  3922. Expected map[string]*ExpectedAttributeValue `type:"map"`
  3923. // One or more substitution tokens for attribute names in an expression. The
  3924. // following are some use cases for using ExpressionAttributeNames:
  3925. //
  3926. // To access an attribute whose name conflicts with a DynamoDB reserved word.
  3927. //
  3928. // To create a placeholder for repeating occurrences of an attribute name
  3929. // in an expression.
  3930. //
  3931. // To prevent special characters in an attribute name from being misinterpreted
  3932. // in an expression.
  3933. //
  3934. // Use the # character in an expression to dereference an attribute name.
  3935. // For example, consider the following attribute name:
  3936. //
  3937. // Percentile
  3938. //
  3939. // The name of this attribute conflicts with a reserved word, so it cannot
  3940. // be used directly in an expression. (For the complete list of reserved words,
  3941. // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
  3942. // in the Amazon DynamoDB Developer Guide). To work around this, you could specify
  3943. // the following for ExpressionAttributeNames:
  3944. //
  3945. // {"#P":"Percentile"}
  3946. //
  3947. // You could then use this substitution in an expression, as in this example:
  3948. //
  3949. // #P = :val
  3950. //
  3951. // Tokens that begin with the : character are expression attribute values,
  3952. // which are placeholders for the actual value at runtime.
  3953. //
  3954. // For more information on expression attribute names, see Accessing Item
  3955. // Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  3956. // in the Amazon DynamoDB Developer Guide.
  3957. ExpressionAttributeNames map[string]*string `type:"map"`
  3958. // One or more values that can be substituted in an expression.
  3959. //
  3960. // Use the : (colon) character in an expression to dereference an attribute
  3961. // value. For example, suppose that you wanted to check whether the value of
  3962. // the ProductStatus attribute was one of the following:
  3963. //
  3964. // Available | Backordered | Discontinued
  3965. //
  3966. // You would first need to specify ExpressionAttributeValues as follows:
  3967. //
  3968. // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"}
  3969. // }
  3970. //
  3971. // You could then use these values in an expression, such as this:
  3972. //
  3973. // ProductStatus IN (:avail, :back, :disc)
  3974. //
  3975. // For more information on expression attribute values, see Specifying Conditions
  3976. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
  3977. // in the Amazon DynamoDB Developer Guide.
  3978. ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
  3979. // A map of attribute name/value pairs, one for each attribute. Only the primary
  3980. // key attributes are required; you can optionally provide other attribute name-value
  3981. // pairs for the item.
  3982. //
  3983. // You must provide all of the attributes for the primary key. For example,
  3984. // with a simple primary key, you only need to provide a value for the partition
  3985. // key. For a composite primary key, you must provide both values for both the
  3986. // partition key and the sort key.
  3987. //
  3988. // If you specify any attributes that are part of an index key, then the data
  3989. // types for those attributes must match those of the schema in the table's
  3990. // attribute definition.
  3991. //
  3992. // For more information about primary keys, see Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey)
  3993. // in the Amazon DynamoDB Developer Guide.
  3994. //
  3995. // Each element in the Item map is an AttributeValue object.
  3996. Item map[string]*AttributeValue `type:"map" required:"true"`
  3997. // Determines the level of detail about provisioned throughput consumption that
  3998. // is returned in the response:
  3999. //
  4000. // INDEXES - The response includes the aggregate ConsumedCapacity for the
  4001. // operation, together with ConsumedCapacity for each table and secondary index
  4002. // that was accessed.
  4003. //
  4004. // Note that some operations, such as GetItem and BatchGetItem, do not access
  4005. // any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity
  4006. // information for table(s).
  4007. //
  4008. // TOTAL - The response includes only the aggregate ConsumedCapacity for
  4009. // the operation.
  4010. //
  4011. // NONE - No ConsumedCapacity details are included in the response.
  4012. ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
  4013. // Determines whether item collection metrics are returned. If set to SIZE,
  4014. // the response includes statistics about item collections, if any, that were
  4015. // modified during the operation are returned in the response. If set to NONE
  4016. // (the default), no statistics are returned.
  4017. ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"`
  4018. // Use ReturnValues if you want to get the item attributes as they appeared
  4019. // before they were updated with the PutItem request. For PutItem, the valid
  4020. // values are:
  4021. //
  4022. // NONE - If ReturnValues is not specified, or if its value is NONE, then
  4023. // nothing is returned. (This setting is the default for ReturnValues.)
  4024. //
  4025. // ALL_OLD - If PutItem overwrote an attribute name-value pair, then the
  4026. // content of the old item is returned.
  4027. //
  4028. // The ReturnValues parameter is used by several DynamoDB operations; however,
  4029. // PutItem does not recognize any values other than NONE or ALL_OLD.
  4030. ReturnValues *string `type:"string" enum:"ReturnValue"`
  4031. // The name of the table to contain the item.
  4032. TableName *string `min:"3" type:"string" required:"true"`
  4033. }
  4034. // String returns the string representation
  4035. func (s PutItemInput) String() string {
  4036. return awsutil.Prettify(s)
  4037. }
  4038. // GoString returns the string representation
  4039. func (s PutItemInput) GoString() string {
  4040. return s.String()
  4041. }
  4042. // Validate inspects the fields of the type to determine if they are valid.
  4043. func (s *PutItemInput) Validate() error {
  4044. invalidParams := request.ErrInvalidParams{Context: "PutItemInput"}
  4045. if s.Item == nil {
  4046. invalidParams.Add(request.NewErrParamRequired("Item"))
  4047. }
  4048. if s.TableName == nil {
  4049. invalidParams.Add(request.NewErrParamRequired("TableName"))
  4050. }
  4051. if s.TableName != nil && len(*s.TableName) < 3 {
  4052. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  4053. }
  4054. if invalidParams.Len() > 0 {
  4055. return invalidParams
  4056. }
  4057. return nil
  4058. }
  4059. // Represents the output of a PutItem operation.
  4060. type PutItemOutput struct {
  4061. _ struct{} `type:"structure"`
  4062. // The attribute values as they appeared before the PutItem operation, but only
  4063. // if ReturnValues is specified as ALL_OLD in the request. Each element consists
  4064. // of an attribute name and an attribute value.
  4065. Attributes map[string]*AttributeValue `type:"map"`
  4066. // The capacity units consumed by an operation. The data returned includes the
  4067. // total provisioned throughput consumed, along with statistics for the table
  4068. // and any indexes involved in the operation. ConsumedCapacity is only returned
  4069. // if the request asked for it. For more information, see Provisioned Throughput
  4070. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
  4071. // in the Amazon DynamoDB Developer Guide.
  4072. ConsumedCapacity *ConsumedCapacity `type:"structure"`
  4073. // Information about item collections, if any, that were affected by the operation.
  4074. // ItemCollectionMetrics is only returned if the request asked for it. If the
  4075. // table does not have any local secondary indexes, this information is not
  4076. // returned in the response.
  4077. //
  4078. // Each ItemCollectionMetrics element consists of:
  4079. //
  4080. // ItemCollectionKey - The partition key value of the item collection. This
  4081. // is the same as the partition key value of the item itself.
  4082. //
  4083. // SizeEstimateRange - An estimate of item collection size, in gigabytes.
  4084. // This value is a two-element array containing a lower bound and an upper bound
  4085. // for the estimate. The estimate includes the size of all the items in the
  4086. // table, plus the size of all attributes projected into all of the local secondary
  4087. // indexes on that table. Use this estimate to measure whether a local secondary
  4088. // index is approaching its size limit.
  4089. //
  4090. // The estimate is subject to change over time; therefore, do not rely on the
  4091. // precision or accuracy of the estimate.
  4092. ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"`
  4093. }
  4094. // String returns the string representation
  4095. func (s PutItemOutput) String() string {
  4096. return awsutil.Prettify(s)
  4097. }
  4098. // GoString returns the string representation
  4099. func (s PutItemOutput) GoString() string {
  4100. return s.String()
  4101. }
  4102. // Represents a request to perform a PutItem operation on an item.
  4103. type PutRequest struct {
  4104. _ struct{} `type:"structure"`
  4105. // A map of attribute name to attribute values, representing the primary key
  4106. // of an item to be processed by PutItem. All of the table's primary key attributes
  4107. // must be specified, and their data types must match those of the table's key
  4108. // schema. If any attributes are present in the item which are part of an index
  4109. // key schema for the table, their types must match the index key schema.
  4110. Item map[string]*AttributeValue `type:"map" required:"true"`
  4111. }
  4112. // String returns the string representation
  4113. func (s PutRequest) String() string {
  4114. return awsutil.Prettify(s)
  4115. }
  4116. // GoString returns the string representation
  4117. func (s PutRequest) GoString() string {
  4118. return s.String()
  4119. }
  4120. // Represents the input of a Query operation.
  4121. type QueryInput struct {
  4122. _ struct{} `type:"structure"`
  4123. // This is a legacy parameter, for backward compatibility. New applications
  4124. // should use ProjectionExpression instead. Do not combine legacy parameters
  4125. // and expression parameters in a single API call; otherwise, DynamoDB will
  4126. // return a ValidationException exception.
  4127. //
  4128. // This parameter allows you to retrieve attributes of type List or Map; however,
  4129. // it cannot retrieve individual elements within a List or a Map.
  4130. //
  4131. // The names of one or more attributes to retrieve. If no attribute names
  4132. // are provided, then all attributes will be returned. If any of the requested
  4133. // attributes are not found, they will not appear in the result.
  4134. //
  4135. // Note that AttributesToGet has no effect on provisioned throughput consumption.
  4136. // DynamoDB determines capacity units consumed based on item size, not on the
  4137. // amount of data that is returned to an application.
  4138. //
  4139. // You cannot use both AttributesToGet and Select together in a Query request,
  4140. // unless the value for Select is SPECIFIC_ATTRIBUTES. (This usage is equivalent
  4141. // to specifying AttributesToGet without any value for Select.)
  4142. //
  4143. // If you query a local secondary index and request only attributes that are
  4144. // projected into that index, the operation will read only the index and not
  4145. // the table. If any of the requested attributes are not projected into the
  4146. // local secondary index, DynamoDB will fetch each of these attributes from
  4147. // the parent table. This extra fetching incurs additional throughput cost and
  4148. // latency.
  4149. //
  4150. // If you query a global secondary index, you can only request attributes that
  4151. // are projected into the index. Global secondary index queries cannot fetch
  4152. // attributes from the parent table.
  4153. AttributesToGet []*string `min:"1" type:"list"`
  4154. // This is a legacy parameter, for backward compatibility. New applications
  4155. // should use FilterExpression instead. Do not combine legacy parameters and
  4156. // expression parameters in a single API call; otherwise, DynamoDB will return
  4157. // a ValidationException exception.
  4158. //
  4159. // A logical operator to apply to the conditions in a QueryFilter map:
  4160. //
  4161. // AND - If all of the conditions evaluate to true, then the entire map
  4162. // evaluates to true.
  4163. //
  4164. // OR - If at least one of the conditions evaluate to true, then the entire
  4165. // map evaluates to true.
  4166. //
  4167. // If you omit ConditionalOperator, then AND is the default.
  4168. //
  4169. // The operation will succeed only if the entire map evaluates to true.
  4170. //
  4171. // This parameter does not support attributes of type List or Map.
  4172. ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
  4173. // Determines the read consistency model: If set to true, then the operation
  4174. // uses strongly consistent reads; otherwise, the operation uses eventually
  4175. // consistent reads.
  4176. //
  4177. // Strongly consistent reads are not supported on global secondary indexes.
  4178. // If you query a global secondary index with ConsistentRead set to true, you
  4179. // will receive a ValidationException.
  4180. ConsistentRead *bool `type:"boolean"`
  4181. // The primary key of the first item that this operation will evaluate. Use
  4182. // the value that was returned for LastEvaluatedKey in the previous operation.
  4183. //
  4184. // The data type for ExclusiveStartKey must be String, Number or Binary. No
  4185. // set data types are allowed.
  4186. ExclusiveStartKey map[string]*AttributeValue `type:"map"`
  4187. // One or more substitution tokens for attribute names in an expression. The
  4188. // following are some use cases for using ExpressionAttributeNames:
  4189. //
  4190. // To access an attribute whose name conflicts with a DynamoDB reserved word.
  4191. //
  4192. // To create a placeholder for repeating occurrences of an attribute name
  4193. // in an expression.
  4194. //
  4195. // To prevent special characters in an attribute name from being misinterpreted
  4196. // in an expression.
  4197. //
  4198. // Use the # character in an expression to dereference an attribute name.
  4199. // For example, consider the following attribute name:
  4200. //
  4201. // Percentile
  4202. //
  4203. // The name of this attribute conflicts with a reserved word, so it cannot
  4204. // be used directly in an expression. (For the complete list of reserved words,
  4205. // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
  4206. // in the Amazon DynamoDB Developer Guide). To work around this, you could specify
  4207. // the following for ExpressionAttributeNames:
  4208. //
  4209. // {"#P":"Percentile"}
  4210. //
  4211. // You could then use this substitution in an expression, as in this example:
  4212. //
  4213. // #P = :val
  4214. //
  4215. // Tokens that begin with the : character are expression attribute values,
  4216. // which are placeholders for the actual value at runtime.
  4217. //
  4218. // For more information on expression attribute names, see Accessing Item
  4219. // Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  4220. // in the Amazon DynamoDB Developer Guide.
  4221. ExpressionAttributeNames map[string]*string `type:"map"`
  4222. // One or more values that can be substituted in an expression.
  4223. //
  4224. // Use the : (colon) character in an expression to dereference an attribute
  4225. // value. For example, suppose that you wanted to check whether the value of
  4226. // the ProductStatus attribute was one of the following:
  4227. //
  4228. // Available | Backordered | Discontinued
  4229. //
  4230. // You would first need to specify ExpressionAttributeValues as follows:
  4231. //
  4232. // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"}
  4233. // }
  4234. //
  4235. // You could then use these values in an expression, such as this:
  4236. //
  4237. // ProductStatus IN (:avail, :back, :disc)
  4238. //
  4239. // For more information on expression attribute values, see Specifying Conditions
  4240. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
  4241. // in the Amazon DynamoDB Developer Guide.
  4242. ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
  4243. // A string that contains conditions that DynamoDB applies after the Query operation,
  4244. // but before the data is returned to you. Items that do not satisfy the FilterExpression
  4245. // criteria are not returned.
  4246. //
  4247. // A FilterExpression is applied after the items have already been read; the
  4248. // process of filtering does not consume any additional read capacity units.
  4249. //
  4250. // For more information, see Filter Expressions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults)
  4251. // in the Amazon DynamoDB Developer Guide.
  4252. //
  4253. // FilterExpression replaces the legacy QueryFilter and ConditionalOperator
  4254. // parameters.
  4255. FilterExpression *string `type:"string"`
  4256. // The name of an index to query. This index can be any local secondary index
  4257. // or global secondary index on the table. Note that if you use the IndexName
  4258. // parameter, you must also provide TableName.
  4259. IndexName *string `min:"3" type:"string"`
  4260. // The condition that specifies the key value(s) for items to be retrieved by
  4261. // the Query action.
  4262. //
  4263. // The condition must perform an equality test on a single partition key value.
  4264. // The condition can also perform one of several comparison tests on a single
  4265. // sort key value. Query can use KeyConditionExpression to retrieve one item
  4266. // with a given partition key value and sort key value, or several items that
  4267. // have the same partition key value but different sort key values.
  4268. //
  4269. // The partition key equality test is required, and must be specified in the
  4270. // following format:
  4271. //
  4272. // partitionKeyName = :partitionkeyval
  4273. //
  4274. // If you also want to provide a condition for the sort key, it must be combined
  4275. // using AND with the condition for the sort key. Following is an example, using
  4276. // the = comparison operator for the sort key:
  4277. //
  4278. // partitionKeyName = :partitionkeyval AND sortKeyName = :sortkeyval
  4279. //
  4280. // Valid comparisons for the sort key condition are as follows:
  4281. //
  4282. // sortKeyName = :sortkeyval - true if the sort key value is equal to :sortkeyval.
  4283. //
  4284. // sortKeyName < :sortkeyval - true if the sort key value is less than :sortkeyval.
  4285. //
  4286. // sortKeyName <= :sortkeyval - true if the sort key value is less than
  4287. // or equal to :sortkeyval.
  4288. //
  4289. // sortKeyName > :sortkeyval - true if the sort key value is greater than
  4290. // :sortkeyval.
  4291. //
  4292. // sortKeyName >= :sortkeyval - true if the sort key value is greater than
  4293. // or equal to :sortkeyval.
  4294. //
  4295. // sortKeyName BETWEEN :sortkeyval1 AND :sortkeyval2 - true if the sort
  4296. // key value is greater than or equal to :sortkeyval1, and less than or equal
  4297. // to :sortkeyval2.
  4298. //
  4299. // begins_with ( sortKeyName, :sortkeyval ) - true if the sort key value
  4300. // begins with a particular operand. (You cannot use this function with a sort
  4301. // key that is of type Number.) Note that the function name begins_with is case-sensitive.
  4302. //
  4303. // Use the ExpressionAttributeValues parameter to replace tokens such as
  4304. // :partitionval and :sortval with actual values at runtime.
  4305. //
  4306. // You can optionally use the ExpressionAttributeNames parameter to replace
  4307. // the names of the partition key and sort key with placeholder tokens. This
  4308. // option might be necessary if an attribute name conflicts with a DynamoDB
  4309. // reserved word. For example, the following KeyConditionExpression parameter
  4310. // causes an error because Size is a reserved word:
  4311. //
  4312. // Size = :myval
  4313. //
  4314. // To work around this, define a placeholder (such a #S) to represent the
  4315. // attribute name Size. KeyConditionExpression then is as follows:
  4316. //
  4317. // #S = :myval
  4318. //
  4319. // For a list of reserved words, see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
  4320. // in the Amazon DynamoDB Developer Guide.
  4321. //
  4322. // For more information on ExpressionAttributeNames and ExpressionAttributeValues,
  4323. // see Using Placeholders for Attribute Names and Values (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html)
  4324. // in the Amazon DynamoDB Developer Guide.
  4325. //
  4326. // KeyConditionExpression replaces the legacy KeyConditions parameter.
  4327. KeyConditionExpression *string `type:"string"`
  4328. // This is a legacy parameter, for backward compatibility. New applications
  4329. // should use KeyConditionExpression instead. Do not combine legacy parameters
  4330. // and expression parameters in a single API call; otherwise, DynamoDB will
  4331. // return a ValidationException exception.
  4332. //
  4333. // The selection criteria for the query. For a query on a table, you can have
  4334. // conditions only on the table primary key attributes. You must provide the
  4335. // partition key name and value as an EQ condition. You can optionally provide
  4336. // a second condition, referring to the sort key.
  4337. //
  4338. // If you don't provide a sort key condition, all of the items that match
  4339. // the partition key will be retrieved. If a FilterExpression or QueryFilter
  4340. // is present, it will be applied after the items are retrieved.
  4341. //
  4342. // For a query on an index, you can have conditions only on the index key
  4343. // attributes. You must provide the index partition key name and value as an
  4344. // EQ condition. You can optionally provide a second condition, referring to
  4345. // the index sort key.
  4346. //
  4347. // Each KeyConditions element consists of an attribute name to compare, along
  4348. // with the following:
  4349. //
  4350. // AttributeValueList - One or more values to evaluate against the supplied
  4351. // attribute. The number of values in the list depends on the ComparisonOperator
  4352. // being used.
  4353. //
  4354. // For type Number, value comparisons are numeric.
  4355. //
  4356. // String value comparisons for greater than, equals, or less than are based
  4357. // on ASCII character code values. For example, a is greater than A, and a is
  4358. // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
  4359. // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  4360. //
  4361. // For Binary, DynamoDB treats each byte of the binary data as unsigned when
  4362. // it compares binary values.
  4363. //
  4364. // ComparisonOperator - A comparator for evaluating attributes, for example,
  4365. // equals, greater than, less than, and so on.
  4366. //
  4367. // For KeyConditions, only the following comparison operators are supported:
  4368. //
  4369. // EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN
  4370. //
  4371. // The following are descriptions of these comparison operators.
  4372. //
  4373. // EQ : Equal.
  4374. //
  4375. // AttributeValueList can contain only one AttributeValue of type String,
  4376. // Number, or Binary (not a set type). If an item contains an AttributeValue
  4377. // element of a different type than the one specified in the request, the value
  4378. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  4379. // does not equal {"NS":["6", "2", "1"]}.
  4380. //
  4381. // LE : Less than or equal.
  4382. //
  4383. // AttributeValueList can contain only one AttributeValue element of type
  4384. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  4385. // element of a different type than the one provided in the request, the value
  4386. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  4387. // does not compare to {"NS":["6", "2", "1"]}.
  4388. //
  4389. // LT : Less than.
  4390. //
  4391. // AttributeValueList can contain only one AttributeValue of type String,
  4392. // Number, or Binary (not a set type). If an item contains an AttributeValue
  4393. // element of a different type than the one provided in the request, the value
  4394. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  4395. // does not compare to {"NS":["6", "2", "1"]}.
  4396. //
  4397. // GE : Greater than or equal.
  4398. //
  4399. // AttributeValueList can contain only one AttributeValue element of type
  4400. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  4401. // element of a different type than the one provided in the request, the value
  4402. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  4403. // does not compare to {"NS":["6", "2", "1"]}.
  4404. //
  4405. // GT : Greater than.
  4406. //
  4407. // AttributeValueList can contain only one AttributeValue element of type
  4408. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  4409. // element of a different type than the one provided in the request, the value
  4410. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  4411. // does not compare to {"NS":["6", "2", "1"]}.
  4412. //
  4413. // BEGINS_WITH : Checks for a prefix.
  4414. //
  4415. // AttributeValueList can contain only one AttributeValue of type String or
  4416. // Binary (not a Number or a set type). The target attribute of the comparison
  4417. // must be of type String or Binary (not a Number or a set type).
  4418. //
  4419. // BETWEEN : Greater than or equal to the first value, and less than or
  4420. // equal to the second value.
  4421. //
  4422. // AttributeValueList must contain two AttributeValue elements of the same
  4423. // type, either String, Number, or Binary (not a set type). A target attribute
  4424. // matches if the target value is greater than, or equal to, the first element
  4425. // and less than, or equal to, the second element. If an item contains an AttributeValue
  4426. // element of a different type than the one provided in the request, the value
  4427. // does not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,
  4428. // {"N":"6"} does not compare to {"NS":["6", "2", "1"]}
  4429. //
  4430. // For usage examples of AttributeValueList and ComparisonOperator, see
  4431. // Legacy Conditional Parameters (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html)
  4432. // in the Amazon DynamoDB Developer Guide.
  4433. KeyConditions map[string]*Condition `type:"map"`
  4434. // The maximum number of items to evaluate (not necessarily the number of matching
  4435. // items). If DynamoDB processes the number of items up to the limit while processing
  4436. // the results, it stops the operation and returns the matching values up to
  4437. // that point, and a key in LastEvaluatedKey to apply in a subsequent operation,
  4438. // so that you can pick up where you left off. Also, if the processed data set
  4439. // size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation
  4440. // and returns the matching values up to the limit, and a key in LastEvaluatedKey
  4441. // to apply in a subsequent operation to continue the operation. For more information,
  4442. // see Query and Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html)
  4443. // in the Amazon DynamoDB Developer Guide.
  4444. Limit *int64 `min:"1" type:"integer"`
  4445. // A string that identifies one or more attributes to retrieve from the table.
  4446. // These attributes can include scalars, sets, or elements of a JSON document.
  4447. // The attributes in the expression must be separated by commas.
  4448. //
  4449. // If no attribute names are specified, then all attributes will be returned.
  4450. // If any of the requested attributes are not found, they will not appear in
  4451. // the result.
  4452. //
  4453. // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  4454. // in the Amazon DynamoDB Developer Guide.
  4455. //
  4456. // ProjectionExpression replaces the legacy AttributesToGet parameter.
  4457. ProjectionExpression *string `type:"string"`
  4458. // This is a legacy parameter, for backward compatibility. New applications
  4459. // should use FilterExpression instead. Do not combine legacy parameters and
  4460. // expression parameters in a single API call; otherwise, DynamoDB will return
  4461. // a ValidationException exception.
  4462. //
  4463. // A condition that evaluates the query results after the items are read and
  4464. // returns only the desired values.
  4465. //
  4466. // This parameter does not support attributes of type List or Map.
  4467. //
  4468. // A QueryFilter is applied after the items have already been read; the process
  4469. // of filtering does not consume any additional read capacity units.
  4470. //
  4471. // If you provide more than one condition in the QueryFilter map, then by
  4472. // default all of the conditions must evaluate to true. In other words, the
  4473. // conditions are ANDed together. (You can use the ConditionalOperator parameter
  4474. // to OR the conditions instead. If you do this, then at least one of the conditions
  4475. // must evaluate to true, rather than all of them.)
  4476. //
  4477. // Note that QueryFilter does not allow key attributes. You cannot define a
  4478. // filter condition on a partition key or a sort key.
  4479. //
  4480. // Each QueryFilter element consists of an attribute name to compare, along
  4481. // with the following:
  4482. //
  4483. // AttributeValueList - One or more values to evaluate against the supplied
  4484. // attribute. The number of values in the list depends on the operator specified
  4485. // in ComparisonOperator.
  4486. //
  4487. // For type Number, value comparisons are numeric.
  4488. //
  4489. // String value comparisons for greater than, equals, or less than are based
  4490. // on ASCII character code values. For example, a is greater than A, and a is
  4491. // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
  4492. // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  4493. //
  4494. // For type Binary, DynamoDB treats each byte of the binary data as unsigned
  4495. // when it compares binary values.
  4496. //
  4497. // For information on specifying data types in JSON, see JSON Data Format (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html)
  4498. // in the Amazon DynamoDB Developer Guide.
  4499. //
  4500. // ComparisonOperator - A comparator for evaluating attributes. For example,
  4501. // equals, greater than, less than, etc.
  4502. //
  4503. // The following comparison operators are available:
  4504. //
  4505. // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS
  4506. // | BEGINS_WITH | IN | BETWEEN
  4507. //
  4508. // For complete descriptions of all comparison operators, see the Condition
  4509. // (http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html)
  4510. // data type.
  4511. QueryFilter map[string]*Condition `type:"map"`
  4512. // Determines the level of detail about provisioned throughput consumption that
  4513. // is returned in the response:
  4514. //
  4515. // INDEXES - The response includes the aggregate ConsumedCapacity for the
  4516. // operation, together with ConsumedCapacity for each table and secondary index
  4517. // that was accessed.
  4518. //
  4519. // Note that some operations, such as GetItem and BatchGetItem, do not access
  4520. // any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity
  4521. // information for table(s).
  4522. //
  4523. // TOTAL - The response includes only the aggregate ConsumedCapacity for
  4524. // the operation.
  4525. //
  4526. // NONE - No ConsumedCapacity details are included in the response.
  4527. ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
  4528. // Specifies the order for index traversal: If true (default), the traversal
  4529. // is performed in ascending order; if false, the traversal is performed in
  4530. // descending order.
  4531. //
  4532. // Items with the same partition key value are stored in sorted order by sort
  4533. // key. If the sort key data type is Number, the results are stored in numeric
  4534. // order. For type String, the results are stored in order of ASCII character
  4535. // code values. For type Binary, DynamoDB treats each byte of the binary data
  4536. // as unsigned.
  4537. //
  4538. // If ScanIndexForward is true, DynamoDB returns the results in the order in
  4539. // which they are stored (by sort key value). This is the default behavior.
  4540. // If ScanIndexForward is false, DynamoDB reads the results in reverse order
  4541. // by sort key value, and then returns the results to the client.
  4542. ScanIndexForward *bool `type:"boolean"`
  4543. // The attributes to be returned in the result. You can retrieve all item attributes,
  4544. // specific item attributes, the count of matching items, or in the case of
  4545. // an index, some or all of the attributes projected into the index.
  4546. //
  4547. // ALL_ATTRIBUTES - Returns all of the item attributes from the specified
  4548. // table or index. If you query a local secondary index, then for each matching
  4549. // item in the index DynamoDB will fetch the entire item from the parent table.
  4550. // If the index is configured to project all item attributes, then all of the
  4551. // data can be obtained from the local secondary index, and no fetching is required.
  4552. //
  4553. // ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves
  4554. // all attributes that have been projected into the index. If the index is configured
  4555. // to project all attributes, this return value is equivalent to specifying
  4556. // ALL_ATTRIBUTES.
  4557. //
  4558. // COUNT - Returns the number of matching items, rather than the matching
  4559. // items themselves.
  4560. //
  4561. // SPECIFIC_ATTRIBUTES - Returns only the attributes listed in AttributesToGet.
  4562. // This return value is equivalent to specifying AttributesToGet without specifying
  4563. // any value for Select.
  4564. //
  4565. // If you query a local secondary index and request only attributes that are
  4566. // projected into that index, the operation will read only the index and not
  4567. // the table. If any of the requested attributes are not projected into the
  4568. // local secondary index, DynamoDB will fetch each of these attributes from
  4569. // the parent table. This extra fetching incurs additional throughput cost and
  4570. // latency.
  4571. //
  4572. // If you query a global secondary index, you can only request attributes that
  4573. // are projected into the index. Global secondary index queries cannot fetch
  4574. // attributes from the parent table.
  4575. //
  4576. // If neither Select nor AttributesToGet are specified, DynamoDB defaults
  4577. // to ALL_ATTRIBUTES when accessing a table, and ALL_PROJECTED_ATTRIBUTES when
  4578. // accessing an index. You cannot use both Select and AttributesToGet together
  4579. // in a single request, unless the value for Select is SPECIFIC_ATTRIBUTES.
  4580. // (This usage is equivalent to specifying AttributesToGet without any value
  4581. // for Select.)
  4582. //
  4583. // If you use the ProjectionExpression parameter, then the value for Select
  4584. // can only be SPECIFIC_ATTRIBUTES. Any other value for Select will return an
  4585. // error.
  4586. Select *string `type:"string" enum:"Select"`
  4587. // The name of the table containing the requested items.
  4588. TableName *string `min:"3" type:"string" required:"true"`
  4589. }
  4590. // String returns the string representation
  4591. func (s QueryInput) String() string {
  4592. return awsutil.Prettify(s)
  4593. }
  4594. // GoString returns the string representation
  4595. func (s QueryInput) GoString() string {
  4596. return s.String()
  4597. }
  4598. // Validate inspects the fields of the type to determine if they are valid.
  4599. func (s *QueryInput) Validate() error {
  4600. invalidParams := request.ErrInvalidParams{Context: "QueryInput"}
  4601. if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 {
  4602. invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1))
  4603. }
  4604. if s.IndexName != nil && len(*s.IndexName) < 3 {
  4605. invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
  4606. }
  4607. if s.Limit != nil && *s.Limit < 1 {
  4608. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  4609. }
  4610. if s.TableName == nil {
  4611. invalidParams.Add(request.NewErrParamRequired("TableName"))
  4612. }
  4613. if s.TableName != nil && len(*s.TableName) < 3 {
  4614. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  4615. }
  4616. if s.KeyConditions != nil {
  4617. for i, v := range s.KeyConditions {
  4618. if v == nil {
  4619. continue
  4620. }
  4621. if err := v.Validate(); err != nil {
  4622. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeyConditions", i), err.(request.ErrInvalidParams))
  4623. }
  4624. }
  4625. }
  4626. if s.QueryFilter != nil {
  4627. for i, v := range s.QueryFilter {
  4628. if v == nil {
  4629. continue
  4630. }
  4631. if err := v.Validate(); err != nil {
  4632. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "QueryFilter", i), err.(request.ErrInvalidParams))
  4633. }
  4634. }
  4635. }
  4636. if invalidParams.Len() > 0 {
  4637. return invalidParams
  4638. }
  4639. return nil
  4640. }
  4641. // Represents the output of a Query operation.
  4642. type QueryOutput struct {
  4643. _ struct{} `type:"structure"`
  4644. // The capacity units consumed by an operation. The data returned includes the
  4645. // total provisioned throughput consumed, along with statistics for the table
  4646. // and any indexes involved in the operation. ConsumedCapacity is only returned
  4647. // if the request asked for it. For more information, see Provisioned Throughput
  4648. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
  4649. // in the Amazon DynamoDB Developer Guide.
  4650. ConsumedCapacity *ConsumedCapacity `type:"structure"`
  4651. // The number of items in the response.
  4652. //
  4653. // If you used a QueryFilter in the request, then Count is the number of items
  4654. // returned after the filter was applied, and ScannedCount is the number of
  4655. // matching items before the filter was applied.
  4656. //
  4657. // If you did not use a filter in the request, then Count and ScannedCount
  4658. // are the same.
  4659. Count *int64 `type:"integer"`
  4660. // An array of item attributes that match the query criteria. Each element in
  4661. // this array consists of an attribute name and the value for that attribute.
  4662. Items []map[string]*AttributeValue `type:"list"`
  4663. // The primary key of the item where the operation stopped, inclusive of the
  4664. // previous result set. Use this value to start a new operation, excluding this
  4665. // value in the new request.
  4666. //
  4667. // If LastEvaluatedKey is empty, then the "last page" of results has been processed
  4668. // and there is no more data to be retrieved.
  4669. //
  4670. // If LastEvaluatedKey is not empty, it does not necessarily mean that there
  4671. // is more data in the result set. The only way to know when you have reached
  4672. // the end of the result set is when LastEvaluatedKey is empty.
  4673. LastEvaluatedKey map[string]*AttributeValue `type:"map"`
  4674. // The number of items evaluated, before any QueryFilter is applied. A high
  4675. // ScannedCount value with few, or no, Count results indicates an inefficient
  4676. // Query operation. For more information, see Count and ScannedCount (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count)
  4677. // in the Amazon DynamoDB Developer Guide.
  4678. //
  4679. // If you did not use a filter in the request, then ScannedCount is the same
  4680. // as Count.
  4681. ScannedCount *int64 `type:"integer"`
  4682. }
  4683. // String returns the string representation
  4684. func (s QueryOutput) String() string {
  4685. return awsutil.Prettify(s)
  4686. }
  4687. // GoString returns the string representation
  4688. func (s QueryOutput) GoString() string {
  4689. return s.String()
  4690. }
  4691. // Represents the input of a Scan operation.
  4692. type ScanInput struct {
  4693. _ struct{} `type:"structure"`
  4694. // This is a legacy parameter, for backward compatibility. New applications
  4695. // should use ProjectionExpression instead. Do not combine legacy parameters
  4696. // and expression parameters in a single API call; otherwise, DynamoDB will
  4697. // return a ValidationException exception.
  4698. //
  4699. // This parameter allows you to retrieve attributes of type List or Map; however,
  4700. // it cannot retrieve individual elements within a List or a Map.
  4701. //
  4702. // The names of one or more attributes to retrieve. If no attribute names
  4703. // are provided, then all attributes will be returned. If any of the requested
  4704. // attributes are not found, they will not appear in the result.
  4705. //
  4706. // Note that AttributesToGet has no effect on provisioned throughput consumption.
  4707. // DynamoDB determines capacity units consumed based on item size, not on the
  4708. // amount of data that is returned to an application.
  4709. AttributesToGet []*string `min:"1" type:"list"`
  4710. // This is a legacy parameter, for backward compatibility. New applications
  4711. // should use FilterExpression instead. Do not combine legacy parameters and
  4712. // expression parameters in a single API call; otherwise, DynamoDB will return
  4713. // a ValidationException exception.
  4714. //
  4715. // A logical operator to apply to the conditions in a ScanFilter map:
  4716. //
  4717. // AND - If all of the conditions evaluate to true, then the entire map
  4718. // evaluates to true.
  4719. //
  4720. // OR - If at least one of the conditions evaluate to true, then the entire
  4721. // map evaluates to true.
  4722. //
  4723. // If you omit ConditionalOperator, then AND is the default.
  4724. //
  4725. // The operation will succeed only if the entire map evaluates to true.
  4726. //
  4727. // This parameter does not support attributes of type List or Map.
  4728. ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
  4729. // A Boolean value that determines the read consistency model during the scan:
  4730. //
  4731. // If ConsistentRead is false, then the data returned from Scan might not
  4732. // contain the results from other recently completed write operations (PutItem,
  4733. // UpdateItem or DeleteItem).
  4734. //
  4735. // If ConsistentRead is true, then all of the write operations that completed
  4736. // before the Scan began are guaranteed to be contained in the Scan response.
  4737. //
  4738. // The default setting for ConsistentRead is false.
  4739. //
  4740. // The ConsistentRead parameter is not supported on global secondary indexes.
  4741. // If you scan a global secondary index with ConsistentRead set to true, you
  4742. // will receive a ValidationException.
  4743. ConsistentRead *bool `type:"boolean"`
  4744. // The primary key of the first item that this operation will evaluate. Use
  4745. // the value that was returned for LastEvaluatedKey in the previous operation.
  4746. //
  4747. // The data type for ExclusiveStartKey must be String, Number or Binary. No
  4748. // set data types are allowed.
  4749. //
  4750. // In a parallel scan, a Scan request that includes ExclusiveStartKey must
  4751. // specify the same segment whose previous Scan returned the corresponding value
  4752. // of LastEvaluatedKey.
  4753. ExclusiveStartKey map[string]*AttributeValue `type:"map"`
  4754. // One or more substitution tokens for attribute names in an expression. The
  4755. // following are some use cases for using ExpressionAttributeNames:
  4756. //
  4757. // To access an attribute whose name conflicts with a DynamoDB reserved word.
  4758. //
  4759. // To create a placeholder for repeating occurrences of an attribute name
  4760. // in an expression.
  4761. //
  4762. // To prevent special characters in an attribute name from being misinterpreted
  4763. // in an expression.
  4764. //
  4765. // Use the # character in an expression to dereference an attribute name.
  4766. // For example, consider the following attribute name:
  4767. //
  4768. // Percentile
  4769. //
  4770. // The name of this attribute conflicts with a reserved word, so it cannot
  4771. // be used directly in an expression. (For the complete list of reserved words,
  4772. // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
  4773. // in the Amazon DynamoDB Developer Guide). To work around this, you could specify
  4774. // the following for ExpressionAttributeNames:
  4775. //
  4776. // {"#P":"Percentile"}
  4777. //
  4778. // You could then use this substitution in an expression, as in this example:
  4779. //
  4780. // #P = :val
  4781. //
  4782. // Tokens that begin with the : character are expression attribute values,
  4783. // which are placeholders for the actual value at runtime.
  4784. //
  4785. // For more information on expression attribute names, see Accessing Item
  4786. // Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  4787. // in the Amazon DynamoDB Developer Guide.
  4788. ExpressionAttributeNames map[string]*string `type:"map"`
  4789. // One or more values that can be substituted in an expression.
  4790. //
  4791. // Use the : (colon) character in an expression to dereference an attribute
  4792. // value. For example, suppose that you wanted to check whether the value of
  4793. // the ProductStatus attribute was one of the following:
  4794. //
  4795. // Available | Backordered | Discontinued
  4796. //
  4797. // You would first need to specify ExpressionAttributeValues as follows:
  4798. //
  4799. // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"}
  4800. // }
  4801. //
  4802. // You could then use these values in an expression, such as this:
  4803. //
  4804. // ProductStatus IN (:avail, :back, :disc)
  4805. //
  4806. // For more information on expression attribute values, see Specifying Conditions
  4807. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
  4808. // in the Amazon DynamoDB Developer Guide.
  4809. ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
  4810. // A string that contains conditions that DynamoDB applies after the Scan operation,
  4811. // but before the data is returned to you. Items that do not satisfy the FilterExpression
  4812. // criteria are not returned.
  4813. //
  4814. // A FilterExpression is applied after the items have already been read; the
  4815. // process of filtering does not consume any additional read capacity units.
  4816. //
  4817. // For more information, see Filter Expressions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults)
  4818. // in the Amazon DynamoDB Developer Guide.
  4819. //
  4820. // FilterExpression replaces the legacy ScanFilter and ConditionalOperator
  4821. // parameters.
  4822. FilterExpression *string `type:"string"`
  4823. // The name of a secondary index to scan. This index can be any local secondary
  4824. // index or global secondary index. Note that if you use the IndexName parameter,
  4825. // you must also provide TableName.
  4826. IndexName *string `min:"3" type:"string"`
  4827. // The maximum number of items to evaluate (not necessarily the number of matching
  4828. // items). If DynamoDB processes the number of items up to the limit while processing
  4829. // the results, it stops the operation and returns the matching values up to
  4830. // that point, and a key in LastEvaluatedKey to apply in a subsequent operation,
  4831. // so that you can pick up where you left off. Also, if the processed data set
  4832. // size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation
  4833. // and returns the matching values up to the limit, and a key in LastEvaluatedKey
  4834. // to apply in a subsequent operation to continue the operation. For more information,
  4835. // see Query and Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html)
  4836. // in the Amazon DynamoDB Developer Guide.
  4837. Limit *int64 `min:"1" type:"integer"`
  4838. // A string that identifies one or more attributes to retrieve from the specified
  4839. // table or index. These attributes can include scalars, sets, or elements of
  4840. // a JSON document. The attributes in the expression must be separated by commas.
  4841. //
  4842. // If no attribute names are specified, then all attributes will be returned.
  4843. // If any of the requested attributes are not found, they will not appear in
  4844. // the result.
  4845. //
  4846. // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  4847. // in the Amazon DynamoDB Developer Guide.
  4848. //
  4849. // ProjectionExpression replaces the legacy AttributesToGet parameter.
  4850. ProjectionExpression *string `type:"string"`
  4851. // Determines the level of detail about provisioned throughput consumption that
  4852. // is returned in the response:
  4853. //
  4854. // INDEXES - The response includes the aggregate ConsumedCapacity for the
  4855. // operation, together with ConsumedCapacity for each table and secondary index
  4856. // that was accessed.
  4857. //
  4858. // Note that some operations, such as GetItem and BatchGetItem, do not access
  4859. // any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity
  4860. // information for table(s).
  4861. //
  4862. // TOTAL - The response includes only the aggregate ConsumedCapacity for
  4863. // the operation.
  4864. //
  4865. // NONE - No ConsumedCapacity details are included in the response.
  4866. ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
  4867. // This is a legacy parameter, for backward compatibility. New applications
  4868. // should use FilterExpression instead. Do not combine legacy parameters and
  4869. // expression parameters in a single API call; otherwise, DynamoDB will return
  4870. // a ValidationException exception.
  4871. //
  4872. // A condition that evaluates the scan results and returns only the desired
  4873. // values.
  4874. //
  4875. // This parameter does not support attributes of type List or Map.
  4876. //
  4877. // If you specify more than one condition in the ScanFilter map, then by default
  4878. // all of the conditions must evaluate to true. In other words, the conditions
  4879. // are ANDed together. (You can use the ConditionalOperator parameter to OR
  4880. // the conditions instead. If you do this, then at least one of the conditions
  4881. // must evaluate to true, rather than all of them.)
  4882. //
  4883. // Each ScanFilter element consists of an attribute name to compare, along
  4884. // with the following:
  4885. //
  4886. // AttributeValueList - One or more values to evaluate against the supplied
  4887. // attribute. The number of values in the list depends on the operator specified
  4888. // in ComparisonOperator .
  4889. //
  4890. // For type Number, value comparisons are numeric.
  4891. //
  4892. // String value comparisons for greater than, equals, or less than are based
  4893. // on ASCII character code values. For example, a is greater than A, and a is
  4894. // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
  4895. // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  4896. //
  4897. // For Binary, DynamoDB treats each byte of the binary data as unsigned when
  4898. // it compares binary values.
  4899. //
  4900. // For information on specifying data types in JSON, see JSON Data Format (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html)
  4901. // in the Amazon DynamoDB Developer Guide.
  4902. //
  4903. // ComparisonOperator - A comparator for evaluating attributes. For example,
  4904. // equals, greater than, less than, etc.
  4905. //
  4906. // The following comparison operators are available:
  4907. //
  4908. // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS
  4909. // | BEGINS_WITH | IN | BETWEEN
  4910. //
  4911. // For complete descriptions of all comparison operators, see Condition (http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html).
  4912. ScanFilter map[string]*Condition `type:"map"`
  4913. // For a parallel Scan request, Segment identifies an individual segment to
  4914. // be scanned by an application worker.
  4915. //
  4916. // Segment IDs are zero-based, so the first segment is always 0. For example,
  4917. // if you want to use four application threads to scan a table or an index,
  4918. // then the first thread specifies a Segment value of 0, the second thread specifies
  4919. // 1, and so on.
  4920. //
  4921. // The value of LastEvaluatedKey returned from a parallel Scan request must
  4922. // be used as ExclusiveStartKey with the same segment ID in a subsequent Scan
  4923. // operation.
  4924. //
  4925. // The value for Segment must be greater than or equal to 0, and less than
  4926. // the value provided for TotalSegments.
  4927. //
  4928. // If you provide Segment, you must also provide TotalSegments.
  4929. Segment *int64 `type:"integer"`
  4930. // The attributes to be returned in the result. You can retrieve all item attributes,
  4931. // specific item attributes, or the count of matching items.
  4932. //
  4933. // ALL_ATTRIBUTES - Returns all of the item attributes.
  4934. //
  4935. // ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves
  4936. // all attributes that have been projected into the index. If the index is configured
  4937. // to project all attributes, this return value is equivalent to specifying
  4938. // ALL_ATTRIBUTES.
  4939. //
  4940. // COUNT - Returns the number of matching items, rather than the matching
  4941. // items themselves.
  4942. //
  4943. // SPECIFIC_ATTRIBUTES - Returns only the attributes listed in AttributesToGet.
  4944. // This return value is equivalent to specifying AttributesToGet without specifying
  4945. // any value for Select.
  4946. //
  4947. // If neither Select nor AttributesToGet are specified, DynamoDB defaults
  4948. // to ALL_ATTRIBUTES. You cannot use both AttributesToGet and Select together
  4949. // in a single request, unless the value for Select is SPECIFIC_ATTRIBUTES.
  4950. // (This usage is equivalent to specifying AttributesToGet without any value
  4951. // for Select.)
  4952. Select *string `type:"string" enum:"Select"`
  4953. // The name of the table containing the requested items; or, if you provide
  4954. // IndexName, the name of the table to which that index belongs.
  4955. TableName *string `min:"3" type:"string" required:"true"`
  4956. // For a parallel Scan request, TotalSegments represents the total number of
  4957. // segments into which the Scan operation will be divided. The value of TotalSegments
  4958. // corresponds to the number of application workers that will perform the parallel
  4959. // scan. For example, if you want to use four application threads to scan a
  4960. // table or an index, specify a TotalSegments value of 4.
  4961. //
  4962. // The value for TotalSegments must be greater than or equal to 1, and less
  4963. // than or equal to 1000000. If you specify a TotalSegments value of 1, the
  4964. // Scan operation will be sequential rather than parallel.
  4965. //
  4966. // If you specify TotalSegments, you must also specify Segment.
  4967. TotalSegments *int64 `min:"1" type:"integer"`
  4968. }
  4969. // String returns the string representation
  4970. func (s ScanInput) String() string {
  4971. return awsutil.Prettify(s)
  4972. }
  4973. // GoString returns the string representation
  4974. func (s ScanInput) GoString() string {
  4975. return s.String()
  4976. }
  4977. // Validate inspects the fields of the type to determine if they are valid.
  4978. func (s *ScanInput) Validate() error {
  4979. invalidParams := request.ErrInvalidParams{Context: "ScanInput"}
  4980. if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 {
  4981. invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1))
  4982. }
  4983. if s.IndexName != nil && len(*s.IndexName) < 3 {
  4984. invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
  4985. }
  4986. if s.Limit != nil && *s.Limit < 1 {
  4987. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  4988. }
  4989. if s.TableName == nil {
  4990. invalidParams.Add(request.NewErrParamRequired("TableName"))
  4991. }
  4992. if s.TableName != nil && len(*s.TableName) < 3 {
  4993. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  4994. }
  4995. if s.TotalSegments != nil && *s.TotalSegments < 1 {
  4996. invalidParams.Add(request.NewErrParamMinValue("TotalSegments", 1))
  4997. }
  4998. if s.ScanFilter != nil {
  4999. for i, v := range s.ScanFilter {
  5000. if v == nil {
  5001. continue
  5002. }
  5003. if err := v.Validate(); err != nil {
  5004. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ScanFilter", i), err.(request.ErrInvalidParams))
  5005. }
  5006. }
  5007. }
  5008. if invalidParams.Len() > 0 {
  5009. return invalidParams
  5010. }
  5011. return nil
  5012. }
  5013. // Represents the output of a Scan operation.
  5014. type ScanOutput struct {
  5015. _ struct{} `type:"structure"`
  5016. // The capacity units consumed by an operation. The data returned includes the
  5017. // total provisioned throughput consumed, along with statistics for the table
  5018. // and any indexes involved in the operation. ConsumedCapacity is only returned
  5019. // if the request asked for it. For more information, see Provisioned Throughput
  5020. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
  5021. // in the Amazon DynamoDB Developer Guide.
  5022. ConsumedCapacity *ConsumedCapacity `type:"structure"`
  5023. // The number of items in the response.
  5024. //
  5025. // If you set ScanFilter in the request, then Count is the number of items
  5026. // returned after the filter was applied, and ScannedCount is the number of
  5027. // matching items before the filter was applied.
  5028. //
  5029. // If you did not use a filter in the request, then Count is the same as ScannedCount.
  5030. Count *int64 `type:"integer"`
  5031. // An array of item attributes that match the scan criteria. Each element in
  5032. // this array consists of an attribute name and the value for that attribute.
  5033. Items []map[string]*AttributeValue `type:"list"`
  5034. // The primary key of the item where the operation stopped, inclusive of the
  5035. // previous result set. Use this value to start a new operation, excluding this
  5036. // value in the new request.
  5037. //
  5038. // If LastEvaluatedKey is empty, then the "last page" of results has been processed
  5039. // and there is no more data to be retrieved.
  5040. //
  5041. // If LastEvaluatedKey is not empty, it does not necessarily mean that there
  5042. // is more data in the result set. The only way to know when you have reached
  5043. // the end of the result set is when LastEvaluatedKey is empty.
  5044. LastEvaluatedKey map[string]*AttributeValue `type:"map"`
  5045. // The number of items evaluated, before any ScanFilter is applied. A high ScannedCount
  5046. // value with few, or no, Count results indicates an inefficient Scan operation.
  5047. // For more information, see Count and ScannedCount (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count)
  5048. // in the Amazon DynamoDB Developer Guide.
  5049. //
  5050. // If you did not use a filter in the request, then ScannedCount is the same
  5051. // as Count.
  5052. ScannedCount *int64 `type:"integer"`
  5053. }
  5054. // String returns the string representation
  5055. func (s ScanOutput) String() string {
  5056. return awsutil.Prettify(s)
  5057. }
  5058. // GoString returns the string representation
  5059. func (s ScanOutput) GoString() string {
  5060. return s.String()
  5061. }
  5062. // Represents the DynamoDB Streams configuration for a table in DynamoDB.
  5063. type StreamSpecification struct {
  5064. _ struct{} `type:"structure"`
  5065. // Indicates whether DynamoDB Streams is enabled (true) or disabled (false)
  5066. // on the table.
  5067. StreamEnabled *bool `type:"boolean"`
  5068. // The DynamoDB Streams settings for the table. These settings consist of:
  5069. //
  5070. // StreamEnabled - Indicates whether DynamoDB Streams is enabled (true)
  5071. // or disabled (false) on the table.
  5072. //
  5073. // StreamViewType - When an item in the table is modified, StreamViewType
  5074. // determines what information is written to the stream for this table. Valid
  5075. // values for StreamViewType are:
  5076. //
  5077. // KEYS_ONLY - Only the key attributes of the modified item are written
  5078. // to the stream.
  5079. //
  5080. // NEW_IMAGE - The entire item, as it appears after it was modified, is
  5081. // written to the stream.
  5082. //
  5083. // OLD_IMAGE - The entire item, as it appeared before it was modified, is
  5084. // written to the stream.
  5085. //
  5086. // NEW_AND_OLD_IMAGES - Both the new and the old item images of the item
  5087. // are written to the stream.
  5088. StreamViewType *string `type:"string" enum:"StreamViewType"`
  5089. }
  5090. // String returns the string representation
  5091. func (s StreamSpecification) String() string {
  5092. return awsutil.Prettify(s)
  5093. }
  5094. // GoString returns the string representation
  5095. func (s StreamSpecification) GoString() string {
  5096. return s.String()
  5097. }
  5098. // Represents the properties of a table.
  5099. type TableDescription struct {
  5100. _ struct{} `type:"structure"`
  5101. // An array of AttributeDefinition objects. Each of these objects describes
  5102. // one attribute in the table and index key schema.
  5103. //
  5104. // Each AttributeDefinition object in this array is composed of:
  5105. //
  5106. // AttributeName - The name of the attribute.
  5107. //
  5108. // AttributeType - The data type for the attribute.
  5109. AttributeDefinitions []*AttributeDefinition `type:"list"`
  5110. // The date and time when the table was created, in UNIX epoch time (http://www.epochconverter.com/)
  5111. // format.
  5112. CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  5113. // The global secondary indexes, if any, on the table. Each index is scoped
  5114. // to a given partition key value. Each element is composed of:
  5115. //
  5116. // Backfilling - If true, then the index is currently in the backfilling
  5117. // phase. Backfilling occurs only when a new global secondary index is added
  5118. // to the table; it is the process by which DynamoDB populates the new index
  5119. // with data from the table. (This attribute does not appear for indexes that
  5120. // were created during a CreateTable operation.)
  5121. //
  5122. // IndexName - The name of the global secondary index.
  5123. //
  5124. // IndexSizeBytes - The total size of the global secondary index, in bytes.
  5125. // DynamoDB updates this value approximately every six hours. Recent changes
  5126. // might not be reflected in this value.
  5127. //
  5128. // IndexStatus - The current status of the global secondary index:
  5129. //
  5130. // CREATING - The index is being created.
  5131. //
  5132. // UPDATING - The index is being updated.
  5133. //
  5134. // DELETING - The index is being deleted.
  5135. //
  5136. // ACTIVE - The index is ready for use.
  5137. //
  5138. // ItemCount - The number of items in the global secondary index. DynamoDB
  5139. // updates this value approximately every six hours. Recent changes might not
  5140. // be reflected in this value.
  5141. //
  5142. // KeySchema - Specifies the complete index key schema. The attribute names
  5143. // in the key schema must be between 1 and 255 characters (inclusive). The key
  5144. // schema must begin with the same partition key as the table.
  5145. //
  5146. // Projection - Specifies attributes that are copied (projected) from the
  5147. // table into the index. These are in addition to the primary key attributes
  5148. // and index key attributes, which are automatically projected. Each attribute
  5149. // specification is composed of:
  5150. //
  5151. // ProjectionType - One of the following:
  5152. //
  5153. // KEYS_ONLY - Only the index and primary keys are projected into the index.
  5154. //
  5155. // INCLUDE - Only the specified table attributes are projected into the
  5156. // index. The list of projected attributes are in NonKeyAttributes.
  5157. //
  5158. // ALL - All of the table attributes are projected into the index.
  5159. //
  5160. // NonKeyAttributes - A list of one or more non-key attribute names that
  5161. // are projected into the secondary index. The total count of attributes provided
  5162. // in NonKeyAttributes, summed across all of the secondary indexes, must not
  5163. // exceed 20. If you project the same attribute into two different indexes,
  5164. // this counts as two distinct attributes when determining the total.
  5165. //
  5166. // ProvisionedThroughput - The provisioned throughput settings for the
  5167. // global secondary index, consisting of read and write capacity units, along
  5168. // with data about increases and decreases.
  5169. //
  5170. // If the table is in the DELETING state, no information about indexes will
  5171. // be returned.
  5172. GlobalSecondaryIndexes []*GlobalSecondaryIndexDescription `type:"list"`
  5173. // The number of items in the specified table. DynamoDB updates this value approximately
  5174. // every six hours. Recent changes might not be reflected in this value.
  5175. ItemCount *int64 `type:"long"`
  5176. // The primary key structure for the table. Each KeySchemaElement consists of:
  5177. //
  5178. // AttributeName - The name of the attribute.
  5179. //
  5180. // KeyType - The role of the attribute:
  5181. //
  5182. // HASH - partition key
  5183. //
  5184. // RANGE - sort key
  5185. //
  5186. // The partition key of an item is also known as its hash attribute. The
  5187. // term "hash attribute" derives from DynamoDB' usage of an internal hash function
  5188. // to evenly distribute data items across partitions, based on their partition
  5189. // key values.
  5190. //
  5191. // The sort key of an item is also known as its range attribute. The term "range
  5192. // attribute" derives from the way DynamoDB stores items with the same partition
  5193. // key physically close together, in sorted order by the sort key value.
  5194. //
  5195. // For more information about primary keys, see Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey)
  5196. // in the Amazon DynamoDB Developer Guide.
  5197. KeySchema []*KeySchemaElement `min:"1" type:"list"`
  5198. // The Amazon Resource Name (ARN) that uniquely identifies the latest stream
  5199. // for this table.
  5200. LatestStreamArn *string `min:"37" type:"string"`
  5201. // A timestamp, in ISO 8601 format, for this stream.
  5202. //
  5203. // Note that LatestStreamLabel is not a unique identifier for the stream, because
  5204. // it is possible that a stream from another table might have the same timestamp.
  5205. // However, the combination of the following three elements is guaranteed to
  5206. // be unique:
  5207. //
  5208. // the AWS customer ID.
  5209. //
  5210. // the table name.
  5211. //
  5212. // the StreamLabel.
  5213. LatestStreamLabel *string `type:"string"`
  5214. // Represents one or more local secondary indexes on the table. Each index is
  5215. // scoped to a given partition key value. Tables with one or more local secondary
  5216. // indexes are subject to an item collection size limit, where the amount of
  5217. // data within a given item collection cannot exceed 10 GB. Each element is
  5218. // composed of:
  5219. //
  5220. // IndexName - The name of the local secondary index.
  5221. //
  5222. // KeySchema - Specifies the complete index key schema. The attribute names
  5223. // in the key schema must be between 1 and 255 characters (inclusive). The key
  5224. // schema must begin with the same partition key as the table.
  5225. //
  5226. // Projection - Specifies attributes that are copied (projected) from the
  5227. // table into the index. These are in addition to the primary key attributes
  5228. // and index key attributes, which are automatically projected. Each attribute
  5229. // specification is composed of:
  5230. //
  5231. // ProjectionType - One of the following:
  5232. //
  5233. // KEYS_ONLY - Only the index and primary keys are projected into the index.
  5234. //
  5235. // INCLUDE - Only the specified table attributes are projected into the
  5236. // index. The list of projected attributes are in NonKeyAttributes.
  5237. //
  5238. // ALL - All of the table attributes are projected into the index.
  5239. //
  5240. // NonKeyAttributes - A list of one or more non-key attribute names that
  5241. // are projected into the secondary index. The total count of attributes provided
  5242. // in NonKeyAttributes, summed across all of the secondary indexes, must not
  5243. // exceed 20. If you project the same attribute into two different indexes,
  5244. // this counts as two distinct attributes when determining the total.
  5245. //
  5246. // IndexSizeBytes - Represents the total size of the index, in bytes.
  5247. // DynamoDB updates this value approximately every six hours. Recent changes
  5248. // might not be reflected in this value.
  5249. //
  5250. // ItemCount - Represents the number of items in the index. DynamoDB updates
  5251. // this value approximately every six hours. Recent changes might not be reflected
  5252. // in this value.
  5253. //
  5254. // If the table is in the DELETING state, no information about indexes will
  5255. // be returned.
  5256. LocalSecondaryIndexes []*LocalSecondaryIndexDescription `type:"list"`
  5257. // The provisioned throughput settings for the table, consisting of read and
  5258. // write capacity units, along with data about increases and decreases.
  5259. ProvisionedThroughput *ProvisionedThroughputDescription `type:"structure"`
  5260. // The current DynamoDB Streams configuration for the table.
  5261. StreamSpecification *StreamSpecification `type:"structure"`
  5262. // The Amazon Resource Name (ARN) that uniquely identifies the table.
  5263. TableArn *string `type:"string"`
  5264. // The name of the table.
  5265. TableName *string `min:"3" type:"string"`
  5266. // The total size of the specified table, in bytes. DynamoDB updates this value
  5267. // approximately every six hours. Recent changes might not be reflected in this
  5268. // value.
  5269. TableSizeBytes *int64 `type:"long"`
  5270. // The current state of the table:
  5271. //
  5272. // CREATING - The table is being created.
  5273. //
  5274. // UPDATING - The table is being updated.
  5275. //
  5276. // DELETING - The table is being deleted.
  5277. //
  5278. // ACTIVE - The table is ready for use.
  5279. TableStatus *string `type:"string" enum:"TableStatus"`
  5280. }
  5281. // String returns the string representation
  5282. func (s TableDescription) String() string {
  5283. return awsutil.Prettify(s)
  5284. }
  5285. // GoString returns the string representation
  5286. func (s TableDescription) GoString() string {
  5287. return s.String()
  5288. }
  5289. // Represents the new provisioned throughput settings to be applied to a global
  5290. // secondary index.
  5291. type UpdateGlobalSecondaryIndexAction struct {
  5292. _ struct{} `type:"structure"`
  5293. // The name of the global secondary index to be updated.
  5294. IndexName *string `min:"3" type:"string" required:"true"`
  5295. // Represents the provisioned throughput settings for a specified table or index.
  5296. // The settings can be modified using the UpdateTable operation.
  5297. //
  5298. // For current minimum and maximum provisioned throughput values, see Limits
  5299. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
  5300. // in the Amazon DynamoDB Developer Guide.
  5301. ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"`
  5302. }
  5303. // String returns the string representation
  5304. func (s UpdateGlobalSecondaryIndexAction) String() string {
  5305. return awsutil.Prettify(s)
  5306. }
  5307. // GoString returns the string representation
  5308. func (s UpdateGlobalSecondaryIndexAction) GoString() string {
  5309. return s.String()
  5310. }
  5311. // Validate inspects the fields of the type to determine if they are valid.
  5312. func (s *UpdateGlobalSecondaryIndexAction) Validate() error {
  5313. invalidParams := request.ErrInvalidParams{Context: "UpdateGlobalSecondaryIndexAction"}
  5314. if s.IndexName == nil {
  5315. invalidParams.Add(request.NewErrParamRequired("IndexName"))
  5316. }
  5317. if s.IndexName != nil && len(*s.IndexName) < 3 {
  5318. invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
  5319. }
  5320. if s.ProvisionedThroughput == nil {
  5321. invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
  5322. }
  5323. if s.ProvisionedThroughput != nil {
  5324. if err := s.ProvisionedThroughput.Validate(); err != nil {
  5325. invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
  5326. }
  5327. }
  5328. if invalidParams.Len() > 0 {
  5329. return invalidParams
  5330. }
  5331. return nil
  5332. }
  5333. // Represents the input of an UpdateItem operation.
  5334. type UpdateItemInput struct {
  5335. _ struct{} `type:"structure"`
  5336. // This is a legacy parameter, for backward compatibility. New applications
  5337. // should use UpdateExpression instead. Do not combine legacy parameters and
  5338. // expression parameters in a single API call; otherwise, DynamoDB will return
  5339. // a ValidationException exception.
  5340. //
  5341. // This parameter can be used for modifying top-level attributes; however,
  5342. // it does not support individual list or map elements.
  5343. //
  5344. // The names of attributes to be modified, the action to perform on each,
  5345. // and the new value for each. If you are updating an attribute that is an index
  5346. // key attribute for any indexes on that table, the attribute type must match
  5347. // the index key type defined in the AttributesDefinition of the table description.
  5348. // You can use UpdateItem to update any non-key attributes.
  5349. //
  5350. // Attribute values cannot be null. String and Binary type attributes must
  5351. // have lengths greater than zero. Set type attributes must not be empty. Requests
  5352. // with empty values will be rejected with a ValidationException exception.
  5353. //
  5354. // Each AttributeUpdates element consists of an attribute name to modify, along
  5355. // with the following:
  5356. //
  5357. // Value - The new value, if applicable, for this attribute.
  5358. //
  5359. // Action - A value that specifies how to perform the update. This action
  5360. // is only valid for an existing attribute whose data type is Number or is a
  5361. // set; do not use ADD for other data types.
  5362. //
  5363. // If an item with the specified primary key is found in the table, the following
  5364. // values perform the following actions:
  5365. //
  5366. // PUT - Adds the specified attribute to the item. If the attribute already
  5367. // exists, it is replaced by the new value.
  5368. //
  5369. // DELETE - Removes the attribute and its value, if no value is specified
  5370. // for DELETE. The data type of the specified value must match the existing
  5371. // value's data type.
  5372. //
  5373. // If a set of values is specified, then those values are subtracted from the
  5374. // old set. For example, if the attribute value was the set [a,b,c] and the
  5375. // DELETE action specifies [a,c], then the final attribute value is [b]. Specifying
  5376. // an empty set is an error.
  5377. //
  5378. // ADD - Adds the specified value to the item, if the attribute does not
  5379. // already exist. If the attribute does exist, then the behavior of ADD depends
  5380. // on the data type of the attribute:
  5381. //
  5382. // If the existing attribute is a number, and if Value is also a number,
  5383. // then Value is mathematically added to the existing attribute. If Value is
  5384. // a negative number, then it is subtracted from the existing attribute.
  5385. //
  5386. // If you use ADD to increment or decrement a number value for an item that
  5387. // doesn't exist before the update, DynamoDB uses 0 as the initial value.
  5388. //
  5389. // Similarly, if you use ADD for an existing item to increment or decrement
  5390. // an attribute value that doesn't exist before the update, DynamoDB uses 0
  5391. // as the initial value. For example, suppose that the item you want to update
  5392. // doesn't have an attribute named itemcount, but you decide to ADD the number
  5393. // 3 to this attribute anyway. DynamoDB will create the itemcount attribute,
  5394. // set its initial value to 0, and finally add 3 to it. The result will be a
  5395. // new itemcount attribute, with a value of 3.
  5396. //
  5397. // If the existing data type is a set, and if Value is also a set, then
  5398. // Value is appended to the existing set. For example, if the attribute value
  5399. // is the set [1,2], and the ADD action specified [3], then the final attribute
  5400. // value is [1,2,3]. An error occurs if an ADD action is specified for a set
  5401. // attribute and the attribute type specified does not match the existing set
  5402. // type.
  5403. //
  5404. // Both sets must have the same primitive data type. For example, if the existing
  5405. // data type is a set of strings, Value must also be a set of strings.
  5406. //
  5407. // If no item with the specified key is found in the table, the following
  5408. // values perform the following actions:
  5409. //
  5410. // PUT - Causes DynamoDB to create a new item with the specified primary
  5411. // key, and then adds the attribute.
  5412. //
  5413. // DELETE - Nothing happens, because attributes cannot be deleted from a
  5414. // nonexistent item. The operation succeeds, but DynamoDB does not create a
  5415. // new item.
  5416. //
  5417. // ADD - Causes DynamoDB to create an item with the supplied primary key
  5418. // and number (or set of numbers) for the attribute value. The only data types
  5419. // allowed are Number and Number Set.
  5420. //
  5421. // If you provide any attributes that are part of an index key, then the
  5422. // data types for those attributes must match those of the schema in the table's
  5423. // attribute definition.
  5424. AttributeUpdates map[string]*AttributeValueUpdate `type:"map"`
  5425. // A condition that must be satisfied in order for a conditional update to succeed.
  5426. //
  5427. // An expression can contain any of the following:
  5428. //
  5429. // Functions: attribute_exists | attribute_not_exists | attribute_type |
  5430. // contains | begins_with | size
  5431. //
  5432. // These function names are case-sensitive.
  5433. //
  5434. // Comparison operators: = | &#x3C;&#x3E; | &#x3C; | &#x3E; | &#x3C;= |
  5435. // &#x3E;= | BETWEEN | IN
  5436. //
  5437. // Logical operators: AND | OR | NOT
  5438. //
  5439. // For more information on condition expressions, see Specifying Conditions
  5440. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
  5441. // in the Amazon DynamoDB Developer Guide.
  5442. //
  5443. // ConditionExpression replaces the legacy ConditionalOperator and Expected
  5444. // parameters.
  5445. ConditionExpression *string `type:"string"`
  5446. // This is a legacy parameter, for backward compatibility. New applications
  5447. // should use ConditionExpression instead. Do not combine legacy parameters
  5448. // and expression parameters in a single API call; otherwise, DynamoDB will
  5449. // return a ValidationException exception.
  5450. //
  5451. // A logical operator to apply to the conditions in the Expected map:
  5452. //
  5453. // AND - If all of the conditions evaluate to true, then the entire map
  5454. // evaluates to true.
  5455. //
  5456. // OR - If at least one of the conditions evaluate to true, then the entire
  5457. // map evaluates to true.
  5458. //
  5459. // If you omit ConditionalOperator, then AND is the default.
  5460. //
  5461. // The operation will succeed only if the entire map evaluates to true.
  5462. //
  5463. // This parameter does not support attributes of type List or Map.
  5464. ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
  5465. // This is a legacy parameter, for backward compatibility. New applications
  5466. // should use ConditionExpression instead. Do not combine legacy parameters
  5467. // and expression parameters in a single API call; otherwise, DynamoDB will
  5468. // return a ValidationException exception.
  5469. //
  5470. // A map of attribute/condition pairs. Expected provides a conditional block
  5471. // for the UpdateItem operation.
  5472. //
  5473. // Each element of Expected consists of an attribute name, a comparison operator,
  5474. // and one or more values. DynamoDB compares the attribute with the value(s)
  5475. // you supplied, using the comparison operator. For each Expected element, the
  5476. // result of the evaluation is either true or false.
  5477. //
  5478. // If you specify more than one element in the Expected map, then by default
  5479. // all of the conditions must evaluate to true. In other words, the conditions
  5480. // are ANDed together. (You can use the ConditionalOperator parameter to OR
  5481. // the conditions instead. If you do this, then at least one of the conditions
  5482. // must evaluate to true, rather than all of them.)
  5483. //
  5484. // If the Expected map evaluates to true, then the conditional operation succeeds;
  5485. // otherwise, it fails.
  5486. //
  5487. // Expected contains the following:
  5488. //
  5489. // AttributeValueList - One or more values to evaluate against the supplied
  5490. // attribute. The number of values in the list depends on the ComparisonOperator
  5491. // being used.
  5492. //
  5493. // For type Number, value comparisons are numeric.
  5494. //
  5495. // String value comparisons for greater than, equals, or less than are based
  5496. // on ASCII character code values. For example, a is greater than A, and a is
  5497. // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
  5498. // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).
  5499. //
  5500. // For type Binary, DynamoDB treats each byte of the binary data as unsigned
  5501. // when it compares binary values.
  5502. //
  5503. // ComparisonOperator - A comparator for evaluating attributes in the AttributeValueList.
  5504. // When performing the comparison, DynamoDB uses strongly consistent reads.
  5505. //
  5506. // The following comparison operators are available:
  5507. //
  5508. // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS
  5509. // | BEGINS_WITH | IN | BETWEEN
  5510. //
  5511. // The following are descriptions of each comparison operator.
  5512. //
  5513. // EQ : Equal. EQ is supported for all datatypes, including lists and maps.
  5514. //
  5515. // AttributeValueList can contain only one AttributeValue element of type
  5516. // String, Number, Binary, String Set, Number Set, or Binary Set. If an item
  5517. // contains an AttributeValue element of a different type than the one provided
  5518. // in the request, the value does not match. For example, {"S":"6"} does not
  5519. // equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  5520. //
  5521. // NE : Not equal. NE is supported for all datatypes, including lists and
  5522. // maps.
  5523. //
  5524. // AttributeValueList can contain only one AttributeValue of type String,
  5525. // Number, Binary, String Set, Number Set, or Binary Set. If an item contains
  5526. // an AttributeValue of a different type than the one provided in the request,
  5527. // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}.
  5528. // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
  5529. //
  5530. // LE : Less than or equal.
  5531. //
  5532. // AttributeValueList can contain only one AttributeValue element of type
  5533. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  5534. // element of a different type than the one provided in the request, the value
  5535. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  5536. // does not compare to {"NS":["6", "2", "1"]}.
  5537. //
  5538. // LT : Less than.
  5539. //
  5540. // AttributeValueList can contain only one AttributeValue of type String,
  5541. // Number, or Binary (not a set type). If an item contains an AttributeValue
  5542. // element of a different type than the one provided in the request, the value
  5543. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  5544. // does not compare to {"NS":["6", "2", "1"]}.
  5545. //
  5546. // GE : Greater than or equal.
  5547. //
  5548. // AttributeValueList can contain only one AttributeValue element of type
  5549. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  5550. // element of a different type than the one provided in the request, the value
  5551. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  5552. // does not compare to {"NS":["6", "2", "1"]}.
  5553. //
  5554. // GT : Greater than.
  5555. //
  5556. // AttributeValueList can contain only one AttributeValue element of type
  5557. // String, Number, or Binary (not a set type). If an item contains an AttributeValue
  5558. // element of a different type than the one provided in the request, the value
  5559. // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
  5560. // does not compare to {"NS":["6", "2", "1"]}.
  5561. //
  5562. // NOT_NULL : The attribute exists. NOT_NULL is supported for all datatypes,
  5563. // including lists and maps.
  5564. //
  5565. // This operator tests for the existence of an attribute, not its data type.
  5566. // If the data type of attribute "a" is null, and you evaluate it using NOT_NULL,
  5567. // the result is a Boolean true. This result is because the attribute "a" exists;
  5568. // its data type is not relevant to the NOT_NULL comparison operator.
  5569. //
  5570. // NULL : The attribute does not exist. NULL is supported for all datatypes,
  5571. // including lists and maps.
  5572. //
  5573. // This operator tests for the nonexistence of an attribute, not its data
  5574. // type. If the data type of attribute "a" is null, and you evaluate it using
  5575. // NULL, the result is a Boolean false. This is because the attribute "a" exists;
  5576. // its data type is not relevant to the NULL comparison operator.
  5577. //
  5578. // CONTAINS : Checks for a subsequence, or value in a set.
  5579. //
  5580. // AttributeValueList can contain only one AttributeValue element of type
  5581. // String, Number, or Binary (not a set type). If the target attribute of the
  5582. // comparison is of type String, then the operator checks for a substring match.
  5583. // If the target attribute of the comparison is of type Binary, then the operator
  5584. // looks for a subsequence of the target that matches the input. If the target
  5585. // attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator
  5586. // evaluates to true if it finds an exact match with any member of the set.
  5587. //
  5588. // CONTAINS is supported for lists: When evaluating "a CONTAINS b", "a" can
  5589. // be a list; however, "b" cannot be a set, a map, or a list.
  5590. //
  5591. // NOT_CONTAINS : Checks for absence of a subsequence, or absence of a value
  5592. // in a set.
  5593. //
  5594. // AttributeValueList can contain only one AttributeValue element of type
  5595. // String, Number, or Binary (not a set type). If the target attribute of the
  5596. // comparison is a String, then the operator checks for the absence of a substring
  5597. // match. If the target attribute of the comparison is Binary, then the operator
  5598. // checks for the absence of a subsequence of the target that matches the input.
  5599. // If the target attribute of the comparison is a set ("SS", "NS", or "BS"),
  5600. // then the operator evaluates to true if it does not find an exact match with
  5601. // any member of the set.
  5602. //
  5603. // NOT_CONTAINS is supported for lists: When evaluating "a NOT CONTAINS b",
  5604. // "a" can be a list; however, "b" cannot be a set, a map, or a list.
  5605. //
  5606. // BEGINS_WITH : Checks for a prefix.
  5607. //
  5608. // AttributeValueList can contain only one AttributeValue of type String or
  5609. // Binary (not a Number or a set type). The target attribute of the comparison
  5610. // must be of type String or Binary (not a Number or a set type).
  5611. //
  5612. // IN : Checks for matching elements within two sets.
  5613. //
  5614. // AttributeValueList can contain one or more AttributeValue elements of type
  5615. // String, Number, or Binary (not a set type). These attributes are compared
  5616. // against an existing set type attribute of an item. If any elements of the
  5617. // input set are present in the item attribute, the expression evaluates to
  5618. // true.
  5619. //
  5620. // BETWEEN : Greater than or equal to the first value, and less than or
  5621. // equal to the second value.
  5622. //
  5623. // AttributeValueList must contain two AttributeValue elements of the same
  5624. // type, either String, Number, or Binary (not a set type). A target attribute
  5625. // matches if the target value is greater than, or equal to, the first element
  5626. // and less than, or equal to, the second element. If an item contains an AttributeValue
  5627. // element of a different type than the one provided in the request, the value
  5628. // does not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also,
  5629. // {"N":"6"} does not compare to {"NS":["6", "2", "1"]}
  5630. //
  5631. // For usage examples of AttributeValueList and ComparisonOperator, see
  5632. // Legacy Conditional Parameters (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html)
  5633. // in the Amazon DynamoDB Developer Guide.
  5634. //
  5635. // For backward compatibility with previous DynamoDB releases, the following
  5636. // parameters can be used instead of AttributeValueList and ComparisonOperator:
  5637. //
  5638. // Value - A value for DynamoDB to compare with an attribute.
  5639. //
  5640. // Exists - A Boolean value that causes DynamoDB to evaluate the value before
  5641. // attempting the conditional operation:
  5642. //
  5643. // If Exists is true, DynamoDB will check to see if that attribute value
  5644. // already exists in the table. If it is found, then the condition evaluates
  5645. // to true; otherwise the condition evaluate to false.
  5646. //
  5647. // If Exists is false, DynamoDB assumes that the attribute value does not
  5648. // exist in the table. If in fact the value does not exist, then the assumption
  5649. // is valid and the condition evaluates to true. If the value is found, despite
  5650. // the assumption that it does not exist, the condition evaluates to false.
  5651. //
  5652. // Note that the default value for Exists is true.
  5653. //
  5654. // The Value and Exists parameters are incompatible with AttributeValueList
  5655. // and ComparisonOperator. Note that if you use both sets of parameters at once,
  5656. // DynamoDB will return a ValidationException exception.
  5657. //
  5658. // This parameter does not support attributes of type List or Map.
  5659. Expected map[string]*ExpectedAttributeValue `type:"map"`
  5660. // One or more substitution tokens for attribute names in an expression. The
  5661. // following are some use cases for using ExpressionAttributeNames:
  5662. //
  5663. // To access an attribute whose name conflicts with a DynamoDB reserved word.
  5664. //
  5665. // To create a placeholder for repeating occurrences of an attribute name
  5666. // in an expression.
  5667. //
  5668. // To prevent special characters in an attribute name from being misinterpreted
  5669. // in an expression.
  5670. //
  5671. // Use the # character in an expression to dereference an attribute name.
  5672. // For example, consider the following attribute name:
  5673. //
  5674. // Percentile
  5675. //
  5676. // The name of this attribute conflicts with a reserved word, so it cannot
  5677. // be used directly in an expression. (For the complete list of reserved words,
  5678. // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
  5679. // in the Amazon DynamoDB Developer Guide). To work around this, you could specify
  5680. // the following for ExpressionAttributeNames:
  5681. //
  5682. // {"#P":"Percentile"}
  5683. //
  5684. // You could then use this substitution in an expression, as in this example:
  5685. //
  5686. // #P = :val
  5687. //
  5688. // Tokens that begin with the : character are expression attribute values,
  5689. // which are placeholders for the actual value at runtime.
  5690. //
  5691. // For more information on expression attribute names, see Accessing Item
  5692. // Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
  5693. // in the Amazon DynamoDB Developer Guide.
  5694. ExpressionAttributeNames map[string]*string `type:"map"`
  5695. // One or more values that can be substituted in an expression.
  5696. //
  5697. // Use the : (colon) character in an expression to dereference an attribute
  5698. // value. For example, suppose that you wanted to check whether the value of
  5699. // the ProductStatus attribute was one of the following:
  5700. //
  5701. // Available | Backordered | Discontinued
  5702. //
  5703. // You would first need to specify ExpressionAttributeValues as follows:
  5704. //
  5705. // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"}
  5706. // }
  5707. //
  5708. // You could then use these values in an expression, such as this:
  5709. //
  5710. // ProductStatus IN (:avail, :back, :disc)
  5711. //
  5712. // For more information on expression attribute values, see Specifying Conditions
  5713. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
  5714. // in the Amazon DynamoDB Developer Guide.
  5715. ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
  5716. // The primary key of the item to be updated. Each element consists of an attribute
  5717. // name and a value for that attribute.
  5718. //
  5719. // For the primary key, you must provide all of the attributes. For example,
  5720. // with a simple primary key, you only need to provide a value for the partition
  5721. // key. For a composite primary key, you must provide values for both the partition
  5722. // key and the sort key.
  5723. Key map[string]*AttributeValue `type:"map" required:"true"`
  5724. // Determines the level of detail about provisioned throughput consumption that
  5725. // is returned in the response:
  5726. //
  5727. // INDEXES - The response includes the aggregate ConsumedCapacity for the
  5728. // operation, together with ConsumedCapacity for each table and secondary index
  5729. // that was accessed.
  5730. //
  5731. // Note that some operations, such as GetItem and BatchGetItem, do not access
  5732. // any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity
  5733. // information for table(s).
  5734. //
  5735. // TOTAL - The response includes only the aggregate ConsumedCapacity for
  5736. // the operation.
  5737. //
  5738. // NONE - No ConsumedCapacity details are included in the response.
  5739. ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
  5740. // Determines whether item collection metrics are returned. If set to SIZE,
  5741. // the response includes statistics about item collections, if any, that were
  5742. // modified during the operation are returned in the response. If set to NONE
  5743. // (the default), no statistics are returned.
  5744. ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"`
  5745. // Use ReturnValues if you want to get the item attributes as they appeared
  5746. // either before or after they were updated. For UpdateItem, the valid values
  5747. // are:
  5748. //
  5749. // NONE - If ReturnValues is not specified, or if its value is NONE, then
  5750. // nothing is returned. (This setting is the default for ReturnValues.)
  5751. //
  5752. // ALL_OLD - If UpdateItem overwrote an attribute name-value pair, then
  5753. // the content of the old item is returned.
  5754. //
  5755. // UPDATED_OLD - The old versions of only the updated attributes are returned.
  5756. //
  5757. // ALL_NEW - All of the attributes of the new version of the item are returned.
  5758. //
  5759. // UPDATED_NEW - The new versions of only the updated attributes are returned.
  5760. //
  5761. // There is no additional cost associated with requesting a return value
  5762. // aside from the small network and processing overhead of receiving a larger
  5763. // response. No Read Capacity Units are consumed.
  5764. //
  5765. // Values returned are strongly consistent
  5766. ReturnValues *string `type:"string" enum:"ReturnValue"`
  5767. // The name of the table containing the item to update.
  5768. TableName *string `min:"3" type:"string" required:"true"`
  5769. // An expression that defines one or more attributes to be updated, the action
  5770. // to be performed on them, and new value(s) for them.
  5771. //
  5772. // The following action values are available for UpdateExpression.
  5773. //
  5774. // SET - Adds one or more attributes and values to an item. If any of these
  5775. // attribute already exist, they are replaced by the new values. You can also
  5776. // use SET to add or subtract from an attribute that is of type Number. For
  5777. // example: SET myNum = myNum + :val
  5778. //
  5779. // SET supports the following functions:
  5780. //
  5781. // if_not_exists (path, operand) - if the item does not contain an attribute
  5782. // at the specified path, then if_not_exists evaluates to operand; otherwise,
  5783. // it evaluates to path. You can use this function to avoid overwriting an attribute
  5784. // that may already be present in the item.
  5785. //
  5786. // list_append (operand, operand) - evaluates to a list with a new element
  5787. // added to it. You can append the new element to the start or the end of the
  5788. // list by reversing the order of the operands.
  5789. //
  5790. // These function names are case-sensitive.
  5791. //
  5792. // REMOVE - Removes one or more attributes from an item.
  5793. //
  5794. // ADD - Adds the specified value to the item, if the attribute does not
  5795. // already exist. If the attribute does exist, then the behavior of ADD depends
  5796. // on the data type of the attribute:
  5797. //
  5798. // If the existing attribute is a number, and if Value is also a number,
  5799. // then Value is mathematically added to the existing attribute. If Value is
  5800. // a negative number, then it is subtracted from the existing attribute.
  5801. //
  5802. // If you use ADD to increment or decrement a number value for an item that
  5803. // doesn't exist before the update, DynamoDB uses 0 as the initial value.
  5804. //
  5805. // Similarly, if you use ADD for an existing item to increment or decrement
  5806. // an attribute value that doesn't exist before the update, DynamoDB uses 0
  5807. // as the initial value. For example, suppose that the item you want to update
  5808. // doesn't have an attribute named itemcount, but you decide to ADD the number
  5809. // 3 to this attribute anyway. DynamoDB will create the itemcount attribute,
  5810. // set its initial value to 0, and finally add 3 to it. The result will be a
  5811. // new itemcount attribute in the item, with a value of 3.
  5812. //
  5813. // If the existing data type is a set and if Value is also a set, then Value
  5814. // is added to the existing set. For example, if the attribute value is the
  5815. // set [1,2], and the ADD action specified [3], then the final attribute value
  5816. // is [1,2,3]. An error occurs if an ADD action is specified for a set attribute
  5817. // and the attribute type specified does not match the existing set type.
  5818. //
  5819. // Both sets must have the same primitive data type. For example, if the existing
  5820. // data type is a set of strings, the Value must also be a set of strings.
  5821. //
  5822. // The ADD action only supports Number and set data types. In addition,
  5823. // ADD can only be used on top-level attributes, not nested attributes.
  5824. //
  5825. // DELETE - Deletes an element from a set.
  5826. //
  5827. // If a set of values is specified, then those values are subtracted from the
  5828. // old set. For example, if the attribute value was the set [a,b,c] and the
  5829. // DELETE action specifies [a,c], then the final attribute value is [b]. Specifying
  5830. // an empty set is an error.
  5831. //
  5832. // The DELETE action only supports set data types. In addition, DELETE can
  5833. // only be used on top-level attributes, not nested attributes.
  5834. //
  5835. // You can have many actions in a single expression, such as the following:
  5836. // SET a=:value1, b=:value2 DELETE :value3, :value4, :value5
  5837. //
  5838. // For more information on update expressions, see Modifying Items and Attributes
  5839. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html)
  5840. // in the Amazon DynamoDB Developer Guide.
  5841. //
  5842. // UpdateExpression replaces the legacy AttributeUpdates parameter.
  5843. UpdateExpression *string `type:"string"`
  5844. }
  5845. // String returns the string representation
  5846. func (s UpdateItemInput) String() string {
  5847. return awsutil.Prettify(s)
  5848. }
  5849. // GoString returns the string representation
  5850. func (s UpdateItemInput) GoString() string {
  5851. return s.String()
  5852. }
  5853. // Validate inspects the fields of the type to determine if they are valid.
  5854. func (s *UpdateItemInput) Validate() error {
  5855. invalidParams := request.ErrInvalidParams{Context: "UpdateItemInput"}
  5856. if s.Key == nil {
  5857. invalidParams.Add(request.NewErrParamRequired("Key"))
  5858. }
  5859. if s.TableName == nil {
  5860. invalidParams.Add(request.NewErrParamRequired("TableName"))
  5861. }
  5862. if s.TableName != nil && len(*s.TableName) < 3 {
  5863. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  5864. }
  5865. if invalidParams.Len() > 0 {
  5866. return invalidParams
  5867. }
  5868. return nil
  5869. }
  5870. // Represents the output of an UpdateItem operation.
  5871. type UpdateItemOutput struct {
  5872. _ struct{} `type:"structure"`
  5873. // A map of attribute values as they appeared before the UpdateItem operation.
  5874. // This map only appears if ReturnValues was specified as something other than
  5875. // NONE in the request. Each element represents one attribute.
  5876. Attributes map[string]*AttributeValue `type:"map"`
  5877. // The capacity units consumed by an operation. The data returned includes the
  5878. // total provisioned throughput consumed, along with statistics for the table
  5879. // and any indexes involved in the operation. ConsumedCapacity is only returned
  5880. // if the request asked for it. For more information, see Provisioned Throughput
  5881. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
  5882. // in the Amazon DynamoDB Developer Guide.
  5883. ConsumedCapacity *ConsumedCapacity `type:"structure"`
  5884. // Information about item collections, if any, that were affected by the operation.
  5885. // ItemCollectionMetrics is only returned if the request asked for it. If the
  5886. // table does not have any local secondary indexes, this information is not
  5887. // returned in the response.
  5888. ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"`
  5889. }
  5890. // String returns the string representation
  5891. func (s UpdateItemOutput) String() string {
  5892. return awsutil.Prettify(s)
  5893. }
  5894. // GoString returns the string representation
  5895. func (s UpdateItemOutput) GoString() string {
  5896. return s.String()
  5897. }
  5898. // Represents the input of an UpdateTable operation.
  5899. type UpdateTableInput struct {
  5900. _ struct{} `type:"structure"`
  5901. // An array of attributes that describe the key schema for the table and indexes.
  5902. // If you are adding a new global secondary index to the table, AttributeDefinitions
  5903. // must include the key element(s) of the new index.
  5904. AttributeDefinitions []*AttributeDefinition `type:"list"`
  5905. // An array of one or more global secondary indexes for the table. For each
  5906. // index in the array, you can request one action:
  5907. //
  5908. // Create - add a new global secondary index to the table.
  5909. //
  5910. // Update - modify the provisioned throughput settings of an existing global
  5911. // secondary index.
  5912. //
  5913. // Delete - remove a global secondary index from the table.
  5914. //
  5915. // For more information, see Managing Global Secondary Indexes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html)
  5916. // in the Amazon DynamoDB Developer Guide.
  5917. GlobalSecondaryIndexUpdates []*GlobalSecondaryIndexUpdate `type:"list"`
  5918. // Represents the provisioned throughput settings for a specified table or index.
  5919. // The settings can be modified using the UpdateTable operation.
  5920. //
  5921. // For current minimum and maximum provisioned throughput values, see Limits
  5922. // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
  5923. // in the Amazon DynamoDB Developer Guide.
  5924. ProvisionedThroughput *ProvisionedThroughput `type:"structure"`
  5925. // Represents the DynamoDB Streams configuration for the table.
  5926. //
  5927. // You will receive a ResourceInUseException if you attempt to enable a stream
  5928. // on a table that already has a stream, or if you attempt to disable a stream
  5929. // on a table which does not have a stream.
  5930. StreamSpecification *StreamSpecification `type:"structure"`
  5931. // The name of the table to be updated.
  5932. TableName *string `min:"3" type:"string" required:"true"`
  5933. }
  5934. // String returns the string representation
  5935. func (s UpdateTableInput) String() string {
  5936. return awsutil.Prettify(s)
  5937. }
  5938. // GoString returns the string representation
  5939. func (s UpdateTableInput) GoString() string {
  5940. return s.String()
  5941. }
  5942. // Validate inspects the fields of the type to determine if they are valid.
  5943. func (s *UpdateTableInput) Validate() error {
  5944. invalidParams := request.ErrInvalidParams{Context: "UpdateTableInput"}
  5945. if s.TableName == nil {
  5946. invalidParams.Add(request.NewErrParamRequired("TableName"))
  5947. }
  5948. if s.TableName != nil && len(*s.TableName) < 3 {
  5949. invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
  5950. }
  5951. if s.AttributeDefinitions != nil {
  5952. for i, v := range s.AttributeDefinitions {
  5953. if v == nil {
  5954. continue
  5955. }
  5956. if err := v.Validate(); err != nil {
  5957. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AttributeDefinitions", i), err.(request.ErrInvalidParams))
  5958. }
  5959. }
  5960. }
  5961. if s.GlobalSecondaryIndexUpdates != nil {
  5962. for i, v := range s.GlobalSecondaryIndexUpdates {
  5963. if v == nil {
  5964. continue
  5965. }
  5966. if err := v.Validate(); err != nil {
  5967. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexUpdates", i), err.(request.ErrInvalidParams))
  5968. }
  5969. }
  5970. }
  5971. if s.ProvisionedThroughput != nil {
  5972. if err := s.ProvisionedThroughput.Validate(); err != nil {
  5973. invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
  5974. }
  5975. }
  5976. if invalidParams.Len() > 0 {
  5977. return invalidParams
  5978. }
  5979. return nil
  5980. }
  5981. // Represents the output of an UpdateTable operation.
  5982. type UpdateTableOutput struct {
  5983. _ struct{} `type:"structure"`
  5984. // Represents the properties of a table.
  5985. TableDescription *TableDescription `type:"structure"`
  5986. }
  5987. // String returns the string representation
  5988. func (s UpdateTableOutput) String() string {
  5989. return awsutil.Prettify(s)
  5990. }
  5991. // GoString returns the string representation
  5992. func (s UpdateTableOutput) GoString() string {
  5993. return s.String()
  5994. }
  5995. // Represents an operation to perform - either DeleteItem or PutItem. You can
  5996. // only request one of these operations, not both, in a single WriteRequest.
  5997. // If you do need to perform both of these operations, you will need to provide
  5998. // two separate WriteRequest objects.
  5999. type WriteRequest struct {
  6000. _ struct{} `type:"structure"`
  6001. // A request to perform a DeleteItem operation.
  6002. DeleteRequest *DeleteRequest `type:"structure"`
  6003. // A request to perform a PutItem operation.
  6004. PutRequest *PutRequest `type:"structure"`
  6005. }
  6006. // String returns the string representation
  6007. func (s WriteRequest) String() string {
  6008. return awsutil.Prettify(s)
  6009. }
  6010. // GoString returns the string representation
  6011. func (s WriteRequest) GoString() string {
  6012. return s.String()
  6013. }
  6014. const (
  6015. // @enum AttributeAction
  6016. AttributeActionAdd = "ADD"
  6017. // @enum AttributeAction
  6018. AttributeActionPut = "PUT"
  6019. // @enum AttributeAction
  6020. AttributeActionDelete = "DELETE"
  6021. )
  6022. const (
  6023. // @enum ComparisonOperator
  6024. ComparisonOperatorEq = "EQ"
  6025. // @enum ComparisonOperator
  6026. ComparisonOperatorNe = "NE"
  6027. // @enum ComparisonOperator
  6028. ComparisonOperatorIn = "IN"
  6029. // @enum ComparisonOperator
  6030. ComparisonOperatorLe = "LE"
  6031. // @enum ComparisonOperator
  6032. ComparisonOperatorLt = "LT"
  6033. // @enum ComparisonOperator
  6034. ComparisonOperatorGe = "GE"
  6035. // @enum ComparisonOperator
  6036. ComparisonOperatorGt = "GT"
  6037. // @enum ComparisonOperator
  6038. ComparisonOperatorBetween = "BETWEEN"
  6039. // @enum ComparisonOperator
  6040. ComparisonOperatorNotNull = "NOT_NULL"
  6041. // @enum ComparisonOperator
  6042. ComparisonOperatorNull = "NULL"
  6043. // @enum ComparisonOperator
  6044. ComparisonOperatorContains = "CONTAINS"
  6045. // @enum ComparisonOperator
  6046. ComparisonOperatorNotContains = "NOT_CONTAINS"
  6047. // @enum ComparisonOperator
  6048. ComparisonOperatorBeginsWith = "BEGINS_WITH"
  6049. )
  6050. const (
  6051. // @enum ConditionalOperator
  6052. ConditionalOperatorAnd = "AND"
  6053. // @enum ConditionalOperator
  6054. ConditionalOperatorOr = "OR"
  6055. )
  6056. const (
  6057. // @enum IndexStatus
  6058. IndexStatusCreating = "CREATING"
  6059. // @enum IndexStatus
  6060. IndexStatusUpdating = "UPDATING"
  6061. // @enum IndexStatus
  6062. IndexStatusDeleting = "DELETING"
  6063. // @enum IndexStatus
  6064. IndexStatusActive = "ACTIVE"
  6065. )
  6066. const (
  6067. // @enum KeyType
  6068. KeyTypeHash = "HASH"
  6069. // @enum KeyType
  6070. KeyTypeRange = "RANGE"
  6071. )
  6072. const (
  6073. // @enum ProjectionType
  6074. ProjectionTypeAll = "ALL"
  6075. // @enum ProjectionType
  6076. ProjectionTypeKeysOnly = "KEYS_ONLY"
  6077. // @enum ProjectionType
  6078. ProjectionTypeInclude = "INCLUDE"
  6079. )
  6080. // Determines the level of detail about provisioned throughput consumption that
  6081. // is returned in the response:
  6082. //
  6083. // INDEXES - The response includes the aggregate ConsumedCapacity for the
  6084. // operation, together with ConsumedCapacity for each table and secondary index
  6085. // that was accessed.
  6086. //
  6087. // Note that some operations, such as GetItem and BatchGetItem, do not access
  6088. // any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity
  6089. // information for table(s).
  6090. //
  6091. // TOTAL - The response includes only the aggregate ConsumedCapacity for
  6092. // the operation.
  6093. //
  6094. // NONE - No ConsumedCapacity details are included in the response.
  6095. const (
  6096. // @enum ReturnConsumedCapacity
  6097. ReturnConsumedCapacityIndexes = "INDEXES"
  6098. // @enum ReturnConsumedCapacity
  6099. ReturnConsumedCapacityTotal = "TOTAL"
  6100. // @enum ReturnConsumedCapacity
  6101. ReturnConsumedCapacityNone = "NONE"
  6102. )
  6103. const (
  6104. // @enum ReturnItemCollectionMetrics
  6105. ReturnItemCollectionMetricsSize = "SIZE"
  6106. // @enum ReturnItemCollectionMetrics
  6107. ReturnItemCollectionMetricsNone = "NONE"
  6108. )
  6109. const (
  6110. // @enum ReturnValue
  6111. ReturnValueNone = "NONE"
  6112. // @enum ReturnValue
  6113. ReturnValueAllOld = "ALL_OLD"
  6114. // @enum ReturnValue
  6115. ReturnValueUpdatedOld = "UPDATED_OLD"
  6116. // @enum ReturnValue
  6117. ReturnValueAllNew = "ALL_NEW"
  6118. // @enum ReturnValue
  6119. ReturnValueUpdatedNew = "UPDATED_NEW"
  6120. )
  6121. const (
  6122. // @enum ScalarAttributeType
  6123. ScalarAttributeTypeS = "S"
  6124. // @enum ScalarAttributeType
  6125. ScalarAttributeTypeN = "N"
  6126. // @enum ScalarAttributeType
  6127. ScalarAttributeTypeB = "B"
  6128. )
  6129. const (
  6130. // @enum Select
  6131. SelectAllAttributes = "ALL_ATTRIBUTES"
  6132. // @enum Select
  6133. SelectAllProjectedAttributes = "ALL_PROJECTED_ATTRIBUTES"
  6134. // @enum Select
  6135. SelectSpecificAttributes = "SPECIFIC_ATTRIBUTES"
  6136. // @enum Select
  6137. SelectCount = "COUNT"
  6138. )
  6139. const (
  6140. // @enum StreamViewType
  6141. StreamViewTypeNewImage = "NEW_IMAGE"
  6142. // @enum StreamViewType
  6143. StreamViewTypeOldImage = "OLD_IMAGE"
  6144. // @enum StreamViewType
  6145. StreamViewTypeNewAndOldImages = "NEW_AND_OLD_IMAGES"
  6146. // @enum StreamViewType
  6147. StreamViewTypeKeysOnly = "KEYS_ONLY"
  6148. )
  6149. const (
  6150. // @enum TableStatus
  6151. TableStatusCreating = "CREATING"
  6152. // @enum TableStatus
  6153. TableStatusUpdating = "UPDATING"
  6154. // @enum TableStatus
  6155. TableStatusDeleting = "DELETING"
  6156. // @enum TableStatus
  6157. TableStatusActive = "ACTIVE"
  6158. )