api.go 272 KB

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