serializers.go 450 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698
  1. // Code generated by smithy-go-codegen DO NOT EDIT.
  2. package s3
  3. import (
  4. "bytes"
  5. "context"
  6. "fmt"
  7. "github.com/aws/aws-sdk-go-v2/service/s3/types"
  8. smithy "github.com/aws/smithy-go"
  9. "github.com/aws/smithy-go/encoding/httpbinding"
  10. smithyxml "github.com/aws/smithy-go/encoding/xml"
  11. "github.com/aws/smithy-go/middleware"
  12. smithytime "github.com/aws/smithy-go/time"
  13. "github.com/aws/smithy-go/tracing"
  14. smithyhttp "github.com/aws/smithy-go/transport/http"
  15. "net/http"
  16. "strconv"
  17. "strings"
  18. )
  19. type awsRestxml_serializeOpAbortMultipartUpload struct {
  20. }
  21. func (*awsRestxml_serializeOpAbortMultipartUpload) ID() string {
  22. return "OperationSerializer"
  23. }
  24. func (m *awsRestxml_serializeOpAbortMultipartUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  25. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  26. ) {
  27. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  28. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  29. defer endTimer()
  30. defer span.End()
  31. request, ok := in.Request.(*smithyhttp.Request)
  32. if !ok {
  33. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  34. }
  35. input, ok := in.Parameters.(*AbortMultipartUploadInput)
  36. _ = input
  37. if !ok {
  38. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  39. }
  40. opPath, opQuery := httpbinding.SplitURI("/{Key+}?x-id=AbortMultipartUpload")
  41. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  42. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  43. request.Method = "DELETE"
  44. var restEncoder *httpbinding.Encoder
  45. if request.URL.RawPath == "" {
  46. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  47. } else {
  48. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  49. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  50. }
  51. if err != nil {
  52. return out, metadata, &smithy.SerializationError{Err: err}
  53. }
  54. if err := awsRestxml_serializeOpHttpBindingsAbortMultipartUploadInput(input, restEncoder); err != nil {
  55. return out, metadata, &smithy.SerializationError{Err: err}
  56. }
  57. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  58. return out, metadata, &smithy.SerializationError{Err: err}
  59. }
  60. in.Request = request
  61. endTimer()
  62. span.End()
  63. return next.HandleSerialize(ctx, in)
  64. }
  65. func awsRestxml_serializeOpHttpBindingsAbortMultipartUploadInput(v *AbortMultipartUploadInput, encoder *httpbinding.Encoder) error {
  66. if v == nil {
  67. return fmt.Errorf("unsupported serialization of nil %T", v)
  68. }
  69. if v.ExpectedBucketOwner != nil {
  70. locationName := "X-Amz-Expected-Bucket-Owner"
  71. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  72. }
  73. if v.IfMatchInitiatedTime != nil {
  74. locationName := "X-Amz-If-Match-Initiated-Time"
  75. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfMatchInitiatedTime))
  76. }
  77. if v.Key == nil || len(*v.Key) == 0 {
  78. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  79. }
  80. if v.Key != nil {
  81. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  82. return err
  83. }
  84. }
  85. if len(v.RequestPayer) > 0 {
  86. locationName := "X-Amz-Request-Payer"
  87. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  88. }
  89. if v.UploadId != nil {
  90. encoder.SetQuery("uploadId").String(*v.UploadId)
  91. }
  92. return nil
  93. }
  94. type awsRestxml_serializeOpCompleteMultipartUpload struct {
  95. }
  96. func (*awsRestxml_serializeOpCompleteMultipartUpload) ID() string {
  97. return "OperationSerializer"
  98. }
  99. func (m *awsRestxml_serializeOpCompleteMultipartUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  100. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  101. ) {
  102. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  103. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  104. defer endTimer()
  105. defer span.End()
  106. request, ok := in.Request.(*smithyhttp.Request)
  107. if !ok {
  108. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  109. }
  110. input, ok := in.Parameters.(*CompleteMultipartUploadInput)
  111. _ = input
  112. if !ok {
  113. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  114. }
  115. opPath, opQuery := httpbinding.SplitURI("/{Key+}")
  116. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  117. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  118. request.Method = "POST"
  119. var restEncoder *httpbinding.Encoder
  120. if request.URL.RawPath == "" {
  121. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  122. } else {
  123. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  124. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  125. }
  126. if err != nil {
  127. return out, metadata, &smithy.SerializationError{Err: err}
  128. }
  129. if err := awsRestxml_serializeOpHttpBindingsCompleteMultipartUploadInput(input, restEncoder); err != nil {
  130. return out, metadata, &smithy.SerializationError{Err: err}
  131. }
  132. if input.MultipartUpload != nil {
  133. if !restEncoder.HasHeader("Content-Type") {
  134. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  135. restEncoder.SetHeader("Content-Type").String("application/xml")
  136. }
  137. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  138. payloadRootAttr := []smithyxml.Attr{}
  139. payloadRoot := smithyxml.StartElement{
  140. Name: smithyxml.Name{
  141. Local: "CompleteMultipartUpload",
  142. },
  143. Attr: payloadRootAttr,
  144. }
  145. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  146. if err := awsRestxml_serializeDocumentCompletedMultipartUpload(input.MultipartUpload, xmlEncoder.RootElement(payloadRoot)); err != nil {
  147. return out, metadata, &smithy.SerializationError{Err: err}
  148. }
  149. payload := bytes.NewReader(xmlEncoder.Bytes())
  150. if request, err = request.SetStream(payload); err != nil {
  151. return out, metadata, &smithy.SerializationError{Err: err}
  152. }
  153. }
  154. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  155. return out, metadata, &smithy.SerializationError{Err: err}
  156. }
  157. in.Request = request
  158. endTimer()
  159. span.End()
  160. return next.HandleSerialize(ctx, in)
  161. }
  162. func awsRestxml_serializeOpHttpBindingsCompleteMultipartUploadInput(v *CompleteMultipartUploadInput, encoder *httpbinding.Encoder) error {
  163. if v == nil {
  164. return fmt.Errorf("unsupported serialization of nil %T", v)
  165. }
  166. if v.ChecksumCRC32 != nil {
  167. locationName := "X-Amz-Checksum-Crc32"
  168. encoder.SetHeader(locationName).String(*v.ChecksumCRC32)
  169. }
  170. if v.ChecksumCRC32C != nil {
  171. locationName := "X-Amz-Checksum-Crc32c"
  172. encoder.SetHeader(locationName).String(*v.ChecksumCRC32C)
  173. }
  174. if v.ChecksumCRC64NVME != nil {
  175. locationName := "X-Amz-Checksum-Crc64nvme"
  176. encoder.SetHeader(locationName).String(*v.ChecksumCRC64NVME)
  177. }
  178. if v.ChecksumSHA1 != nil {
  179. locationName := "X-Amz-Checksum-Sha1"
  180. encoder.SetHeader(locationName).String(*v.ChecksumSHA1)
  181. }
  182. if v.ChecksumSHA256 != nil {
  183. locationName := "X-Amz-Checksum-Sha256"
  184. encoder.SetHeader(locationName).String(*v.ChecksumSHA256)
  185. }
  186. if len(v.ChecksumType) > 0 {
  187. locationName := "X-Amz-Checksum-Type"
  188. encoder.SetHeader(locationName).String(string(v.ChecksumType))
  189. }
  190. if v.ExpectedBucketOwner != nil {
  191. locationName := "X-Amz-Expected-Bucket-Owner"
  192. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  193. }
  194. if v.IfMatch != nil {
  195. locationName := "If-Match"
  196. encoder.SetHeader(locationName).String(*v.IfMatch)
  197. }
  198. if v.IfNoneMatch != nil {
  199. locationName := "If-None-Match"
  200. encoder.SetHeader(locationName).String(*v.IfNoneMatch)
  201. }
  202. if v.Key == nil || len(*v.Key) == 0 {
  203. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  204. }
  205. if v.Key != nil {
  206. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  207. return err
  208. }
  209. }
  210. if v.MpuObjectSize != nil {
  211. locationName := "X-Amz-Mp-Object-Size"
  212. encoder.SetHeader(locationName).Long(*v.MpuObjectSize)
  213. }
  214. if len(v.RequestPayer) > 0 {
  215. locationName := "X-Amz-Request-Payer"
  216. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  217. }
  218. if v.SSECustomerAlgorithm != nil {
  219. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  220. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  221. }
  222. if v.SSECustomerKey != nil {
  223. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  224. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  225. }
  226. if v.SSECustomerKeyMD5 != nil {
  227. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  228. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  229. }
  230. if v.UploadId != nil {
  231. encoder.SetQuery("uploadId").String(*v.UploadId)
  232. }
  233. return nil
  234. }
  235. type awsRestxml_serializeOpCopyObject struct {
  236. }
  237. func (*awsRestxml_serializeOpCopyObject) ID() string {
  238. return "OperationSerializer"
  239. }
  240. func (m *awsRestxml_serializeOpCopyObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  241. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  242. ) {
  243. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  244. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  245. defer endTimer()
  246. defer span.End()
  247. request, ok := in.Request.(*smithyhttp.Request)
  248. if !ok {
  249. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  250. }
  251. input, ok := in.Parameters.(*CopyObjectInput)
  252. _ = input
  253. if !ok {
  254. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  255. }
  256. opPath, opQuery := httpbinding.SplitURI("/{Key+}?x-id=CopyObject")
  257. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  258. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  259. request.Method = "PUT"
  260. var restEncoder *httpbinding.Encoder
  261. if request.URL.RawPath == "" {
  262. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  263. } else {
  264. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  265. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  266. }
  267. if err != nil {
  268. return out, metadata, &smithy.SerializationError{Err: err}
  269. }
  270. if err := awsRestxml_serializeOpHttpBindingsCopyObjectInput(input, restEncoder); err != nil {
  271. return out, metadata, &smithy.SerializationError{Err: err}
  272. }
  273. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  274. return out, metadata, &smithy.SerializationError{Err: err}
  275. }
  276. in.Request = request
  277. endTimer()
  278. span.End()
  279. return next.HandleSerialize(ctx, in)
  280. }
  281. func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encoder *httpbinding.Encoder) error {
  282. if v == nil {
  283. return fmt.Errorf("unsupported serialization of nil %T", v)
  284. }
  285. if len(v.ACL) > 0 {
  286. locationName := "X-Amz-Acl"
  287. encoder.SetHeader(locationName).String(string(v.ACL))
  288. }
  289. if v.BucketKeyEnabled != nil {
  290. locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled"
  291. encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled)
  292. }
  293. if v.CacheControl != nil {
  294. locationName := "Cache-Control"
  295. encoder.SetHeader(locationName).String(*v.CacheControl)
  296. }
  297. if len(v.ChecksumAlgorithm) > 0 {
  298. locationName := "X-Amz-Checksum-Algorithm"
  299. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  300. }
  301. if v.ContentDisposition != nil {
  302. locationName := "Content-Disposition"
  303. encoder.SetHeader(locationName).String(*v.ContentDisposition)
  304. }
  305. if v.ContentEncoding != nil {
  306. locationName := "Content-Encoding"
  307. encoder.SetHeader(locationName).String(*v.ContentEncoding)
  308. }
  309. if v.ContentLanguage != nil {
  310. locationName := "Content-Language"
  311. encoder.SetHeader(locationName).String(*v.ContentLanguage)
  312. }
  313. if v.ContentType != nil {
  314. locationName := "Content-Type"
  315. encoder.SetHeader(locationName).String(*v.ContentType)
  316. }
  317. if v.CopySource != nil {
  318. locationName := "X-Amz-Copy-Source"
  319. encoder.SetHeader(locationName).String(*v.CopySource)
  320. }
  321. if v.CopySourceIfMatch != nil {
  322. locationName := "X-Amz-Copy-Source-If-Match"
  323. encoder.SetHeader(locationName).String(*v.CopySourceIfMatch)
  324. }
  325. if v.CopySourceIfModifiedSince != nil {
  326. locationName := "X-Amz-Copy-Source-If-Modified-Since"
  327. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfModifiedSince))
  328. }
  329. if v.CopySourceIfNoneMatch != nil {
  330. locationName := "X-Amz-Copy-Source-If-None-Match"
  331. encoder.SetHeader(locationName).String(*v.CopySourceIfNoneMatch)
  332. }
  333. if v.CopySourceIfUnmodifiedSince != nil {
  334. locationName := "X-Amz-Copy-Source-If-Unmodified-Since"
  335. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfUnmodifiedSince))
  336. }
  337. if v.CopySourceSSECustomerAlgorithm != nil {
  338. locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm"
  339. encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerAlgorithm)
  340. }
  341. if v.CopySourceSSECustomerKey != nil {
  342. locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key"
  343. encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKey)
  344. }
  345. if v.CopySourceSSECustomerKeyMD5 != nil {
  346. locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5"
  347. encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKeyMD5)
  348. }
  349. if v.ExpectedBucketOwner != nil {
  350. locationName := "X-Amz-Expected-Bucket-Owner"
  351. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  352. }
  353. if v.ExpectedSourceBucketOwner != nil {
  354. locationName := "X-Amz-Source-Expected-Bucket-Owner"
  355. encoder.SetHeader(locationName).String(*v.ExpectedSourceBucketOwner)
  356. }
  357. if v.Expires != nil {
  358. locationName := "Expires"
  359. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires))
  360. }
  361. if v.GrantFullControl != nil {
  362. locationName := "X-Amz-Grant-Full-Control"
  363. encoder.SetHeader(locationName).String(*v.GrantFullControl)
  364. }
  365. if v.GrantRead != nil {
  366. locationName := "X-Amz-Grant-Read"
  367. encoder.SetHeader(locationName).String(*v.GrantRead)
  368. }
  369. if v.GrantReadACP != nil {
  370. locationName := "X-Amz-Grant-Read-Acp"
  371. encoder.SetHeader(locationName).String(*v.GrantReadACP)
  372. }
  373. if v.GrantWriteACP != nil {
  374. locationName := "X-Amz-Grant-Write-Acp"
  375. encoder.SetHeader(locationName).String(*v.GrantWriteACP)
  376. }
  377. if v.Key == nil || len(*v.Key) == 0 {
  378. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  379. }
  380. if v.Key != nil {
  381. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  382. return err
  383. }
  384. }
  385. if v.Metadata != nil {
  386. hv := encoder.Headers("X-Amz-Meta-")
  387. for mapKey, mapVal := range v.Metadata {
  388. hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal)
  389. }
  390. }
  391. if len(v.MetadataDirective) > 0 {
  392. locationName := "X-Amz-Metadata-Directive"
  393. encoder.SetHeader(locationName).String(string(v.MetadataDirective))
  394. }
  395. if len(v.ObjectLockLegalHoldStatus) > 0 {
  396. locationName := "X-Amz-Object-Lock-Legal-Hold"
  397. encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus))
  398. }
  399. if len(v.ObjectLockMode) > 0 {
  400. locationName := "X-Amz-Object-Lock-Mode"
  401. encoder.SetHeader(locationName).String(string(v.ObjectLockMode))
  402. }
  403. if v.ObjectLockRetainUntilDate != nil {
  404. locationName := "X-Amz-Object-Lock-Retain-Until-Date"
  405. encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.ObjectLockRetainUntilDate))
  406. }
  407. if len(v.RequestPayer) > 0 {
  408. locationName := "X-Amz-Request-Payer"
  409. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  410. }
  411. if len(v.ServerSideEncryption) > 0 {
  412. locationName := "X-Amz-Server-Side-Encryption"
  413. encoder.SetHeader(locationName).String(string(v.ServerSideEncryption))
  414. }
  415. if v.SSECustomerAlgorithm != nil {
  416. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  417. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  418. }
  419. if v.SSECustomerKey != nil {
  420. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  421. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  422. }
  423. if v.SSECustomerKeyMD5 != nil {
  424. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  425. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  426. }
  427. if v.SSEKMSEncryptionContext != nil {
  428. locationName := "X-Amz-Server-Side-Encryption-Context"
  429. encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext)
  430. }
  431. if v.SSEKMSKeyId != nil {
  432. locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id"
  433. encoder.SetHeader(locationName).String(*v.SSEKMSKeyId)
  434. }
  435. if len(v.StorageClass) > 0 {
  436. locationName := "X-Amz-Storage-Class"
  437. encoder.SetHeader(locationName).String(string(v.StorageClass))
  438. }
  439. if v.Tagging != nil {
  440. locationName := "X-Amz-Tagging"
  441. encoder.SetHeader(locationName).String(*v.Tagging)
  442. }
  443. if len(v.TaggingDirective) > 0 {
  444. locationName := "X-Amz-Tagging-Directive"
  445. encoder.SetHeader(locationName).String(string(v.TaggingDirective))
  446. }
  447. if v.WebsiteRedirectLocation != nil {
  448. locationName := "X-Amz-Website-Redirect-Location"
  449. encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation)
  450. }
  451. return nil
  452. }
  453. type awsRestxml_serializeOpCreateBucket struct {
  454. }
  455. func (*awsRestxml_serializeOpCreateBucket) ID() string {
  456. return "OperationSerializer"
  457. }
  458. func (m *awsRestxml_serializeOpCreateBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  459. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  460. ) {
  461. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  462. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  463. defer endTimer()
  464. defer span.End()
  465. request, ok := in.Request.(*smithyhttp.Request)
  466. if !ok {
  467. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  468. }
  469. input, ok := in.Parameters.(*CreateBucketInput)
  470. _ = input
  471. if !ok {
  472. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  473. }
  474. opPath, opQuery := httpbinding.SplitURI("/")
  475. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  476. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  477. request.Method = "PUT"
  478. var restEncoder *httpbinding.Encoder
  479. if request.URL.RawPath == "" {
  480. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  481. } else {
  482. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  483. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  484. }
  485. if err != nil {
  486. return out, metadata, &smithy.SerializationError{Err: err}
  487. }
  488. if err := awsRestxml_serializeOpHttpBindingsCreateBucketInput(input, restEncoder); err != nil {
  489. return out, metadata, &smithy.SerializationError{Err: err}
  490. }
  491. if input.CreateBucketConfiguration != nil {
  492. if !restEncoder.HasHeader("Content-Type") {
  493. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  494. restEncoder.SetHeader("Content-Type").String("application/xml")
  495. }
  496. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  497. payloadRootAttr := []smithyxml.Attr{}
  498. payloadRoot := smithyxml.StartElement{
  499. Name: smithyxml.Name{
  500. Local: "CreateBucketConfiguration",
  501. },
  502. Attr: payloadRootAttr,
  503. }
  504. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  505. if err := awsRestxml_serializeDocumentCreateBucketConfiguration(input.CreateBucketConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  506. return out, metadata, &smithy.SerializationError{Err: err}
  507. }
  508. payload := bytes.NewReader(xmlEncoder.Bytes())
  509. if request, err = request.SetStream(payload); err != nil {
  510. return out, metadata, &smithy.SerializationError{Err: err}
  511. }
  512. }
  513. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  514. return out, metadata, &smithy.SerializationError{Err: err}
  515. }
  516. in.Request = request
  517. endTimer()
  518. span.End()
  519. return next.HandleSerialize(ctx, in)
  520. }
  521. func awsRestxml_serializeOpHttpBindingsCreateBucketInput(v *CreateBucketInput, encoder *httpbinding.Encoder) error {
  522. if v == nil {
  523. return fmt.Errorf("unsupported serialization of nil %T", v)
  524. }
  525. if len(v.ACL) > 0 {
  526. locationName := "X-Amz-Acl"
  527. encoder.SetHeader(locationName).String(string(v.ACL))
  528. }
  529. if v.GrantFullControl != nil {
  530. locationName := "X-Amz-Grant-Full-Control"
  531. encoder.SetHeader(locationName).String(*v.GrantFullControl)
  532. }
  533. if v.GrantRead != nil {
  534. locationName := "X-Amz-Grant-Read"
  535. encoder.SetHeader(locationName).String(*v.GrantRead)
  536. }
  537. if v.GrantReadACP != nil {
  538. locationName := "X-Amz-Grant-Read-Acp"
  539. encoder.SetHeader(locationName).String(*v.GrantReadACP)
  540. }
  541. if v.GrantWrite != nil {
  542. locationName := "X-Amz-Grant-Write"
  543. encoder.SetHeader(locationName).String(*v.GrantWrite)
  544. }
  545. if v.GrantWriteACP != nil {
  546. locationName := "X-Amz-Grant-Write-Acp"
  547. encoder.SetHeader(locationName).String(*v.GrantWriteACP)
  548. }
  549. if v.ObjectLockEnabledForBucket != nil {
  550. locationName := "X-Amz-Bucket-Object-Lock-Enabled"
  551. encoder.SetHeader(locationName).Boolean(*v.ObjectLockEnabledForBucket)
  552. }
  553. if len(v.ObjectOwnership) > 0 {
  554. locationName := "X-Amz-Object-Ownership"
  555. encoder.SetHeader(locationName).String(string(v.ObjectOwnership))
  556. }
  557. return nil
  558. }
  559. type awsRestxml_serializeOpCreateBucketMetadataConfiguration struct {
  560. }
  561. func (*awsRestxml_serializeOpCreateBucketMetadataConfiguration) ID() string {
  562. return "OperationSerializer"
  563. }
  564. func (m *awsRestxml_serializeOpCreateBucketMetadataConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  565. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  566. ) {
  567. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  568. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  569. defer endTimer()
  570. defer span.End()
  571. request, ok := in.Request.(*smithyhttp.Request)
  572. if !ok {
  573. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  574. }
  575. input, ok := in.Parameters.(*CreateBucketMetadataConfigurationInput)
  576. _ = input
  577. if !ok {
  578. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  579. }
  580. opPath, opQuery := httpbinding.SplitURI("/?metadataConfiguration")
  581. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  582. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  583. request.Method = "POST"
  584. var restEncoder *httpbinding.Encoder
  585. if request.URL.RawPath == "" {
  586. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  587. } else {
  588. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  589. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  590. }
  591. if err != nil {
  592. return out, metadata, &smithy.SerializationError{Err: err}
  593. }
  594. if err := awsRestxml_serializeOpHttpBindingsCreateBucketMetadataConfigurationInput(input, restEncoder); err != nil {
  595. return out, metadata, &smithy.SerializationError{Err: err}
  596. }
  597. if input.MetadataConfiguration != nil {
  598. if !restEncoder.HasHeader("Content-Type") {
  599. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  600. restEncoder.SetHeader("Content-Type").String("application/xml")
  601. }
  602. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  603. payloadRootAttr := []smithyxml.Attr{}
  604. payloadRoot := smithyxml.StartElement{
  605. Name: smithyxml.Name{
  606. Local: "MetadataConfiguration",
  607. },
  608. Attr: payloadRootAttr,
  609. }
  610. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  611. if err := awsRestxml_serializeDocumentMetadataConfiguration(input.MetadataConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  612. return out, metadata, &smithy.SerializationError{Err: err}
  613. }
  614. payload := bytes.NewReader(xmlEncoder.Bytes())
  615. if request, err = request.SetStream(payload); err != nil {
  616. return out, metadata, &smithy.SerializationError{Err: err}
  617. }
  618. }
  619. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  620. return out, metadata, &smithy.SerializationError{Err: err}
  621. }
  622. in.Request = request
  623. endTimer()
  624. span.End()
  625. return next.HandleSerialize(ctx, in)
  626. }
  627. func awsRestxml_serializeOpHttpBindingsCreateBucketMetadataConfigurationInput(v *CreateBucketMetadataConfigurationInput, encoder *httpbinding.Encoder) error {
  628. if v == nil {
  629. return fmt.Errorf("unsupported serialization of nil %T", v)
  630. }
  631. if len(v.ChecksumAlgorithm) > 0 {
  632. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  633. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  634. }
  635. if v.ContentMD5 != nil {
  636. locationName := "Content-Md5"
  637. encoder.SetHeader(locationName).String(*v.ContentMD5)
  638. }
  639. if v.ExpectedBucketOwner != nil {
  640. locationName := "X-Amz-Expected-Bucket-Owner"
  641. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  642. }
  643. return nil
  644. }
  645. type awsRestxml_serializeOpCreateBucketMetadataTableConfiguration struct {
  646. }
  647. func (*awsRestxml_serializeOpCreateBucketMetadataTableConfiguration) ID() string {
  648. return "OperationSerializer"
  649. }
  650. func (m *awsRestxml_serializeOpCreateBucketMetadataTableConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  651. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  652. ) {
  653. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  654. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  655. defer endTimer()
  656. defer span.End()
  657. request, ok := in.Request.(*smithyhttp.Request)
  658. if !ok {
  659. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  660. }
  661. input, ok := in.Parameters.(*CreateBucketMetadataTableConfigurationInput)
  662. _ = input
  663. if !ok {
  664. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  665. }
  666. opPath, opQuery := httpbinding.SplitURI("/?metadataTable")
  667. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  668. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  669. request.Method = "POST"
  670. var restEncoder *httpbinding.Encoder
  671. if request.URL.RawPath == "" {
  672. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  673. } else {
  674. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  675. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  676. }
  677. if err != nil {
  678. return out, metadata, &smithy.SerializationError{Err: err}
  679. }
  680. if err := awsRestxml_serializeOpHttpBindingsCreateBucketMetadataTableConfigurationInput(input, restEncoder); err != nil {
  681. return out, metadata, &smithy.SerializationError{Err: err}
  682. }
  683. if input.MetadataTableConfiguration != nil {
  684. if !restEncoder.HasHeader("Content-Type") {
  685. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  686. restEncoder.SetHeader("Content-Type").String("application/xml")
  687. }
  688. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  689. payloadRootAttr := []smithyxml.Attr{}
  690. payloadRoot := smithyxml.StartElement{
  691. Name: smithyxml.Name{
  692. Local: "MetadataTableConfiguration",
  693. },
  694. Attr: payloadRootAttr,
  695. }
  696. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  697. if err := awsRestxml_serializeDocumentMetadataTableConfiguration(input.MetadataTableConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  698. return out, metadata, &smithy.SerializationError{Err: err}
  699. }
  700. payload := bytes.NewReader(xmlEncoder.Bytes())
  701. if request, err = request.SetStream(payload); err != nil {
  702. return out, metadata, &smithy.SerializationError{Err: err}
  703. }
  704. }
  705. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  706. return out, metadata, &smithy.SerializationError{Err: err}
  707. }
  708. in.Request = request
  709. endTimer()
  710. span.End()
  711. return next.HandleSerialize(ctx, in)
  712. }
  713. func awsRestxml_serializeOpHttpBindingsCreateBucketMetadataTableConfigurationInput(v *CreateBucketMetadataTableConfigurationInput, encoder *httpbinding.Encoder) error {
  714. if v == nil {
  715. return fmt.Errorf("unsupported serialization of nil %T", v)
  716. }
  717. if len(v.ChecksumAlgorithm) > 0 {
  718. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  719. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  720. }
  721. if v.ContentMD5 != nil {
  722. locationName := "Content-Md5"
  723. encoder.SetHeader(locationName).String(*v.ContentMD5)
  724. }
  725. if v.ExpectedBucketOwner != nil {
  726. locationName := "X-Amz-Expected-Bucket-Owner"
  727. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  728. }
  729. return nil
  730. }
  731. type awsRestxml_serializeOpCreateMultipartUpload struct {
  732. }
  733. func (*awsRestxml_serializeOpCreateMultipartUpload) ID() string {
  734. return "OperationSerializer"
  735. }
  736. func (m *awsRestxml_serializeOpCreateMultipartUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  737. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  738. ) {
  739. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  740. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  741. defer endTimer()
  742. defer span.End()
  743. request, ok := in.Request.(*smithyhttp.Request)
  744. if !ok {
  745. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  746. }
  747. input, ok := in.Parameters.(*CreateMultipartUploadInput)
  748. _ = input
  749. if !ok {
  750. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  751. }
  752. opPath, opQuery := httpbinding.SplitURI("/{Key+}?uploads")
  753. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  754. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  755. request.Method = "POST"
  756. var restEncoder *httpbinding.Encoder
  757. if request.URL.RawPath == "" {
  758. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  759. } else {
  760. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  761. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  762. }
  763. if err != nil {
  764. return out, metadata, &smithy.SerializationError{Err: err}
  765. }
  766. if err := awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(input, restEncoder); err != nil {
  767. return out, metadata, &smithy.SerializationError{Err: err}
  768. }
  769. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  770. return out, metadata, &smithy.SerializationError{Err: err}
  771. }
  772. in.Request = request
  773. endTimer()
  774. span.End()
  775. return next.HandleSerialize(ctx, in)
  776. }
  777. func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMultipartUploadInput, encoder *httpbinding.Encoder) error {
  778. if v == nil {
  779. return fmt.Errorf("unsupported serialization of nil %T", v)
  780. }
  781. if len(v.ACL) > 0 {
  782. locationName := "X-Amz-Acl"
  783. encoder.SetHeader(locationName).String(string(v.ACL))
  784. }
  785. if v.BucketKeyEnabled != nil {
  786. locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled"
  787. encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled)
  788. }
  789. if v.CacheControl != nil {
  790. locationName := "Cache-Control"
  791. encoder.SetHeader(locationName).String(*v.CacheControl)
  792. }
  793. if len(v.ChecksumAlgorithm) > 0 {
  794. locationName := "X-Amz-Checksum-Algorithm"
  795. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  796. }
  797. if len(v.ChecksumType) > 0 {
  798. locationName := "X-Amz-Checksum-Type"
  799. encoder.SetHeader(locationName).String(string(v.ChecksumType))
  800. }
  801. if v.ContentDisposition != nil {
  802. locationName := "Content-Disposition"
  803. encoder.SetHeader(locationName).String(*v.ContentDisposition)
  804. }
  805. if v.ContentEncoding != nil {
  806. locationName := "Content-Encoding"
  807. encoder.SetHeader(locationName).String(*v.ContentEncoding)
  808. }
  809. if v.ContentLanguage != nil {
  810. locationName := "Content-Language"
  811. encoder.SetHeader(locationName).String(*v.ContentLanguage)
  812. }
  813. if v.ContentType != nil {
  814. locationName := "Content-Type"
  815. encoder.SetHeader(locationName).String(*v.ContentType)
  816. }
  817. if v.ExpectedBucketOwner != nil {
  818. locationName := "X-Amz-Expected-Bucket-Owner"
  819. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  820. }
  821. if v.Expires != nil {
  822. locationName := "Expires"
  823. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires))
  824. }
  825. if v.GrantFullControl != nil {
  826. locationName := "X-Amz-Grant-Full-Control"
  827. encoder.SetHeader(locationName).String(*v.GrantFullControl)
  828. }
  829. if v.GrantRead != nil {
  830. locationName := "X-Amz-Grant-Read"
  831. encoder.SetHeader(locationName).String(*v.GrantRead)
  832. }
  833. if v.GrantReadACP != nil {
  834. locationName := "X-Amz-Grant-Read-Acp"
  835. encoder.SetHeader(locationName).String(*v.GrantReadACP)
  836. }
  837. if v.GrantWriteACP != nil {
  838. locationName := "X-Amz-Grant-Write-Acp"
  839. encoder.SetHeader(locationName).String(*v.GrantWriteACP)
  840. }
  841. if v.Key == nil || len(*v.Key) == 0 {
  842. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  843. }
  844. if v.Key != nil {
  845. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  846. return err
  847. }
  848. }
  849. if v.Metadata != nil {
  850. hv := encoder.Headers("X-Amz-Meta-")
  851. for mapKey, mapVal := range v.Metadata {
  852. hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal)
  853. }
  854. }
  855. if len(v.ObjectLockLegalHoldStatus) > 0 {
  856. locationName := "X-Amz-Object-Lock-Legal-Hold"
  857. encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus))
  858. }
  859. if len(v.ObjectLockMode) > 0 {
  860. locationName := "X-Amz-Object-Lock-Mode"
  861. encoder.SetHeader(locationName).String(string(v.ObjectLockMode))
  862. }
  863. if v.ObjectLockRetainUntilDate != nil {
  864. locationName := "X-Amz-Object-Lock-Retain-Until-Date"
  865. encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.ObjectLockRetainUntilDate))
  866. }
  867. if len(v.RequestPayer) > 0 {
  868. locationName := "X-Amz-Request-Payer"
  869. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  870. }
  871. if len(v.ServerSideEncryption) > 0 {
  872. locationName := "X-Amz-Server-Side-Encryption"
  873. encoder.SetHeader(locationName).String(string(v.ServerSideEncryption))
  874. }
  875. if v.SSECustomerAlgorithm != nil {
  876. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  877. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  878. }
  879. if v.SSECustomerKey != nil {
  880. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  881. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  882. }
  883. if v.SSECustomerKeyMD5 != nil {
  884. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  885. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  886. }
  887. if v.SSEKMSEncryptionContext != nil {
  888. locationName := "X-Amz-Server-Side-Encryption-Context"
  889. encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext)
  890. }
  891. if v.SSEKMSKeyId != nil {
  892. locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id"
  893. encoder.SetHeader(locationName).String(*v.SSEKMSKeyId)
  894. }
  895. if len(v.StorageClass) > 0 {
  896. locationName := "X-Amz-Storage-Class"
  897. encoder.SetHeader(locationName).String(string(v.StorageClass))
  898. }
  899. if v.Tagging != nil {
  900. locationName := "X-Amz-Tagging"
  901. encoder.SetHeader(locationName).String(*v.Tagging)
  902. }
  903. if v.WebsiteRedirectLocation != nil {
  904. locationName := "X-Amz-Website-Redirect-Location"
  905. encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation)
  906. }
  907. return nil
  908. }
  909. type awsRestxml_serializeOpCreateSession struct {
  910. }
  911. func (*awsRestxml_serializeOpCreateSession) ID() string {
  912. return "OperationSerializer"
  913. }
  914. func (m *awsRestxml_serializeOpCreateSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  915. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  916. ) {
  917. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  918. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  919. defer endTimer()
  920. defer span.End()
  921. request, ok := in.Request.(*smithyhttp.Request)
  922. if !ok {
  923. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  924. }
  925. input, ok := in.Parameters.(*CreateSessionInput)
  926. _ = input
  927. if !ok {
  928. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  929. }
  930. opPath, opQuery := httpbinding.SplitURI("/?session")
  931. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  932. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  933. request.Method = "GET"
  934. var restEncoder *httpbinding.Encoder
  935. if request.URL.RawPath == "" {
  936. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  937. } else {
  938. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  939. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  940. }
  941. if err != nil {
  942. return out, metadata, &smithy.SerializationError{Err: err}
  943. }
  944. if err := awsRestxml_serializeOpHttpBindingsCreateSessionInput(input, restEncoder); err != nil {
  945. return out, metadata, &smithy.SerializationError{Err: err}
  946. }
  947. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  948. return out, metadata, &smithy.SerializationError{Err: err}
  949. }
  950. in.Request = request
  951. endTimer()
  952. span.End()
  953. return next.HandleSerialize(ctx, in)
  954. }
  955. func awsRestxml_serializeOpHttpBindingsCreateSessionInput(v *CreateSessionInput, encoder *httpbinding.Encoder) error {
  956. if v == nil {
  957. return fmt.Errorf("unsupported serialization of nil %T", v)
  958. }
  959. if v.BucketKeyEnabled != nil {
  960. locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled"
  961. encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled)
  962. }
  963. if len(v.ServerSideEncryption) > 0 {
  964. locationName := "X-Amz-Server-Side-Encryption"
  965. encoder.SetHeader(locationName).String(string(v.ServerSideEncryption))
  966. }
  967. if len(v.SessionMode) > 0 {
  968. locationName := "X-Amz-Create-Session-Mode"
  969. encoder.SetHeader(locationName).String(string(v.SessionMode))
  970. }
  971. if v.SSEKMSEncryptionContext != nil {
  972. locationName := "X-Amz-Server-Side-Encryption-Context"
  973. encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext)
  974. }
  975. if v.SSEKMSKeyId != nil {
  976. locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id"
  977. encoder.SetHeader(locationName).String(*v.SSEKMSKeyId)
  978. }
  979. return nil
  980. }
  981. type awsRestxml_serializeOpDeleteBucket struct {
  982. }
  983. func (*awsRestxml_serializeOpDeleteBucket) ID() string {
  984. return "OperationSerializer"
  985. }
  986. func (m *awsRestxml_serializeOpDeleteBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  987. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  988. ) {
  989. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  990. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  991. defer endTimer()
  992. defer span.End()
  993. request, ok := in.Request.(*smithyhttp.Request)
  994. if !ok {
  995. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  996. }
  997. input, ok := in.Parameters.(*DeleteBucketInput)
  998. _ = input
  999. if !ok {
  1000. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1001. }
  1002. opPath, opQuery := httpbinding.SplitURI("/")
  1003. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1004. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1005. request.Method = "DELETE"
  1006. var restEncoder *httpbinding.Encoder
  1007. if request.URL.RawPath == "" {
  1008. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1009. } else {
  1010. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1011. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1012. }
  1013. if err != nil {
  1014. return out, metadata, &smithy.SerializationError{Err: err}
  1015. }
  1016. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketInput(input, restEncoder); err != nil {
  1017. return out, metadata, &smithy.SerializationError{Err: err}
  1018. }
  1019. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1020. return out, metadata, &smithy.SerializationError{Err: err}
  1021. }
  1022. in.Request = request
  1023. endTimer()
  1024. span.End()
  1025. return next.HandleSerialize(ctx, in)
  1026. }
  1027. func awsRestxml_serializeOpHttpBindingsDeleteBucketInput(v *DeleteBucketInput, encoder *httpbinding.Encoder) error {
  1028. if v == nil {
  1029. return fmt.Errorf("unsupported serialization of nil %T", v)
  1030. }
  1031. if v.ExpectedBucketOwner != nil {
  1032. locationName := "X-Amz-Expected-Bucket-Owner"
  1033. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1034. }
  1035. return nil
  1036. }
  1037. type awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration struct {
  1038. }
  1039. func (*awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration) ID() string {
  1040. return "OperationSerializer"
  1041. }
  1042. func (m *awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1043. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1044. ) {
  1045. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1046. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1047. defer endTimer()
  1048. defer span.End()
  1049. request, ok := in.Request.(*smithyhttp.Request)
  1050. if !ok {
  1051. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1052. }
  1053. input, ok := in.Parameters.(*DeleteBucketAnalyticsConfigurationInput)
  1054. _ = input
  1055. if !ok {
  1056. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1057. }
  1058. opPath, opQuery := httpbinding.SplitURI("/?analytics")
  1059. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1060. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1061. request.Method = "DELETE"
  1062. var restEncoder *httpbinding.Encoder
  1063. if request.URL.RawPath == "" {
  1064. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1065. } else {
  1066. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1067. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1068. }
  1069. if err != nil {
  1070. return out, metadata, &smithy.SerializationError{Err: err}
  1071. }
  1072. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketAnalyticsConfigurationInput(input, restEncoder); err != nil {
  1073. return out, metadata, &smithy.SerializationError{Err: err}
  1074. }
  1075. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1076. return out, metadata, &smithy.SerializationError{Err: err}
  1077. }
  1078. in.Request = request
  1079. endTimer()
  1080. span.End()
  1081. return next.HandleSerialize(ctx, in)
  1082. }
  1083. func awsRestxml_serializeOpHttpBindingsDeleteBucketAnalyticsConfigurationInput(v *DeleteBucketAnalyticsConfigurationInput, encoder *httpbinding.Encoder) error {
  1084. if v == nil {
  1085. return fmt.Errorf("unsupported serialization of nil %T", v)
  1086. }
  1087. if v.ExpectedBucketOwner != nil {
  1088. locationName := "X-Amz-Expected-Bucket-Owner"
  1089. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1090. }
  1091. if v.Id != nil {
  1092. encoder.SetQuery("id").String(*v.Id)
  1093. }
  1094. return nil
  1095. }
  1096. type awsRestxml_serializeOpDeleteBucketCors struct {
  1097. }
  1098. func (*awsRestxml_serializeOpDeleteBucketCors) ID() string {
  1099. return "OperationSerializer"
  1100. }
  1101. func (m *awsRestxml_serializeOpDeleteBucketCors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1102. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1103. ) {
  1104. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1105. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1106. defer endTimer()
  1107. defer span.End()
  1108. request, ok := in.Request.(*smithyhttp.Request)
  1109. if !ok {
  1110. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1111. }
  1112. input, ok := in.Parameters.(*DeleteBucketCorsInput)
  1113. _ = input
  1114. if !ok {
  1115. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1116. }
  1117. opPath, opQuery := httpbinding.SplitURI("/?cors")
  1118. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1119. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1120. request.Method = "DELETE"
  1121. var restEncoder *httpbinding.Encoder
  1122. if request.URL.RawPath == "" {
  1123. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1124. } else {
  1125. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1126. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1127. }
  1128. if err != nil {
  1129. return out, metadata, &smithy.SerializationError{Err: err}
  1130. }
  1131. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketCorsInput(input, restEncoder); err != nil {
  1132. return out, metadata, &smithy.SerializationError{Err: err}
  1133. }
  1134. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1135. return out, metadata, &smithy.SerializationError{Err: err}
  1136. }
  1137. in.Request = request
  1138. endTimer()
  1139. span.End()
  1140. return next.HandleSerialize(ctx, in)
  1141. }
  1142. func awsRestxml_serializeOpHttpBindingsDeleteBucketCorsInput(v *DeleteBucketCorsInput, encoder *httpbinding.Encoder) error {
  1143. if v == nil {
  1144. return fmt.Errorf("unsupported serialization of nil %T", v)
  1145. }
  1146. if v.ExpectedBucketOwner != nil {
  1147. locationName := "X-Amz-Expected-Bucket-Owner"
  1148. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1149. }
  1150. return nil
  1151. }
  1152. type awsRestxml_serializeOpDeleteBucketEncryption struct {
  1153. }
  1154. func (*awsRestxml_serializeOpDeleteBucketEncryption) ID() string {
  1155. return "OperationSerializer"
  1156. }
  1157. func (m *awsRestxml_serializeOpDeleteBucketEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1158. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1159. ) {
  1160. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1161. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1162. defer endTimer()
  1163. defer span.End()
  1164. request, ok := in.Request.(*smithyhttp.Request)
  1165. if !ok {
  1166. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1167. }
  1168. input, ok := in.Parameters.(*DeleteBucketEncryptionInput)
  1169. _ = input
  1170. if !ok {
  1171. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1172. }
  1173. opPath, opQuery := httpbinding.SplitURI("/?encryption")
  1174. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1175. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1176. request.Method = "DELETE"
  1177. var restEncoder *httpbinding.Encoder
  1178. if request.URL.RawPath == "" {
  1179. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1180. } else {
  1181. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1182. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1183. }
  1184. if err != nil {
  1185. return out, metadata, &smithy.SerializationError{Err: err}
  1186. }
  1187. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketEncryptionInput(input, restEncoder); err != nil {
  1188. return out, metadata, &smithy.SerializationError{Err: err}
  1189. }
  1190. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1191. return out, metadata, &smithy.SerializationError{Err: err}
  1192. }
  1193. in.Request = request
  1194. endTimer()
  1195. span.End()
  1196. return next.HandleSerialize(ctx, in)
  1197. }
  1198. func awsRestxml_serializeOpHttpBindingsDeleteBucketEncryptionInput(v *DeleteBucketEncryptionInput, encoder *httpbinding.Encoder) error {
  1199. if v == nil {
  1200. return fmt.Errorf("unsupported serialization of nil %T", v)
  1201. }
  1202. if v.ExpectedBucketOwner != nil {
  1203. locationName := "X-Amz-Expected-Bucket-Owner"
  1204. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1205. }
  1206. return nil
  1207. }
  1208. type awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration struct {
  1209. }
  1210. func (*awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration) ID() string {
  1211. return "OperationSerializer"
  1212. }
  1213. func (m *awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1214. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1215. ) {
  1216. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1217. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1218. defer endTimer()
  1219. defer span.End()
  1220. request, ok := in.Request.(*smithyhttp.Request)
  1221. if !ok {
  1222. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1223. }
  1224. input, ok := in.Parameters.(*DeleteBucketIntelligentTieringConfigurationInput)
  1225. _ = input
  1226. if !ok {
  1227. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1228. }
  1229. opPath, opQuery := httpbinding.SplitURI("/?intelligent-tiering")
  1230. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1231. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1232. request.Method = "DELETE"
  1233. var restEncoder *httpbinding.Encoder
  1234. if request.URL.RawPath == "" {
  1235. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1236. } else {
  1237. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1238. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1239. }
  1240. if err != nil {
  1241. return out, metadata, &smithy.SerializationError{Err: err}
  1242. }
  1243. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketIntelligentTieringConfigurationInput(input, restEncoder); err != nil {
  1244. return out, metadata, &smithy.SerializationError{Err: err}
  1245. }
  1246. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1247. return out, metadata, &smithy.SerializationError{Err: err}
  1248. }
  1249. in.Request = request
  1250. endTimer()
  1251. span.End()
  1252. return next.HandleSerialize(ctx, in)
  1253. }
  1254. func awsRestxml_serializeOpHttpBindingsDeleteBucketIntelligentTieringConfigurationInput(v *DeleteBucketIntelligentTieringConfigurationInput, encoder *httpbinding.Encoder) error {
  1255. if v == nil {
  1256. return fmt.Errorf("unsupported serialization of nil %T", v)
  1257. }
  1258. if v.ExpectedBucketOwner != nil {
  1259. locationName := "X-Amz-Expected-Bucket-Owner"
  1260. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1261. }
  1262. if v.Id != nil {
  1263. encoder.SetQuery("id").String(*v.Id)
  1264. }
  1265. return nil
  1266. }
  1267. type awsRestxml_serializeOpDeleteBucketInventoryConfiguration struct {
  1268. }
  1269. func (*awsRestxml_serializeOpDeleteBucketInventoryConfiguration) ID() string {
  1270. return "OperationSerializer"
  1271. }
  1272. func (m *awsRestxml_serializeOpDeleteBucketInventoryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1273. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1274. ) {
  1275. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1276. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1277. defer endTimer()
  1278. defer span.End()
  1279. request, ok := in.Request.(*smithyhttp.Request)
  1280. if !ok {
  1281. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1282. }
  1283. input, ok := in.Parameters.(*DeleteBucketInventoryConfigurationInput)
  1284. _ = input
  1285. if !ok {
  1286. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1287. }
  1288. opPath, opQuery := httpbinding.SplitURI("/?inventory")
  1289. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1290. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1291. request.Method = "DELETE"
  1292. var restEncoder *httpbinding.Encoder
  1293. if request.URL.RawPath == "" {
  1294. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1295. } else {
  1296. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1297. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1298. }
  1299. if err != nil {
  1300. return out, metadata, &smithy.SerializationError{Err: err}
  1301. }
  1302. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketInventoryConfigurationInput(input, restEncoder); err != nil {
  1303. return out, metadata, &smithy.SerializationError{Err: err}
  1304. }
  1305. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1306. return out, metadata, &smithy.SerializationError{Err: err}
  1307. }
  1308. in.Request = request
  1309. endTimer()
  1310. span.End()
  1311. return next.HandleSerialize(ctx, in)
  1312. }
  1313. func awsRestxml_serializeOpHttpBindingsDeleteBucketInventoryConfigurationInput(v *DeleteBucketInventoryConfigurationInput, encoder *httpbinding.Encoder) error {
  1314. if v == nil {
  1315. return fmt.Errorf("unsupported serialization of nil %T", v)
  1316. }
  1317. if v.ExpectedBucketOwner != nil {
  1318. locationName := "X-Amz-Expected-Bucket-Owner"
  1319. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1320. }
  1321. if v.Id != nil {
  1322. encoder.SetQuery("id").String(*v.Id)
  1323. }
  1324. return nil
  1325. }
  1326. type awsRestxml_serializeOpDeleteBucketLifecycle struct {
  1327. }
  1328. func (*awsRestxml_serializeOpDeleteBucketLifecycle) ID() string {
  1329. return "OperationSerializer"
  1330. }
  1331. func (m *awsRestxml_serializeOpDeleteBucketLifecycle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1332. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1333. ) {
  1334. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1335. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1336. defer endTimer()
  1337. defer span.End()
  1338. request, ok := in.Request.(*smithyhttp.Request)
  1339. if !ok {
  1340. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1341. }
  1342. input, ok := in.Parameters.(*DeleteBucketLifecycleInput)
  1343. _ = input
  1344. if !ok {
  1345. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1346. }
  1347. opPath, opQuery := httpbinding.SplitURI("/?lifecycle")
  1348. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1349. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1350. request.Method = "DELETE"
  1351. var restEncoder *httpbinding.Encoder
  1352. if request.URL.RawPath == "" {
  1353. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1354. } else {
  1355. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1356. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1357. }
  1358. if err != nil {
  1359. return out, metadata, &smithy.SerializationError{Err: err}
  1360. }
  1361. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleInput(input, restEncoder); err != nil {
  1362. return out, metadata, &smithy.SerializationError{Err: err}
  1363. }
  1364. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1365. return out, metadata, &smithy.SerializationError{Err: err}
  1366. }
  1367. in.Request = request
  1368. endTimer()
  1369. span.End()
  1370. return next.HandleSerialize(ctx, in)
  1371. }
  1372. func awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleInput(v *DeleteBucketLifecycleInput, encoder *httpbinding.Encoder) error {
  1373. if v == nil {
  1374. return fmt.Errorf("unsupported serialization of nil %T", v)
  1375. }
  1376. if v.ExpectedBucketOwner != nil {
  1377. locationName := "X-Amz-Expected-Bucket-Owner"
  1378. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1379. }
  1380. return nil
  1381. }
  1382. type awsRestxml_serializeOpDeleteBucketMetadataConfiguration struct {
  1383. }
  1384. func (*awsRestxml_serializeOpDeleteBucketMetadataConfiguration) ID() string {
  1385. return "OperationSerializer"
  1386. }
  1387. func (m *awsRestxml_serializeOpDeleteBucketMetadataConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1388. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1389. ) {
  1390. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1391. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1392. defer endTimer()
  1393. defer span.End()
  1394. request, ok := in.Request.(*smithyhttp.Request)
  1395. if !ok {
  1396. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1397. }
  1398. input, ok := in.Parameters.(*DeleteBucketMetadataConfigurationInput)
  1399. _ = input
  1400. if !ok {
  1401. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1402. }
  1403. opPath, opQuery := httpbinding.SplitURI("/?metadataConfiguration")
  1404. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1405. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1406. request.Method = "DELETE"
  1407. var restEncoder *httpbinding.Encoder
  1408. if request.URL.RawPath == "" {
  1409. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1410. } else {
  1411. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1412. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1413. }
  1414. if err != nil {
  1415. return out, metadata, &smithy.SerializationError{Err: err}
  1416. }
  1417. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketMetadataConfigurationInput(input, restEncoder); err != nil {
  1418. return out, metadata, &smithy.SerializationError{Err: err}
  1419. }
  1420. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1421. return out, metadata, &smithy.SerializationError{Err: err}
  1422. }
  1423. in.Request = request
  1424. endTimer()
  1425. span.End()
  1426. return next.HandleSerialize(ctx, in)
  1427. }
  1428. func awsRestxml_serializeOpHttpBindingsDeleteBucketMetadataConfigurationInput(v *DeleteBucketMetadataConfigurationInput, encoder *httpbinding.Encoder) error {
  1429. if v == nil {
  1430. return fmt.Errorf("unsupported serialization of nil %T", v)
  1431. }
  1432. if v.ExpectedBucketOwner != nil {
  1433. locationName := "X-Amz-Expected-Bucket-Owner"
  1434. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1435. }
  1436. return nil
  1437. }
  1438. type awsRestxml_serializeOpDeleteBucketMetadataTableConfiguration struct {
  1439. }
  1440. func (*awsRestxml_serializeOpDeleteBucketMetadataTableConfiguration) ID() string {
  1441. return "OperationSerializer"
  1442. }
  1443. func (m *awsRestxml_serializeOpDeleteBucketMetadataTableConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1444. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1445. ) {
  1446. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1447. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1448. defer endTimer()
  1449. defer span.End()
  1450. request, ok := in.Request.(*smithyhttp.Request)
  1451. if !ok {
  1452. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1453. }
  1454. input, ok := in.Parameters.(*DeleteBucketMetadataTableConfigurationInput)
  1455. _ = input
  1456. if !ok {
  1457. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1458. }
  1459. opPath, opQuery := httpbinding.SplitURI("/?metadataTable")
  1460. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1461. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1462. request.Method = "DELETE"
  1463. var restEncoder *httpbinding.Encoder
  1464. if request.URL.RawPath == "" {
  1465. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1466. } else {
  1467. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1468. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1469. }
  1470. if err != nil {
  1471. return out, metadata, &smithy.SerializationError{Err: err}
  1472. }
  1473. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketMetadataTableConfigurationInput(input, restEncoder); err != nil {
  1474. return out, metadata, &smithy.SerializationError{Err: err}
  1475. }
  1476. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1477. return out, metadata, &smithy.SerializationError{Err: err}
  1478. }
  1479. in.Request = request
  1480. endTimer()
  1481. span.End()
  1482. return next.HandleSerialize(ctx, in)
  1483. }
  1484. func awsRestxml_serializeOpHttpBindingsDeleteBucketMetadataTableConfigurationInput(v *DeleteBucketMetadataTableConfigurationInput, encoder *httpbinding.Encoder) error {
  1485. if v == nil {
  1486. return fmt.Errorf("unsupported serialization of nil %T", v)
  1487. }
  1488. if v.ExpectedBucketOwner != nil {
  1489. locationName := "X-Amz-Expected-Bucket-Owner"
  1490. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1491. }
  1492. return nil
  1493. }
  1494. type awsRestxml_serializeOpDeleteBucketMetricsConfiguration struct {
  1495. }
  1496. func (*awsRestxml_serializeOpDeleteBucketMetricsConfiguration) ID() string {
  1497. return "OperationSerializer"
  1498. }
  1499. func (m *awsRestxml_serializeOpDeleteBucketMetricsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1500. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1501. ) {
  1502. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1503. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1504. defer endTimer()
  1505. defer span.End()
  1506. request, ok := in.Request.(*smithyhttp.Request)
  1507. if !ok {
  1508. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1509. }
  1510. input, ok := in.Parameters.(*DeleteBucketMetricsConfigurationInput)
  1511. _ = input
  1512. if !ok {
  1513. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1514. }
  1515. opPath, opQuery := httpbinding.SplitURI("/?metrics")
  1516. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1517. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1518. request.Method = "DELETE"
  1519. var restEncoder *httpbinding.Encoder
  1520. if request.URL.RawPath == "" {
  1521. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1522. } else {
  1523. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1524. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1525. }
  1526. if err != nil {
  1527. return out, metadata, &smithy.SerializationError{Err: err}
  1528. }
  1529. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketMetricsConfigurationInput(input, restEncoder); err != nil {
  1530. return out, metadata, &smithy.SerializationError{Err: err}
  1531. }
  1532. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1533. return out, metadata, &smithy.SerializationError{Err: err}
  1534. }
  1535. in.Request = request
  1536. endTimer()
  1537. span.End()
  1538. return next.HandleSerialize(ctx, in)
  1539. }
  1540. func awsRestxml_serializeOpHttpBindingsDeleteBucketMetricsConfigurationInput(v *DeleteBucketMetricsConfigurationInput, encoder *httpbinding.Encoder) error {
  1541. if v == nil {
  1542. return fmt.Errorf("unsupported serialization of nil %T", v)
  1543. }
  1544. if v.ExpectedBucketOwner != nil {
  1545. locationName := "X-Amz-Expected-Bucket-Owner"
  1546. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1547. }
  1548. if v.Id != nil {
  1549. encoder.SetQuery("id").String(*v.Id)
  1550. }
  1551. return nil
  1552. }
  1553. type awsRestxml_serializeOpDeleteBucketOwnershipControls struct {
  1554. }
  1555. func (*awsRestxml_serializeOpDeleteBucketOwnershipControls) ID() string {
  1556. return "OperationSerializer"
  1557. }
  1558. func (m *awsRestxml_serializeOpDeleteBucketOwnershipControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1559. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1560. ) {
  1561. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1562. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1563. defer endTimer()
  1564. defer span.End()
  1565. request, ok := in.Request.(*smithyhttp.Request)
  1566. if !ok {
  1567. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1568. }
  1569. input, ok := in.Parameters.(*DeleteBucketOwnershipControlsInput)
  1570. _ = input
  1571. if !ok {
  1572. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1573. }
  1574. opPath, opQuery := httpbinding.SplitURI("/?ownershipControls")
  1575. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1576. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1577. request.Method = "DELETE"
  1578. var restEncoder *httpbinding.Encoder
  1579. if request.URL.RawPath == "" {
  1580. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1581. } else {
  1582. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1583. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1584. }
  1585. if err != nil {
  1586. return out, metadata, &smithy.SerializationError{Err: err}
  1587. }
  1588. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketOwnershipControlsInput(input, restEncoder); err != nil {
  1589. return out, metadata, &smithy.SerializationError{Err: err}
  1590. }
  1591. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1592. return out, metadata, &smithy.SerializationError{Err: err}
  1593. }
  1594. in.Request = request
  1595. endTimer()
  1596. span.End()
  1597. return next.HandleSerialize(ctx, in)
  1598. }
  1599. func awsRestxml_serializeOpHttpBindingsDeleteBucketOwnershipControlsInput(v *DeleteBucketOwnershipControlsInput, encoder *httpbinding.Encoder) error {
  1600. if v == nil {
  1601. return fmt.Errorf("unsupported serialization of nil %T", v)
  1602. }
  1603. if v.ExpectedBucketOwner != nil {
  1604. locationName := "X-Amz-Expected-Bucket-Owner"
  1605. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1606. }
  1607. return nil
  1608. }
  1609. type awsRestxml_serializeOpDeleteBucketPolicy struct {
  1610. }
  1611. func (*awsRestxml_serializeOpDeleteBucketPolicy) ID() string {
  1612. return "OperationSerializer"
  1613. }
  1614. func (m *awsRestxml_serializeOpDeleteBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1615. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1616. ) {
  1617. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1618. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1619. defer endTimer()
  1620. defer span.End()
  1621. request, ok := in.Request.(*smithyhttp.Request)
  1622. if !ok {
  1623. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1624. }
  1625. input, ok := in.Parameters.(*DeleteBucketPolicyInput)
  1626. _ = input
  1627. if !ok {
  1628. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1629. }
  1630. opPath, opQuery := httpbinding.SplitURI("/?policy")
  1631. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1632. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1633. request.Method = "DELETE"
  1634. var restEncoder *httpbinding.Encoder
  1635. if request.URL.RawPath == "" {
  1636. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1637. } else {
  1638. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1639. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1640. }
  1641. if err != nil {
  1642. return out, metadata, &smithy.SerializationError{Err: err}
  1643. }
  1644. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(input, restEncoder); err != nil {
  1645. return out, metadata, &smithy.SerializationError{Err: err}
  1646. }
  1647. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1648. return out, metadata, &smithy.SerializationError{Err: err}
  1649. }
  1650. in.Request = request
  1651. endTimer()
  1652. span.End()
  1653. return next.HandleSerialize(ctx, in)
  1654. }
  1655. func awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(v *DeleteBucketPolicyInput, encoder *httpbinding.Encoder) error {
  1656. if v == nil {
  1657. return fmt.Errorf("unsupported serialization of nil %T", v)
  1658. }
  1659. if v.ExpectedBucketOwner != nil {
  1660. locationName := "X-Amz-Expected-Bucket-Owner"
  1661. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1662. }
  1663. return nil
  1664. }
  1665. type awsRestxml_serializeOpDeleteBucketReplication struct {
  1666. }
  1667. func (*awsRestxml_serializeOpDeleteBucketReplication) ID() string {
  1668. return "OperationSerializer"
  1669. }
  1670. func (m *awsRestxml_serializeOpDeleteBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1671. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1672. ) {
  1673. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1674. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1675. defer endTimer()
  1676. defer span.End()
  1677. request, ok := in.Request.(*smithyhttp.Request)
  1678. if !ok {
  1679. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1680. }
  1681. input, ok := in.Parameters.(*DeleteBucketReplicationInput)
  1682. _ = input
  1683. if !ok {
  1684. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1685. }
  1686. opPath, opQuery := httpbinding.SplitURI("/?replication")
  1687. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1688. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1689. request.Method = "DELETE"
  1690. var restEncoder *httpbinding.Encoder
  1691. if request.URL.RawPath == "" {
  1692. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1693. } else {
  1694. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1695. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1696. }
  1697. if err != nil {
  1698. return out, metadata, &smithy.SerializationError{Err: err}
  1699. }
  1700. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(input, restEncoder); err != nil {
  1701. return out, metadata, &smithy.SerializationError{Err: err}
  1702. }
  1703. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1704. return out, metadata, &smithy.SerializationError{Err: err}
  1705. }
  1706. in.Request = request
  1707. endTimer()
  1708. span.End()
  1709. return next.HandleSerialize(ctx, in)
  1710. }
  1711. func awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(v *DeleteBucketReplicationInput, encoder *httpbinding.Encoder) error {
  1712. if v == nil {
  1713. return fmt.Errorf("unsupported serialization of nil %T", v)
  1714. }
  1715. if v.ExpectedBucketOwner != nil {
  1716. locationName := "X-Amz-Expected-Bucket-Owner"
  1717. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1718. }
  1719. return nil
  1720. }
  1721. type awsRestxml_serializeOpDeleteBucketTagging struct {
  1722. }
  1723. func (*awsRestxml_serializeOpDeleteBucketTagging) ID() string {
  1724. return "OperationSerializer"
  1725. }
  1726. func (m *awsRestxml_serializeOpDeleteBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1727. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1728. ) {
  1729. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1730. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1731. defer endTimer()
  1732. defer span.End()
  1733. request, ok := in.Request.(*smithyhttp.Request)
  1734. if !ok {
  1735. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1736. }
  1737. input, ok := in.Parameters.(*DeleteBucketTaggingInput)
  1738. _ = input
  1739. if !ok {
  1740. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1741. }
  1742. opPath, opQuery := httpbinding.SplitURI("/?tagging")
  1743. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1744. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1745. request.Method = "DELETE"
  1746. var restEncoder *httpbinding.Encoder
  1747. if request.URL.RawPath == "" {
  1748. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1749. } else {
  1750. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1751. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1752. }
  1753. if err != nil {
  1754. return out, metadata, &smithy.SerializationError{Err: err}
  1755. }
  1756. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(input, restEncoder); err != nil {
  1757. return out, metadata, &smithy.SerializationError{Err: err}
  1758. }
  1759. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1760. return out, metadata, &smithy.SerializationError{Err: err}
  1761. }
  1762. in.Request = request
  1763. endTimer()
  1764. span.End()
  1765. return next.HandleSerialize(ctx, in)
  1766. }
  1767. func awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(v *DeleteBucketTaggingInput, encoder *httpbinding.Encoder) error {
  1768. if v == nil {
  1769. return fmt.Errorf("unsupported serialization of nil %T", v)
  1770. }
  1771. if v.ExpectedBucketOwner != nil {
  1772. locationName := "X-Amz-Expected-Bucket-Owner"
  1773. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1774. }
  1775. return nil
  1776. }
  1777. type awsRestxml_serializeOpDeleteBucketWebsite struct {
  1778. }
  1779. func (*awsRestxml_serializeOpDeleteBucketWebsite) ID() string {
  1780. return "OperationSerializer"
  1781. }
  1782. func (m *awsRestxml_serializeOpDeleteBucketWebsite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1783. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1784. ) {
  1785. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1786. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1787. defer endTimer()
  1788. defer span.End()
  1789. request, ok := in.Request.(*smithyhttp.Request)
  1790. if !ok {
  1791. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1792. }
  1793. input, ok := in.Parameters.(*DeleteBucketWebsiteInput)
  1794. _ = input
  1795. if !ok {
  1796. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1797. }
  1798. opPath, opQuery := httpbinding.SplitURI("/?website")
  1799. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1800. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1801. request.Method = "DELETE"
  1802. var restEncoder *httpbinding.Encoder
  1803. if request.URL.RawPath == "" {
  1804. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1805. } else {
  1806. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1807. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1808. }
  1809. if err != nil {
  1810. return out, metadata, &smithy.SerializationError{Err: err}
  1811. }
  1812. if err := awsRestxml_serializeOpHttpBindingsDeleteBucketWebsiteInput(input, restEncoder); err != nil {
  1813. return out, metadata, &smithy.SerializationError{Err: err}
  1814. }
  1815. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1816. return out, metadata, &smithy.SerializationError{Err: err}
  1817. }
  1818. in.Request = request
  1819. endTimer()
  1820. span.End()
  1821. return next.HandleSerialize(ctx, in)
  1822. }
  1823. func awsRestxml_serializeOpHttpBindingsDeleteBucketWebsiteInput(v *DeleteBucketWebsiteInput, encoder *httpbinding.Encoder) error {
  1824. if v == nil {
  1825. return fmt.Errorf("unsupported serialization of nil %T", v)
  1826. }
  1827. if v.ExpectedBucketOwner != nil {
  1828. locationName := "X-Amz-Expected-Bucket-Owner"
  1829. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1830. }
  1831. return nil
  1832. }
  1833. type awsRestxml_serializeOpDeleteObject struct {
  1834. }
  1835. func (*awsRestxml_serializeOpDeleteObject) ID() string {
  1836. return "OperationSerializer"
  1837. }
  1838. func (m *awsRestxml_serializeOpDeleteObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1839. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1840. ) {
  1841. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1842. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1843. defer endTimer()
  1844. defer span.End()
  1845. request, ok := in.Request.(*smithyhttp.Request)
  1846. if !ok {
  1847. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1848. }
  1849. input, ok := in.Parameters.(*DeleteObjectInput)
  1850. _ = input
  1851. if !ok {
  1852. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1853. }
  1854. opPath, opQuery := httpbinding.SplitURI("/{Key+}?x-id=DeleteObject")
  1855. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1856. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1857. request.Method = "DELETE"
  1858. var restEncoder *httpbinding.Encoder
  1859. if request.URL.RawPath == "" {
  1860. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1861. } else {
  1862. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1863. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1864. }
  1865. if err != nil {
  1866. return out, metadata, &smithy.SerializationError{Err: err}
  1867. }
  1868. if err := awsRestxml_serializeOpHttpBindingsDeleteObjectInput(input, restEncoder); err != nil {
  1869. return out, metadata, &smithy.SerializationError{Err: err}
  1870. }
  1871. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1872. return out, metadata, &smithy.SerializationError{Err: err}
  1873. }
  1874. in.Request = request
  1875. endTimer()
  1876. span.End()
  1877. return next.HandleSerialize(ctx, in)
  1878. }
  1879. func awsRestxml_serializeOpHttpBindingsDeleteObjectInput(v *DeleteObjectInput, encoder *httpbinding.Encoder) error {
  1880. if v == nil {
  1881. return fmt.Errorf("unsupported serialization of nil %T", v)
  1882. }
  1883. if v.BypassGovernanceRetention != nil {
  1884. locationName := "X-Amz-Bypass-Governance-Retention"
  1885. encoder.SetHeader(locationName).Boolean(*v.BypassGovernanceRetention)
  1886. }
  1887. if v.ExpectedBucketOwner != nil {
  1888. locationName := "X-Amz-Expected-Bucket-Owner"
  1889. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  1890. }
  1891. if v.IfMatch != nil {
  1892. locationName := "If-Match"
  1893. encoder.SetHeader(locationName).String(*v.IfMatch)
  1894. }
  1895. if v.IfMatchLastModifiedTime != nil {
  1896. locationName := "X-Amz-If-Match-Last-Modified-Time"
  1897. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfMatchLastModifiedTime))
  1898. }
  1899. if v.IfMatchSize != nil {
  1900. locationName := "X-Amz-If-Match-Size"
  1901. encoder.SetHeader(locationName).Long(*v.IfMatchSize)
  1902. }
  1903. if v.Key == nil || len(*v.Key) == 0 {
  1904. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  1905. }
  1906. if v.Key != nil {
  1907. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  1908. return err
  1909. }
  1910. }
  1911. if v.MFA != nil {
  1912. locationName := "X-Amz-Mfa"
  1913. encoder.SetHeader(locationName).String(*v.MFA)
  1914. }
  1915. if len(v.RequestPayer) > 0 {
  1916. locationName := "X-Amz-Request-Payer"
  1917. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  1918. }
  1919. if v.VersionId != nil {
  1920. encoder.SetQuery("versionId").String(*v.VersionId)
  1921. }
  1922. return nil
  1923. }
  1924. type awsRestxml_serializeOpDeleteObjects struct {
  1925. }
  1926. func (*awsRestxml_serializeOpDeleteObjects) ID() string {
  1927. return "OperationSerializer"
  1928. }
  1929. func (m *awsRestxml_serializeOpDeleteObjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  1930. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  1931. ) {
  1932. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  1933. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  1934. defer endTimer()
  1935. defer span.End()
  1936. request, ok := in.Request.(*smithyhttp.Request)
  1937. if !ok {
  1938. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  1939. }
  1940. input, ok := in.Parameters.(*DeleteObjectsInput)
  1941. _ = input
  1942. if !ok {
  1943. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  1944. }
  1945. opPath, opQuery := httpbinding.SplitURI("/?delete")
  1946. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  1947. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  1948. request.Method = "POST"
  1949. var restEncoder *httpbinding.Encoder
  1950. if request.URL.RawPath == "" {
  1951. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  1952. } else {
  1953. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  1954. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  1955. }
  1956. if err != nil {
  1957. return out, metadata, &smithy.SerializationError{Err: err}
  1958. }
  1959. if err := awsRestxml_serializeOpHttpBindingsDeleteObjectsInput(input, restEncoder); err != nil {
  1960. return out, metadata, &smithy.SerializationError{Err: err}
  1961. }
  1962. if input.Delete != nil {
  1963. if !restEncoder.HasHeader("Content-Type") {
  1964. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  1965. restEncoder.SetHeader("Content-Type").String("application/xml")
  1966. }
  1967. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  1968. payloadRootAttr := []smithyxml.Attr{}
  1969. payloadRoot := smithyxml.StartElement{
  1970. Name: smithyxml.Name{
  1971. Local: "Delete",
  1972. },
  1973. Attr: payloadRootAttr,
  1974. }
  1975. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  1976. if err := awsRestxml_serializeDocumentDelete(input.Delete, xmlEncoder.RootElement(payloadRoot)); err != nil {
  1977. return out, metadata, &smithy.SerializationError{Err: err}
  1978. }
  1979. payload := bytes.NewReader(xmlEncoder.Bytes())
  1980. if request, err = request.SetStream(payload); err != nil {
  1981. return out, metadata, &smithy.SerializationError{Err: err}
  1982. }
  1983. }
  1984. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  1985. return out, metadata, &smithy.SerializationError{Err: err}
  1986. }
  1987. in.Request = request
  1988. endTimer()
  1989. span.End()
  1990. return next.HandleSerialize(ctx, in)
  1991. }
  1992. func awsRestxml_serializeOpHttpBindingsDeleteObjectsInput(v *DeleteObjectsInput, encoder *httpbinding.Encoder) error {
  1993. if v == nil {
  1994. return fmt.Errorf("unsupported serialization of nil %T", v)
  1995. }
  1996. if v.BypassGovernanceRetention != nil {
  1997. locationName := "X-Amz-Bypass-Governance-Retention"
  1998. encoder.SetHeader(locationName).Boolean(*v.BypassGovernanceRetention)
  1999. }
  2000. if len(v.ChecksumAlgorithm) > 0 {
  2001. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  2002. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  2003. }
  2004. if v.ExpectedBucketOwner != nil {
  2005. locationName := "X-Amz-Expected-Bucket-Owner"
  2006. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2007. }
  2008. if v.MFA != nil {
  2009. locationName := "X-Amz-Mfa"
  2010. encoder.SetHeader(locationName).String(*v.MFA)
  2011. }
  2012. if len(v.RequestPayer) > 0 {
  2013. locationName := "X-Amz-Request-Payer"
  2014. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  2015. }
  2016. return nil
  2017. }
  2018. type awsRestxml_serializeOpDeleteObjectTagging struct {
  2019. }
  2020. func (*awsRestxml_serializeOpDeleteObjectTagging) ID() string {
  2021. return "OperationSerializer"
  2022. }
  2023. func (m *awsRestxml_serializeOpDeleteObjectTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2024. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2025. ) {
  2026. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2027. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2028. defer endTimer()
  2029. defer span.End()
  2030. request, ok := in.Request.(*smithyhttp.Request)
  2031. if !ok {
  2032. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2033. }
  2034. input, ok := in.Parameters.(*DeleteObjectTaggingInput)
  2035. _ = input
  2036. if !ok {
  2037. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2038. }
  2039. opPath, opQuery := httpbinding.SplitURI("/{Key+}?tagging")
  2040. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2041. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2042. request.Method = "DELETE"
  2043. var restEncoder *httpbinding.Encoder
  2044. if request.URL.RawPath == "" {
  2045. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2046. } else {
  2047. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2048. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2049. }
  2050. if err != nil {
  2051. return out, metadata, &smithy.SerializationError{Err: err}
  2052. }
  2053. if err := awsRestxml_serializeOpHttpBindingsDeleteObjectTaggingInput(input, restEncoder); err != nil {
  2054. return out, metadata, &smithy.SerializationError{Err: err}
  2055. }
  2056. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2057. return out, metadata, &smithy.SerializationError{Err: err}
  2058. }
  2059. in.Request = request
  2060. endTimer()
  2061. span.End()
  2062. return next.HandleSerialize(ctx, in)
  2063. }
  2064. func awsRestxml_serializeOpHttpBindingsDeleteObjectTaggingInput(v *DeleteObjectTaggingInput, encoder *httpbinding.Encoder) error {
  2065. if v == nil {
  2066. return fmt.Errorf("unsupported serialization of nil %T", v)
  2067. }
  2068. if v.ExpectedBucketOwner != nil {
  2069. locationName := "X-Amz-Expected-Bucket-Owner"
  2070. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2071. }
  2072. if v.Key == nil || len(*v.Key) == 0 {
  2073. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  2074. }
  2075. if v.Key != nil {
  2076. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  2077. return err
  2078. }
  2079. }
  2080. if v.VersionId != nil {
  2081. encoder.SetQuery("versionId").String(*v.VersionId)
  2082. }
  2083. return nil
  2084. }
  2085. type awsRestxml_serializeOpDeletePublicAccessBlock struct {
  2086. }
  2087. func (*awsRestxml_serializeOpDeletePublicAccessBlock) ID() string {
  2088. return "OperationSerializer"
  2089. }
  2090. func (m *awsRestxml_serializeOpDeletePublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2091. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2092. ) {
  2093. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2094. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2095. defer endTimer()
  2096. defer span.End()
  2097. request, ok := in.Request.(*smithyhttp.Request)
  2098. if !ok {
  2099. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2100. }
  2101. input, ok := in.Parameters.(*DeletePublicAccessBlockInput)
  2102. _ = input
  2103. if !ok {
  2104. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2105. }
  2106. opPath, opQuery := httpbinding.SplitURI("/?publicAccessBlock")
  2107. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2108. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2109. request.Method = "DELETE"
  2110. var restEncoder *httpbinding.Encoder
  2111. if request.URL.RawPath == "" {
  2112. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2113. } else {
  2114. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2115. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2116. }
  2117. if err != nil {
  2118. return out, metadata, &smithy.SerializationError{Err: err}
  2119. }
  2120. if err := awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(input, restEncoder); err != nil {
  2121. return out, metadata, &smithy.SerializationError{Err: err}
  2122. }
  2123. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2124. return out, metadata, &smithy.SerializationError{Err: err}
  2125. }
  2126. in.Request = request
  2127. endTimer()
  2128. span.End()
  2129. return next.HandleSerialize(ctx, in)
  2130. }
  2131. func awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(v *DeletePublicAccessBlockInput, encoder *httpbinding.Encoder) error {
  2132. if v == nil {
  2133. return fmt.Errorf("unsupported serialization of nil %T", v)
  2134. }
  2135. if v.ExpectedBucketOwner != nil {
  2136. locationName := "X-Amz-Expected-Bucket-Owner"
  2137. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2138. }
  2139. return nil
  2140. }
  2141. type awsRestxml_serializeOpGetBucketAccelerateConfiguration struct {
  2142. }
  2143. func (*awsRestxml_serializeOpGetBucketAccelerateConfiguration) ID() string {
  2144. return "OperationSerializer"
  2145. }
  2146. func (m *awsRestxml_serializeOpGetBucketAccelerateConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2147. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2148. ) {
  2149. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2150. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2151. defer endTimer()
  2152. defer span.End()
  2153. request, ok := in.Request.(*smithyhttp.Request)
  2154. if !ok {
  2155. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2156. }
  2157. input, ok := in.Parameters.(*GetBucketAccelerateConfigurationInput)
  2158. _ = input
  2159. if !ok {
  2160. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2161. }
  2162. opPath, opQuery := httpbinding.SplitURI("/?accelerate")
  2163. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2164. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2165. request.Method = "GET"
  2166. var restEncoder *httpbinding.Encoder
  2167. if request.URL.RawPath == "" {
  2168. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2169. } else {
  2170. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2171. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2172. }
  2173. if err != nil {
  2174. return out, metadata, &smithy.SerializationError{Err: err}
  2175. }
  2176. if err := awsRestxml_serializeOpHttpBindingsGetBucketAccelerateConfigurationInput(input, restEncoder); err != nil {
  2177. return out, metadata, &smithy.SerializationError{Err: err}
  2178. }
  2179. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2180. return out, metadata, &smithy.SerializationError{Err: err}
  2181. }
  2182. in.Request = request
  2183. endTimer()
  2184. span.End()
  2185. return next.HandleSerialize(ctx, in)
  2186. }
  2187. func awsRestxml_serializeOpHttpBindingsGetBucketAccelerateConfigurationInput(v *GetBucketAccelerateConfigurationInput, encoder *httpbinding.Encoder) error {
  2188. if v == nil {
  2189. return fmt.Errorf("unsupported serialization of nil %T", v)
  2190. }
  2191. if v.ExpectedBucketOwner != nil {
  2192. locationName := "X-Amz-Expected-Bucket-Owner"
  2193. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2194. }
  2195. if len(v.RequestPayer) > 0 {
  2196. locationName := "X-Amz-Request-Payer"
  2197. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  2198. }
  2199. return nil
  2200. }
  2201. type awsRestxml_serializeOpGetBucketAcl struct {
  2202. }
  2203. func (*awsRestxml_serializeOpGetBucketAcl) ID() string {
  2204. return "OperationSerializer"
  2205. }
  2206. func (m *awsRestxml_serializeOpGetBucketAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2207. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2208. ) {
  2209. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2210. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2211. defer endTimer()
  2212. defer span.End()
  2213. request, ok := in.Request.(*smithyhttp.Request)
  2214. if !ok {
  2215. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2216. }
  2217. input, ok := in.Parameters.(*GetBucketAclInput)
  2218. _ = input
  2219. if !ok {
  2220. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2221. }
  2222. opPath, opQuery := httpbinding.SplitURI("/?acl")
  2223. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2224. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2225. request.Method = "GET"
  2226. var restEncoder *httpbinding.Encoder
  2227. if request.URL.RawPath == "" {
  2228. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2229. } else {
  2230. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2231. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2232. }
  2233. if err != nil {
  2234. return out, metadata, &smithy.SerializationError{Err: err}
  2235. }
  2236. if err := awsRestxml_serializeOpHttpBindingsGetBucketAclInput(input, restEncoder); err != nil {
  2237. return out, metadata, &smithy.SerializationError{Err: err}
  2238. }
  2239. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2240. return out, metadata, &smithy.SerializationError{Err: err}
  2241. }
  2242. in.Request = request
  2243. endTimer()
  2244. span.End()
  2245. return next.HandleSerialize(ctx, in)
  2246. }
  2247. func awsRestxml_serializeOpHttpBindingsGetBucketAclInput(v *GetBucketAclInput, encoder *httpbinding.Encoder) error {
  2248. if v == nil {
  2249. return fmt.Errorf("unsupported serialization of nil %T", v)
  2250. }
  2251. if v.ExpectedBucketOwner != nil {
  2252. locationName := "X-Amz-Expected-Bucket-Owner"
  2253. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2254. }
  2255. return nil
  2256. }
  2257. type awsRestxml_serializeOpGetBucketAnalyticsConfiguration struct {
  2258. }
  2259. func (*awsRestxml_serializeOpGetBucketAnalyticsConfiguration) ID() string {
  2260. return "OperationSerializer"
  2261. }
  2262. func (m *awsRestxml_serializeOpGetBucketAnalyticsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2263. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2264. ) {
  2265. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2266. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2267. defer endTimer()
  2268. defer span.End()
  2269. request, ok := in.Request.(*smithyhttp.Request)
  2270. if !ok {
  2271. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2272. }
  2273. input, ok := in.Parameters.(*GetBucketAnalyticsConfigurationInput)
  2274. _ = input
  2275. if !ok {
  2276. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2277. }
  2278. opPath, opQuery := httpbinding.SplitURI("/?analytics&x-id=GetBucketAnalyticsConfiguration")
  2279. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2280. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2281. request.Method = "GET"
  2282. var restEncoder *httpbinding.Encoder
  2283. if request.URL.RawPath == "" {
  2284. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2285. } else {
  2286. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2287. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2288. }
  2289. if err != nil {
  2290. return out, metadata, &smithy.SerializationError{Err: err}
  2291. }
  2292. if err := awsRestxml_serializeOpHttpBindingsGetBucketAnalyticsConfigurationInput(input, restEncoder); err != nil {
  2293. return out, metadata, &smithy.SerializationError{Err: err}
  2294. }
  2295. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2296. return out, metadata, &smithy.SerializationError{Err: err}
  2297. }
  2298. in.Request = request
  2299. endTimer()
  2300. span.End()
  2301. return next.HandleSerialize(ctx, in)
  2302. }
  2303. func awsRestxml_serializeOpHttpBindingsGetBucketAnalyticsConfigurationInput(v *GetBucketAnalyticsConfigurationInput, encoder *httpbinding.Encoder) error {
  2304. if v == nil {
  2305. return fmt.Errorf("unsupported serialization of nil %T", v)
  2306. }
  2307. if v.ExpectedBucketOwner != nil {
  2308. locationName := "X-Amz-Expected-Bucket-Owner"
  2309. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2310. }
  2311. if v.Id != nil {
  2312. encoder.SetQuery("id").String(*v.Id)
  2313. }
  2314. return nil
  2315. }
  2316. type awsRestxml_serializeOpGetBucketCors struct {
  2317. }
  2318. func (*awsRestxml_serializeOpGetBucketCors) ID() string {
  2319. return "OperationSerializer"
  2320. }
  2321. func (m *awsRestxml_serializeOpGetBucketCors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2322. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2323. ) {
  2324. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2325. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2326. defer endTimer()
  2327. defer span.End()
  2328. request, ok := in.Request.(*smithyhttp.Request)
  2329. if !ok {
  2330. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2331. }
  2332. input, ok := in.Parameters.(*GetBucketCorsInput)
  2333. _ = input
  2334. if !ok {
  2335. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2336. }
  2337. opPath, opQuery := httpbinding.SplitURI("/?cors")
  2338. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2339. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2340. request.Method = "GET"
  2341. var restEncoder *httpbinding.Encoder
  2342. if request.URL.RawPath == "" {
  2343. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2344. } else {
  2345. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2346. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2347. }
  2348. if err != nil {
  2349. return out, metadata, &smithy.SerializationError{Err: err}
  2350. }
  2351. if err := awsRestxml_serializeOpHttpBindingsGetBucketCorsInput(input, restEncoder); err != nil {
  2352. return out, metadata, &smithy.SerializationError{Err: err}
  2353. }
  2354. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2355. return out, metadata, &smithy.SerializationError{Err: err}
  2356. }
  2357. in.Request = request
  2358. endTimer()
  2359. span.End()
  2360. return next.HandleSerialize(ctx, in)
  2361. }
  2362. func awsRestxml_serializeOpHttpBindingsGetBucketCorsInput(v *GetBucketCorsInput, encoder *httpbinding.Encoder) error {
  2363. if v == nil {
  2364. return fmt.Errorf("unsupported serialization of nil %T", v)
  2365. }
  2366. if v.ExpectedBucketOwner != nil {
  2367. locationName := "X-Amz-Expected-Bucket-Owner"
  2368. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2369. }
  2370. return nil
  2371. }
  2372. type awsRestxml_serializeOpGetBucketEncryption struct {
  2373. }
  2374. func (*awsRestxml_serializeOpGetBucketEncryption) ID() string {
  2375. return "OperationSerializer"
  2376. }
  2377. func (m *awsRestxml_serializeOpGetBucketEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2378. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2379. ) {
  2380. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2381. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2382. defer endTimer()
  2383. defer span.End()
  2384. request, ok := in.Request.(*smithyhttp.Request)
  2385. if !ok {
  2386. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2387. }
  2388. input, ok := in.Parameters.(*GetBucketEncryptionInput)
  2389. _ = input
  2390. if !ok {
  2391. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2392. }
  2393. opPath, opQuery := httpbinding.SplitURI("/?encryption")
  2394. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2395. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2396. request.Method = "GET"
  2397. var restEncoder *httpbinding.Encoder
  2398. if request.URL.RawPath == "" {
  2399. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2400. } else {
  2401. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2402. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2403. }
  2404. if err != nil {
  2405. return out, metadata, &smithy.SerializationError{Err: err}
  2406. }
  2407. if err := awsRestxml_serializeOpHttpBindingsGetBucketEncryptionInput(input, restEncoder); err != nil {
  2408. return out, metadata, &smithy.SerializationError{Err: err}
  2409. }
  2410. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2411. return out, metadata, &smithy.SerializationError{Err: err}
  2412. }
  2413. in.Request = request
  2414. endTimer()
  2415. span.End()
  2416. return next.HandleSerialize(ctx, in)
  2417. }
  2418. func awsRestxml_serializeOpHttpBindingsGetBucketEncryptionInput(v *GetBucketEncryptionInput, encoder *httpbinding.Encoder) error {
  2419. if v == nil {
  2420. return fmt.Errorf("unsupported serialization of nil %T", v)
  2421. }
  2422. if v.ExpectedBucketOwner != nil {
  2423. locationName := "X-Amz-Expected-Bucket-Owner"
  2424. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2425. }
  2426. return nil
  2427. }
  2428. type awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration struct {
  2429. }
  2430. func (*awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration) ID() string {
  2431. return "OperationSerializer"
  2432. }
  2433. func (m *awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2434. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2435. ) {
  2436. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2437. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2438. defer endTimer()
  2439. defer span.End()
  2440. request, ok := in.Request.(*smithyhttp.Request)
  2441. if !ok {
  2442. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2443. }
  2444. input, ok := in.Parameters.(*GetBucketIntelligentTieringConfigurationInput)
  2445. _ = input
  2446. if !ok {
  2447. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2448. }
  2449. opPath, opQuery := httpbinding.SplitURI("/?intelligent-tiering&x-id=GetBucketIntelligentTieringConfiguration")
  2450. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2451. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2452. request.Method = "GET"
  2453. var restEncoder *httpbinding.Encoder
  2454. if request.URL.RawPath == "" {
  2455. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2456. } else {
  2457. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2458. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2459. }
  2460. if err != nil {
  2461. return out, metadata, &smithy.SerializationError{Err: err}
  2462. }
  2463. if err := awsRestxml_serializeOpHttpBindingsGetBucketIntelligentTieringConfigurationInput(input, restEncoder); err != nil {
  2464. return out, metadata, &smithy.SerializationError{Err: err}
  2465. }
  2466. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2467. return out, metadata, &smithy.SerializationError{Err: err}
  2468. }
  2469. in.Request = request
  2470. endTimer()
  2471. span.End()
  2472. return next.HandleSerialize(ctx, in)
  2473. }
  2474. func awsRestxml_serializeOpHttpBindingsGetBucketIntelligentTieringConfigurationInput(v *GetBucketIntelligentTieringConfigurationInput, encoder *httpbinding.Encoder) error {
  2475. if v == nil {
  2476. return fmt.Errorf("unsupported serialization of nil %T", v)
  2477. }
  2478. if v.ExpectedBucketOwner != nil {
  2479. locationName := "X-Amz-Expected-Bucket-Owner"
  2480. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2481. }
  2482. if v.Id != nil {
  2483. encoder.SetQuery("id").String(*v.Id)
  2484. }
  2485. return nil
  2486. }
  2487. type awsRestxml_serializeOpGetBucketInventoryConfiguration struct {
  2488. }
  2489. func (*awsRestxml_serializeOpGetBucketInventoryConfiguration) ID() string {
  2490. return "OperationSerializer"
  2491. }
  2492. func (m *awsRestxml_serializeOpGetBucketInventoryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2493. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2494. ) {
  2495. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2496. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2497. defer endTimer()
  2498. defer span.End()
  2499. request, ok := in.Request.(*smithyhttp.Request)
  2500. if !ok {
  2501. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2502. }
  2503. input, ok := in.Parameters.(*GetBucketInventoryConfigurationInput)
  2504. _ = input
  2505. if !ok {
  2506. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2507. }
  2508. opPath, opQuery := httpbinding.SplitURI("/?inventory&x-id=GetBucketInventoryConfiguration")
  2509. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2510. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2511. request.Method = "GET"
  2512. var restEncoder *httpbinding.Encoder
  2513. if request.URL.RawPath == "" {
  2514. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2515. } else {
  2516. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2517. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2518. }
  2519. if err != nil {
  2520. return out, metadata, &smithy.SerializationError{Err: err}
  2521. }
  2522. if err := awsRestxml_serializeOpHttpBindingsGetBucketInventoryConfigurationInput(input, restEncoder); err != nil {
  2523. return out, metadata, &smithy.SerializationError{Err: err}
  2524. }
  2525. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2526. return out, metadata, &smithy.SerializationError{Err: err}
  2527. }
  2528. in.Request = request
  2529. endTimer()
  2530. span.End()
  2531. return next.HandleSerialize(ctx, in)
  2532. }
  2533. func awsRestxml_serializeOpHttpBindingsGetBucketInventoryConfigurationInput(v *GetBucketInventoryConfigurationInput, encoder *httpbinding.Encoder) error {
  2534. if v == nil {
  2535. return fmt.Errorf("unsupported serialization of nil %T", v)
  2536. }
  2537. if v.ExpectedBucketOwner != nil {
  2538. locationName := "X-Amz-Expected-Bucket-Owner"
  2539. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2540. }
  2541. if v.Id != nil {
  2542. encoder.SetQuery("id").String(*v.Id)
  2543. }
  2544. return nil
  2545. }
  2546. type awsRestxml_serializeOpGetBucketLifecycleConfiguration struct {
  2547. }
  2548. func (*awsRestxml_serializeOpGetBucketLifecycleConfiguration) ID() string {
  2549. return "OperationSerializer"
  2550. }
  2551. func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2552. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2553. ) {
  2554. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2555. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2556. defer endTimer()
  2557. defer span.End()
  2558. request, ok := in.Request.(*smithyhttp.Request)
  2559. if !ok {
  2560. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2561. }
  2562. input, ok := in.Parameters.(*GetBucketLifecycleConfigurationInput)
  2563. _ = input
  2564. if !ok {
  2565. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2566. }
  2567. opPath, opQuery := httpbinding.SplitURI("/?lifecycle")
  2568. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2569. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2570. request.Method = "GET"
  2571. var restEncoder *httpbinding.Encoder
  2572. if request.URL.RawPath == "" {
  2573. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2574. } else {
  2575. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2576. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2577. }
  2578. if err != nil {
  2579. return out, metadata, &smithy.SerializationError{Err: err}
  2580. }
  2581. if err := awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(input, restEncoder); err != nil {
  2582. return out, metadata, &smithy.SerializationError{Err: err}
  2583. }
  2584. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2585. return out, metadata, &smithy.SerializationError{Err: err}
  2586. }
  2587. in.Request = request
  2588. endTimer()
  2589. span.End()
  2590. return next.HandleSerialize(ctx, in)
  2591. }
  2592. func awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(v *GetBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error {
  2593. if v == nil {
  2594. return fmt.Errorf("unsupported serialization of nil %T", v)
  2595. }
  2596. if v.ExpectedBucketOwner != nil {
  2597. locationName := "X-Amz-Expected-Bucket-Owner"
  2598. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2599. }
  2600. return nil
  2601. }
  2602. type awsRestxml_serializeOpGetBucketLocation struct {
  2603. }
  2604. func (*awsRestxml_serializeOpGetBucketLocation) ID() string {
  2605. return "OperationSerializer"
  2606. }
  2607. func (m *awsRestxml_serializeOpGetBucketLocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2608. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2609. ) {
  2610. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2611. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2612. defer endTimer()
  2613. defer span.End()
  2614. request, ok := in.Request.(*smithyhttp.Request)
  2615. if !ok {
  2616. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2617. }
  2618. input, ok := in.Parameters.(*GetBucketLocationInput)
  2619. _ = input
  2620. if !ok {
  2621. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2622. }
  2623. opPath, opQuery := httpbinding.SplitURI("/?location")
  2624. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2625. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2626. request.Method = "GET"
  2627. var restEncoder *httpbinding.Encoder
  2628. if request.URL.RawPath == "" {
  2629. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2630. } else {
  2631. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2632. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2633. }
  2634. if err != nil {
  2635. return out, metadata, &smithy.SerializationError{Err: err}
  2636. }
  2637. if err := awsRestxml_serializeOpHttpBindingsGetBucketLocationInput(input, restEncoder); err != nil {
  2638. return out, metadata, &smithy.SerializationError{Err: err}
  2639. }
  2640. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2641. return out, metadata, &smithy.SerializationError{Err: err}
  2642. }
  2643. in.Request = request
  2644. endTimer()
  2645. span.End()
  2646. return next.HandleSerialize(ctx, in)
  2647. }
  2648. func awsRestxml_serializeOpHttpBindingsGetBucketLocationInput(v *GetBucketLocationInput, encoder *httpbinding.Encoder) error {
  2649. if v == nil {
  2650. return fmt.Errorf("unsupported serialization of nil %T", v)
  2651. }
  2652. if v.ExpectedBucketOwner != nil {
  2653. locationName := "X-Amz-Expected-Bucket-Owner"
  2654. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2655. }
  2656. return nil
  2657. }
  2658. type awsRestxml_serializeOpGetBucketLogging struct {
  2659. }
  2660. func (*awsRestxml_serializeOpGetBucketLogging) ID() string {
  2661. return "OperationSerializer"
  2662. }
  2663. func (m *awsRestxml_serializeOpGetBucketLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2664. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2665. ) {
  2666. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2667. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2668. defer endTimer()
  2669. defer span.End()
  2670. request, ok := in.Request.(*smithyhttp.Request)
  2671. if !ok {
  2672. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2673. }
  2674. input, ok := in.Parameters.(*GetBucketLoggingInput)
  2675. _ = input
  2676. if !ok {
  2677. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2678. }
  2679. opPath, opQuery := httpbinding.SplitURI("/?logging")
  2680. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2681. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2682. request.Method = "GET"
  2683. var restEncoder *httpbinding.Encoder
  2684. if request.URL.RawPath == "" {
  2685. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2686. } else {
  2687. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2688. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2689. }
  2690. if err != nil {
  2691. return out, metadata, &smithy.SerializationError{Err: err}
  2692. }
  2693. if err := awsRestxml_serializeOpHttpBindingsGetBucketLoggingInput(input, restEncoder); err != nil {
  2694. return out, metadata, &smithy.SerializationError{Err: err}
  2695. }
  2696. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2697. return out, metadata, &smithy.SerializationError{Err: err}
  2698. }
  2699. in.Request = request
  2700. endTimer()
  2701. span.End()
  2702. return next.HandleSerialize(ctx, in)
  2703. }
  2704. func awsRestxml_serializeOpHttpBindingsGetBucketLoggingInput(v *GetBucketLoggingInput, encoder *httpbinding.Encoder) error {
  2705. if v == nil {
  2706. return fmt.Errorf("unsupported serialization of nil %T", v)
  2707. }
  2708. if v.ExpectedBucketOwner != nil {
  2709. locationName := "X-Amz-Expected-Bucket-Owner"
  2710. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2711. }
  2712. return nil
  2713. }
  2714. type awsRestxml_serializeOpGetBucketMetadataConfiguration struct {
  2715. }
  2716. func (*awsRestxml_serializeOpGetBucketMetadataConfiguration) ID() string {
  2717. return "OperationSerializer"
  2718. }
  2719. func (m *awsRestxml_serializeOpGetBucketMetadataConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2720. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2721. ) {
  2722. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2723. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2724. defer endTimer()
  2725. defer span.End()
  2726. request, ok := in.Request.(*smithyhttp.Request)
  2727. if !ok {
  2728. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2729. }
  2730. input, ok := in.Parameters.(*GetBucketMetadataConfigurationInput)
  2731. _ = input
  2732. if !ok {
  2733. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2734. }
  2735. opPath, opQuery := httpbinding.SplitURI("/?metadataConfiguration")
  2736. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2737. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2738. request.Method = "GET"
  2739. var restEncoder *httpbinding.Encoder
  2740. if request.URL.RawPath == "" {
  2741. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2742. } else {
  2743. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2744. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2745. }
  2746. if err != nil {
  2747. return out, metadata, &smithy.SerializationError{Err: err}
  2748. }
  2749. if err := awsRestxml_serializeOpHttpBindingsGetBucketMetadataConfigurationInput(input, restEncoder); err != nil {
  2750. return out, metadata, &smithy.SerializationError{Err: err}
  2751. }
  2752. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2753. return out, metadata, &smithy.SerializationError{Err: err}
  2754. }
  2755. in.Request = request
  2756. endTimer()
  2757. span.End()
  2758. return next.HandleSerialize(ctx, in)
  2759. }
  2760. func awsRestxml_serializeOpHttpBindingsGetBucketMetadataConfigurationInput(v *GetBucketMetadataConfigurationInput, encoder *httpbinding.Encoder) error {
  2761. if v == nil {
  2762. return fmt.Errorf("unsupported serialization of nil %T", v)
  2763. }
  2764. if v.ExpectedBucketOwner != nil {
  2765. locationName := "X-Amz-Expected-Bucket-Owner"
  2766. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2767. }
  2768. return nil
  2769. }
  2770. type awsRestxml_serializeOpGetBucketMetadataTableConfiguration struct {
  2771. }
  2772. func (*awsRestxml_serializeOpGetBucketMetadataTableConfiguration) ID() string {
  2773. return "OperationSerializer"
  2774. }
  2775. func (m *awsRestxml_serializeOpGetBucketMetadataTableConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2776. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2777. ) {
  2778. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2779. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2780. defer endTimer()
  2781. defer span.End()
  2782. request, ok := in.Request.(*smithyhttp.Request)
  2783. if !ok {
  2784. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2785. }
  2786. input, ok := in.Parameters.(*GetBucketMetadataTableConfigurationInput)
  2787. _ = input
  2788. if !ok {
  2789. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2790. }
  2791. opPath, opQuery := httpbinding.SplitURI("/?metadataTable")
  2792. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2793. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2794. request.Method = "GET"
  2795. var restEncoder *httpbinding.Encoder
  2796. if request.URL.RawPath == "" {
  2797. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2798. } else {
  2799. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2800. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2801. }
  2802. if err != nil {
  2803. return out, metadata, &smithy.SerializationError{Err: err}
  2804. }
  2805. if err := awsRestxml_serializeOpHttpBindingsGetBucketMetadataTableConfigurationInput(input, restEncoder); err != nil {
  2806. return out, metadata, &smithy.SerializationError{Err: err}
  2807. }
  2808. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2809. return out, metadata, &smithy.SerializationError{Err: err}
  2810. }
  2811. in.Request = request
  2812. endTimer()
  2813. span.End()
  2814. return next.HandleSerialize(ctx, in)
  2815. }
  2816. func awsRestxml_serializeOpHttpBindingsGetBucketMetadataTableConfigurationInput(v *GetBucketMetadataTableConfigurationInput, encoder *httpbinding.Encoder) error {
  2817. if v == nil {
  2818. return fmt.Errorf("unsupported serialization of nil %T", v)
  2819. }
  2820. if v.ExpectedBucketOwner != nil {
  2821. locationName := "X-Amz-Expected-Bucket-Owner"
  2822. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2823. }
  2824. return nil
  2825. }
  2826. type awsRestxml_serializeOpGetBucketMetricsConfiguration struct {
  2827. }
  2828. func (*awsRestxml_serializeOpGetBucketMetricsConfiguration) ID() string {
  2829. return "OperationSerializer"
  2830. }
  2831. func (m *awsRestxml_serializeOpGetBucketMetricsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2832. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2833. ) {
  2834. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2835. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2836. defer endTimer()
  2837. defer span.End()
  2838. request, ok := in.Request.(*smithyhttp.Request)
  2839. if !ok {
  2840. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2841. }
  2842. input, ok := in.Parameters.(*GetBucketMetricsConfigurationInput)
  2843. _ = input
  2844. if !ok {
  2845. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2846. }
  2847. opPath, opQuery := httpbinding.SplitURI("/?metrics&x-id=GetBucketMetricsConfiguration")
  2848. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2849. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2850. request.Method = "GET"
  2851. var restEncoder *httpbinding.Encoder
  2852. if request.URL.RawPath == "" {
  2853. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2854. } else {
  2855. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2856. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2857. }
  2858. if err != nil {
  2859. return out, metadata, &smithy.SerializationError{Err: err}
  2860. }
  2861. if err := awsRestxml_serializeOpHttpBindingsGetBucketMetricsConfigurationInput(input, restEncoder); err != nil {
  2862. return out, metadata, &smithy.SerializationError{Err: err}
  2863. }
  2864. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2865. return out, metadata, &smithy.SerializationError{Err: err}
  2866. }
  2867. in.Request = request
  2868. endTimer()
  2869. span.End()
  2870. return next.HandleSerialize(ctx, in)
  2871. }
  2872. func awsRestxml_serializeOpHttpBindingsGetBucketMetricsConfigurationInput(v *GetBucketMetricsConfigurationInput, encoder *httpbinding.Encoder) error {
  2873. if v == nil {
  2874. return fmt.Errorf("unsupported serialization of nil %T", v)
  2875. }
  2876. if v.ExpectedBucketOwner != nil {
  2877. locationName := "X-Amz-Expected-Bucket-Owner"
  2878. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2879. }
  2880. if v.Id != nil {
  2881. encoder.SetQuery("id").String(*v.Id)
  2882. }
  2883. return nil
  2884. }
  2885. type awsRestxml_serializeOpGetBucketNotificationConfiguration struct {
  2886. }
  2887. func (*awsRestxml_serializeOpGetBucketNotificationConfiguration) ID() string {
  2888. return "OperationSerializer"
  2889. }
  2890. func (m *awsRestxml_serializeOpGetBucketNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2891. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2892. ) {
  2893. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2894. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2895. defer endTimer()
  2896. defer span.End()
  2897. request, ok := in.Request.(*smithyhttp.Request)
  2898. if !ok {
  2899. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2900. }
  2901. input, ok := in.Parameters.(*GetBucketNotificationConfigurationInput)
  2902. _ = input
  2903. if !ok {
  2904. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2905. }
  2906. opPath, opQuery := httpbinding.SplitURI("/?notification")
  2907. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2908. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2909. request.Method = "GET"
  2910. var restEncoder *httpbinding.Encoder
  2911. if request.URL.RawPath == "" {
  2912. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2913. } else {
  2914. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2915. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2916. }
  2917. if err != nil {
  2918. return out, metadata, &smithy.SerializationError{Err: err}
  2919. }
  2920. if err := awsRestxml_serializeOpHttpBindingsGetBucketNotificationConfigurationInput(input, restEncoder); err != nil {
  2921. return out, metadata, &smithy.SerializationError{Err: err}
  2922. }
  2923. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2924. return out, metadata, &smithy.SerializationError{Err: err}
  2925. }
  2926. in.Request = request
  2927. endTimer()
  2928. span.End()
  2929. return next.HandleSerialize(ctx, in)
  2930. }
  2931. func awsRestxml_serializeOpHttpBindingsGetBucketNotificationConfigurationInput(v *GetBucketNotificationConfigurationInput, encoder *httpbinding.Encoder) error {
  2932. if v == nil {
  2933. return fmt.Errorf("unsupported serialization of nil %T", v)
  2934. }
  2935. if v.ExpectedBucketOwner != nil {
  2936. locationName := "X-Amz-Expected-Bucket-Owner"
  2937. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2938. }
  2939. return nil
  2940. }
  2941. type awsRestxml_serializeOpGetBucketOwnershipControls struct {
  2942. }
  2943. func (*awsRestxml_serializeOpGetBucketOwnershipControls) ID() string {
  2944. return "OperationSerializer"
  2945. }
  2946. func (m *awsRestxml_serializeOpGetBucketOwnershipControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  2947. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  2948. ) {
  2949. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  2950. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  2951. defer endTimer()
  2952. defer span.End()
  2953. request, ok := in.Request.(*smithyhttp.Request)
  2954. if !ok {
  2955. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  2956. }
  2957. input, ok := in.Parameters.(*GetBucketOwnershipControlsInput)
  2958. _ = input
  2959. if !ok {
  2960. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  2961. }
  2962. opPath, opQuery := httpbinding.SplitURI("/?ownershipControls")
  2963. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  2964. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  2965. request.Method = "GET"
  2966. var restEncoder *httpbinding.Encoder
  2967. if request.URL.RawPath == "" {
  2968. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  2969. } else {
  2970. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  2971. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  2972. }
  2973. if err != nil {
  2974. return out, metadata, &smithy.SerializationError{Err: err}
  2975. }
  2976. if err := awsRestxml_serializeOpHttpBindingsGetBucketOwnershipControlsInput(input, restEncoder); err != nil {
  2977. return out, metadata, &smithy.SerializationError{Err: err}
  2978. }
  2979. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  2980. return out, metadata, &smithy.SerializationError{Err: err}
  2981. }
  2982. in.Request = request
  2983. endTimer()
  2984. span.End()
  2985. return next.HandleSerialize(ctx, in)
  2986. }
  2987. func awsRestxml_serializeOpHttpBindingsGetBucketOwnershipControlsInput(v *GetBucketOwnershipControlsInput, encoder *httpbinding.Encoder) error {
  2988. if v == nil {
  2989. return fmt.Errorf("unsupported serialization of nil %T", v)
  2990. }
  2991. if v.ExpectedBucketOwner != nil {
  2992. locationName := "X-Amz-Expected-Bucket-Owner"
  2993. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  2994. }
  2995. return nil
  2996. }
  2997. type awsRestxml_serializeOpGetBucketPolicy struct {
  2998. }
  2999. func (*awsRestxml_serializeOpGetBucketPolicy) ID() string {
  3000. return "OperationSerializer"
  3001. }
  3002. func (m *awsRestxml_serializeOpGetBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3003. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3004. ) {
  3005. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3006. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3007. defer endTimer()
  3008. defer span.End()
  3009. request, ok := in.Request.(*smithyhttp.Request)
  3010. if !ok {
  3011. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3012. }
  3013. input, ok := in.Parameters.(*GetBucketPolicyInput)
  3014. _ = input
  3015. if !ok {
  3016. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3017. }
  3018. opPath, opQuery := httpbinding.SplitURI("/?policy")
  3019. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3020. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3021. request.Method = "GET"
  3022. var restEncoder *httpbinding.Encoder
  3023. if request.URL.RawPath == "" {
  3024. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3025. } else {
  3026. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3027. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3028. }
  3029. if err != nil {
  3030. return out, metadata, &smithy.SerializationError{Err: err}
  3031. }
  3032. if err := awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(input, restEncoder); err != nil {
  3033. return out, metadata, &smithy.SerializationError{Err: err}
  3034. }
  3035. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3036. return out, metadata, &smithy.SerializationError{Err: err}
  3037. }
  3038. in.Request = request
  3039. endTimer()
  3040. span.End()
  3041. return next.HandleSerialize(ctx, in)
  3042. }
  3043. func awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(v *GetBucketPolicyInput, encoder *httpbinding.Encoder) error {
  3044. if v == nil {
  3045. return fmt.Errorf("unsupported serialization of nil %T", v)
  3046. }
  3047. if v.ExpectedBucketOwner != nil {
  3048. locationName := "X-Amz-Expected-Bucket-Owner"
  3049. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3050. }
  3051. return nil
  3052. }
  3053. type awsRestxml_serializeOpGetBucketPolicyStatus struct {
  3054. }
  3055. func (*awsRestxml_serializeOpGetBucketPolicyStatus) ID() string {
  3056. return "OperationSerializer"
  3057. }
  3058. func (m *awsRestxml_serializeOpGetBucketPolicyStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3059. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3060. ) {
  3061. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3062. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3063. defer endTimer()
  3064. defer span.End()
  3065. request, ok := in.Request.(*smithyhttp.Request)
  3066. if !ok {
  3067. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3068. }
  3069. input, ok := in.Parameters.(*GetBucketPolicyStatusInput)
  3070. _ = input
  3071. if !ok {
  3072. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3073. }
  3074. opPath, opQuery := httpbinding.SplitURI("/?policyStatus")
  3075. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3076. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3077. request.Method = "GET"
  3078. var restEncoder *httpbinding.Encoder
  3079. if request.URL.RawPath == "" {
  3080. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3081. } else {
  3082. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3083. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3084. }
  3085. if err != nil {
  3086. return out, metadata, &smithy.SerializationError{Err: err}
  3087. }
  3088. if err := awsRestxml_serializeOpHttpBindingsGetBucketPolicyStatusInput(input, restEncoder); err != nil {
  3089. return out, metadata, &smithy.SerializationError{Err: err}
  3090. }
  3091. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3092. return out, metadata, &smithy.SerializationError{Err: err}
  3093. }
  3094. in.Request = request
  3095. endTimer()
  3096. span.End()
  3097. return next.HandleSerialize(ctx, in)
  3098. }
  3099. func awsRestxml_serializeOpHttpBindingsGetBucketPolicyStatusInput(v *GetBucketPolicyStatusInput, encoder *httpbinding.Encoder) error {
  3100. if v == nil {
  3101. return fmt.Errorf("unsupported serialization of nil %T", v)
  3102. }
  3103. if v.ExpectedBucketOwner != nil {
  3104. locationName := "X-Amz-Expected-Bucket-Owner"
  3105. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3106. }
  3107. return nil
  3108. }
  3109. type awsRestxml_serializeOpGetBucketReplication struct {
  3110. }
  3111. func (*awsRestxml_serializeOpGetBucketReplication) ID() string {
  3112. return "OperationSerializer"
  3113. }
  3114. func (m *awsRestxml_serializeOpGetBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3115. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3116. ) {
  3117. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3118. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3119. defer endTimer()
  3120. defer span.End()
  3121. request, ok := in.Request.(*smithyhttp.Request)
  3122. if !ok {
  3123. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3124. }
  3125. input, ok := in.Parameters.(*GetBucketReplicationInput)
  3126. _ = input
  3127. if !ok {
  3128. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3129. }
  3130. opPath, opQuery := httpbinding.SplitURI("/?replication")
  3131. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3132. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3133. request.Method = "GET"
  3134. var restEncoder *httpbinding.Encoder
  3135. if request.URL.RawPath == "" {
  3136. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3137. } else {
  3138. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3139. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3140. }
  3141. if err != nil {
  3142. return out, metadata, &smithy.SerializationError{Err: err}
  3143. }
  3144. if err := awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(input, restEncoder); err != nil {
  3145. return out, metadata, &smithy.SerializationError{Err: err}
  3146. }
  3147. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3148. return out, metadata, &smithy.SerializationError{Err: err}
  3149. }
  3150. in.Request = request
  3151. endTimer()
  3152. span.End()
  3153. return next.HandleSerialize(ctx, in)
  3154. }
  3155. func awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(v *GetBucketReplicationInput, encoder *httpbinding.Encoder) error {
  3156. if v == nil {
  3157. return fmt.Errorf("unsupported serialization of nil %T", v)
  3158. }
  3159. if v.ExpectedBucketOwner != nil {
  3160. locationName := "X-Amz-Expected-Bucket-Owner"
  3161. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3162. }
  3163. return nil
  3164. }
  3165. type awsRestxml_serializeOpGetBucketRequestPayment struct {
  3166. }
  3167. func (*awsRestxml_serializeOpGetBucketRequestPayment) ID() string {
  3168. return "OperationSerializer"
  3169. }
  3170. func (m *awsRestxml_serializeOpGetBucketRequestPayment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3171. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3172. ) {
  3173. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3174. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3175. defer endTimer()
  3176. defer span.End()
  3177. request, ok := in.Request.(*smithyhttp.Request)
  3178. if !ok {
  3179. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3180. }
  3181. input, ok := in.Parameters.(*GetBucketRequestPaymentInput)
  3182. _ = input
  3183. if !ok {
  3184. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3185. }
  3186. opPath, opQuery := httpbinding.SplitURI("/?requestPayment")
  3187. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3188. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3189. request.Method = "GET"
  3190. var restEncoder *httpbinding.Encoder
  3191. if request.URL.RawPath == "" {
  3192. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3193. } else {
  3194. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3195. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3196. }
  3197. if err != nil {
  3198. return out, metadata, &smithy.SerializationError{Err: err}
  3199. }
  3200. if err := awsRestxml_serializeOpHttpBindingsGetBucketRequestPaymentInput(input, restEncoder); err != nil {
  3201. return out, metadata, &smithy.SerializationError{Err: err}
  3202. }
  3203. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3204. return out, metadata, &smithy.SerializationError{Err: err}
  3205. }
  3206. in.Request = request
  3207. endTimer()
  3208. span.End()
  3209. return next.HandleSerialize(ctx, in)
  3210. }
  3211. func awsRestxml_serializeOpHttpBindingsGetBucketRequestPaymentInput(v *GetBucketRequestPaymentInput, encoder *httpbinding.Encoder) error {
  3212. if v == nil {
  3213. return fmt.Errorf("unsupported serialization of nil %T", v)
  3214. }
  3215. if v.ExpectedBucketOwner != nil {
  3216. locationName := "X-Amz-Expected-Bucket-Owner"
  3217. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3218. }
  3219. return nil
  3220. }
  3221. type awsRestxml_serializeOpGetBucketTagging struct {
  3222. }
  3223. func (*awsRestxml_serializeOpGetBucketTagging) ID() string {
  3224. return "OperationSerializer"
  3225. }
  3226. func (m *awsRestxml_serializeOpGetBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3227. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3228. ) {
  3229. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3230. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3231. defer endTimer()
  3232. defer span.End()
  3233. request, ok := in.Request.(*smithyhttp.Request)
  3234. if !ok {
  3235. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3236. }
  3237. input, ok := in.Parameters.(*GetBucketTaggingInput)
  3238. _ = input
  3239. if !ok {
  3240. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3241. }
  3242. opPath, opQuery := httpbinding.SplitURI("/?tagging")
  3243. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3244. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3245. request.Method = "GET"
  3246. var restEncoder *httpbinding.Encoder
  3247. if request.URL.RawPath == "" {
  3248. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3249. } else {
  3250. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3251. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3252. }
  3253. if err != nil {
  3254. return out, metadata, &smithy.SerializationError{Err: err}
  3255. }
  3256. if err := awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(input, restEncoder); err != nil {
  3257. return out, metadata, &smithy.SerializationError{Err: err}
  3258. }
  3259. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3260. return out, metadata, &smithy.SerializationError{Err: err}
  3261. }
  3262. in.Request = request
  3263. endTimer()
  3264. span.End()
  3265. return next.HandleSerialize(ctx, in)
  3266. }
  3267. func awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(v *GetBucketTaggingInput, encoder *httpbinding.Encoder) error {
  3268. if v == nil {
  3269. return fmt.Errorf("unsupported serialization of nil %T", v)
  3270. }
  3271. if v.ExpectedBucketOwner != nil {
  3272. locationName := "X-Amz-Expected-Bucket-Owner"
  3273. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3274. }
  3275. return nil
  3276. }
  3277. type awsRestxml_serializeOpGetBucketVersioning struct {
  3278. }
  3279. func (*awsRestxml_serializeOpGetBucketVersioning) ID() string {
  3280. return "OperationSerializer"
  3281. }
  3282. func (m *awsRestxml_serializeOpGetBucketVersioning) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3283. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3284. ) {
  3285. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3286. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3287. defer endTimer()
  3288. defer span.End()
  3289. request, ok := in.Request.(*smithyhttp.Request)
  3290. if !ok {
  3291. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3292. }
  3293. input, ok := in.Parameters.(*GetBucketVersioningInput)
  3294. _ = input
  3295. if !ok {
  3296. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3297. }
  3298. opPath, opQuery := httpbinding.SplitURI("/?versioning")
  3299. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3300. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3301. request.Method = "GET"
  3302. var restEncoder *httpbinding.Encoder
  3303. if request.URL.RawPath == "" {
  3304. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3305. } else {
  3306. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3307. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3308. }
  3309. if err != nil {
  3310. return out, metadata, &smithy.SerializationError{Err: err}
  3311. }
  3312. if err := awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(input, restEncoder); err != nil {
  3313. return out, metadata, &smithy.SerializationError{Err: err}
  3314. }
  3315. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3316. return out, metadata, &smithy.SerializationError{Err: err}
  3317. }
  3318. in.Request = request
  3319. endTimer()
  3320. span.End()
  3321. return next.HandleSerialize(ctx, in)
  3322. }
  3323. func awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(v *GetBucketVersioningInput, encoder *httpbinding.Encoder) error {
  3324. if v == nil {
  3325. return fmt.Errorf("unsupported serialization of nil %T", v)
  3326. }
  3327. if v.ExpectedBucketOwner != nil {
  3328. locationName := "X-Amz-Expected-Bucket-Owner"
  3329. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3330. }
  3331. return nil
  3332. }
  3333. type awsRestxml_serializeOpGetBucketWebsite struct {
  3334. }
  3335. func (*awsRestxml_serializeOpGetBucketWebsite) ID() string {
  3336. return "OperationSerializer"
  3337. }
  3338. func (m *awsRestxml_serializeOpGetBucketWebsite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3339. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3340. ) {
  3341. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3342. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3343. defer endTimer()
  3344. defer span.End()
  3345. request, ok := in.Request.(*smithyhttp.Request)
  3346. if !ok {
  3347. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3348. }
  3349. input, ok := in.Parameters.(*GetBucketWebsiteInput)
  3350. _ = input
  3351. if !ok {
  3352. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3353. }
  3354. opPath, opQuery := httpbinding.SplitURI("/?website")
  3355. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3356. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3357. request.Method = "GET"
  3358. var restEncoder *httpbinding.Encoder
  3359. if request.URL.RawPath == "" {
  3360. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3361. } else {
  3362. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3363. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3364. }
  3365. if err != nil {
  3366. return out, metadata, &smithy.SerializationError{Err: err}
  3367. }
  3368. if err := awsRestxml_serializeOpHttpBindingsGetBucketWebsiteInput(input, restEncoder); err != nil {
  3369. return out, metadata, &smithy.SerializationError{Err: err}
  3370. }
  3371. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3372. return out, metadata, &smithy.SerializationError{Err: err}
  3373. }
  3374. in.Request = request
  3375. endTimer()
  3376. span.End()
  3377. return next.HandleSerialize(ctx, in)
  3378. }
  3379. func awsRestxml_serializeOpHttpBindingsGetBucketWebsiteInput(v *GetBucketWebsiteInput, encoder *httpbinding.Encoder) error {
  3380. if v == nil {
  3381. return fmt.Errorf("unsupported serialization of nil %T", v)
  3382. }
  3383. if v.ExpectedBucketOwner != nil {
  3384. locationName := "X-Amz-Expected-Bucket-Owner"
  3385. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3386. }
  3387. return nil
  3388. }
  3389. type awsRestxml_serializeOpGetObject struct {
  3390. }
  3391. func (*awsRestxml_serializeOpGetObject) ID() string {
  3392. return "OperationSerializer"
  3393. }
  3394. func (m *awsRestxml_serializeOpGetObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3395. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3396. ) {
  3397. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3398. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3399. defer endTimer()
  3400. defer span.End()
  3401. request, ok := in.Request.(*smithyhttp.Request)
  3402. if !ok {
  3403. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3404. }
  3405. input, ok := in.Parameters.(*GetObjectInput)
  3406. _ = input
  3407. if !ok {
  3408. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3409. }
  3410. opPath, opQuery := httpbinding.SplitURI("/{Key+}?x-id=GetObject")
  3411. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3412. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3413. request.Method = "GET"
  3414. var restEncoder *httpbinding.Encoder
  3415. if request.URL.RawPath == "" {
  3416. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3417. } else {
  3418. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3419. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3420. }
  3421. if err != nil {
  3422. return out, metadata, &smithy.SerializationError{Err: err}
  3423. }
  3424. if err := awsRestxml_serializeOpHttpBindingsGetObjectInput(input, restEncoder); err != nil {
  3425. return out, metadata, &smithy.SerializationError{Err: err}
  3426. }
  3427. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3428. return out, metadata, &smithy.SerializationError{Err: err}
  3429. }
  3430. in.Request = request
  3431. endTimer()
  3432. span.End()
  3433. return next.HandleSerialize(ctx, in)
  3434. }
  3435. func awsRestxml_serializeOpHttpBindingsGetObjectInput(v *GetObjectInput, encoder *httpbinding.Encoder) error {
  3436. if v == nil {
  3437. return fmt.Errorf("unsupported serialization of nil %T", v)
  3438. }
  3439. if len(v.ChecksumMode) > 0 {
  3440. locationName := "X-Amz-Checksum-Mode"
  3441. encoder.SetHeader(locationName).String(string(v.ChecksumMode))
  3442. }
  3443. if v.ExpectedBucketOwner != nil {
  3444. locationName := "X-Amz-Expected-Bucket-Owner"
  3445. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3446. }
  3447. if v.IfMatch != nil {
  3448. locationName := "If-Match"
  3449. encoder.SetHeader(locationName).String(*v.IfMatch)
  3450. }
  3451. if v.IfModifiedSince != nil {
  3452. locationName := "If-Modified-Since"
  3453. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfModifiedSince))
  3454. }
  3455. if v.IfNoneMatch != nil {
  3456. locationName := "If-None-Match"
  3457. encoder.SetHeader(locationName).String(*v.IfNoneMatch)
  3458. }
  3459. if v.IfUnmodifiedSince != nil {
  3460. locationName := "If-Unmodified-Since"
  3461. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfUnmodifiedSince))
  3462. }
  3463. if v.Key == nil || len(*v.Key) == 0 {
  3464. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  3465. }
  3466. if v.Key != nil {
  3467. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  3468. return err
  3469. }
  3470. }
  3471. if v.PartNumber != nil {
  3472. encoder.SetQuery("partNumber").Integer(*v.PartNumber)
  3473. }
  3474. if v.Range != nil {
  3475. locationName := "Range"
  3476. encoder.SetHeader(locationName).String(*v.Range)
  3477. }
  3478. if len(v.RequestPayer) > 0 {
  3479. locationName := "X-Amz-Request-Payer"
  3480. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  3481. }
  3482. if v.ResponseCacheControl != nil {
  3483. encoder.SetQuery("response-cache-control").String(*v.ResponseCacheControl)
  3484. }
  3485. if v.ResponseContentDisposition != nil {
  3486. encoder.SetQuery("response-content-disposition").String(*v.ResponseContentDisposition)
  3487. }
  3488. if v.ResponseContentEncoding != nil {
  3489. encoder.SetQuery("response-content-encoding").String(*v.ResponseContentEncoding)
  3490. }
  3491. if v.ResponseContentLanguage != nil {
  3492. encoder.SetQuery("response-content-language").String(*v.ResponseContentLanguage)
  3493. }
  3494. if v.ResponseContentType != nil {
  3495. encoder.SetQuery("response-content-type").String(*v.ResponseContentType)
  3496. }
  3497. if v.ResponseExpires != nil {
  3498. encoder.SetQuery("response-expires").String(smithytime.FormatHTTPDate(*v.ResponseExpires))
  3499. }
  3500. if v.SSECustomerAlgorithm != nil {
  3501. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  3502. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  3503. }
  3504. if v.SSECustomerKey != nil {
  3505. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  3506. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  3507. }
  3508. if v.SSECustomerKeyMD5 != nil {
  3509. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  3510. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  3511. }
  3512. if v.VersionId != nil {
  3513. encoder.SetQuery("versionId").String(*v.VersionId)
  3514. }
  3515. return nil
  3516. }
  3517. type awsRestxml_serializeOpGetObjectAcl struct {
  3518. }
  3519. func (*awsRestxml_serializeOpGetObjectAcl) ID() string {
  3520. return "OperationSerializer"
  3521. }
  3522. func (m *awsRestxml_serializeOpGetObjectAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3523. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3524. ) {
  3525. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3526. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3527. defer endTimer()
  3528. defer span.End()
  3529. request, ok := in.Request.(*smithyhttp.Request)
  3530. if !ok {
  3531. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3532. }
  3533. input, ok := in.Parameters.(*GetObjectAclInput)
  3534. _ = input
  3535. if !ok {
  3536. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3537. }
  3538. opPath, opQuery := httpbinding.SplitURI("/{Key+}?acl")
  3539. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3540. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3541. request.Method = "GET"
  3542. var restEncoder *httpbinding.Encoder
  3543. if request.URL.RawPath == "" {
  3544. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3545. } else {
  3546. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3547. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3548. }
  3549. if err != nil {
  3550. return out, metadata, &smithy.SerializationError{Err: err}
  3551. }
  3552. if err := awsRestxml_serializeOpHttpBindingsGetObjectAclInput(input, restEncoder); err != nil {
  3553. return out, metadata, &smithy.SerializationError{Err: err}
  3554. }
  3555. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3556. return out, metadata, &smithy.SerializationError{Err: err}
  3557. }
  3558. in.Request = request
  3559. endTimer()
  3560. span.End()
  3561. return next.HandleSerialize(ctx, in)
  3562. }
  3563. func awsRestxml_serializeOpHttpBindingsGetObjectAclInput(v *GetObjectAclInput, encoder *httpbinding.Encoder) error {
  3564. if v == nil {
  3565. return fmt.Errorf("unsupported serialization of nil %T", v)
  3566. }
  3567. if v.ExpectedBucketOwner != nil {
  3568. locationName := "X-Amz-Expected-Bucket-Owner"
  3569. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3570. }
  3571. if v.Key == nil || len(*v.Key) == 0 {
  3572. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  3573. }
  3574. if v.Key != nil {
  3575. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  3576. return err
  3577. }
  3578. }
  3579. if len(v.RequestPayer) > 0 {
  3580. locationName := "X-Amz-Request-Payer"
  3581. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  3582. }
  3583. if v.VersionId != nil {
  3584. encoder.SetQuery("versionId").String(*v.VersionId)
  3585. }
  3586. return nil
  3587. }
  3588. type awsRestxml_serializeOpGetObjectAttributes struct {
  3589. }
  3590. func (*awsRestxml_serializeOpGetObjectAttributes) ID() string {
  3591. return "OperationSerializer"
  3592. }
  3593. func (m *awsRestxml_serializeOpGetObjectAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3594. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3595. ) {
  3596. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3597. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3598. defer endTimer()
  3599. defer span.End()
  3600. request, ok := in.Request.(*smithyhttp.Request)
  3601. if !ok {
  3602. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3603. }
  3604. input, ok := in.Parameters.(*GetObjectAttributesInput)
  3605. _ = input
  3606. if !ok {
  3607. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3608. }
  3609. opPath, opQuery := httpbinding.SplitURI("/{Key+}?attributes")
  3610. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3611. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3612. request.Method = "GET"
  3613. var restEncoder *httpbinding.Encoder
  3614. if request.URL.RawPath == "" {
  3615. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3616. } else {
  3617. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3618. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3619. }
  3620. if err != nil {
  3621. return out, metadata, &smithy.SerializationError{Err: err}
  3622. }
  3623. if err := awsRestxml_serializeOpHttpBindingsGetObjectAttributesInput(input, restEncoder); err != nil {
  3624. return out, metadata, &smithy.SerializationError{Err: err}
  3625. }
  3626. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3627. return out, metadata, &smithy.SerializationError{Err: err}
  3628. }
  3629. in.Request = request
  3630. endTimer()
  3631. span.End()
  3632. return next.HandleSerialize(ctx, in)
  3633. }
  3634. func awsRestxml_serializeOpHttpBindingsGetObjectAttributesInput(v *GetObjectAttributesInput, encoder *httpbinding.Encoder) error {
  3635. if v == nil {
  3636. return fmt.Errorf("unsupported serialization of nil %T", v)
  3637. }
  3638. if v.ExpectedBucketOwner != nil {
  3639. locationName := "X-Amz-Expected-Bucket-Owner"
  3640. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3641. }
  3642. if v.Key == nil || len(*v.Key) == 0 {
  3643. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  3644. }
  3645. if v.Key != nil {
  3646. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  3647. return err
  3648. }
  3649. }
  3650. if v.MaxParts != nil {
  3651. locationName := "X-Amz-Max-Parts"
  3652. encoder.SetHeader(locationName).Integer(*v.MaxParts)
  3653. }
  3654. if v.ObjectAttributes != nil {
  3655. locationName := "X-Amz-Object-Attributes"
  3656. if len(v.ObjectAttributes) == 0 {
  3657. encoder.AddHeader(locationName).String("")
  3658. }
  3659. for i := range v.ObjectAttributes {
  3660. if len(v.ObjectAttributes[i]) > 0 {
  3661. escaped := string(v.ObjectAttributes[i])
  3662. if strings.Index(string(v.ObjectAttributes[i]), `,`) != -1 || strings.Index(string(v.ObjectAttributes[i]), `"`) != -1 {
  3663. escaped = strconv.Quote(string(v.ObjectAttributes[i]))
  3664. }
  3665. encoder.AddHeader(locationName).String(string(escaped))
  3666. }
  3667. }
  3668. }
  3669. if v.PartNumberMarker != nil {
  3670. locationName := "X-Amz-Part-Number-Marker"
  3671. encoder.SetHeader(locationName).String(*v.PartNumberMarker)
  3672. }
  3673. if len(v.RequestPayer) > 0 {
  3674. locationName := "X-Amz-Request-Payer"
  3675. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  3676. }
  3677. if v.SSECustomerAlgorithm != nil {
  3678. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  3679. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  3680. }
  3681. if v.SSECustomerKey != nil {
  3682. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  3683. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  3684. }
  3685. if v.SSECustomerKeyMD5 != nil {
  3686. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  3687. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  3688. }
  3689. if v.VersionId != nil {
  3690. encoder.SetQuery("versionId").String(*v.VersionId)
  3691. }
  3692. return nil
  3693. }
  3694. type awsRestxml_serializeOpGetObjectLegalHold struct {
  3695. }
  3696. func (*awsRestxml_serializeOpGetObjectLegalHold) ID() string {
  3697. return "OperationSerializer"
  3698. }
  3699. func (m *awsRestxml_serializeOpGetObjectLegalHold) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3700. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3701. ) {
  3702. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3703. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3704. defer endTimer()
  3705. defer span.End()
  3706. request, ok := in.Request.(*smithyhttp.Request)
  3707. if !ok {
  3708. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3709. }
  3710. input, ok := in.Parameters.(*GetObjectLegalHoldInput)
  3711. _ = input
  3712. if !ok {
  3713. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3714. }
  3715. opPath, opQuery := httpbinding.SplitURI("/{Key+}?legal-hold")
  3716. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3717. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3718. request.Method = "GET"
  3719. var restEncoder *httpbinding.Encoder
  3720. if request.URL.RawPath == "" {
  3721. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3722. } else {
  3723. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3724. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3725. }
  3726. if err != nil {
  3727. return out, metadata, &smithy.SerializationError{Err: err}
  3728. }
  3729. if err := awsRestxml_serializeOpHttpBindingsGetObjectLegalHoldInput(input, restEncoder); err != nil {
  3730. return out, metadata, &smithy.SerializationError{Err: err}
  3731. }
  3732. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3733. return out, metadata, &smithy.SerializationError{Err: err}
  3734. }
  3735. in.Request = request
  3736. endTimer()
  3737. span.End()
  3738. return next.HandleSerialize(ctx, in)
  3739. }
  3740. func awsRestxml_serializeOpHttpBindingsGetObjectLegalHoldInput(v *GetObjectLegalHoldInput, encoder *httpbinding.Encoder) error {
  3741. if v == nil {
  3742. return fmt.Errorf("unsupported serialization of nil %T", v)
  3743. }
  3744. if v.ExpectedBucketOwner != nil {
  3745. locationName := "X-Amz-Expected-Bucket-Owner"
  3746. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3747. }
  3748. if v.Key == nil || len(*v.Key) == 0 {
  3749. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  3750. }
  3751. if v.Key != nil {
  3752. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  3753. return err
  3754. }
  3755. }
  3756. if len(v.RequestPayer) > 0 {
  3757. locationName := "X-Amz-Request-Payer"
  3758. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  3759. }
  3760. if v.VersionId != nil {
  3761. encoder.SetQuery("versionId").String(*v.VersionId)
  3762. }
  3763. return nil
  3764. }
  3765. type awsRestxml_serializeOpGetObjectLockConfiguration struct {
  3766. }
  3767. func (*awsRestxml_serializeOpGetObjectLockConfiguration) ID() string {
  3768. return "OperationSerializer"
  3769. }
  3770. func (m *awsRestxml_serializeOpGetObjectLockConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3771. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3772. ) {
  3773. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3774. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3775. defer endTimer()
  3776. defer span.End()
  3777. request, ok := in.Request.(*smithyhttp.Request)
  3778. if !ok {
  3779. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3780. }
  3781. input, ok := in.Parameters.(*GetObjectLockConfigurationInput)
  3782. _ = input
  3783. if !ok {
  3784. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3785. }
  3786. opPath, opQuery := httpbinding.SplitURI("/?object-lock")
  3787. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3788. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3789. request.Method = "GET"
  3790. var restEncoder *httpbinding.Encoder
  3791. if request.URL.RawPath == "" {
  3792. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3793. } else {
  3794. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3795. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3796. }
  3797. if err != nil {
  3798. return out, metadata, &smithy.SerializationError{Err: err}
  3799. }
  3800. if err := awsRestxml_serializeOpHttpBindingsGetObjectLockConfigurationInput(input, restEncoder); err != nil {
  3801. return out, metadata, &smithy.SerializationError{Err: err}
  3802. }
  3803. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3804. return out, metadata, &smithy.SerializationError{Err: err}
  3805. }
  3806. in.Request = request
  3807. endTimer()
  3808. span.End()
  3809. return next.HandleSerialize(ctx, in)
  3810. }
  3811. func awsRestxml_serializeOpHttpBindingsGetObjectLockConfigurationInput(v *GetObjectLockConfigurationInput, encoder *httpbinding.Encoder) error {
  3812. if v == nil {
  3813. return fmt.Errorf("unsupported serialization of nil %T", v)
  3814. }
  3815. if v.ExpectedBucketOwner != nil {
  3816. locationName := "X-Amz-Expected-Bucket-Owner"
  3817. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3818. }
  3819. return nil
  3820. }
  3821. type awsRestxml_serializeOpGetObjectRetention struct {
  3822. }
  3823. func (*awsRestxml_serializeOpGetObjectRetention) ID() string {
  3824. return "OperationSerializer"
  3825. }
  3826. func (m *awsRestxml_serializeOpGetObjectRetention) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3827. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3828. ) {
  3829. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3830. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3831. defer endTimer()
  3832. defer span.End()
  3833. request, ok := in.Request.(*smithyhttp.Request)
  3834. if !ok {
  3835. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3836. }
  3837. input, ok := in.Parameters.(*GetObjectRetentionInput)
  3838. _ = input
  3839. if !ok {
  3840. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3841. }
  3842. opPath, opQuery := httpbinding.SplitURI("/{Key+}?retention")
  3843. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3844. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3845. request.Method = "GET"
  3846. var restEncoder *httpbinding.Encoder
  3847. if request.URL.RawPath == "" {
  3848. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3849. } else {
  3850. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3851. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3852. }
  3853. if err != nil {
  3854. return out, metadata, &smithy.SerializationError{Err: err}
  3855. }
  3856. if err := awsRestxml_serializeOpHttpBindingsGetObjectRetentionInput(input, restEncoder); err != nil {
  3857. return out, metadata, &smithy.SerializationError{Err: err}
  3858. }
  3859. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3860. return out, metadata, &smithy.SerializationError{Err: err}
  3861. }
  3862. in.Request = request
  3863. endTimer()
  3864. span.End()
  3865. return next.HandleSerialize(ctx, in)
  3866. }
  3867. func awsRestxml_serializeOpHttpBindingsGetObjectRetentionInput(v *GetObjectRetentionInput, encoder *httpbinding.Encoder) error {
  3868. if v == nil {
  3869. return fmt.Errorf("unsupported serialization of nil %T", v)
  3870. }
  3871. if v.ExpectedBucketOwner != nil {
  3872. locationName := "X-Amz-Expected-Bucket-Owner"
  3873. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3874. }
  3875. if v.Key == nil || len(*v.Key) == 0 {
  3876. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  3877. }
  3878. if v.Key != nil {
  3879. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  3880. return err
  3881. }
  3882. }
  3883. if len(v.RequestPayer) > 0 {
  3884. locationName := "X-Amz-Request-Payer"
  3885. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  3886. }
  3887. if v.VersionId != nil {
  3888. encoder.SetQuery("versionId").String(*v.VersionId)
  3889. }
  3890. return nil
  3891. }
  3892. type awsRestxml_serializeOpGetObjectTagging struct {
  3893. }
  3894. func (*awsRestxml_serializeOpGetObjectTagging) ID() string {
  3895. return "OperationSerializer"
  3896. }
  3897. func (m *awsRestxml_serializeOpGetObjectTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3898. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3899. ) {
  3900. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3901. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3902. defer endTimer()
  3903. defer span.End()
  3904. request, ok := in.Request.(*smithyhttp.Request)
  3905. if !ok {
  3906. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3907. }
  3908. input, ok := in.Parameters.(*GetObjectTaggingInput)
  3909. _ = input
  3910. if !ok {
  3911. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3912. }
  3913. opPath, opQuery := httpbinding.SplitURI("/{Key+}?tagging")
  3914. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3915. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3916. request.Method = "GET"
  3917. var restEncoder *httpbinding.Encoder
  3918. if request.URL.RawPath == "" {
  3919. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3920. } else {
  3921. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3922. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3923. }
  3924. if err != nil {
  3925. return out, metadata, &smithy.SerializationError{Err: err}
  3926. }
  3927. if err := awsRestxml_serializeOpHttpBindingsGetObjectTaggingInput(input, restEncoder); err != nil {
  3928. return out, metadata, &smithy.SerializationError{Err: err}
  3929. }
  3930. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  3931. return out, metadata, &smithy.SerializationError{Err: err}
  3932. }
  3933. in.Request = request
  3934. endTimer()
  3935. span.End()
  3936. return next.HandleSerialize(ctx, in)
  3937. }
  3938. func awsRestxml_serializeOpHttpBindingsGetObjectTaggingInput(v *GetObjectTaggingInput, encoder *httpbinding.Encoder) error {
  3939. if v == nil {
  3940. return fmt.Errorf("unsupported serialization of nil %T", v)
  3941. }
  3942. if v.ExpectedBucketOwner != nil {
  3943. locationName := "X-Amz-Expected-Bucket-Owner"
  3944. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  3945. }
  3946. if v.Key == nil || len(*v.Key) == 0 {
  3947. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  3948. }
  3949. if v.Key != nil {
  3950. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  3951. return err
  3952. }
  3953. }
  3954. if len(v.RequestPayer) > 0 {
  3955. locationName := "X-Amz-Request-Payer"
  3956. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  3957. }
  3958. if v.VersionId != nil {
  3959. encoder.SetQuery("versionId").String(*v.VersionId)
  3960. }
  3961. return nil
  3962. }
  3963. type awsRestxml_serializeOpGetObjectTorrent struct {
  3964. }
  3965. func (*awsRestxml_serializeOpGetObjectTorrent) ID() string {
  3966. return "OperationSerializer"
  3967. }
  3968. func (m *awsRestxml_serializeOpGetObjectTorrent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  3969. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  3970. ) {
  3971. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  3972. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  3973. defer endTimer()
  3974. defer span.End()
  3975. request, ok := in.Request.(*smithyhttp.Request)
  3976. if !ok {
  3977. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  3978. }
  3979. input, ok := in.Parameters.(*GetObjectTorrentInput)
  3980. _ = input
  3981. if !ok {
  3982. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  3983. }
  3984. opPath, opQuery := httpbinding.SplitURI("/{Key+}?torrent")
  3985. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  3986. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  3987. request.Method = "GET"
  3988. var restEncoder *httpbinding.Encoder
  3989. if request.URL.RawPath == "" {
  3990. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  3991. } else {
  3992. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  3993. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  3994. }
  3995. if err != nil {
  3996. return out, metadata, &smithy.SerializationError{Err: err}
  3997. }
  3998. if err := awsRestxml_serializeOpHttpBindingsGetObjectTorrentInput(input, restEncoder); err != nil {
  3999. return out, metadata, &smithy.SerializationError{Err: err}
  4000. }
  4001. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4002. return out, metadata, &smithy.SerializationError{Err: err}
  4003. }
  4004. in.Request = request
  4005. endTimer()
  4006. span.End()
  4007. return next.HandleSerialize(ctx, in)
  4008. }
  4009. func awsRestxml_serializeOpHttpBindingsGetObjectTorrentInput(v *GetObjectTorrentInput, encoder *httpbinding.Encoder) error {
  4010. if v == nil {
  4011. return fmt.Errorf("unsupported serialization of nil %T", v)
  4012. }
  4013. if v.ExpectedBucketOwner != nil {
  4014. locationName := "X-Amz-Expected-Bucket-Owner"
  4015. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4016. }
  4017. if v.Key == nil || len(*v.Key) == 0 {
  4018. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  4019. }
  4020. if v.Key != nil {
  4021. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  4022. return err
  4023. }
  4024. }
  4025. if len(v.RequestPayer) > 0 {
  4026. locationName := "X-Amz-Request-Payer"
  4027. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  4028. }
  4029. return nil
  4030. }
  4031. type awsRestxml_serializeOpGetPublicAccessBlock struct {
  4032. }
  4033. func (*awsRestxml_serializeOpGetPublicAccessBlock) ID() string {
  4034. return "OperationSerializer"
  4035. }
  4036. func (m *awsRestxml_serializeOpGetPublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4037. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4038. ) {
  4039. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4040. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4041. defer endTimer()
  4042. defer span.End()
  4043. request, ok := in.Request.(*smithyhttp.Request)
  4044. if !ok {
  4045. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4046. }
  4047. input, ok := in.Parameters.(*GetPublicAccessBlockInput)
  4048. _ = input
  4049. if !ok {
  4050. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4051. }
  4052. opPath, opQuery := httpbinding.SplitURI("/?publicAccessBlock")
  4053. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4054. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4055. request.Method = "GET"
  4056. var restEncoder *httpbinding.Encoder
  4057. if request.URL.RawPath == "" {
  4058. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4059. } else {
  4060. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4061. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4062. }
  4063. if err != nil {
  4064. return out, metadata, &smithy.SerializationError{Err: err}
  4065. }
  4066. if err := awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(input, restEncoder); err != nil {
  4067. return out, metadata, &smithy.SerializationError{Err: err}
  4068. }
  4069. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4070. return out, metadata, &smithy.SerializationError{Err: err}
  4071. }
  4072. in.Request = request
  4073. endTimer()
  4074. span.End()
  4075. return next.HandleSerialize(ctx, in)
  4076. }
  4077. func awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(v *GetPublicAccessBlockInput, encoder *httpbinding.Encoder) error {
  4078. if v == nil {
  4079. return fmt.Errorf("unsupported serialization of nil %T", v)
  4080. }
  4081. if v.ExpectedBucketOwner != nil {
  4082. locationName := "X-Amz-Expected-Bucket-Owner"
  4083. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4084. }
  4085. return nil
  4086. }
  4087. type awsRestxml_serializeOpHeadBucket struct {
  4088. }
  4089. func (*awsRestxml_serializeOpHeadBucket) ID() string {
  4090. return "OperationSerializer"
  4091. }
  4092. func (m *awsRestxml_serializeOpHeadBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4093. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4094. ) {
  4095. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4096. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4097. defer endTimer()
  4098. defer span.End()
  4099. request, ok := in.Request.(*smithyhttp.Request)
  4100. if !ok {
  4101. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4102. }
  4103. input, ok := in.Parameters.(*HeadBucketInput)
  4104. _ = input
  4105. if !ok {
  4106. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4107. }
  4108. opPath, opQuery := httpbinding.SplitURI("/")
  4109. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4110. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4111. request.Method = "HEAD"
  4112. var restEncoder *httpbinding.Encoder
  4113. if request.URL.RawPath == "" {
  4114. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4115. } else {
  4116. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4117. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4118. }
  4119. if err != nil {
  4120. return out, metadata, &smithy.SerializationError{Err: err}
  4121. }
  4122. if err := awsRestxml_serializeOpHttpBindingsHeadBucketInput(input, restEncoder); err != nil {
  4123. return out, metadata, &smithy.SerializationError{Err: err}
  4124. }
  4125. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4126. return out, metadata, &smithy.SerializationError{Err: err}
  4127. }
  4128. in.Request = request
  4129. endTimer()
  4130. span.End()
  4131. return next.HandleSerialize(ctx, in)
  4132. }
  4133. func awsRestxml_serializeOpHttpBindingsHeadBucketInput(v *HeadBucketInput, encoder *httpbinding.Encoder) error {
  4134. if v == nil {
  4135. return fmt.Errorf("unsupported serialization of nil %T", v)
  4136. }
  4137. if v.ExpectedBucketOwner != nil {
  4138. locationName := "X-Amz-Expected-Bucket-Owner"
  4139. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4140. }
  4141. return nil
  4142. }
  4143. type awsRestxml_serializeOpHeadObject struct {
  4144. }
  4145. func (*awsRestxml_serializeOpHeadObject) ID() string {
  4146. return "OperationSerializer"
  4147. }
  4148. func (m *awsRestxml_serializeOpHeadObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4149. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4150. ) {
  4151. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4152. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4153. defer endTimer()
  4154. defer span.End()
  4155. request, ok := in.Request.(*smithyhttp.Request)
  4156. if !ok {
  4157. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4158. }
  4159. input, ok := in.Parameters.(*HeadObjectInput)
  4160. _ = input
  4161. if !ok {
  4162. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4163. }
  4164. opPath, opQuery := httpbinding.SplitURI("/{Key+}")
  4165. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4166. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4167. request.Method = "HEAD"
  4168. var restEncoder *httpbinding.Encoder
  4169. if request.URL.RawPath == "" {
  4170. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4171. } else {
  4172. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4173. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4174. }
  4175. if err != nil {
  4176. return out, metadata, &smithy.SerializationError{Err: err}
  4177. }
  4178. if err := awsRestxml_serializeOpHttpBindingsHeadObjectInput(input, restEncoder); err != nil {
  4179. return out, metadata, &smithy.SerializationError{Err: err}
  4180. }
  4181. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4182. return out, metadata, &smithy.SerializationError{Err: err}
  4183. }
  4184. in.Request = request
  4185. endTimer()
  4186. span.End()
  4187. return next.HandleSerialize(ctx, in)
  4188. }
  4189. func awsRestxml_serializeOpHttpBindingsHeadObjectInput(v *HeadObjectInput, encoder *httpbinding.Encoder) error {
  4190. if v == nil {
  4191. return fmt.Errorf("unsupported serialization of nil %T", v)
  4192. }
  4193. if len(v.ChecksumMode) > 0 {
  4194. locationName := "X-Amz-Checksum-Mode"
  4195. encoder.SetHeader(locationName).String(string(v.ChecksumMode))
  4196. }
  4197. if v.ExpectedBucketOwner != nil {
  4198. locationName := "X-Amz-Expected-Bucket-Owner"
  4199. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4200. }
  4201. if v.IfMatch != nil {
  4202. locationName := "If-Match"
  4203. encoder.SetHeader(locationName).String(*v.IfMatch)
  4204. }
  4205. if v.IfModifiedSince != nil {
  4206. locationName := "If-Modified-Since"
  4207. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfModifiedSince))
  4208. }
  4209. if v.IfNoneMatch != nil {
  4210. locationName := "If-None-Match"
  4211. encoder.SetHeader(locationName).String(*v.IfNoneMatch)
  4212. }
  4213. if v.IfUnmodifiedSince != nil {
  4214. locationName := "If-Unmodified-Since"
  4215. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfUnmodifiedSince))
  4216. }
  4217. if v.Key == nil || len(*v.Key) == 0 {
  4218. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  4219. }
  4220. if v.Key != nil {
  4221. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  4222. return err
  4223. }
  4224. }
  4225. if v.PartNumber != nil {
  4226. encoder.SetQuery("partNumber").Integer(*v.PartNumber)
  4227. }
  4228. if v.Range != nil {
  4229. locationName := "Range"
  4230. encoder.SetHeader(locationName).String(*v.Range)
  4231. }
  4232. if len(v.RequestPayer) > 0 {
  4233. locationName := "X-Amz-Request-Payer"
  4234. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  4235. }
  4236. if v.ResponseCacheControl != nil {
  4237. encoder.SetQuery("response-cache-control").String(*v.ResponseCacheControl)
  4238. }
  4239. if v.ResponseContentDisposition != nil {
  4240. encoder.SetQuery("response-content-disposition").String(*v.ResponseContentDisposition)
  4241. }
  4242. if v.ResponseContentEncoding != nil {
  4243. encoder.SetQuery("response-content-encoding").String(*v.ResponseContentEncoding)
  4244. }
  4245. if v.ResponseContentLanguage != nil {
  4246. encoder.SetQuery("response-content-language").String(*v.ResponseContentLanguage)
  4247. }
  4248. if v.ResponseContentType != nil {
  4249. encoder.SetQuery("response-content-type").String(*v.ResponseContentType)
  4250. }
  4251. if v.ResponseExpires != nil {
  4252. encoder.SetQuery("response-expires").String(smithytime.FormatHTTPDate(*v.ResponseExpires))
  4253. }
  4254. if v.SSECustomerAlgorithm != nil {
  4255. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  4256. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  4257. }
  4258. if v.SSECustomerKey != nil {
  4259. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  4260. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  4261. }
  4262. if v.SSECustomerKeyMD5 != nil {
  4263. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  4264. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  4265. }
  4266. if v.VersionId != nil {
  4267. encoder.SetQuery("versionId").String(*v.VersionId)
  4268. }
  4269. return nil
  4270. }
  4271. type awsRestxml_serializeOpListBucketAnalyticsConfigurations struct {
  4272. }
  4273. func (*awsRestxml_serializeOpListBucketAnalyticsConfigurations) ID() string {
  4274. return "OperationSerializer"
  4275. }
  4276. func (m *awsRestxml_serializeOpListBucketAnalyticsConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4277. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4278. ) {
  4279. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4280. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4281. defer endTimer()
  4282. defer span.End()
  4283. request, ok := in.Request.(*smithyhttp.Request)
  4284. if !ok {
  4285. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4286. }
  4287. input, ok := in.Parameters.(*ListBucketAnalyticsConfigurationsInput)
  4288. _ = input
  4289. if !ok {
  4290. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4291. }
  4292. opPath, opQuery := httpbinding.SplitURI("/?analytics&x-id=ListBucketAnalyticsConfigurations")
  4293. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4294. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4295. request.Method = "GET"
  4296. var restEncoder *httpbinding.Encoder
  4297. if request.URL.RawPath == "" {
  4298. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4299. } else {
  4300. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4301. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4302. }
  4303. if err != nil {
  4304. return out, metadata, &smithy.SerializationError{Err: err}
  4305. }
  4306. if err := awsRestxml_serializeOpHttpBindingsListBucketAnalyticsConfigurationsInput(input, restEncoder); err != nil {
  4307. return out, metadata, &smithy.SerializationError{Err: err}
  4308. }
  4309. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4310. return out, metadata, &smithy.SerializationError{Err: err}
  4311. }
  4312. in.Request = request
  4313. endTimer()
  4314. span.End()
  4315. return next.HandleSerialize(ctx, in)
  4316. }
  4317. func awsRestxml_serializeOpHttpBindingsListBucketAnalyticsConfigurationsInput(v *ListBucketAnalyticsConfigurationsInput, encoder *httpbinding.Encoder) error {
  4318. if v == nil {
  4319. return fmt.Errorf("unsupported serialization of nil %T", v)
  4320. }
  4321. if v.ContinuationToken != nil {
  4322. encoder.SetQuery("continuation-token").String(*v.ContinuationToken)
  4323. }
  4324. if v.ExpectedBucketOwner != nil {
  4325. locationName := "X-Amz-Expected-Bucket-Owner"
  4326. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4327. }
  4328. return nil
  4329. }
  4330. type awsRestxml_serializeOpListBucketIntelligentTieringConfigurations struct {
  4331. }
  4332. func (*awsRestxml_serializeOpListBucketIntelligentTieringConfigurations) ID() string {
  4333. return "OperationSerializer"
  4334. }
  4335. func (m *awsRestxml_serializeOpListBucketIntelligentTieringConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4336. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4337. ) {
  4338. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4339. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4340. defer endTimer()
  4341. defer span.End()
  4342. request, ok := in.Request.(*smithyhttp.Request)
  4343. if !ok {
  4344. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4345. }
  4346. input, ok := in.Parameters.(*ListBucketIntelligentTieringConfigurationsInput)
  4347. _ = input
  4348. if !ok {
  4349. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4350. }
  4351. opPath, opQuery := httpbinding.SplitURI("/?intelligent-tiering&x-id=ListBucketIntelligentTieringConfigurations")
  4352. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4353. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4354. request.Method = "GET"
  4355. var restEncoder *httpbinding.Encoder
  4356. if request.URL.RawPath == "" {
  4357. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4358. } else {
  4359. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4360. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4361. }
  4362. if err != nil {
  4363. return out, metadata, &smithy.SerializationError{Err: err}
  4364. }
  4365. if err := awsRestxml_serializeOpHttpBindingsListBucketIntelligentTieringConfigurationsInput(input, restEncoder); err != nil {
  4366. return out, metadata, &smithy.SerializationError{Err: err}
  4367. }
  4368. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4369. return out, metadata, &smithy.SerializationError{Err: err}
  4370. }
  4371. in.Request = request
  4372. endTimer()
  4373. span.End()
  4374. return next.HandleSerialize(ctx, in)
  4375. }
  4376. func awsRestxml_serializeOpHttpBindingsListBucketIntelligentTieringConfigurationsInput(v *ListBucketIntelligentTieringConfigurationsInput, encoder *httpbinding.Encoder) error {
  4377. if v == nil {
  4378. return fmt.Errorf("unsupported serialization of nil %T", v)
  4379. }
  4380. if v.ContinuationToken != nil {
  4381. encoder.SetQuery("continuation-token").String(*v.ContinuationToken)
  4382. }
  4383. if v.ExpectedBucketOwner != nil {
  4384. locationName := "X-Amz-Expected-Bucket-Owner"
  4385. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4386. }
  4387. return nil
  4388. }
  4389. type awsRestxml_serializeOpListBucketInventoryConfigurations struct {
  4390. }
  4391. func (*awsRestxml_serializeOpListBucketInventoryConfigurations) ID() string {
  4392. return "OperationSerializer"
  4393. }
  4394. func (m *awsRestxml_serializeOpListBucketInventoryConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4395. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4396. ) {
  4397. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4398. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4399. defer endTimer()
  4400. defer span.End()
  4401. request, ok := in.Request.(*smithyhttp.Request)
  4402. if !ok {
  4403. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4404. }
  4405. input, ok := in.Parameters.(*ListBucketInventoryConfigurationsInput)
  4406. _ = input
  4407. if !ok {
  4408. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4409. }
  4410. opPath, opQuery := httpbinding.SplitURI("/?inventory&x-id=ListBucketInventoryConfigurations")
  4411. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4412. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4413. request.Method = "GET"
  4414. var restEncoder *httpbinding.Encoder
  4415. if request.URL.RawPath == "" {
  4416. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4417. } else {
  4418. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4419. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4420. }
  4421. if err != nil {
  4422. return out, metadata, &smithy.SerializationError{Err: err}
  4423. }
  4424. if err := awsRestxml_serializeOpHttpBindingsListBucketInventoryConfigurationsInput(input, restEncoder); err != nil {
  4425. return out, metadata, &smithy.SerializationError{Err: err}
  4426. }
  4427. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4428. return out, metadata, &smithy.SerializationError{Err: err}
  4429. }
  4430. in.Request = request
  4431. endTimer()
  4432. span.End()
  4433. return next.HandleSerialize(ctx, in)
  4434. }
  4435. func awsRestxml_serializeOpHttpBindingsListBucketInventoryConfigurationsInput(v *ListBucketInventoryConfigurationsInput, encoder *httpbinding.Encoder) error {
  4436. if v == nil {
  4437. return fmt.Errorf("unsupported serialization of nil %T", v)
  4438. }
  4439. if v.ContinuationToken != nil {
  4440. encoder.SetQuery("continuation-token").String(*v.ContinuationToken)
  4441. }
  4442. if v.ExpectedBucketOwner != nil {
  4443. locationName := "X-Amz-Expected-Bucket-Owner"
  4444. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4445. }
  4446. return nil
  4447. }
  4448. type awsRestxml_serializeOpListBucketMetricsConfigurations struct {
  4449. }
  4450. func (*awsRestxml_serializeOpListBucketMetricsConfigurations) ID() string {
  4451. return "OperationSerializer"
  4452. }
  4453. func (m *awsRestxml_serializeOpListBucketMetricsConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4454. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4455. ) {
  4456. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4457. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4458. defer endTimer()
  4459. defer span.End()
  4460. request, ok := in.Request.(*smithyhttp.Request)
  4461. if !ok {
  4462. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4463. }
  4464. input, ok := in.Parameters.(*ListBucketMetricsConfigurationsInput)
  4465. _ = input
  4466. if !ok {
  4467. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4468. }
  4469. opPath, opQuery := httpbinding.SplitURI("/?metrics&x-id=ListBucketMetricsConfigurations")
  4470. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4471. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4472. request.Method = "GET"
  4473. var restEncoder *httpbinding.Encoder
  4474. if request.URL.RawPath == "" {
  4475. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4476. } else {
  4477. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4478. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4479. }
  4480. if err != nil {
  4481. return out, metadata, &smithy.SerializationError{Err: err}
  4482. }
  4483. if err := awsRestxml_serializeOpHttpBindingsListBucketMetricsConfigurationsInput(input, restEncoder); err != nil {
  4484. return out, metadata, &smithy.SerializationError{Err: err}
  4485. }
  4486. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4487. return out, metadata, &smithy.SerializationError{Err: err}
  4488. }
  4489. in.Request = request
  4490. endTimer()
  4491. span.End()
  4492. return next.HandleSerialize(ctx, in)
  4493. }
  4494. func awsRestxml_serializeOpHttpBindingsListBucketMetricsConfigurationsInput(v *ListBucketMetricsConfigurationsInput, encoder *httpbinding.Encoder) error {
  4495. if v == nil {
  4496. return fmt.Errorf("unsupported serialization of nil %T", v)
  4497. }
  4498. if v.ContinuationToken != nil {
  4499. encoder.SetQuery("continuation-token").String(*v.ContinuationToken)
  4500. }
  4501. if v.ExpectedBucketOwner != nil {
  4502. locationName := "X-Amz-Expected-Bucket-Owner"
  4503. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4504. }
  4505. return nil
  4506. }
  4507. type awsRestxml_serializeOpListBuckets struct {
  4508. }
  4509. func (*awsRestxml_serializeOpListBuckets) ID() string {
  4510. return "OperationSerializer"
  4511. }
  4512. func (m *awsRestxml_serializeOpListBuckets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4513. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4514. ) {
  4515. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4516. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4517. defer endTimer()
  4518. defer span.End()
  4519. request, ok := in.Request.(*smithyhttp.Request)
  4520. if !ok {
  4521. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4522. }
  4523. input, ok := in.Parameters.(*ListBucketsInput)
  4524. _ = input
  4525. if !ok {
  4526. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4527. }
  4528. opPath, opQuery := httpbinding.SplitURI("/?x-id=ListBuckets")
  4529. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4530. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4531. request.Method = "GET"
  4532. var restEncoder *httpbinding.Encoder
  4533. if request.URL.RawPath == "" {
  4534. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4535. } else {
  4536. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4537. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4538. }
  4539. if err != nil {
  4540. return out, metadata, &smithy.SerializationError{Err: err}
  4541. }
  4542. if err := awsRestxml_serializeOpHttpBindingsListBucketsInput(input, restEncoder); err != nil {
  4543. return out, metadata, &smithy.SerializationError{Err: err}
  4544. }
  4545. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4546. return out, metadata, &smithy.SerializationError{Err: err}
  4547. }
  4548. in.Request = request
  4549. endTimer()
  4550. span.End()
  4551. return next.HandleSerialize(ctx, in)
  4552. }
  4553. func awsRestxml_serializeOpHttpBindingsListBucketsInput(v *ListBucketsInput, encoder *httpbinding.Encoder) error {
  4554. if v == nil {
  4555. return fmt.Errorf("unsupported serialization of nil %T", v)
  4556. }
  4557. if v.BucketRegion != nil {
  4558. encoder.SetQuery("bucket-region").String(*v.BucketRegion)
  4559. }
  4560. if v.ContinuationToken != nil {
  4561. encoder.SetQuery("continuation-token").String(*v.ContinuationToken)
  4562. }
  4563. if v.MaxBuckets != nil {
  4564. encoder.SetQuery("max-buckets").Integer(*v.MaxBuckets)
  4565. }
  4566. if v.Prefix != nil {
  4567. encoder.SetQuery("prefix").String(*v.Prefix)
  4568. }
  4569. return nil
  4570. }
  4571. type awsRestxml_serializeOpListDirectoryBuckets struct {
  4572. }
  4573. func (*awsRestxml_serializeOpListDirectoryBuckets) ID() string {
  4574. return "OperationSerializer"
  4575. }
  4576. func (m *awsRestxml_serializeOpListDirectoryBuckets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4577. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4578. ) {
  4579. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4580. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4581. defer endTimer()
  4582. defer span.End()
  4583. request, ok := in.Request.(*smithyhttp.Request)
  4584. if !ok {
  4585. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4586. }
  4587. input, ok := in.Parameters.(*ListDirectoryBucketsInput)
  4588. _ = input
  4589. if !ok {
  4590. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4591. }
  4592. opPath, opQuery := httpbinding.SplitURI("/?x-id=ListDirectoryBuckets")
  4593. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4594. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4595. request.Method = "GET"
  4596. var restEncoder *httpbinding.Encoder
  4597. if request.URL.RawPath == "" {
  4598. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4599. } else {
  4600. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4601. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4602. }
  4603. if err != nil {
  4604. return out, metadata, &smithy.SerializationError{Err: err}
  4605. }
  4606. if err := awsRestxml_serializeOpHttpBindingsListDirectoryBucketsInput(input, restEncoder); err != nil {
  4607. return out, metadata, &smithy.SerializationError{Err: err}
  4608. }
  4609. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4610. return out, metadata, &smithy.SerializationError{Err: err}
  4611. }
  4612. in.Request = request
  4613. endTimer()
  4614. span.End()
  4615. return next.HandleSerialize(ctx, in)
  4616. }
  4617. func awsRestxml_serializeOpHttpBindingsListDirectoryBucketsInput(v *ListDirectoryBucketsInput, encoder *httpbinding.Encoder) error {
  4618. if v == nil {
  4619. return fmt.Errorf("unsupported serialization of nil %T", v)
  4620. }
  4621. if v.ContinuationToken != nil {
  4622. encoder.SetQuery("continuation-token").String(*v.ContinuationToken)
  4623. }
  4624. if v.MaxDirectoryBuckets != nil {
  4625. encoder.SetQuery("max-directory-buckets").Integer(*v.MaxDirectoryBuckets)
  4626. }
  4627. return nil
  4628. }
  4629. type awsRestxml_serializeOpListMultipartUploads struct {
  4630. }
  4631. func (*awsRestxml_serializeOpListMultipartUploads) ID() string {
  4632. return "OperationSerializer"
  4633. }
  4634. func (m *awsRestxml_serializeOpListMultipartUploads) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4635. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4636. ) {
  4637. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4638. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4639. defer endTimer()
  4640. defer span.End()
  4641. request, ok := in.Request.(*smithyhttp.Request)
  4642. if !ok {
  4643. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4644. }
  4645. input, ok := in.Parameters.(*ListMultipartUploadsInput)
  4646. _ = input
  4647. if !ok {
  4648. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4649. }
  4650. opPath, opQuery := httpbinding.SplitURI("/?uploads")
  4651. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4652. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4653. request.Method = "GET"
  4654. var restEncoder *httpbinding.Encoder
  4655. if request.URL.RawPath == "" {
  4656. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4657. } else {
  4658. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4659. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4660. }
  4661. if err != nil {
  4662. return out, metadata, &smithy.SerializationError{Err: err}
  4663. }
  4664. if err := awsRestxml_serializeOpHttpBindingsListMultipartUploadsInput(input, restEncoder); err != nil {
  4665. return out, metadata, &smithy.SerializationError{Err: err}
  4666. }
  4667. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4668. return out, metadata, &smithy.SerializationError{Err: err}
  4669. }
  4670. in.Request = request
  4671. endTimer()
  4672. span.End()
  4673. return next.HandleSerialize(ctx, in)
  4674. }
  4675. func awsRestxml_serializeOpHttpBindingsListMultipartUploadsInput(v *ListMultipartUploadsInput, encoder *httpbinding.Encoder) error {
  4676. if v == nil {
  4677. return fmt.Errorf("unsupported serialization of nil %T", v)
  4678. }
  4679. if v.Delimiter != nil {
  4680. encoder.SetQuery("delimiter").String(*v.Delimiter)
  4681. }
  4682. if len(v.EncodingType) > 0 {
  4683. encoder.SetQuery("encoding-type").String(string(v.EncodingType))
  4684. }
  4685. if v.ExpectedBucketOwner != nil {
  4686. locationName := "X-Amz-Expected-Bucket-Owner"
  4687. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4688. }
  4689. if v.KeyMarker != nil {
  4690. encoder.SetQuery("key-marker").String(*v.KeyMarker)
  4691. }
  4692. if v.MaxUploads != nil {
  4693. encoder.SetQuery("max-uploads").Integer(*v.MaxUploads)
  4694. }
  4695. if v.Prefix != nil {
  4696. encoder.SetQuery("prefix").String(*v.Prefix)
  4697. }
  4698. if len(v.RequestPayer) > 0 {
  4699. locationName := "X-Amz-Request-Payer"
  4700. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  4701. }
  4702. if v.UploadIdMarker != nil {
  4703. encoder.SetQuery("upload-id-marker").String(*v.UploadIdMarker)
  4704. }
  4705. return nil
  4706. }
  4707. type awsRestxml_serializeOpListObjects struct {
  4708. }
  4709. func (*awsRestxml_serializeOpListObjects) ID() string {
  4710. return "OperationSerializer"
  4711. }
  4712. func (m *awsRestxml_serializeOpListObjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4713. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4714. ) {
  4715. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4716. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4717. defer endTimer()
  4718. defer span.End()
  4719. request, ok := in.Request.(*smithyhttp.Request)
  4720. if !ok {
  4721. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4722. }
  4723. input, ok := in.Parameters.(*ListObjectsInput)
  4724. _ = input
  4725. if !ok {
  4726. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4727. }
  4728. opPath, opQuery := httpbinding.SplitURI("/")
  4729. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4730. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4731. request.Method = "GET"
  4732. var restEncoder *httpbinding.Encoder
  4733. if request.URL.RawPath == "" {
  4734. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4735. } else {
  4736. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4737. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4738. }
  4739. if err != nil {
  4740. return out, metadata, &smithy.SerializationError{Err: err}
  4741. }
  4742. if err := awsRestxml_serializeOpHttpBindingsListObjectsInput(input, restEncoder); err != nil {
  4743. return out, metadata, &smithy.SerializationError{Err: err}
  4744. }
  4745. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4746. return out, metadata, &smithy.SerializationError{Err: err}
  4747. }
  4748. in.Request = request
  4749. endTimer()
  4750. span.End()
  4751. return next.HandleSerialize(ctx, in)
  4752. }
  4753. func awsRestxml_serializeOpHttpBindingsListObjectsInput(v *ListObjectsInput, encoder *httpbinding.Encoder) error {
  4754. if v == nil {
  4755. return fmt.Errorf("unsupported serialization of nil %T", v)
  4756. }
  4757. if v.Delimiter != nil {
  4758. encoder.SetQuery("delimiter").String(*v.Delimiter)
  4759. }
  4760. if len(v.EncodingType) > 0 {
  4761. encoder.SetQuery("encoding-type").String(string(v.EncodingType))
  4762. }
  4763. if v.ExpectedBucketOwner != nil {
  4764. locationName := "X-Amz-Expected-Bucket-Owner"
  4765. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4766. }
  4767. if v.Marker != nil {
  4768. encoder.SetQuery("marker").String(*v.Marker)
  4769. }
  4770. if v.MaxKeys != nil {
  4771. encoder.SetQuery("max-keys").Integer(*v.MaxKeys)
  4772. }
  4773. if v.OptionalObjectAttributes != nil {
  4774. locationName := "X-Amz-Optional-Object-Attributes"
  4775. if len(v.OptionalObjectAttributes) == 0 {
  4776. encoder.AddHeader(locationName).String("")
  4777. }
  4778. for i := range v.OptionalObjectAttributes {
  4779. if len(v.OptionalObjectAttributes[i]) > 0 {
  4780. escaped := string(v.OptionalObjectAttributes[i])
  4781. if strings.Index(string(v.OptionalObjectAttributes[i]), `,`) != -1 || strings.Index(string(v.OptionalObjectAttributes[i]), `"`) != -1 {
  4782. escaped = strconv.Quote(string(v.OptionalObjectAttributes[i]))
  4783. }
  4784. encoder.AddHeader(locationName).String(string(escaped))
  4785. }
  4786. }
  4787. }
  4788. if v.Prefix != nil {
  4789. encoder.SetQuery("prefix").String(*v.Prefix)
  4790. }
  4791. if len(v.RequestPayer) > 0 {
  4792. locationName := "X-Amz-Request-Payer"
  4793. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  4794. }
  4795. return nil
  4796. }
  4797. type awsRestxml_serializeOpListObjectsV2 struct {
  4798. }
  4799. func (*awsRestxml_serializeOpListObjectsV2) ID() string {
  4800. return "OperationSerializer"
  4801. }
  4802. func (m *awsRestxml_serializeOpListObjectsV2) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4803. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4804. ) {
  4805. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4806. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4807. defer endTimer()
  4808. defer span.End()
  4809. request, ok := in.Request.(*smithyhttp.Request)
  4810. if !ok {
  4811. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4812. }
  4813. input, ok := in.Parameters.(*ListObjectsV2Input)
  4814. _ = input
  4815. if !ok {
  4816. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4817. }
  4818. opPath, opQuery := httpbinding.SplitURI("/?list-type=2")
  4819. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4820. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4821. request.Method = "GET"
  4822. var restEncoder *httpbinding.Encoder
  4823. if request.URL.RawPath == "" {
  4824. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4825. } else {
  4826. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4827. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4828. }
  4829. if err != nil {
  4830. return out, metadata, &smithy.SerializationError{Err: err}
  4831. }
  4832. if err := awsRestxml_serializeOpHttpBindingsListObjectsV2Input(input, restEncoder); err != nil {
  4833. return out, metadata, &smithy.SerializationError{Err: err}
  4834. }
  4835. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4836. return out, metadata, &smithy.SerializationError{Err: err}
  4837. }
  4838. in.Request = request
  4839. endTimer()
  4840. span.End()
  4841. return next.HandleSerialize(ctx, in)
  4842. }
  4843. func awsRestxml_serializeOpHttpBindingsListObjectsV2Input(v *ListObjectsV2Input, encoder *httpbinding.Encoder) error {
  4844. if v == nil {
  4845. return fmt.Errorf("unsupported serialization of nil %T", v)
  4846. }
  4847. if v.ContinuationToken != nil {
  4848. encoder.SetQuery("continuation-token").String(*v.ContinuationToken)
  4849. }
  4850. if v.Delimiter != nil {
  4851. encoder.SetQuery("delimiter").String(*v.Delimiter)
  4852. }
  4853. if len(v.EncodingType) > 0 {
  4854. encoder.SetQuery("encoding-type").String(string(v.EncodingType))
  4855. }
  4856. if v.ExpectedBucketOwner != nil {
  4857. locationName := "X-Amz-Expected-Bucket-Owner"
  4858. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4859. }
  4860. if v.FetchOwner != nil {
  4861. encoder.SetQuery("fetch-owner").Boolean(*v.FetchOwner)
  4862. }
  4863. if v.MaxKeys != nil {
  4864. encoder.SetQuery("max-keys").Integer(*v.MaxKeys)
  4865. }
  4866. if v.OptionalObjectAttributes != nil {
  4867. locationName := "X-Amz-Optional-Object-Attributes"
  4868. if len(v.OptionalObjectAttributes) == 0 {
  4869. encoder.AddHeader(locationName).String("")
  4870. }
  4871. for i := range v.OptionalObjectAttributes {
  4872. if len(v.OptionalObjectAttributes[i]) > 0 {
  4873. escaped := string(v.OptionalObjectAttributes[i])
  4874. if strings.Index(string(v.OptionalObjectAttributes[i]), `,`) != -1 || strings.Index(string(v.OptionalObjectAttributes[i]), `"`) != -1 {
  4875. escaped = strconv.Quote(string(v.OptionalObjectAttributes[i]))
  4876. }
  4877. encoder.AddHeader(locationName).String(string(escaped))
  4878. }
  4879. }
  4880. }
  4881. if v.Prefix != nil {
  4882. encoder.SetQuery("prefix").String(*v.Prefix)
  4883. }
  4884. if len(v.RequestPayer) > 0 {
  4885. locationName := "X-Amz-Request-Payer"
  4886. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  4887. }
  4888. if v.StartAfter != nil {
  4889. encoder.SetQuery("start-after").String(*v.StartAfter)
  4890. }
  4891. return nil
  4892. }
  4893. type awsRestxml_serializeOpListObjectVersions struct {
  4894. }
  4895. func (*awsRestxml_serializeOpListObjectVersions) ID() string {
  4896. return "OperationSerializer"
  4897. }
  4898. func (m *awsRestxml_serializeOpListObjectVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4899. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4900. ) {
  4901. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4902. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4903. defer endTimer()
  4904. defer span.End()
  4905. request, ok := in.Request.(*smithyhttp.Request)
  4906. if !ok {
  4907. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  4908. }
  4909. input, ok := in.Parameters.(*ListObjectVersionsInput)
  4910. _ = input
  4911. if !ok {
  4912. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  4913. }
  4914. opPath, opQuery := httpbinding.SplitURI("/?versions")
  4915. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  4916. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  4917. request.Method = "GET"
  4918. var restEncoder *httpbinding.Encoder
  4919. if request.URL.RawPath == "" {
  4920. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  4921. } else {
  4922. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  4923. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  4924. }
  4925. if err != nil {
  4926. return out, metadata, &smithy.SerializationError{Err: err}
  4927. }
  4928. if err := awsRestxml_serializeOpHttpBindingsListObjectVersionsInput(input, restEncoder); err != nil {
  4929. return out, metadata, &smithy.SerializationError{Err: err}
  4930. }
  4931. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  4932. return out, metadata, &smithy.SerializationError{Err: err}
  4933. }
  4934. in.Request = request
  4935. endTimer()
  4936. span.End()
  4937. return next.HandleSerialize(ctx, in)
  4938. }
  4939. func awsRestxml_serializeOpHttpBindingsListObjectVersionsInput(v *ListObjectVersionsInput, encoder *httpbinding.Encoder) error {
  4940. if v == nil {
  4941. return fmt.Errorf("unsupported serialization of nil %T", v)
  4942. }
  4943. if v.Delimiter != nil {
  4944. encoder.SetQuery("delimiter").String(*v.Delimiter)
  4945. }
  4946. if len(v.EncodingType) > 0 {
  4947. encoder.SetQuery("encoding-type").String(string(v.EncodingType))
  4948. }
  4949. if v.ExpectedBucketOwner != nil {
  4950. locationName := "X-Amz-Expected-Bucket-Owner"
  4951. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  4952. }
  4953. if v.KeyMarker != nil {
  4954. encoder.SetQuery("key-marker").String(*v.KeyMarker)
  4955. }
  4956. if v.MaxKeys != nil {
  4957. encoder.SetQuery("max-keys").Integer(*v.MaxKeys)
  4958. }
  4959. if v.OptionalObjectAttributes != nil {
  4960. locationName := "X-Amz-Optional-Object-Attributes"
  4961. if len(v.OptionalObjectAttributes) == 0 {
  4962. encoder.AddHeader(locationName).String("")
  4963. }
  4964. for i := range v.OptionalObjectAttributes {
  4965. if len(v.OptionalObjectAttributes[i]) > 0 {
  4966. escaped := string(v.OptionalObjectAttributes[i])
  4967. if strings.Index(string(v.OptionalObjectAttributes[i]), `,`) != -1 || strings.Index(string(v.OptionalObjectAttributes[i]), `"`) != -1 {
  4968. escaped = strconv.Quote(string(v.OptionalObjectAttributes[i]))
  4969. }
  4970. encoder.AddHeader(locationName).String(string(escaped))
  4971. }
  4972. }
  4973. }
  4974. if v.Prefix != nil {
  4975. encoder.SetQuery("prefix").String(*v.Prefix)
  4976. }
  4977. if len(v.RequestPayer) > 0 {
  4978. locationName := "X-Amz-Request-Payer"
  4979. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  4980. }
  4981. if v.VersionIdMarker != nil {
  4982. encoder.SetQuery("version-id-marker").String(*v.VersionIdMarker)
  4983. }
  4984. return nil
  4985. }
  4986. type awsRestxml_serializeOpListParts struct {
  4987. }
  4988. func (*awsRestxml_serializeOpListParts) ID() string {
  4989. return "OperationSerializer"
  4990. }
  4991. func (m *awsRestxml_serializeOpListParts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  4992. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  4993. ) {
  4994. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  4995. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  4996. defer endTimer()
  4997. defer span.End()
  4998. request, ok := in.Request.(*smithyhttp.Request)
  4999. if !ok {
  5000. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5001. }
  5002. input, ok := in.Parameters.(*ListPartsInput)
  5003. _ = input
  5004. if !ok {
  5005. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5006. }
  5007. opPath, opQuery := httpbinding.SplitURI("/{Key+}?x-id=ListParts")
  5008. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5009. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5010. request.Method = "GET"
  5011. var restEncoder *httpbinding.Encoder
  5012. if request.URL.RawPath == "" {
  5013. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5014. } else {
  5015. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5016. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5017. }
  5018. if err != nil {
  5019. return out, metadata, &smithy.SerializationError{Err: err}
  5020. }
  5021. if err := awsRestxml_serializeOpHttpBindingsListPartsInput(input, restEncoder); err != nil {
  5022. return out, metadata, &smithy.SerializationError{Err: err}
  5023. }
  5024. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5025. return out, metadata, &smithy.SerializationError{Err: err}
  5026. }
  5027. in.Request = request
  5028. endTimer()
  5029. span.End()
  5030. return next.HandleSerialize(ctx, in)
  5031. }
  5032. func awsRestxml_serializeOpHttpBindingsListPartsInput(v *ListPartsInput, encoder *httpbinding.Encoder) error {
  5033. if v == nil {
  5034. return fmt.Errorf("unsupported serialization of nil %T", v)
  5035. }
  5036. if v.ExpectedBucketOwner != nil {
  5037. locationName := "X-Amz-Expected-Bucket-Owner"
  5038. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5039. }
  5040. if v.Key == nil || len(*v.Key) == 0 {
  5041. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  5042. }
  5043. if v.Key != nil {
  5044. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  5045. return err
  5046. }
  5047. }
  5048. if v.MaxParts != nil {
  5049. encoder.SetQuery("max-parts").Integer(*v.MaxParts)
  5050. }
  5051. if v.PartNumberMarker != nil {
  5052. encoder.SetQuery("part-number-marker").String(*v.PartNumberMarker)
  5053. }
  5054. if len(v.RequestPayer) > 0 {
  5055. locationName := "X-Amz-Request-Payer"
  5056. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  5057. }
  5058. if v.SSECustomerAlgorithm != nil {
  5059. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  5060. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  5061. }
  5062. if v.SSECustomerKey != nil {
  5063. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  5064. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  5065. }
  5066. if v.SSECustomerKeyMD5 != nil {
  5067. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  5068. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  5069. }
  5070. if v.UploadId != nil {
  5071. encoder.SetQuery("uploadId").String(*v.UploadId)
  5072. }
  5073. return nil
  5074. }
  5075. type awsRestxml_serializeOpPutBucketAccelerateConfiguration struct {
  5076. }
  5077. func (*awsRestxml_serializeOpPutBucketAccelerateConfiguration) ID() string {
  5078. return "OperationSerializer"
  5079. }
  5080. func (m *awsRestxml_serializeOpPutBucketAccelerateConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5081. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5082. ) {
  5083. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5084. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5085. defer endTimer()
  5086. defer span.End()
  5087. request, ok := in.Request.(*smithyhttp.Request)
  5088. if !ok {
  5089. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5090. }
  5091. input, ok := in.Parameters.(*PutBucketAccelerateConfigurationInput)
  5092. _ = input
  5093. if !ok {
  5094. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5095. }
  5096. opPath, opQuery := httpbinding.SplitURI("/?accelerate")
  5097. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5098. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5099. request.Method = "PUT"
  5100. var restEncoder *httpbinding.Encoder
  5101. if request.URL.RawPath == "" {
  5102. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5103. } else {
  5104. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5105. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5106. }
  5107. if err != nil {
  5108. return out, metadata, &smithy.SerializationError{Err: err}
  5109. }
  5110. if err := awsRestxml_serializeOpHttpBindingsPutBucketAccelerateConfigurationInput(input, restEncoder); err != nil {
  5111. return out, metadata, &smithy.SerializationError{Err: err}
  5112. }
  5113. if input.AccelerateConfiguration != nil {
  5114. if !restEncoder.HasHeader("Content-Type") {
  5115. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5116. restEncoder.SetHeader("Content-Type").String("application/xml")
  5117. }
  5118. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5119. payloadRootAttr := []smithyxml.Attr{}
  5120. payloadRoot := smithyxml.StartElement{
  5121. Name: smithyxml.Name{
  5122. Local: "AccelerateConfiguration",
  5123. },
  5124. Attr: payloadRootAttr,
  5125. }
  5126. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5127. if err := awsRestxml_serializeDocumentAccelerateConfiguration(input.AccelerateConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5128. return out, metadata, &smithy.SerializationError{Err: err}
  5129. }
  5130. payload := bytes.NewReader(xmlEncoder.Bytes())
  5131. if request, err = request.SetStream(payload); err != nil {
  5132. return out, metadata, &smithy.SerializationError{Err: err}
  5133. }
  5134. }
  5135. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5136. return out, metadata, &smithy.SerializationError{Err: err}
  5137. }
  5138. in.Request = request
  5139. endTimer()
  5140. span.End()
  5141. return next.HandleSerialize(ctx, in)
  5142. }
  5143. func awsRestxml_serializeOpHttpBindingsPutBucketAccelerateConfigurationInput(v *PutBucketAccelerateConfigurationInput, encoder *httpbinding.Encoder) error {
  5144. if v == nil {
  5145. return fmt.Errorf("unsupported serialization of nil %T", v)
  5146. }
  5147. if len(v.ChecksumAlgorithm) > 0 {
  5148. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  5149. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  5150. }
  5151. if v.ExpectedBucketOwner != nil {
  5152. locationName := "X-Amz-Expected-Bucket-Owner"
  5153. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5154. }
  5155. return nil
  5156. }
  5157. type awsRestxml_serializeOpPutBucketAcl struct {
  5158. }
  5159. func (*awsRestxml_serializeOpPutBucketAcl) ID() string {
  5160. return "OperationSerializer"
  5161. }
  5162. func (m *awsRestxml_serializeOpPutBucketAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5163. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5164. ) {
  5165. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5166. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5167. defer endTimer()
  5168. defer span.End()
  5169. request, ok := in.Request.(*smithyhttp.Request)
  5170. if !ok {
  5171. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5172. }
  5173. input, ok := in.Parameters.(*PutBucketAclInput)
  5174. _ = input
  5175. if !ok {
  5176. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5177. }
  5178. opPath, opQuery := httpbinding.SplitURI("/?acl")
  5179. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5180. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5181. request.Method = "PUT"
  5182. var restEncoder *httpbinding.Encoder
  5183. if request.URL.RawPath == "" {
  5184. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5185. } else {
  5186. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5187. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5188. }
  5189. if err != nil {
  5190. return out, metadata, &smithy.SerializationError{Err: err}
  5191. }
  5192. if err := awsRestxml_serializeOpHttpBindingsPutBucketAclInput(input, restEncoder); err != nil {
  5193. return out, metadata, &smithy.SerializationError{Err: err}
  5194. }
  5195. if input.AccessControlPolicy != nil {
  5196. if !restEncoder.HasHeader("Content-Type") {
  5197. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5198. restEncoder.SetHeader("Content-Type").String("application/xml")
  5199. }
  5200. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5201. payloadRootAttr := []smithyxml.Attr{}
  5202. payloadRoot := smithyxml.StartElement{
  5203. Name: smithyxml.Name{
  5204. Local: "AccessControlPolicy",
  5205. },
  5206. Attr: payloadRootAttr,
  5207. }
  5208. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5209. if err := awsRestxml_serializeDocumentAccessControlPolicy(input.AccessControlPolicy, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5210. return out, metadata, &smithy.SerializationError{Err: err}
  5211. }
  5212. payload := bytes.NewReader(xmlEncoder.Bytes())
  5213. if request, err = request.SetStream(payload); err != nil {
  5214. return out, metadata, &smithy.SerializationError{Err: err}
  5215. }
  5216. }
  5217. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5218. return out, metadata, &smithy.SerializationError{Err: err}
  5219. }
  5220. in.Request = request
  5221. endTimer()
  5222. span.End()
  5223. return next.HandleSerialize(ctx, in)
  5224. }
  5225. func awsRestxml_serializeOpHttpBindingsPutBucketAclInput(v *PutBucketAclInput, encoder *httpbinding.Encoder) error {
  5226. if v == nil {
  5227. return fmt.Errorf("unsupported serialization of nil %T", v)
  5228. }
  5229. if len(v.ACL) > 0 {
  5230. locationName := "X-Amz-Acl"
  5231. encoder.SetHeader(locationName).String(string(v.ACL))
  5232. }
  5233. if len(v.ChecksumAlgorithm) > 0 {
  5234. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  5235. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  5236. }
  5237. if v.ContentMD5 != nil {
  5238. locationName := "Content-Md5"
  5239. encoder.SetHeader(locationName).String(*v.ContentMD5)
  5240. }
  5241. if v.ExpectedBucketOwner != nil {
  5242. locationName := "X-Amz-Expected-Bucket-Owner"
  5243. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5244. }
  5245. if v.GrantFullControl != nil {
  5246. locationName := "X-Amz-Grant-Full-Control"
  5247. encoder.SetHeader(locationName).String(*v.GrantFullControl)
  5248. }
  5249. if v.GrantRead != nil {
  5250. locationName := "X-Amz-Grant-Read"
  5251. encoder.SetHeader(locationName).String(*v.GrantRead)
  5252. }
  5253. if v.GrantReadACP != nil {
  5254. locationName := "X-Amz-Grant-Read-Acp"
  5255. encoder.SetHeader(locationName).String(*v.GrantReadACP)
  5256. }
  5257. if v.GrantWrite != nil {
  5258. locationName := "X-Amz-Grant-Write"
  5259. encoder.SetHeader(locationName).String(*v.GrantWrite)
  5260. }
  5261. if v.GrantWriteACP != nil {
  5262. locationName := "X-Amz-Grant-Write-Acp"
  5263. encoder.SetHeader(locationName).String(*v.GrantWriteACP)
  5264. }
  5265. return nil
  5266. }
  5267. type awsRestxml_serializeOpPutBucketAnalyticsConfiguration struct {
  5268. }
  5269. func (*awsRestxml_serializeOpPutBucketAnalyticsConfiguration) ID() string {
  5270. return "OperationSerializer"
  5271. }
  5272. func (m *awsRestxml_serializeOpPutBucketAnalyticsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5273. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5274. ) {
  5275. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5276. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5277. defer endTimer()
  5278. defer span.End()
  5279. request, ok := in.Request.(*smithyhttp.Request)
  5280. if !ok {
  5281. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5282. }
  5283. input, ok := in.Parameters.(*PutBucketAnalyticsConfigurationInput)
  5284. _ = input
  5285. if !ok {
  5286. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5287. }
  5288. opPath, opQuery := httpbinding.SplitURI("/?analytics")
  5289. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5290. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5291. request.Method = "PUT"
  5292. var restEncoder *httpbinding.Encoder
  5293. if request.URL.RawPath == "" {
  5294. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5295. } else {
  5296. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5297. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5298. }
  5299. if err != nil {
  5300. return out, metadata, &smithy.SerializationError{Err: err}
  5301. }
  5302. if err := awsRestxml_serializeOpHttpBindingsPutBucketAnalyticsConfigurationInput(input, restEncoder); err != nil {
  5303. return out, metadata, &smithy.SerializationError{Err: err}
  5304. }
  5305. if input.AnalyticsConfiguration != nil {
  5306. if !restEncoder.HasHeader("Content-Type") {
  5307. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5308. restEncoder.SetHeader("Content-Type").String("application/xml")
  5309. }
  5310. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5311. payloadRootAttr := []smithyxml.Attr{}
  5312. payloadRoot := smithyxml.StartElement{
  5313. Name: smithyxml.Name{
  5314. Local: "AnalyticsConfiguration",
  5315. },
  5316. Attr: payloadRootAttr,
  5317. }
  5318. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5319. if err := awsRestxml_serializeDocumentAnalyticsConfiguration(input.AnalyticsConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5320. return out, metadata, &smithy.SerializationError{Err: err}
  5321. }
  5322. payload := bytes.NewReader(xmlEncoder.Bytes())
  5323. if request, err = request.SetStream(payload); err != nil {
  5324. return out, metadata, &smithy.SerializationError{Err: err}
  5325. }
  5326. }
  5327. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5328. return out, metadata, &smithy.SerializationError{Err: err}
  5329. }
  5330. in.Request = request
  5331. endTimer()
  5332. span.End()
  5333. return next.HandleSerialize(ctx, in)
  5334. }
  5335. func awsRestxml_serializeOpHttpBindingsPutBucketAnalyticsConfigurationInput(v *PutBucketAnalyticsConfigurationInput, encoder *httpbinding.Encoder) error {
  5336. if v == nil {
  5337. return fmt.Errorf("unsupported serialization of nil %T", v)
  5338. }
  5339. if v.ExpectedBucketOwner != nil {
  5340. locationName := "X-Amz-Expected-Bucket-Owner"
  5341. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5342. }
  5343. if v.Id != nil {
  5344. encoder.SetQuery("id").String(*v.Id)
  5345. }
  5346. return nil
  5347. }
  5348. type awsRestxml_serializeOpPutBucketCors struct {
  5349. }
  5350. func (*awsRestxml_serializeOpPutBucketCors) ID() string {
  5351. return "OperationSerializer"
  5352. }
  5353. func (m *awsRestxml_serializeOpPutBucketCors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5354. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5355. ) {
  5356. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5357. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5358. defer endTimer()
  5359. defer span.End()
  5360. request, ok := in.Request.(*smithyhttp.Request)
  5361. if !ok {
  5362. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5363. }
  5364. input, ok := in.Parameters.(*PutBucketCorsInput)
  5365. _ = input
  5366. if !ok {
  5367. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5368. }
  5369. opPath, opQuery := httpbinding.SplitURI("/?cors")
  5370. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5371. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5372. request.Method = "PUT"
  5373. var restEncoder *httpbinding.Encoder
  5374. if request.URL.RawPath == "" {
  5375. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5376. } else {
  5377. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5378. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5379. }
  5380. if err != nil {
  5381. return out, metadata, &smithy.SerializationError{Err: err}
  5382. }
  5383. if err := awsRestxml_serializeOpHttpBindingsPutBucketCorsInput(input, restEncoder); err != nil {
  5384. return out, metadata, &smithy.SerializationError{Err: err}
  5385. }
  5386. if input.CORSConfiguration != nil {
  5387. if !restEncoder.HasHeader("Content-Type") {
  5388. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5389. restEncoder.SetHeader("Content-Type").String("application/xml")
  5390. }
  5391. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5392. payloadRootAttr := []smithyxml.Attr{}
  5393. payloadRoot := smithyxml.StartElement{
  5394. Name: smithyxml.Name{
  5395. Local: "CORSConfiguration",
  5396. },
  5397. Attr: payloadRootAttr,
  5398. }
  5399. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5400. if err := awsRestxml_serializeDocumentCORSConfiguration(input.CORSConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5401. return out, metadata, &smithy.SerializationError{Err: err}
  5402. }
  5403. payload := bytes.NewReader(xmlEncoder.Bytes())
  5404. if request, err = request.SetStream(payload); err != nil {
  5405. return out, metadata, &smithy.SerializationError{Err: err}
  5406. }
  5407. }
  5408. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5409. return out, metadata, &smithy.SerializationError{Err: err}
  5410. }
  5411. in.Request = request
  5412. endTimer()
  5413. span.End()
  5414. return next.HandleSerialize(ctx, in)
  5415. }
  5416. func awsRestxml_serializeOpHttpBindingsPutBucketCorsInput(v *PutBucketCorsInput, encoder *httpbinding.Encoder) error {
  5417. if v == nil {
  5418. return fmt.Errorf("unsupported serialization of nil %T", v)
  5419. }
  5420. if len(v.ChecksumAlgorithm) > 0 {
  5421. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  5422. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  5423. }
  5424. if v.ContentMD5 != nil {
  5425. locationName := "Content-Md5"
  5426. encoder.SetHeader(locationName).String(*v.ContentMD5)
  5427. }
  5428. if v.ExpectedBucketOwner != nil {
  5429. locationName := "X-Amz-Expected-Bucket-Owner"
  5430. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5431. }
  5432. return nil
  5433. }
  5434. type awsRestxml_serializeOpPutBucketEncryption struct {
  5435. }
  5436. func (*awsRestxml_serializeOpPutBucketEncryption) ID() string {
  5437. return "OperationSerializer"
  5438. }
  5439. func (m *awsRestxml_serializeOpPutBucketEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5440. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5441. ) {
  5442. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5443. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5444. defer endTimer()
  5445. defer span.End()
  5446. request, ok := in.Request.(*smithyhttp.Request)
  5447. if !ok {
  5448. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5449. }
  5450. input, ok := in.Parameters.(*PutBucketEncryptionInput)
  5451. _ = input
  5452. if !ok {
  5453. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5454. }
  5455. opPath, opQuery := httpbinding.SplitURI("/?encryption")
  5456. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5457. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5458. request.Method = "PUT"
  5459. var restEncoder *httpbinding.Encoder
  5460. if request.URL.RawPath == "" {
  5461. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5462. } else {
  5463. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5464. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5465. }
  5466. if err != nil {
  5467. return out, metadata, &smithy.SerializationError{Err: err}
  5468. }
  5469. if err := awsRestxml_serializeOpHttpBindingsPutBucketEncryptionInput(input, restEncoder); err != nil {
  5470. return out, metadata, &smithy.SerializationError{Err: err}
  5471. }
  5472. if input.ServerSideEncryptionConfiguration != nil {
  5473. if !restEncoder.HasHeader("Content-Type") {
  5474. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5475. restEncoder.SetHeader("Content-Type").String("application/xml")
  5476. }
  5477. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5478. payloadRootAttr := []smithyxml.Attr{}
  5479. payloadRoot := smithyxml.StartElement{
  5480. Name: smithyxml.Name{
  5481. Local: "ServerSideEncryptionConfiguration",
  5482. },
  5483. Attr: payloadRootAttr,
  5484. }
  5485. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5486. if err := awsRestxml_serializeDocumentServerSideEncryptionConfiguration(input.ServerSideEncryptionConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5487. return out, metadata, &smithy.SerializationError{Err: err}
  5488. }
  5489. payload := bytes.NewReader(xmlEncoder.Bytes())
  5490. if request, err = request.SetStream(payload); err != nil {
  5491. return out, metadata, &smithy.SerializationError{Err: err}
  5492. }
  5493. }
  5494. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5495. return out, metadata, &smithy.SerializationError{Err: err}
  5496. }
  5497. in.Request = request
  5498. endTimer()
  5499. span.End()
  5500. return next.HandleSerialize(ctx, in)
  5501. }
  5502. func awsRestxml_serializeOpHttpBindingsPutBucketEncryptionInput(v *PutBucketEncryptionInput, encoder *httpbinding.Encoder) error {
  5503. if v == nil {
  5504. return fmt.Errorf("unsupported serialization of nil %T", v)
  5505. }
  5506. if len(v.ChecksumAlgorithm) > 0 {
  5507. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  5508. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  5509. }
  5510. if v.ContentMD5 != nil {
  5511. locationName := "Content-Md5"
  5512. encoder.SetHeader(locationName).String(*v.ContentMD5)
  5513. }
  5514. if v.ExpectedBucketOwner != nil {
  5515. locationName := "X-Amz-Expected-Bucket-Owner"
  5516. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5517. }
  5518. return nil
  5519. }
  5520. type awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration struct {
  5521. }
  5522. func (*awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration) ID() string {
  5523. return "OperationSerializer"
  5524. }
  5525. func (m *awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5526. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5527. ) {
  5528. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5529. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5530. defer endTimer()
  5531. defer span.End()
  5532. request, ok := in.Request.(*smithyhttp.Request)
  5533. if !ok {
  5534. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5535. }
  5536. input, ok := in.Parameters.(*PutBucketIntelligentTieringConfigurationInput)
  5537. _ = input
  5538. if !ok {
  5539. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5540. }
  5541. opPath, opQuery := httpbinding.SplitURI("/?intelligent-tiering")
  5542. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5543. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5544. request.Method = "PUT"
  5545. var restEncoder *httpbinding.Encoder
  5546. if request.URL.RawPath == "" {
  5547. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5548. } else {
  5549. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5550. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5551. }
  5552. if err != nil {
  5553. return out, metadata, &smithy.SerializationError{Err: err}
  5554. }
  5555. if err := awsRestxml_serializeOpHttpBindingsPutBucketIntelligentTieringConfigurationInput(input, restEncoder); err != nil {
  5556. return out, metadata, &smithy.SerializationError{Err: err}
  5557. }
  5558. if input.IntelligentTieringConfiguration != nil {
  5559. if !restEncoder.HasHeader("Content-Type") {
  5560. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5561. restEncoder.SetHeader("Content-Type").String("application/xml")
  5562. }
  5563. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5564. payloadRootAttr := []smithyxml.Attr{}
  5565. payloadRoot := smithyxml.StartElement{
  5566. Name: smithyxml.Name{
  5567. Local: "IntelligentTieringConfiguration",
  5568. },
  5569. Attr: payloadRootAttr,
  5570. }
  5571. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5572. if err := awsRestxml_serializeDocumentIntelligentTieringConfiguration(input.IntelligentTieringConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5573. return out, metadata, &smithy.SerializationError{Err: err}
  5574. }
  5575. payload := bytes.NewReader(xmlEncoder.Bytes())
  5576. if request, err = request.SetStream(payload); err != nil {
  5577. return out, metadata, &smithy.SerializationError{Err: err}
  5578. }
  5579. }
  5580. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5581. return out, metadata, &smithy.SerializationError{Err: err}
  5582. }
  5583. in.Request = request
  5584. endTimer()
  5585. span.End()
  5586. return next.HandleSerialize(ctx, in)
  5587. }
  5588. func awsRestxml_serializeOpHttpBindingsPutBucketIntelligentTieringConfigurationInput(v *PutBucketIntelligentTieringConfigurationInput, encoder *httpbinding.Encoder) error {
  5589. if v == nil {
  5590. return fmt.Errorf("unsupported serialization of nil %T", v)
  5591. }
  5592. if v.ExpectedBucketOwner != nil {
  5593. locationName := "X-Amz-Expected-Bucket-Owner"
  5594. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5595. }
  5596. if v.Id != nil {
  5597. encoder.SetQuery("id").String(*v.Id)
  5598. }
  5599. return nil
  5600. }
  5601. type awsRestxml_serializeOpPutBucketInventoryConfiguration struct {
  5602. }
  5603. func (*awsRestxml_serializeOpPutBucketInventoryConfiguration) ID() string {
  5604. return "OperationSerializer"
  5605. }
  5606. func (m *awsRestxml_serializeOpPutBucketInventoryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5607. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5608. ) {
  5609. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5610. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5611. defer endTimer()
  5612. defer span.End()
  5613. request, ok := in.Request.(*smithyhttp.Request)
  5614. if !ok {
  5615. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5616. }
  5617. input, ok := in.Parameters.(*PutBucketInventoryConfigurationInput)
  5618. _ = input
  5619. if !ok {
  5620. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5621. }
  5622. opPath, opQuery := httpbinding.SplitURI("/?inventory")
  5623. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5624. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5625. request.Method = "PUT"
  5626. var restEncoder *httpbinding.Encoder
  5627. if request.URL.RawPath == "" {
  5628. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5629. } else {
  5630. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5631. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5632. }
  5633. if err != nil {
  5634. return out, metadata, &smithy.SerializationError{Err: err}
  5635. }
  5636. if err := awsRestxml_serializeOpHttpBindingsPutBucketInventoryConfigurationInput(input, restEncoder); err != nil {
  5637. return out, metadata, &smithy.SerializationError{Err: err}
  5638. }
  5639. if input.InventoryConfiguration != nil {
  5640. if !restEncoder.HasHeader("Content-Type") {
  5641. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5642. restEncoder.SetHeader("Content-Type").String("application/xml")
  5643. }
  5644. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5645. payloadRootAttr := []smithyxml.Attr{}
  5646. payloadRoot := smithyxml.StartElement{
  5647. Name: smithyxml.Name{
  5648. Local: "InventoryConfiguration",
  5649. },
  5650. Attr: payloadRootAttr,
  5651. }
  5652. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5653. if err := awsRestxml_serializeDocumentInventoryConfiguration(input.InventoryConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5654. return out, metadata, &smithy.SerializationError{Err: err}
  5655. }
  5656. payload := bytes.NewReader(xmlEncoder.Bytes())
  5657. if request, err = request.SetStream(payload); err != nil {
  5658. return out, metadata, &smithy.SerializationError{Err: err}
  5659. }
  5660. }
  5661. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5662. return out, metadata, &smithy.SerializationError{Err: err}
  5663. }
  5664. in.Request = request
  5665. endTimer()
  5666. span.End()
  5667. return next.HandleSerialize(ctx, in)
  5668. }
  5669. func awsRestxml_serializeOpHttpBindingsPutBucketInventoryConfigurationInput(v *PutBucketInventoryConfigurationInput, encoder *httpbinding.Encoder) error {
  5670. if v == nil {
  5671. return fmt.Errorf("unsupported serialization of nil %T", v)
  5672. }
  5673. if v.ExpectedBucketOwner != nil {
  5674. locationName := "X-Amz-Expected-Bucket-Owner"
  5675. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5676. }
  5677. if v.Id != nil {
  5678. encoder.SetQuery("id").String(*v.Id)
  5679. }
  5680. return nil
  5681. }
  5682. type awsRestxml_serializeOpPutBucketLifecycleConfiguration struct {
  5683. }
  5684. func (*awsRestxml_serializeOpPutBucketLifecycleConfiguration) ID() string {
  5685. return "OperationSerializer"
  5686. }
  5687. func (m *awsRestxml_serializeOpPutBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5688. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5689. ) {
  5690. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5691. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5692. defer endTimer()
  5693. defer span.End()
  5694. request, ok := in.Request.(*smithyhttp.Request)
  5695. if !ok {
  5696. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5697. }
  5698. input, ok := in.Parameters.(*PutBucketLifecycleConfigurationInput)
  5699. _ = input
  5700. if !ok {
  5701. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5702. }
  5703. opPath, opQuery := httpbinding.SplitURI("/?lifecycle")
  5704. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5705. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5706. request.Method = "PUT"
  5707. var restEncoder *httpbinding.Encoder
  5708. if request.URL.RawPath == "" {
  5709. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5710. } else {
  5711. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5712. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5713. }
  5714. if err != nil {
  5715. return out, metadata, &smithy.SerializationError{Err: err}
  5716. }
  5717. if err := awsRestxml_serializeOpHttpBindingsPutBucketLifecycleConfigurationInput(input, restEncoder); err != nil {
  5718. return out, metadata, &smithy.SerializationError{Err: err}
  5719. }
  5720. if input.LifecycleConfiguration != nil {
  5721. if !restEncoder.HasHeader("Content-Type") {
  5722. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5723. restEncoder.SetHeader("Content-Type").String("application/xml")
  5724. }
  5725. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5726. payloadRootAttr := []smithyxml.Attr{}
  5727. payloadRoot := smithyxml.StartElement{
  5728. Name: smithyxml.Name{
  5729. Local: "LifecycleConfiguration",
  5730. },
  5731. Attr: payloadRootAttr,
  5732. }
  5733. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5734. if err := awsRestxml_serializeDocumentBucketLifecycleConfiguration(input.LifecycleConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5735. return out, metadata, &smithy.SerializationError{Err: err}
  5736. }
  5737. payload := bytes.NewReader(xmlEncoder.Bytes())
  5738. if request, err = request.SetStream(payload); err != nil {
  5739. return out, metadata, &smithy.SerializationError{Err: err}
  5740. }
  5741. }
  5742. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5743. return out, metadata, &smithy.SerializationError{Err: err}
  5744. }
  5745. in.Request = request
  5746. endTimer()
  5747. span.End()
  5748. return next.HandleSerialize(ctx, in)
  5749. }
  5750. func awsRestxml_serializeOpHttpBindingsPutBucketLifecycleConfigurationInput(v *PutBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error {
  5751. if v == nil {
  5752. return fmt.Errorf("unsupported serialization of nil %T", v)
  5753. }
  5754. if len(v.ChecksumAlgorithm) > 0 {
  5755. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  5756. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  5757. }
  5758. if v.ExpectedBucketOwner != nil {
  5759. locationName := "X-Amz-Expected-Bucket-Owner"
  5760. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5761. }
  5762. if len(v.TransitionDefaultMinimumObjectSize) > 0 {
  5763. locationName := "X-Amz-Transition-Default-Minimum-Object-Size"
  5764. encoder.SetHeader(locationName).String(string(v.TransitionDefaultMinimumObjectSize))
  5765. }
  5766. return nil
  5767. }
  5768. type awsRestxml_serializeOpPutBucketLogging struct {
  5769. }
  5770. func (*awsRestxml_serializeOpPutBucketLogging) ID() string {
  5771. return "OperationSerializer"
  5772. }
  5773. func (m *awsRestxml_serializeOpPutBucketLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5774. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5775. ) {
  5776. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5777. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5778. defer endTimer()
  5779. defer span.End()
  5780. request, ok := in.Request.(*smithyhttp.Request)
  5781. if !ok {
  5782. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5783. }
  5784. input, ok := in.Parameters.(*PutBucketLoggingInput)
  5785. _ = input
  5786. if !ok {
  5787. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5788. }
  5789. opPath, opQuery := httpbinding.SplitURI("/?logging")
  5790. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5791. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5792. request.Method = "PUT"
  5793. var restEncoder *httpbinding.Encoder
  5794. if request.URL.RawPath == "" {
  5795. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5796. } else {
  5797. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5798. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5799. }
  5800. if err != nil {
  5801. return out, metadata, &smithy.SerializationError{Err: err}
  5802. }
  5803. if err := awsRestxml_serializeOpHttpBindingsPutBucketLoggingInput(input, restEncoder); err != nil {
  5804. return out, metadata, &smithy.SerializationError{Err: err}
  5805. }
  5806. if input.BucketLoggingStatus != nil {
  5807. if !restEncoder.HasHeader("Content-Type") {
  5808. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5809. restEncoder.SetHeader("Content-Type").String("application/xml")
  5810. }
  5811. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5812. payloadRootAttr := []smithyxml.Attr{}
  5813. payloadRoot := smithyxml.StartElement{
  5814. Name: smithyxml.Name{
  5815. Local: "BucketLoggingStatus",
  5816. },
  5817. Attr: payloadRootAttr,
  5818. }
  5819. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5820. if err := awsRestxml_serializeDocumentBucketLoggingStatus(input.BucketLoggingStatus, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5821. return out, metadata, &smithy.SerializationError{Err: err}
  5822. }
  5823. payload := bytes.NewReader(xmlEncoder.Bytes())
  5824. if request, err = request.SetStream(payload); err != nil {
  5825. return out, metadata, &smithy.SerializationError{Err: err}
  5826. }
  5827. }
  5828. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5829. return out, metadata, &smithy.SerializationError{Err: err}
  5830. }
  5831. in.Request = request
  5832. endTimer()
  5833. span.End()
  5834. return next.HandleSerialize(ctx, in)
  5835. }
  5836. func awsRestxml_serializeOpHttpBindingsPutBucketLoggingInput(v *PutBucketLoggingInput, encoder *httpbinding.Encoder) error {
  5837. if v == nil {
  5838. return fmt.Errorf("unsupported serialization of nil %T", v)
  5839. }
  5840. if len(v.ChecksumAlgorithm) > 0 {
  5841. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  5842. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  5843. }
  5844. if v.ContentMD5 != nil {
  5845. locationName := "Content-Md5"
  5846. encoder.SetHeader(locationName).String(*v.ContentMD5)
  5847. }
  5848. if v.ExpectedBucketOwner != nil {
  5849. locationName := "X-Amz-Expected-Bucket-Owner"
  5850. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5851. }
  5852. return nil
  5853. }
  5854. type awsRestxml_serializeOpPutBucketMetricsConfiguration struct {
  5855. }
  5856. func (*awsRestxml_serializeOpPutBucketMetricsConfiguration) ID() string {
  5857. return "OperationSerializer"
  5858. }
  5859. func (m *awsRestxml_serializeOpPutBucketMetricsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5860. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5861. ) {
  5862. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5863. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5864. defer endTimer()
  5865. defer span.End()
  5866. request, ok := in.Request.(*smithyhttp.Request)
  5867. if !ok {
  5868. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5869. }
  5870. input, ok := in.Parameters.(*PutBucketMetricsConfigurationInput)
  5871. _ = input
  5872. if !ok {
  5873. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5874. }
  5875. opPath, opQuery := httpbinding.SplitURI("/?metrics")
  5876. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5877. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5878. request.Method = "PUT"
  5879. var restEncoder *httpbinding.Encoder
  5880. if request.URL.RawPath == "" {
  5881. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5882. } else {
  5883. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5884. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5885. }
  5886. if err != nil {
  5887. return out, metadata, &smithy.SerializationError{Err: err}
  5888. }
  5889. if err := awsRestxml_serializeOpHttpBindingsPutBucketMetricsConfigurationInput(input, restEncoder); err != nil {
  5890. return out, metadata, &smithy.SerializationError{Err: err}
  5891. }
  5892. if input.MetricsConfiguration != nil {
  5893. if !restEncoder.HasHeader("Content-Type") {
  5894. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5895. restEncoder.SetHeader("Content-Type").String("application/xml")
  5896. }
  5897. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5898. payloadRootAttr := []smithyxml.Attr{}
  5899. payloadRoot := smithyxml.StartElement{
  5900. Name: smithyxml.Name{
  5901. Local: "MetricsConfiguration",
  5902. },
  5903. Attr: payloadRootAttr,
  5904. }
  5905. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5906. if err := awsRestxml_serializeDocumentMetricsConfiguration(input.MetricsConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5907. return out, metadata, &smithy.SerializationError{Err: err}
  5908. }
  5909. payload := bytes.NewReader(xmlEncoder.Bytes())
  5910. if request, err = request.SetStream(payload); err != nil {
  5911. return out, metadata, &smithy.SerializationError{Err: err}
  5912. }
  5913. }
  5914. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5915. return out, metadata, &smithy.SerializationError{Err: err}
  5916. }
  5917. in.Request = request
  5918. endTimer()
  5919. span.End()
  5920. return next.HandleSerialize(ctx, in)
  5921. }
  5922. func awsRestxml_serializeOpHttpBindingsPutBucketMetricsConfigurationInput(v *PutBucketMetricsConfigurationInput, encoder *httpbinding.Encoder) error {
  5923. if v == nil {
  5924. return fmt.Errorf("unsupported serialization of nil %T", v)
  5925. }
  5926. if v.ExpectedBucketOwner != nil {
  5927. locationName := "X-Amz-Expected-Bucket-Owner"
  5928. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  5929. }
  5930. if v.Id != nil {
  5931. encoder.SetQuery("id").String(*v.Id)
  5932. }
  5933. return nil
  5934. }
  5935. type awsRestxml_serializeOpPutBucketNotificationConfiguration struct {
  5936. }
  5937. func (*awsRestxml_serializeOpPutBucketNotificationConfiguration) ID() string {
  5938. return "OperationSerializer"
  5939. }
  5940. func (m *awsRestxml_serializeOpPutBucketNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  5941. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  5942. ) {
  5943. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  5944. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  5945. defer endTimer()
  5946. defer span.End()
  5947. request, ok := in.Request.(*smithyhttp.Request)
  5948. if !ok {
  5949. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  5950. }
  5951. input, ok := in.Parameters.(*PutBucketNotificationConfigurationInput)
  5952. _ = input
  5953. if !ok {
  5954. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  5955. }
  5956. opPath, opQuery := httpbinding.SplitURI("/?notification")
  5957. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  5958. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  5959. request.Method = "PUT"
  5960. var restEncoder *httpbinding.Encoder
  5961. if request.URL.RawPath == "" {
  5962. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  5963. } else {
  5964. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  5965. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  5966. }
  5967. if err != nil {
  5968. return out, metadata, &smithy.SerializationError{Err: err}
  5969. }
  5970. if err := awsRestxml_serializeOpHttpBindingsPutBucketNotificationConfigurationInput(input, restEncoder); err != nil {
  5971. return out, metadata, &smithy.SerializationError{Err: err}
  5972. }
  5973. if input.NotificationConfiguration != nil {
  5974. if !restEncoder.HasHeader("Content-Type") {
  5975. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  5976. restEncoder.SetHeader("Content-Type").String("application/xml")
  5977. }
  5978. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  5979. payloadRootAttr := []smithyxml.Attr{}
  5980. payloadRoot := smithyxml.StartElement{
  5981. Name: smithyxml.Name{
  5982. Local: "NotificationConfiguration",
  5983. },
  5984. Attr: payloadRootAttr,
  5985. }
  5986. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  5987. if err := awsRestxml_serializeDocumentNotificationConfiguration(input.NotificationConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  5988. return out, metadata, &smithy.SerializationError{Err: err}
  5989. }
  5990. payload := bytes.NewReader(xmlEncoder.Bytes())
  5991. if request, err = request.SetStream(payload); err != nil {
  5992. return out, metadata, &smithy.SerializationError{Err: err}
  5993. }
  5994. }
  5995. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  5996. return out, metadata, &smithy.SerializationError{Err: err}
  5997. }
  5998. in.Request = request
  5999. endTimer()
  6000. span.End()
  6001. return next.HandleSerialize(ctx, in)
  6002. }
  6003. func awsRestxml_serializeOpHttpBindingsPutBucketNotificationConfigurationInput(v *PutBucketNotificationConfigurationInput, encoder *httpbinding.Encoder) error {
  6004. if v == nil {
  6005. return fmt.Errorf("unsupported serialization of nil %T", v)
  6006. }
  6007. if v.ExpectedBucketOwner != nil {
  6008. locationName := "X-Amz-Expected-Bucket-Owner"
  6009. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6010. }
  6011. if v.SkipDestinationValidation != nil {
  6012. locationName := "X-Amz-Skip-Destination-Validation"
  6013. encoder.SetHeader(locationName).Boolean(*v.SkipDestinationValidation)
  6014. }
  6015. return nil
  6016. }
  6017. type awsRestxml_serializeOpPutBucketOwnershipControls struct {
  6018. }
  6019. func (*awsRestxml_serializeOpPutBucketOwnershipControls) ID() string {
  6020. return "OperationSerializer"
  6021. }
  6022. func (m *awsRestxml_serializeOpPutBucketOwnershipControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6023. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6024. ) {
  6025. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6026. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6027. defer endTimer()
  6028. defer span.End()
  6029. request, ok := in.Request.(*smithyhttp.Request)
  6030. if !ok {
  6031. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6032. }
  6033. input, ok := in.Parameters.(*PutBucketOwnershipControlsInput)
  6034. _ = input
  6035. if !ok {
  6036. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6037. }
  6038. opPath, opQuery := httpbinding.SplitURI("/?ownershipControls")
  6039. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6040. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6041. request.Method = "PUT"
  6042. var restEncoder *httpbinding.Encoder
  6043. if request.URL.RawPath == "" {
  6044. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6045. } else {
  6046. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6047. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6048. }
  6049. if err != nil {
  6050. return out, metadata, &smithy.SerializationError{Err: err}
  6051. }
  6052. if err := awsRestxml_serializeOpHttpBindingsPutBucketOwnershipControlsInput(input, restEncoder); err != nil {
  6053. return out, metadata, &smithy.SerializationError{Err: err}
  6054. }
  6055. if input.OwnershipControls != nil {
  6056. if !restEncoder.HasHeader("Content-Type") {
  6057. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  6058. restEncoder.SetHeader("Content-Type").String("application/xml")
  6059. }
  6060. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  6061. payloadRootAttr := []smithyxml.Attr{}
  6062. payloadRoot := smithyxml.StartElement{
  6063. Name: smithyxml.Name{
  6064. Local: "OwnershipControls",
  6065. },
  6066. Attr: payloadRootAttr,
  6067. }
  6068. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  6069. if err := awsRestxml_serializeDocumentOwnershipControls(input.OwnershipControls, xmlEncoder.RootElement(payloadRoot)); err != nil {
  6070. return out, metadata, &smithy.SerializationError{Err: err}
  6071. }
  6072. payload := bytes.NewReader(xmlEncoder.Bytes())
  6073. if request, err = request.SetStream(payload); err != nil {
  6074. return out, metadata, &smithy.SerializationError{Err: err}
  6075. }
  6076. }
  6077. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  6078. return out, metadata, &smithy.SerializationError{Err: err}
  6079. }
  6080. in.Request = request
  6081. endTimer()
  6082. span.End()
  6083. return next.HandleSerialize(ctx, in)
  6084. }
  6085. func awsRestxml_serializeOpHttpBindingsPutBucketOwnershipControlsInput(v *PutBucketOwnershipControlsInput, encoder *httpbinding.Encoder) error {
  6086. if v == nil {
  6087. return fmt.Errorf("unsupported serialization of nil %T", v)
  6088. }
  6089. if len(v.ChecksumAlgorithm) > 0 {
  6090. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  6091. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  6092. }
  6093. if v.ContentMD5 != nil {
  6094. locationName := "Content-Md5"
  6095. encoder.SetHeader(locationName).String(*v.ContentMD5)
  6096. }
  6097. if v.ExpectedBucketOwner != nil {
  6098. locationName := "X-Amz-Expected-Bucket-Owner"
  6099. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6100. }
  6101. return nil
  6102. }
  6103. type awsRestxml_serializeOpPutBucketPolicy struct {
  6104. }
  6105. func (*awsRestxml_serializeOpPutBucketPolicy) ID() string {
  6106. return "OperationSerializer"
  6107. }
  6108. func (m *awsRestxml_serializeOpPutBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6109. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6110. ) {
  6111. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6112. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6113. defer endTimer()
  6114. defer span.End()
  6115. request, ok := in.Request.(*smithyhttp.Request)
  6116. if !ok {
  6117. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6118. }
  6119. input, ok := in.Parameters.(*PutBucketPolicyInput)
  6120. _ = input
  6121. if !ok {
  6122. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6123. }
  6124. opPath, opQuery := httpbinding.SplitURI("/?policy")
  6125. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6126. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6127. request.Method = "PUT"
  6128. var restEncoder *httpbinding.Encoder
  6129. if request.URL.RawPath == "" {
  6130. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6131. } else {
  6132. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6133. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6134. }
  6135. if err != nil {
  6136. return out, metadata, &smithy.SerializationError{Err: err}
  6137. }
  6138. if err := awsRestxml_serializeOpHttpBindingsPutBucketPolicyInput(input, restEncoder); err != nil {
  6139. return out, metadata, &smithy.SerializationError{Err: err}
  6140. }
  6141. if !restEncoder.HasHeader("Content-Type") {
  6142. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  6143. restEncoder.SetHeader("Content-Type").String("text/plain")
  6144. }
  6145. if input.Policy != nil {
  6146. payload := strings.NewReader(*input.Policy)
  6147. if request, err = request.SetStream(payload); err != nil {
  6148. return out, metadata, &smithy.SerializationError{Err: err}
  6149. }
  6150. }
  6151. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  6152. return out, metadata, &smithy.SerializationError{Err: err}
  6153. }
  6154. in.Request = request
  6155. endTimer()
  6156. span.End()
  6157. return next.HandleSerialize(ctx, in)
  6158. }
  6159. func awsRestxml_serializeOpHttpBindingsPutBucketPolicyInput(v *PutBucketPolicyInput, encoder *httpbinding.Encoder) error {
  6160. if v == nil {
  6161. return fmt.Errorf("unsupported serialization of nil %T", v)
  6162. }
  6163. if len(v.ChecksumAlgorithm) > 0 {
  6164. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  6165. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  6166. }
  6167. if v.ConfirmRemoveSelfBucketAccess != nil {
  6168. locationName := "X-Amz-Confirm-Remove-Self-Bucket-Access"
  6169. encoder.SetHeader(locationName).Boolean(*v.ConfirmRemoveSelfBucketAccess)
  6170. }
  6171. if v.ContentMD5 != nil {
  6172. locationName := "Content-Md5"
  6173. encoder.SetHeader(locationName).String(*v.ContentMD5)
  6174. }
  6175. if v.ExpectedBucketOwner != nil {
  6176. locationName := "X-Amz-Expected-Bucket-Owner"
  6177. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6178. }
  6179. return nil
  6180. }
  6181. type awsRestxml_serializeOpPutBucketReplication struct {
  6182. }
  6183. func (*awsRestxml_serializeOpPutBucketReplication) ID() string {
  6184. return "OperationSerializer"
  6185. }
  6186. func (m *awsRestxml_serializeOpPutBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6187. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6188. ) {
  6189. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6190. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6191. defer endTimer()
  6192. defer span.End()
  6193. request, ok := in.Request.(*smithyhttp.Request)
  6194. if !ok {
  6195. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6196. }
  6197. input, ok := in.Parameters.(*PutBucketReplicationInput)
  6198. _ = input
  6199. if !ok {
  6200. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6201. }
  6202. opPath, opQuery := httpbinding.SplitURI("/?replication")
  6203. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6204. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6205. request.Method = "PUT"
  6206. var restEncoder *httpbinding.Encoder
  6207. if request.URL.RawPath == "" {
  6208. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6209. } else {
  6210. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6211. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6212. }
  6213. if err != nil {
  6214. return out, metadata, &smithy.SerializationError{Err: err}
  6215. }
  6216. if err := awsRestxml_serializeOpHttpBindingsPutBucketReplicationInput(input, restEncoder); err != nil {
  6217. return out, metadata, &smithy.SerializationError{Err: err}
  6218. }
  6219. if input.ReplicationConfiguration != nil {
  6220. if !restEncoder.HasHeader("Content-Type") {
  6221. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  6222. restEncoder.SetHeader("Content-Type").String("application/xml")
  6223. }
  6224. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  6225. payloadRootAttr := []smithyxml.Attr{}
  6226. payloadRoot := smithyxml.StartElement{
  6227. Name: smithyxml.Name{
  6228. Local: "ReplicationConfiguration",
  6229. },
  6230. Attr: payloadRootAttr,
  6231. }
  6232. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  6233. if err := awsRestxml_serializeDocumentReplicationConfiguration(input.ReplicationConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  6234. return out, metadata, &smithy.SerializationError{Err: err}
  6235. }
  6236. payload := bytes.NewReader(xmlEncoder.Bytes())
  6237. if request, err = request.SetStream(payload); err != nil {
  6238. return out, metadata, &smithy.SerializationError{Err: err}
  6239. }
  6240. }
  6241. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  6242. return out, metadata, &smithy.SerializationError{Err: err}
  6243. }
  6244. in.Request = request
  6245. endTimer()
  6246. span.End()
  6247. return next.HandleSerialize(ctx, in)
  6248. }
  6249. func awsRestxml_serializeOpHttpBindingsPutBucketReplicationInput(v *PutBucketReplicationInput, encoder *httpbinding.Encoder) error {
  6250. if v == nil {
  6251. return fmt.Errorf("unsupported serialization of nil %T", v)
  6252. }
  6253. if len(v.ChecksumAlgorithm) > 0 {
  6254. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  6255. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  6256. }
  6257. if v.ContentMD5 != nil {
  6258. locationName := "Content-Md5"
  6259. encoder.SetHeader(locationName).String(*v.ContentMD5)
  6260. }
  6261. if v.ExpectedBucketOwner != nil {
  6262. locationName := "X-Amz-Expected-Bucket-Owner"
  6263. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6264. }
  6265. if v.Token != nil {
  6266. locationName := "X-Amz-Bucket-Object-Lock-Token"
  6267. encoder.SetHeader(locationName).String(*v.Token)
  6268. }
  6269. return nil
  6270. }
  6271. type awsRestxml_serializeOpPutBucketRequestPayment struct {
  6272. }
  6273. func (*awsRestxml_serializeOpPutBucketRequestPayment) ID() string {
  6274. return "OperationSerializer"
  6275. }
  6276. func (m *awsRestxml_serializeOpPutBucketRequestPayment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6277. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6278. ) {
  6279. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6280. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6281. defer endTimer()
  6282. defer span.End()
  6283. request, ok := in.Request.(*smithyhttp.Request)
  6284. if !ok {
  6285. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6286. }
  6287. input, ok := in.Parameters.(*PutBucketRequestPaymentInput)
  6288. _ = input
  6289. if !ok {
  6290. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6291. }
  6292. opPath, opQuery := httpbinding.SplitURI("/?requestPayment")
  6293. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6294. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6295. request.Method = "PUT"
  6296. var restEncoder *httpbinding.Encoder
  6297. if request.URL.RawPath == "" {
  6298. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6299. } else {
  6300. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6301. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6302. }
  6303. if err != nil {
  6304. return out, metadata, &smithy.SerializationError{Err: err}
  6305. }
  6306. if err := awsRestxml_serializeOpHttpBindingsPutBucketRequestPaymentInput(input, restEncoder); err != nil {
  6307. return out, metadata, &smithy.SerializationError{Err: err}
  6308. }
  6309. if input.RequestPaymentConfiguration != nil {
  6310. if !restEncoder.HasHeader("Content-Type") {
  6311. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  6312. restEncoder.SetHeader("Content-Type").String("application/xml")
  6313. }
  6314. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  6315. payloadRootAttr := []smithyxml.Attr{}
  6316. payloadRoot := smithyxml.StartElement{
  6317. Name: smithyxml.Name{
  6318. Local: "RequestPaymentConfiguration",
  6319. },
  6320. Attr: payloadRootAttr,
  6321. }
  6322. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  6323. if err := awsRestxml_serializeDocumentRequestPaymentConfiguration(input.RequestPaymentConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  6324. return out, metadata, &smithy.SerializationError{Err: err}
  6325. }
  6326. payload := bytes.NewReader(xmlEncoder.Bytes())
  6327. if request, err = request.SetStream(payload); err != nil {
  6328. return out, metadata, &smithy.SerializationError{Err: err}
  6329. }
  6330. }
  6331. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  6332. return out, metadata, &smithy.SerializationError{Err: err}
  6333. }
  6334. in.Request = request
  6335. endTimer()
  6336. span.End()
  6337. return next.HandleSerialize(ctx, in)
  6338. }
  6339. func awsRestxml_serializeOpHttpBindingsPutBucketRequestPaymentInput(v *PutBucketRequestPaymentInput, encoder *httpbinding.Encoder) error {
  6340. if v == nil {
  6341. return fmt.Errorf("unsupported serialization of nil %T", v)
  6342. }
  6343. if len(v.ChecksumAlgorithm) > 0 {
  6344. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  6345. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  6346. }
  6347. if v.ContentMD5 != nil {
  6348. locationName := "Content-Md5"
  6349. encoder.SetHeader(locationName).String(*v.ContentMD5)
  6350. }
  6351. if v.ExpectedBucketOwner != nil {
  6352. locationName := "X-Amz-Expected-Bucket-Owner"
  6353. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6354. }
  6355. return nil
  6356. }
  6357. type awsRestxml_serializeOpPutBucketTagging struct {
  6358. }
  6359. func (*awsRestxml_serializeOpPutBucketTagging) ID() string {
  6360. return "OperationSerializer"
  6361. }
  6362. func (m *awsRestxml_serializeOpPutBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6363. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6364. ) {
  6365. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6366. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6367. defer endTimer()
  6368. defer span.End()
  6369. request, ok := in.Request.(*smithyhttp.Request)
  6370. if !ok {
  6371. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6372. }
  6373. input, ok := in.Parameters.(*PutBucketTaggingInput)
  6374. _ = input
  6375. if !ok {
  6376. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6377. }
  6378. opPath, opQuery := httpbinding.SplitURI("/?tagging")
  6379. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6380. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6381. request.Method = "PUT"
  6382. var restEncoder *httpbinding.Encoder
  6383. if request.URL.RawPath == "" {
  6384. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6385. } else {
  6386. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6387. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6388. }
  6389. if err != nil {
  6390. return out, metadata, &smithy.SerializationError{Err: err}
  6391. }
  6392. if err := awsRestxml_serializeOpHttpBindingsPutBucketTaggingInput(input, restEncoder); err != nil {
  6393. return out, metadata, &smithy.SerializationError{Err: err}
  6394. }
  6395. if input.Tagging != nil {
  6396. if !restEncoder.HasHeader("Content-Type") {
  6397. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  6398. restEncoder.SetHeader("Content-Type").String("application/xml")
  6399. }
  6400. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  6401. payloadRootAttr := []smithyxml.Attr{}
  6402. payloadRoot := smithyxml.StartElement{
  6403. Name: smithyxml.Name{
  6404. Local: "Tagging",
  6405. },
  6406. Attr: payloadRootAttr,
  6407. }
  6408. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  6409. if err := awsRestxml_serializeDocumentTagging(input.Tagging, xmlEncoder.RootElement(payloadRoot)); err != nil {
  6410. return out, metadata, &smithy.SerializationError{Err: err}
  6411. }
  6412. payload := bytes.NewReader(xmlEncoder.Bytes())
  6413. if request, err = request.SetStream(payload); err != nil {
  6414. return out, metadata, &smithy.SerializationError{Err: err}
  6415. }
  6416. }
  6417. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  6418. return out, metadata, &smithy.SerializationError{Err: err}
  6419. }
  6420. in.Request = request
  6421. endTimer()
  6422. span.End()
  6423. return next.HandleSerialize(ctx, in)
  6424. }
  6425. func awsRestxml_serializeOpHttpBindingsPutBucketTaggingInput(v *PutBucketTaggingInput, encoder *httpbinding.Encoder) error {
  6426. if v == nil {
  6427. return fmt.Errorf("unsupported serialization of nil %T", v)
  6428. }
  6429. if len(v.ChecksumAlgorithm) > 0 {
  6430. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  6431. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  6432. }
  6433. if v.ContentMD5 != nil {
  6434. locationName := "Content-Md5"
  6435. encoder.SetHeader(locationName).String(*v.ContentMD5)
  6436. }
  6437. if v.ExpectedBucketOwner != nil {
  6438. locationName := "X-Amz-Expected-Bucket-Owner"
  6439. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6440. }
  6441. return nil
  6442. }
  6443. type awsRestxml_serializeOpPutBucketVersioning struct {
  6444. }
  6445. func (*awsRestxml_serializeOpPutBucketVersioning) ID() string {
  6446. return "OperationSerializer"
  6447. }
  6448. func (m *awsRestxml_serializeOpPutBucketVersioning) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6449. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6450. ) {
  6451. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6452. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6453. defer endTimer()
  6454. defer span.End()
  6455. request, ok := in.Request.(*smithyhttp.Request)
  6456. if !ok {
  6457. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6458. }
  6459. input, ok := in.Parameters.(*PutBucketVersioningInput)
  6460. _ = input
  6461. if !ok {
  6462. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6463. }
  6464. opPath, opQuery := httpbinding.SplitURI("/?versioning")
  6465. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6466. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6467. request.Method = "PUT"
  6468. var restEncoder *httpbinding.Encoder
  6469. if request.URL.RawPath == "" {
  6470. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6471. } else {
  6472. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6473. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6474. }
  6475. if err != nil {
  6476. return out, metadata, &smithy.SerializationError{Err: err}
  6477. }
  6478. if err := awsRestxml_serializeOpHttpBindingsPutBucketVersioningInput(input, restEncoder); err != nil {
  6479. return out, metadata, &smithy.SerializationError{Err: err}
  6480. }
  6481. if input.VersioningConfiguration != nil {
  6482. if !restEncoder.HasHeader("Content-Type") {
  6483. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  6484. restEncoder.SetHeader("Content-Type").String("application/xml")
  6485. }
  6486. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  6487. payloadRootAttr := []smithyxml.Attr{}
  6488. payloadRoot := smithyxml.StartElement{
  6489. Name: smithyxml.Name{
  6490. Local: "VersioningConfiguration",
  6491. },
  6492. Attr: payloadRootAttr,
  6493. }
  6494. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  6495. if err := awsRestxml_serializeDocumentVersioningConfiguration(input.VersioningConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  6496. return out, metadata, &smithy.SerializationError{Err: err}
  6497. }
  6498. payload := bytes.NewReader(xmlEncoder.Bytes())
  6499. if request, err = request.SetStream(payload); err != nil {
  6500. return out, metadata, &smithy.SerializationError{Err: err}
  6501. }
  6502. }
  6503. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  6504. return out, metadata, &smithy.SerializationError{Err: err}
  6505. }
  6506. in.Request = request
  6507. endTimer()
  6508. span.End()
  6509. return next.HandleSerialize(ctx, in)
  6510. }
  6511. func awsRestxml_serializeOpHttpBindingsPutBucketVersioningInput(v *PutBucketVersioningInput, encoder *httpbinding.Encoder) error {
  6512. if v == nil {
  6513. return fmt.Errorf("unsupported serialization of nil %T", v)
  6514. }
  6515. if len(v.ChecksumAlgorithm) > 0 {
  6516. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  6517. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  6518. }
  6519. if v.ContentMD5 != nil {
  6520. locationName := "Content-Md5"
  6521. encoder.SetHeader(locationName).String(*v.ContentMD5)
  6522. }
  6523. if v.ExpectedBucketOwner != nil {
  6524. locationName := "X-Amz-Expected-Bucket-Owner"
  6525. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6526. }
  6527. if v.MFA != nil {
  6528. locationName := "X-Amz-Mfa"
  6529. encoder.SetHeader(locationName).String(*v.MFA)
  6530. }
  6531. return nil
  6532. }
  6533. type awsRestxml_serializeOpPutBucketWebsite struct {
  6534. }
  6535. func (*awsRestxml_serializeOpPutBucketWebsite) ID() string {
  6536. return "OperationSerializer"
  6537. }
  6538. func (m *awsRestxml_serializeOpPutBucketWebsite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6539. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6540. ) {
  6541. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6542. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6543. defer endTimer()
  6544. defer span.End()
  6545. request, ok := in.Request.(*smithyhttp.Request)
  6546. if !ok {
  6547. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6548. }
  6549. input, ok := in.Parameters.(*PutBucketWebsiteInput)
  6550. _ = input
  6551. if !ok {
  6552. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6553. }
  6554. opPath, opQuery := httpbinding.SplitURI("/?website")
  6555. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6556. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6557. request.Method = "PUT"
  6558. var restEncoder *httpbinding.Encoder
  6559. if request.URL.RawPath == "" {
  6560. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6561. } else {
  6562. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6563. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6564. }
  6565. if err != nil {
  6566. return out, metadata, &smithy.SerializationError{Err: err}
  6567. }
  6568. if err := awsRestxml_serializeOpHttpBindingsPutBucketWebsiteInput(input, restEncoder); err != nil {
  6569. return out, metadata, &smithy.SerializationError{Err: err}
  6570. }
  6571. if input.WebsiteConfiguration != nil {
  6572. if !restEncoder.HasHeader("Content-Type") {
  6573. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  6574. restEncoder.SetHeader("Content-Type").String("application/xml")
  6575. }
  6576. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  6577. payloadRootAttr := []smithyxml.Attr{}
  6578. payloadRoot := smithyxml.StartElement{
  6579. Name: smithyxml.Name{
  6580. Local: "WebsiteConfiguration",
  6581. },
  6582. Attr: payloadRootAttr,
  6583. }
  6584. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  6585. if err := awsRestxml_serializeDocumentWebsiteConfiguration(input.WebsiteConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  6586. return out, metadata, &smithy.SerializationError{Err: err}
  6587. }
  6588. payload := bytes.NewReader(xmlEncoder.Bytes())
  6589. if request, err = request.SetStream(payload); err != nil {
  6590. return out, metadata, &smithy.SerializationError{Err: err}
  6591. }
  6592. }
  6593. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  6594. return out, metadata, &smithy.SerializationError{Err: err}
  6595. }
  6596. in.Request = request
  6597. endTimer()
  6598. span.End()
  6599. return next.HandleSerialize(ctx, in)
  6600. }
  6601. func awsRestxml_serializeOpHttpBindingsPutBucketWebsiteInput(v *PutBucketWebsiteInput, encoder *httpbinding.Encoder) error {
  6602. if v == nil {
  6603. return fmt.Errorf("unsupported serialization of nil %T", v)
  6604. }
  6605. if len(v.ChecksumAlgorithm) > 0 {
  6606. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  6607. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  6608. }
  6609. if v.ContentMD5 != nil {
  6610. locationName := "Content-Md5"
  6611. encoder.SetHeader(locationName).String(*v.ContentMD5)
  6612. }
  6613. if v.ExpectedBucketOwner != nil {
  6614. locationName := "X-Amz-Expected-Bucket-Owner"
  6615. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6616. }
  6617. return nil
  6618. }
  6619. type awsRestxml_serializeOpPutObject struct {
  6620. }
  6621. func (*awsRestxml_serializeOpPutObject) ID() string {
  6622. return "OperationSerializer"
  6623. }
  6624. func (m *awsRestxml_serializeOpPutObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6625. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6626. ) {
  6627. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6628. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6629. defer endTimer()
  6630. defer span.End()
  6631. request, ok := in.Request.(*smithyhttp.Request)
  6632. if !ok {
  6633. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6634. }
  6635. input, ok := in.Parameters.(*PutObjectInput)
  6636. _ = input
  6637. if !ok {
  6638. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6639. }
  6640. opPath, opQuery := httpbinding.SplitURI("/{Key+}?x-id=PutObject")
  6641. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6642. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6643. request.Method = "PUT"
  6644. var restEncoder *httpbinding.Encoder
  6645. if request.URL.RawPath == "" {
  6646. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6647. } else {
  6648. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6649. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6650. }
  6651. if err != nil {
  6652. return out, metadata, &smithy.SerializationError{Err: err}
  6653. }
  6654. if err := awsRestxml_serializeOpHttpBindingsPutObjectInput(input, restEncoder); err != nil {
  6655. return out, metadata, &smithy.SerializationError{Err: err}
  6656. }
  6657. if !restEncoder.HasHeader("Content-Type") {
  6658. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  6659. restEncoder.SetHeader("Content-Type").String("application/octet-stream")
  6660. }
  6661. if input.Body != nil {
  6662. payload := input.Body
  6663. if request, err = request.SetStream(payload); err != nil {
  6664. return out, metadata, &smithy.SerializationError{Err: err}
  6665. }
  6666. }
  6667. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  6668. return out, metadata, &smithy.SerializationError{Err: err}
  6669. }
  6670. in.Request = request
  6671. endTimer()
  6672. span.End()
  6673. return next.HandleSerialize(ctx, in)
  6674. }
  6675. func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder *httpbinding.Encoder) error {
  6676. if v == nil {
  6677. return fmt.Errorf("unsupported serialization of nil %T", v)
  6678. }
  6679. if len(v.ACL) > 0 {
  6680. locationName := "X-Amz-Acl"
  6681. encoder.SetHeader(locationName).String(string(v.ACL))
  6682. }
  6683. if v.BucketKeyEnabled != nil {
  6684. locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled"
  6685. encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled)
  6686. }
  6687. if v.CacheControl != nil {
  6688. locationName := "Cache-Control"
  6689. encoder.SetHeader(locationName).String(*v.CacheControl)
  6690. }
  6691. if len(v.ChecksumAlgorithm) > 0 {
  6692. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  6693. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  6694. }
  6695. if v.ChecksumCRC32 != nil {
  6696. locationName := "X-Amz-Checksum-Crc32"
  6697. encoder.SetHeader(locationName).String(*v.ChecksumCRC32)
  6698. }
  6699. if v.ChecksumCRC32C != nil {
  6700. locationName := "X-Amz-Checksum-Crc32c"
  6701. encoder.SetHeader(locationName).String(*v.ChecksumCRC32C)
  6702. }
  6703. if v.ChecksumCRC64NVME != nil {
  6704. locationName := "X-Amz-Checksum-Crc64nvme"
  6705. encoder.SetHeader(locationName).String(*v.ChecksumCRC64NVME)
  6706. }
  6707. if v.ChecksumSHA1 != nil {
  6708. locationName := "X-Amz-Checksum-Sha1"
  6709. encoder.SetHeader(locationName).String(*v.ChecksumSHA1)
  6710. }
  6711. if v.ChecksumSHA256 != nil {
  6712. locationName := "X-Amz-Checksum-Sha256"
  6713. encoder.SetHeader(locationName).String(*v.ChecksumSHA256)
  6714. }
  6715. if v.ContentDisposition != nil {
  6716. locationName := "Content-Disposition"
  6717. encoder.SetHeader(locationName).String(*v.ContentDisposition)
  6718. }
  6719. if v.ContentEncoding != nil {
  6720. locationName := "Content-Encoding"
  6721. encoder.SetHeader(locationName).String(*v.ContentEncoding)
  6722. }
  6723. if v.ContentLanguage != nil {
  6724. locationName := "Content-Language"
  6725. encoder.SetHeader(locationName).String(*v.ContentLanguage)
  6726. }
  6727. if v.ContentLength != nil {
  6728. locationName := "Content-Length"
  6729. encoder.SetHeader(locationName).Long(*v.ContentLength)
  6730. }
  6731. if v.ContentMD5 != nil {
  6732. locationName := "Content-Md5"
  6733. encoder.SetHeader(locationName).String(*v.ContentMD5)
  6734. }
  6735. if v.ContentType != nil {
  6736. locationName := "Content-Type"
  6737. encoder.SetHeader(locationName).String(*v.ContentType)
  6738. }
  6739. if v.ExpectedBucketOwner != nil {
  6740. locationName := "X-Amz-Expected-Bucket-Owner"
  6741. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6742. }
  6743. if v.Expires != nil {
  6744. locationName := "Expires"
  6745. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires))
  6746. }
  6747. if v.GrantFullControl != nil {
  6748. locationName := "X-Amz-Grant-Full-Control"
  6749. encoder.SetHeader(locationName).String(*v.GrantFullControl)
  6750. }
  6751. if v.GrantRead != nil {
  6752. locationName := "X-Amz-Grant-Read"
  6753. encoder.SetHeader(locationName).String(*v.GrantRead)
  6754. }
  6755. if v.GrantReadACP != nil {
  6756. locationName := "X-Amz-Grant-Read-Acp"
  6757. encoder.SetHeader(locationName).String(*v.GrantReadACP)
  6758. }
  6759. if v.GrantWriteACP != nil {
  6760. locationName := "X-Amz-Grant-Write-Acp"
  6761. encoder.SetHeader(locationName).String(*v.GrantWriteACP)
  6762. }
  6763. if v.IfMatch != nil {
  6764. locationName := "If-Match"
  6765. encoder.SetHeader(locationName).String(*v.IfMatch)
  6766. }
  6767. if v.IfNoneMatch != nil {
  6768. locationName := "If-None-Match"
  6769. encoder.SetHeader(locationName).String(*v.IfNoneMatch)
  6770. }
  6771. if v.Key == nil || len(*v.Key) == 0 {
  6772. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  6773. }
  6774. if v.Key != nil {
  6775. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  6776. return err
  6777. }
  6778. }
  6779. if v.Metadata != nil {
  6780. hv := encoder.Headers("X-Amz-Meta-")
  6781. for mapKey, mapVal := range v.Metadata {
  6782. hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal)
  6783. }
  6784. }
  6785. if len(v.ObjectLockLegalHoldStatus) > 0 {
  6786. locationName := "X-Amz-Object-Lock-Legal-Hold"
  6787. encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus))
  6788. }
  6789. if len(v.ObjectLockMode) > 0 {
  6790. locationName := "X-Amz-Object-Lock-Mode"
  6791. encoder.SetHeader(locationName).String(string(v.ObjectLockMode))
  6792. }
  6793. if v.ObjectLockRetainUntilDate != nil {
  6794. locationName := "X-Amz-Object-Lock-Retain-Until-Date"
  6795. encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.ObjectLockRetainUntilDate))
  6796. }
  6797. if len(v.RequestPayer) > 0 {
  6798. locationName := "X-Amz-Request-Payer"
  6799. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  6800. }
  6801. if len(v.ServerSideEncryption) > 0 {
  6802. locationName := "X-Amz-Server-Side-Encryption"
  6803. encoder.SetHeader(locationName).String(string(v.ServerSideEncryption))
  6804. }
  6805. if v.SSECustomerAlgorithm != nil {
  6806. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  6807. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  6808. }
  6809. if v.SSECustomerKey != nil {
  6810. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  6811. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  6812. }
  6813. if v.SSECustomerKeyMD5 != nil {
  6814. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  6815. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  6816. }
  6817. if v.SSEKMSEncryptionContext != nil {
  6818. locationName := "X-Amz-Server-Side-Encryption-Context"
  6819. encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext)
  6820. }
  6821. if v.SSEKMSKeyId != nil {
  6822. locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id"
  6823. encoder.SetHeader(locationName).String(*v.SSEKMSKeyId)
  6824. }
  6825. if len(v.StorageClass) > 0 {
  6826. locationName := "X-Amz-Storage-Class"
  6827. encoder.SetHeader(locationName).String(string(v.StorageClass))
  6828. }
  6829. if v.Tagging != nil {
  6830. locationName := "X-Amz-Tagging"
  6831. encoder.SetHeader(locationName).String(*v.Tagging)
  6832. }
  6833. if v.WebsiteRedirectLocation != nil {
  6834. locationName := "X-Amz-Website-Redirect-Location"
  6835. encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation)
  6836. }
  6837. if v.WriteOffsetBytes != nil {
  6838. locationName := "X-Amz-Write-Offset-Bytes"
  6839. encoder.SetHeader(locationName).Long(*v.WriteOffsetBytes)
  6840. }
  6841. return nil
  6842. }
  6843. type awsRestxml_serializeOpPutObjectAcl struct {
  6844. }
  6845. func (*awsRestxml_serializeOpPutObjectAcl) ID() string {
  6846. return "OperationSerializer"
  6847. }
  6848. func (m *awsRestxml_serializeOpPutObjectAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6849. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6850. ) {
  6851. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6852. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6853. defer endTimer()
  6854. defer span.End()
  6855. request, ok := in.Request.(*smithyhttp.Request)
  6856. if !ok {
  6857. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6858. }
  6859. input, ok := in.Parameters.(*PutObjectAclInput)
  6860. _ = input
  6861. if !ok {
  6862. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6863. }
  6864. opPath, opQuery := httpbinding.SplitURI("/{Key+}?acl")
  6865. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6866. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6867. request.Method = "PUT"
  6868. var restEncoder *httpbinding.Encoder
  6869. if request.URL.RawPath == "" {
  6870. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6871. } else {
  6872. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6873. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6874. }
  6875. if err != nil {
  6876. return out, metadata, &smithy.SerializationError{Err: err}
  6877. }
  6878. if err := awsRestxml_serializeOpHttpBindingsPutObjectAclInput(input, restEncoder); err != nil {
  6879. return out, metadata, &smithy.SerializationError{Err: err}
  6880. }
  6881. if input.AccessControlPolicy != nil {
  6882. if !restEncoder.HasHeader("Content-Type") {
  6883. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  6884. restEncoder.SetHeader("Content-Type").String("application/xml")
  6885. }
  6886. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  6887. payloadRootAttr := []smithyxml.Attr{}
  6888. payloadRoot := smithyxml.StartElement{
  6889. Name: smithyxml.Name{
  6890. Local: "AccessControlPolicy",
  6891. },
  6892. Attr: payloadRootAttr,
  6893. }
  6894. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  6895. if err := awsRestxml_serializeDocumentAccessControlPolicy(input.AccessControlPolicy, xmlEncoder.RootElement(payloadRoot)); err != nil {
  6896. return out, metadata, &smithy.SerializationError{Err: err}
  6897. }
  6898. payload := bytes.NewReader(xmlEncoder.Bytes())
  6899. if request, err = request.SetStream(payload); err != nil {
  6900. return out, metadata, &smithy.SerializationError{Err: err}
  6901. }
  6902. }
  6903. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  6904. return out, metadata, &smithy.SerializationError{Err: err}
  6905. }
  6906. in.Request = request
  6907. endTimer()
  6908. span.End()
  6909. return next.HandleSerialize(ctx, in)
  6910. }
  6911. func awsRestxml_serializeOpHttpBindingsPutObjectAclInput(v *PutObjectAclInput, encoder *httpbinding.Encoder) error {
  6912. if v == nil {
  6913. return fmt.Errorf("unsupported serialization of nil %T", v)
  6914. }
  6915. if len(v.ACL) > 0 {
  6916. locationName := "X-Amz-Acl"
  6917. encoder.SetHeader(locationName).String(string(v.ACL))
  6918. }
  6919. if len(v.ChecksumAlgorithm) > 0 {
  6920. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  6921. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  6922. }
  6923. if v.ContentMD5 != nil {
  6924. locationName := "Content-Md5"
  6925. encoder.SetHeader(locationName).String(*v.ContentMD5)
  6926. }
  6927. if v.ExpectedBucketOwner != nil {
  6928. locationName := "X-Amz-Expected-Bucket-Owner"
  6929. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  6930. }
  6931. if v.GrantFullControl != nil {
  6932. locationName := "X-Amz-Grant-Full-Control"
  6933. encoder.SetHeader(locationName).String(*v.GrantFullControl)
  6934. }
  6935. if v.GrantRead != nil {
  6936. locationName := "X-Amz-Grant-Read"
  6937. encoder.SetHeader(locationName).String(*v.GrantRead)
  6938. }
  6939. if v.GrantReadACP != nil {
  6940. locationName := "X-Amz-Grant-Read-Acp"
  6941. encoder.SetHeader(locationName).String(*v.GrantReadACP)
  6942. }
  6943. if v.GrantWrite != nil {
  6944. locationName := "X-Amz-Grant-Write"
  6945. encoder.SetHeader(locationName).String(*v.GrantWrite)
  6946. }
  6947. if v.GrantWriteACP != nil {
  6948. locationName := "X-Amz-Grant-Write-Acp"
  6949. encoder.SetHeader(locationName).String(*v.GrantWriteACP)
  6950. }
  6951. if v.Key == nil || len(*v.Key) == 0 {
  6952. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  6953. }
  6954. if v.Key != nil {
  6955. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  6956. return err
  6957. }
  6958. }
  6959. if len(v.RequestPayer) > 0 {
  6960. locationName := "X-Amz-Request-Payer"
  6961. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  6962. }
  6963. if v.VersionId != nil {
  6964. encoder.SetQuery("versionId").String(*v.VersionId)
  6965. }
  6966. return nil
  6967. }
  6968. type awsRestxml_serializeOpPutObjectLegalHold struct {
  6969. }
  6970. func (*awsRestxml_serializeOpPutObjectLegalHold) ID() string {
  6971. return "OperationSerializer"
  6972. }
  6973. func (m *awsRestxml_serializeOpPutObjectLegalHold) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  6974. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  6975. ) {
  6976. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  6977. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  6978. defer endTimer()
  6979. defer span.End()
  6980. request, ok := in.Request.(*smithyhttp.Request)
  6981. if !ok {
  6982. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  6983. }
  6984. input, ok := in.Parameters.(*PutObjectLegalHoldInput)
  6985. _ = input
  6986. if !ok {
  6987. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  6988. }
  6989. opPath, opQuery := httpbinding.SplitURI("/{Key+}?legal-hold")
  6990. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  6991. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  6992. request.Method = "PUT"
  6993. var restEncoder *httpbinding.Encoder
  6994. if request.URL.RawPath == "" {
  6995. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  6996. } else {
  6997. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  6998. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  6999. }
  7000. if err != nil {
  7001. return out, metadata, &smithy.SerializationError{Err: err}
  7002. }
  7003. if err := awsRestxml_serializeOpHttpBindingsPutObjectLegalHoldInput(input, restEncoder); err != nil {
  7004. return out, metadata, &smithy.SerializationError{Err: err}
  7005. }
  7006. if input.LegalHold != nil {
  7007. if !restEncoder.HasHeader("Content-Type") {
  7008. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  7009. restEncoder.SetHeader("Content-Type").String("application/xml")
  7010. }
  7011. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  7012. payloadRootAttr := []smithyxml.Attr{}
  7013. payloadRoot := smithyxml.StartElement{
  7014. Name: smithyxml.Name{
  7015. Local: "LegalHold",
  7016. },
  7017. Attr: payloadRootAttr,
  7018. }
  7019. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  7020. if err := awsRestxml_serializeDocumentObjectLockLegalHold(input.LegalHold, xmlEncoder.RootElement(payloadRoot)); err != nil {
  7021. return out, metadata, &smithy.SerializationError{Err: err}
  7022. }
  7023. payload := bytes.NewReader(xmlEncoder.Bytes())
  7024. if request, err = request.SetStream(payload); err != nil {
  7025. return out, metadata, &smithy.SerializationError{Err: err}
  7026. }
  7027. }
  7028. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7029. return out, metadata, &smithy.SerializationError{Err: err}
  7030. }
  7031. in.Request = request
  7032. endTimer()
  7033. span.End()
  7034. return next.HandleSerialize(ctx, in)
  7035. }
  7036. func awsRestxml_serializeOpHttpBindingsPutObjectLegalHoldInput(v *PutObjectLegalHoldInput, encoder *httpbinding.Encoder) error {
  7037. if v == nil {
  7038. return fmt.Errorf("unsupported serialization of nil %T", v)
  7039. }
  7040. if len(v.ChecksumAlgorithm) > 0 {
  7041. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  7042. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  7043. }
  7044. if v.ContentMD5 != nil {
  7045. locationName := "Content-Md5"
  7046. encoder.SetHeader(locationName).String(*v.ContentMD5)
  7047. }
  7048. if v.ExpectedBucketOwner != nil {
  7049. locationName := "X-Amz-Expected-Bucket-Owner"
  7050. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  7051. }
  7052. if v.Key == nil || len(*v.Key) == 0 {
  7053. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  7054. }
  7055. if v.Key != nil {
  7056. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  7057. return err
  7058. }
  7059. }
  7060. if len(v.RequestPayer) > 0 {
  7061. locationName := "X-Amz-Request-Payer"
  7062. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  7063. }
  7064. if v.VersionId != nil {
  7065. encoder.SetQuery("versionId").String(*v.VersionId)
  7066. }
  7067. return nil
  7068. }
  7069. type awsRestxml_serializeOpPutObjectLockConfiguration struct {
  7070. }
  7071. func (*awsRestxml_serializeOpPutObjectLockConfiguration) ID() string {
  7072. return "OperationSerializer"
  7073. }
  7074. func (m *awsRestxml_serializeOpPutObjectLockConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  7075. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  7076. ) {
  7077. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  7078. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  7079. defer endTimer()
  7080. defer span.End()
  7081. request, ok := in.Request.(*smithyhttp.Request)
  7082. if !ok {
  7083. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  7084. }
  7085. input, ok := in.Parameters.(*PutObjectLockConfigurationInput)
  7086. _ = input
  7087. if !ok {
  7088. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  7089. }
  7090. opPath, opQuery := httpbinding.SplitURI("/?object-lock")
  7091. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  7092. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  7093. request.Method = "PUT"
  7094. var restEncoder *httpbinding.Encoder
  7095. if request.URL.RawPath == "" {
  7096. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  7097. } else {
  7098. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  7099. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  7100. }
  7101. if err != nil {
  7102. return out, metadata, &smithy.SerializationError{Err: err}
  7103. }
  7104. if err := awsRestxml_serializeOpHttpBindingsPutObjectLockConfigurationInput(input, restEncoder); err != nil {
  7105. return out, metadata, &smithy.SerializationError{Err: err}
  7106. }
  7107. if input.ObjectLockConfiguration != nil {
  7108. if !restEncoder.HasHeader("Content-Type") {
  7109. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  7110. restEncoder.SetHeader("Content-Type").String("application/xml")
  7111. }
  7112. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  7113. payloadRootAttr := []smithyxml.Attr{}
  7114. payloadRoot := smithyxml.StartElement{
  7115. Name: smithyxml.Name{
  7116. Local: "ObjectLockConfiguration",
  7117. },
  7118. Attr: payloadRootAttr,
  7119. }
  7120. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  7121. if err := awsRestxml_serializeDocumentObjectLockConfiguration(input.ObjectLockConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  7122. return out, metadata, &smithy.SerializationError{Err: err}
  7123. }
  7124. payload := bytes.NewReader(xmlEncoder.Bytes())
  7125. if request, err = request.SetStream(payload); err != nil {
  7126. return out, metadata, &smithy.SerializationError{Err: err}
  7127. }
  7128. }
  7129. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7130. return out, metadata, &smithy.SerializationError{Err: err}
  7131. }
  7132. in.Request = request
  7133. endTimer()
  7134. span.End()
  7135. return next.HandleSerialize(ctx, in)
  7136. }
  7137. func awsRestxml_serializeOpHttpBindingsPutObjectLockConfigurationInput(v *PutObjectLockConfigurationInput, encoder *httpbinding.Encoder) error {
  7138. if v == nil {
  7139. return fmt.Errorf("unsupported serialization of nil %T", v)
  7140. }
  7141. if len(v.ChecksumAlgorithm) > 0 {
  7142. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  7143. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  7144. }
  7145. if v.ContentMD5 != nil {
  7146. locationName := "Content-Md5"
  7147. encoder.SetHeader(locationName).String(*v.ContentMD5)
  7148. }
  7149. if v.ExpectedBucketOwner != nil {
  7150. locationName := "X-Amz-Expected-Bucket-Owner"
  7151. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  7152. }
  7153. if len(v.RequestPayer) > 0 {
  7154. locationName := "X-Amz-Request-Payer"
  7155. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  7156. }
  7157. if v.Token != nil {
  7158. locationName := "X-Amz-Bucket-Object-Lock-Token"
  7159. encoder.SetHeader(locationName).String(*v.Token)
  7160. }
  7161. return nil
  7162. }
  7163. type awsRestxml_serializeOpPutObjectRetention struct {
  7164. }
  7165. func (*awsRestxml_serializeOpPutObjectRetention) ID() string {
  7166. return "OperationSerializer"
  7167. }
  7168. func (m *awsRestxml_serializeOpPutObjectRetention) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  7169. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  7170. ) {
  7171. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  7172. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  7173. defer endTimer()
  7174. defer span.End()
  7175. request, ok := in.Request.(*smithyhttp.Request)
  7176. if !ok {
  7177. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  7178. }
  7179. input, ok := in.Parameters.(*PutObjectRetentionInput)
  7180. _ = input
  7181. if !ok {
  7182. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  7183. }
  7184. opPath, opQuery := httpbinding.SplitURI("/{Key+}?retention")
  7185. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  7186. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  7187. request.Method = "PUT"
  7188. var restEncoder *httpbinding.Encoder
  7189. if request.URL.RawPath == "" {
  7190. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  7191. } else {
  7192. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  7193. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  7194. }
  7195. if err != nil {
  7196. return out, metadata, &smithy.SerializationError{Err: err}
  7197. }
  7198. if err := awsRestxml_serializeOpHttpBindingsPutObjectRetentionInput(input, restEncoder); err != nil {
  7199. return out, metadata, &smithy.SerializationError{Err: err}
  7200. }
  7201. if input.Retention != nil {
  7202. if !restEncoder.HasHeader("Content-Type") {
  7203. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  7204. restEncoder.SetHeader("Content-Type").String("application/xml")
  7205. }
  7206. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  7207. payloadRootAttr := []smithyxml.Attr{}
  7208. payloadRoot := smithyxml.StartElement{
  7209. Name: smithyxml.Name{
  7210. Local: "Retention",
  7211. },
  7212. Attr: payloadRootAttr,
  7213. }
  7214. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  7215. if err := awsRestxml_serializeDocumentObjectLockRetention(input.Retention, xmlEncoder.RootElement(payloadRoot)); err != nil {
  7216. return out, metadata, &smithy.SerializationError{Err: err}
  7217. }
  7218. payload := bytes.NewReader(xmlEncoder.Bytes())
  7219. if request, err = request.SetStream(payload); err != nil {
  7220. return out, metadata, &smithy.SerializationError{Err: err}
  7221. }
  7222. }
  7223. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7224. return out, metadata, &smithy.SerializationError{Err: err}
  7225. }
  7226. in.Request = request
  7227. endTimer()
  7228. span.End()
  7229. return next.HandleSerialize(ctx, in)
  7230. }
  7231. func awsRestxml_serializeOpHttpBindingsPutObjectRetentionInput(v *PutObjectRetentionInput, encoder *httpbinding.Encoder) error {
  7232. if v == nil {
  7233. return fmt.Errorf("unsupported serialization of nil %T", v)
  7234. }
  7235. if v.BypassGovernanceRetention != nil {
  7236. locationName := "X-Amz-Bypass-Governance-Retention"
  7237. encoder.SetHeader(locationName).Boolean(*v.BypassGovernanceRetention)
  7238. }
  7239. if len(v.ChecksumAlgorithm) > 0 {
  7240. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  7241. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  7242. }
  7243. if v.ContentMD5 != nil {
  7244. locationName := "Content-Md5"
  7245. encoder.SetHeader(locationName).String(*v.ContentMD5)
  7246. }
  7247. if v.ExpectedBucketOwner != nil {
  7248. locationName := "X-Amz-Expected-Bucket-Owner"
  7249. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  7250. }
  7251. if v.Key == nil || len(*v.Key) == 0 {
  7252. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  7253. }
  7254. if v.Key != nil {
  7255. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  7256. return err
  7257. }
  7258. }
  7259. if len(v.RequestPayer) > 0 {
  7260. locationName := "X-Amz-Request-Payer"
  7261. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  7262. }
  7263. if v.VersionId != nil {
  7264. encoder.SetQuery("versionId").String(*v.VersionId)
  7265. }
  7266. return nil
  7267. }
  7268. type awsRestxml_serializeOpPutObjectTagging struct {
  7269. }
  7270. func (*awsRestxml_serializeOpPutObjectTagging) ID() string {
  7271. return "OperationSerializer"
  7272. }
  7273. func (m *awsRestxml_serializeOpPutObjectTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  7274. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  7275. ) {
  7276. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  7277. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  7278. defer endTimer()
  7279. defer span.End()
  7280. request, ok := in.Request.(*smithyhttp.Request)
  7281. if !ok {
  7282. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  7283. }
  7284. input, ok := in.Parameters.(*PutObjectTaggingInput)
  7285. _ = input
  7286. if !ok {
  7287. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  7288. }
  7289. opPath, opQuery := httpbinding.SplitURI("/{Key+}?tagging")
  7290. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  7291. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  7292. request.Method = "PUT"
  7293. var restEncoder *httpbinding.Encoder
  7294. if request.URL.RawPath == "" {
  7295. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  7296. } else {
  7297. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  7298. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  7299. }
  7300. if err != nil {
  7301. return out, metadata, &smithy.SerializationError{Err: err}
  7302. }
  7303. if err := awsRestxml_serializeOpHttpBindingsPutObjectTaggingInput(input, restEncoder); err != nil {
  7304. return out, metadata, &smithy.SerializationError{Err: err}
  7305. }
  7306. if input.Tagging != nil {
  7307. if !restEncoder.HasHeader("Content-Type") {
  7308. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  7309. restEncoder.SetHeader("Content-Type").String("application/xml")
  7310. }
  7311. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  7312. payloadRootAttr := []smithyxml.Attr{}
  7313. payloadRoot := smithyxml.StartElement{
  7314. Name: smithyxml.Name{
  7315. Local: "Tagging",
  7316. },
  7317. Attr: payloadRootAttr,
  7318. }
  7319. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  7320. if err := awsRestxml_serializeDocumentTagging(input.Tagging, xmlEncoder.RootElement(payloadRoot)); err != nil {
  7321. return out, metadata, &smithy.SerializationError{Err: err}
  7322. }
  7323. payload := bytes.NewReader(xmlEncoder.Bytes())
  7324. if request, err = request.SetStream(payload); err != nil {
  7325. return out, metadata, &smithy.SerializationError{Err: err}
  7326. }
  7327. }
  7328. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7329. return out, metadata, &smithy.SerializationError{Err: err}
  7330. }
  7331. in.Request = request
  7332. endTimer()
  7333. span.End()
  7334. return next.HandleSerialize(ctx, in)
  7335. }
  7336. func awsRestxml_serializeOpHttpBindingsPutObjectTaggingInput(v *PutObjectTaggingInput, encoder *httpbinding.Encoder) error {
  7337. if v == nil {
  7338. return fmt.Errorf("unsupported serialization of nil %T", v)
  7339. }
  7340. if len(v.ChecksumAlgorithm) > 0 {
  7341. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  7342. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  7343. }
  7344. if v.ContentMD5 != nil {
  7345. locationName := "Content-Md5"
  7346. encoder.SetHeader(locationName).String(*v.ContentMD5)
  7347. }
  7348. if v.ExpectedBucketOwner != nil {
  7349. locationName := "X-Amz-Expected-Bucket-Owner"
  7350. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  7351. }
  7352. if v.Key == nil || len(*v.Key) == 0 {
  7353. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  7354. }
  7355. if v.Key != nil {
  7356. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  7357. return err
  7358. }
  7359. }
  7360. if len(v.RequestPayer) > 0 {
  7361. locationName := "X-Amz-Request-Payer"
  7362. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  7363. }
  7364. if v.VersionId != nil {
  7365. encoder.SetQuery("versionId").String(*v.VersionId)
  7366. }
  7367. return nil
  7368. }
  7369. type awsRestxml_serializeOpPutPublicAccessBlock struct {
  7370. }
  7371. func (*awsRestxml_serializeOpPutPublicAccessBlock) ID() string {
  7372. return "OperationSerializer"
  7373. }
  7374. func (m *awsRestxml_serializeOpPutPublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  7375. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  7376. ) {
  7377. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  7378. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  7379. defer endTimer()
  7380. defer span.End()
  7381. request, ok := in.Request.(*smithyhttp.Request)
  7382. if !ok {
  7383. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  7384. }
  7385. input, ok := in.Parameters.(*PutPublicAccessBlockInput)
  7386. _ = input
  7387. if !ok {
  7388. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  7389. }
  7390. opPath, opQuery := httpbinding.SplitURI("/?publicAccessBlock")
  7391. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  7392. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  7393. request.Method = "PUT"
  7394. var restEncoder *httpbinding.Encoder
  7395. if request.URL.RawPath == "" {
  7396. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  7397. } else {
  7398. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  7399. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  7400. }
  7401. if err != nil {
  7402. return out, metadata, &smithy.SerializationError{Err: err}
  7403. }
  7404. if err := awsRestxml_serializeOpHttpBindingsPutPublicAccessBlockInput(input, restEncoder); err != nil {
  7405. return out, metadata, &smithy.SerializationError{Err: err}
  7406. }
  7407. if input.PublicAccessBlockConfiguration != nil {
  7408. if !restEncoder.HasHeader("Content-Type") {
  7409. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  7410. restEncoder.SetHeader("Content-Type").String("application/xml")
  7411. }
  7412. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  7413. payloadRootAttr := []smithyxml.Attr{}
  7414. payloadRoot := smithyxml.StartElement{
  7415. Name: smithyxml.Name{
  7416. Local: "PublicAccessBlockConfiguration",
  7417. },
  7418. Attr: payloadRootAttr,
  7419. }
  7420. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  7421. if err := awsRestxml_serializeDocumentPublicAccessBlockConfiguration(input.PublicAccessBlockConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  7422. return out, metadata, &smithy.SerializationError{Err: err}
  7423. }
  7424. payload := bytes.NewReader(xmlEncoder.Bytes())
  7425. if request, err = request.SetStream(payload); err != nil {
  7426. return out, metadata, &smithy.SerializationError{Err: err}
  7427. }
  7428. }
  7429. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7430. return out, metadata, &smithy.SerializationError{Err: err}
  7431. }
  7432. in.Request = request
  7433. endTimer()
  7434. span.End()
  7435. return next.HandleSerialize(ctx, in)
  7436. }
  7437. func awsRestxml_serializeOpHttpBindingsPutPublicAccessBlockInput(v *PutPublicAccessBlockInput, encoder *httpbinding.Encoder) error {
  7438. if v == nil {
  7439. return fmt.Errorf("unsupported serialization of nil %T", v)
  7440. }
  7441. if len(v.ChecksumAlgorithm) > 0 {
  7442. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  7443. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  7444. }
  7445. if v.ContentMD5 != nil {
  7446. locationName := "Content-Md5"
  7447. encoder.SetHeader(locationName).String(*v.ContentMD5)
  7448. }
  7449. if v.ExpectedBucketOwner != nil {
  7450. locationName := "X-Amz-Expected-Bucket-Owner"
  7451. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  7452. }
  7453. return nil
  7454. }
  7455. type awsRestxml_serializeOpRenameObject struct {
  7456. }
  7457. func (*awsRestxml_serializeOpRenameObject) ID() string {
  7458. return "OperationSerializer"
  7459. }
  7460. func (m *awsRestxml_serializeOpRenameObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  7461. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  7462. ) {
  7463. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  7464. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  7465. defer endTimer()
  7466. defer span.End()
  7467. request, ok := in.Request.(*smithyhttp.Request)
  7468. if !ok {
  7469. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  7470. }
  7471. input, ok := in.Parameters.(*RenameObjectInput)
  7472. _ = input
  7473. if !ok {
  7474. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  7475. }
  7476. opPath, opQuery := httpbinding.SplitURI("/{Key+}?renameObject")
  7477. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  7478. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  7479. request.Method = "PUT"
  7480. var restEncoder *httpbinding.Encoder
  7481. if request.URL.RawPath == "" {
  7482. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  7483. } else {
  7484. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  7485. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  7486. }
  7487. if err != nil {
  7488. return out, metadata, &smithy.SerializationError{Err: err}
  7489. }
  7490. if err := awsRestxml_serializeOpHttpBindingsRenameObjectInput(input, restEncoder); err != nil {
  7491. return out, metadata, &smithy.SerializationError{Err: err}
  7492. }
  7493. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7494. return out, metadata, &smithy.SerializationError{Err: err}
  7495. }
  7496. in.Request = request
  7497. endTimer()
  7498. span.End()
  7499. return next.HandleSerialize(ctx, in)
  7500. }
  7501. func awsRestxml_serializeOpHttpBindingsRenameObjectInput(v *RenameObjectInput, encoder *httpbinding.Encoder) error {
  7502. if v == nil {
  7503. return fmt.Errorf("unsupported serialization of nil %T", v)
  7504. }
  7505. if v.ClientToken != nil {
  7506. locationName := "X-Amz-Client-Token"
  7507. encoder.SetHeader(locationName).String(*v.ClientToken)
  7508. }
  7509. if v.DestinationIfMatch != nil {
  7510. locationName := "If-Match"
  7511. encoder.SetHeader(locationName).String(*v.DestinationIfMatch)
  7512. }
  7513. if v.DestinationIfModifiedSince != nil {
  7514. locationName := "If-Modified-Since"
  7515. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.DestinationIfModifiedSince))
  7516. }
  7517. if v.DestinationIfNoneMatch != nil {
  7518. locationName := "If-None-Match"
  7519. encoder.SetHeader(locationName).String(*v.DestinationIfNoneMatch)
  7520. }
  7521. if v.DestinationIfUnmodifiedSince != nil {
  7522. locationName := "If-Unmodified-Since"
  7523. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.DestinationIfUnmodifiedSince))
  7524. }
  7525. if v.Key == nil || len(*v.Key) == 0 {
  7526. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  7527. }
  7528. if v.Key != nil {
  7529. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  7530. return err
  7531. }
  7532. }
  7533. if v.RenameSource != nil {
  7534. locationName := "X-Amz-Rename-Source"
  7535. encoder.SetHeader(locationName).String(*v.RenameSource)
  7536. }
  7537. if v.SourceIfMatch != nil {
  7538. locationName := "X-Amz-Rename-Source-If-Match"
  7539. encoder.SetHeader(locationName).String(*v.SourceIfMatch)
  7540. }
  7541. if v.SourceIfModifiedSince != nil {
  7542. locationName := "X-Amz-Rename-Source-If-Modified-Since"
  7543. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.SourceIfModifiedSince))
  7544. }
  7545. if v.SourceIfNoneMatch != nil {
  7546. locationName := "X-Amz-Rename-Source-If-None-Match"
  7547. encoder.SetHeader(locationName).String(*v.SourceIfNoneMatch)
  7548. }
  7549. if v.SourceIfUnmodifiedSince != nil {
  7550. locationName := "X-Amz-Rename-Source-If-Unmodified-Since"
  7551. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.SourceIfUnmodifiedSince))
  7552. }
  7553. return nil
  7554. }
  7555. type awsRestxml_serializeOpRestoreObject struct {
  7556. }
  7557. func (*awsRestxml_serializeOpRestoreObject) ID() string {
  7558. return "OperationSerializer"
  7559. }
  7560. func (m *awsRestxml_serializeOpRestoreObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  7561. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  7562. ) {
  7563. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  7564. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  7565. defer endTimer()
  7566. defer span.End()
  7567. request, ok := in.Request.(*smithyhttp.Request)
  7568. if !ok {
  7569. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  7570. }
  7571. input, ok := in.Parameters.(*RestoreObjectInput)
  7572. _ = input
  7573. if !ok {
  7574. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  7575. }
  7576. opPath, opQuery := httpbinding.SplitURI("/{Key+}?restore")
  7577. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  7578. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  7579. request.Method = "POST"
  7580. var restEncoder *httpbinding.Encoder
  7581. if request.URL.RawPath == "" {
  7582. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  7583. } else {
  7584. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  7585. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  7586. }
  7587. if err != nil {
  7588. return out, metadata, &smithy.SerializationError{Err: err}
  7589. }
  7590. if err := awsRestxml_serializeOpHttpBindingsRestoreObjectInput(input, restEncoder); err != nil {
  7591. return out, metadata, &smithy.SerializationError{Err: err}
  7592. }
  7593. if input.RestoreRequest != nil {
  7594. if !restEncoder.HasHeader("Content-Type") {
  7595. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  7596. restEncoder.SetHeader("Content-Type").String("application/xml")
  7597. }
  7598. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  7599. payloadRootAttr := []smithyxml.Attr{}
  7600. payloadRoot := smithyxml.StartElement{
  7601. Name: smithyxml.Name{
  7602. Local: "RestoreRequest",
  7603. },
  7604. Attr: payloadRootAttr,
  7605. }
  7606. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  7607. if err := awsRestxml_serializeDocumentRestoreRequest(input.RestoreRequest, xmlEncoder.RootElement(payloadRoot)); err != nil {
  7608. return out, metadata, &smithy.SerializationError{Err: err}
  7609. }
  7610. payload := bytes.NewReader(xmlEncoder.Bytes())
  7611. if request, err = request.SetStream(payload); err != nil {
  7612. return out, metadata, &smithy.SerializationError{Err: err}
  7613. }
  7614. }
  7615. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7616. return out, metadata, &smithy.SerializationError{Err: err}
  7617. }
  7618. in.Request = request
  7619. endTimer()
  7620. span.End()
  7621. return next.HandleSerialize(ctx, in)
  7622. }
  7623. func awsRestxml_serializeOpHttpBindingsRestoreObjectInput(v *RestoreObjectInput, encoder *httpbinding.Encoder) error {
  7624. if v == nil {
  7625. return fmt.Errorf("unsupported serialization of nil %T", v)
  7626. }
  7627. if len(v.ChecksumAlgorithm) > 0 {
  7628. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  7629. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  7630. }
  7631. if v.ExpectedBucketOwner != nil {
  7632. locationName := "X-Amz-Expected-Bucket-Owner"
  7633. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  7634. }
  7635. if v.Key == nil || len(*v.Key) == 0 {
  7636. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  7637. }
  7638. if v.Key != nil {
  7639. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  7640. return err
  7641. }
  7642. }
  7643. if len(v.RequestPayer) > 0 {
  7644. locationName := "X-Amz-Request-Payer"
  7645. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  7646. }
  7647. if v.VersionId != nil {
  7648. encoder.SetQuery("versionId").String(*v.VersionId)
  7649. }
  7650. return nil
  7651. }
  7652. type awsRestxml_serializeOpSelectObjectContent struct {
  7653. }
  7654. func (*awsRestxml_serializeOpSelectObjectContent) ID() string {
  7655. return "OperationSerializer"
  7656. }
  7657. func (m *awsRestxml_serializeOpSelectObjectContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  7658. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  7659. ) {
  7660. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  7661. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  7662. defer endTimer()
  7663. defer span.End()
  7664. request, ok := in.Request.(*smithyhttp.Request)
  7665. if !ok {
  7666. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  7667. }
  7668. input, ok := in.Parameters.(*SelectObjectContentInput)
  7669. _ = input
  7670. if !ok {
  7671. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  7672. }
  7673. opPath, opQuery := httpbinding.SplitURI("/{Key+}?select&select-type=2")
  7674. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  7675. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  7676. request.Method = "POST"
  7677. var restEncoder *httpbinding.Encoder
  7678. if request.URL.RawPath == "" {
  7679. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  7680. } else {
  7681. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  7682. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  7683. }
  7684. if err != nil {
  7685. return out, metadata, &smithy.SerializationError{Err: err}
  7686. }
  7687. if err := awsRestxml_serializeOpHttpBindingsSelectObjectContentInput(input, restEncoder); err != nil {
  7688. return out, metadata, &smithy.SerializationError{Err: err}
  7689. }
  7690. restEncoder.SetHeader("Content-Type").String("application/xml")
  7691. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  7692. rootAttr := []smithyxml.Attr{}
  7693. root := smithyxml.StartElement{
  7694. Name: smithyxml.Name{
  7695. Local: "SelectObjectContentRequest",
  7696. },
  7697. Attr: rootAttr,
  7698. }
  7699. root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  7700. if err := awsRestxml_serializeOpDocumentSelectObjectContentInput(input, xmlEncoder.RootElement(root)); err != nil {
  7701. return out, metadata, &smithy.SerializationError{Err: err}
  7702. }
  7703. if request, err = request.SetStream(bytes.NewReader(xmlEncoder.Bytes())); err != nil {
  7704. return out, metadata, &smithy.SerializationError{Err: err}
  7705. }
  7706. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7707. return out, metadata, &smithy.SerializationError{Err: err}
  7708. }
  7709. in.Request = request
  7710. endTimer()
  7711. span.End()
  7712. return next.HandleSerialize(ctx, in)
  7713. }
  7714. func awsRestxml_serializeOpHttpBindingsSelectObjectContentInput(v *SelectObjectContentInput, encoder *httpbinding.Encoder) error {
  7715. if v == nil {
  7716. return fmt.Errorf("unsupported serialization of nil %T", v)
  7717. }
  7718. if v.ExpectedBucketOwner != nil {
  7719. locationName := "X-Amz-Expected-Bucket-Owner"
  7720. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  7721. }
  7722. if v.Key == nil || len(*v.Key) == 0 {
  7723. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  7724. }
  7725. if v.Key != nil {
  7726. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  7727. return err
  7728. }
  7729. }
  7730. if v.SSECustomerAlgorithm != nil {
  7731. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  7732. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  7733. }
  7734. if v.SSECustomerKey != nil {
  7735. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  7736. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  7737. }
  7738. if v.SSECustomerKeyMD5 != nil {
  7739. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  7740. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  7741. }
  7742. return nil
  7743. }
  7744. func awsRestxml_serializeOpDocumentSelectObjectContentInput(v *SelectObjectContentInput, value smithyxml.Value) error {
  7745. defer value.Close()
  7746. if v.Expression != nil {
  7747. rootAttr := []smithyxml.Attr{}
  7748. root := smithyxml.StartElement{
  7749. Name: smithyxml.Name{
  7750. Local: "Expression",
  7751. },
  7752. Attr: rootAttr,
  7753. }
  7754. el := value.MemberElement(root)
  7755. el.String(*v.Expression)
  7756. }
  7757. if len(v.ExpressionType) > 0 {
  7758. rootAttr := []smithyxml.Attr{}
  7759. root := smithyxml.StartElement{
  7760. Name: smithyxml.Name{
  7761. Local: "ExpressionType",
  7762. },
  7763. Attr: rootAttr,
  7764. }
  7765. el := value.MemberElement(root)
  7766. el.String(string(v.ExpressionType))
  7767. }
  7768. if v.InputSerialization != nil {
  7769. rootAttr := []smithyxml.Attr{}
  7770. root := smithyxml.StartElement{
  7771. Name: smithyxml.Name{
  7772. Local: "InputSerialization",
  7773. },
  7774. Attr: rootAttr,
  7775. }
  7776. el := value.MemberElement(root)
  7777. if err := awsRestxml_serializeDocumentInputSerialization(v.InputSerialization, el); err != nil {
  7778. return err
  7779. }
  7780. }
  7781. if v.OutputSerialization != nil {
  7782. rootAttr := []smithyxml.Attr{}
  7783. root := smithyxml.StartElement{
  7784. Name: smithyxml.Name{
  7785. Local: "OutputSerialization",
  7786. },
  7787. Attr: rootAttr,
  7788. }
  7789. el := value.MemberElement(root)
  7790. if err := awsRestxml_serializeDocumentOutputSerialization(v.OutputSerialization, el); err != nil {
  7791. return err
  7792. }
  7793. }
  7794. if v.RequestProgress != nil {
  7795. rootAttr := []smithyxml.Attr{}
  7796. root := smithyxml.StartElement{
  7797. Name: smithyxml.Name{
  7798. Local: "RequestProgress",
  7799. },
  7800. Attr: rootAttr,
  7801. }
  7802. el := value.MemberElement(root)
  7803. if err := awsRestxml_serializeDocumentRequestProgress(v.RequestProgress, el); err != nil {
  7804. return err
  7805. }
  7806. }
  7807. if v.ScanRange != nil {
  7808. rootAttr := []smithyxml.Attr{}
  7809. root := smithyxml.StartElement{
  7810. Name: smithyxml.Name{
  7811. Local: "ScanRange",
  7812. },
  7813. Attr: rootAttr,
  7814. }
  7815. el := value.MemberElement(root)
  7816. if err := awsRestxml_serializeDocumentScanRange(v.ScanRange, el); err != nil {
  7817. return err
  7818. }
  7819. }
  7820. return nil
  7821. }
  7822. type awsRestxml_serializeOpUpdateBucketMetadataInventoryTableConfiguration struct {
  7823. }
  7824. func (*awsRestxml_serializeOpUpdateBucketMetadataInventoryTableConfiguration) ID() string {
  7825. return "OperationSerializer"
  7826. }
  7827. func (m *awsRestxml_serializeOpUpdateBucketMetadataInventoryTableConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  7828. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  7829. ) {
  7830. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  7831. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  7832. defer endTimer()
  7833. defer span.End()
  7834. request, ok := in.Request.(*smithyhttp.Request)
  7835. if !ok {
  7836. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  7837. }
  7838. input, ok := in.Parameters.(*UpdateBucketMetadataInventoryTableConfigurationInput)
  7839. _ = input
  7840. if !ok {
  7841. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  7842. }
  7843. opPath, opQuery := httpbinding.SplitURI("/?metadataInventoryTable")
  7844. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  7845. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  7846. request.Method = "PUT"
  7847. var restEncoder *httpbinding.Encoder
  7848. if request.URL.RawPath == "" {
  7849. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  7850. } else {
  7851. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  7852. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  7853. }
  7854. if err != nil {
  7855. return out, metadata, &smithy.SerializationError{Err: err}
  7856. }
  7857. if err := awsRestxml_serializeOpHttpBindingsUpdateBucketMetadataInventoryTableConfigurationInput(input, restEncoder); err != nil {
  7858. return out, metadata, &smithy.SerializationError{Err: err}
  7859. }
  7860. if input.InventoryTableConfiguration != nil {
  7861. if !restEncoder.HasHeader("Content-Type") {
  7862. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  7863. restEncoder.SetHeader("Content-Type").String("application/xml")
  7864. }
  7865. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  7866. payloadRootAttr := []smithyxml.Attr{}
  7867. payloadRoot := smithyxml.StartElement{
  7868. Name: smithyxml.Name{
  7869. Local: "InventoryTableConfiguration",
  7870. },
  7871. Attr: payloadRootAttr,
  7872. }
  7873. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  7874. if err := awsRestxml_serializeDocumentInventoryTableConfigurationUpdates(input.InventoryTableConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  7875. return out, metadata, &smithy.SerializationError{Err: err}
  7876. }
  7877. payload := bytes.NewReader(xmlEncoder.Bytes())
  7878. if request, err = request.SetStream(payload); err != nil {
  7879. return out, metadata, &smithy.SerializationError{Err: err}
  7880. }
  7881. }
  7882. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7883. return out, metadata, &smithy.SerializationError{Err: err}
  7884. }
  7885. in.Request = request
  7886. endTimer()
  7887. span.End()
  7888. return next.HandleSerialize(ctx, in)
  7889. }
  7890. func awsRestxml_serializeOpHttpBindingsUpdateBucketMetadataInventoryTableConfigurationInput(v *UpdateBucketMetadataInventoryTableConfigurationInput, encoder *httpbinding.Encoder) error {
  7891. if v == nil {
  7892. return fmt.Errorf("unsupported serialization of nil %T", v)
  7893. }
  7894. if len(v.ChecksumAlgorithm) > 0 {
  7895. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  7896. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  7897. }
  7898. if v.ContentMD5 != nil {
  7899. locationName := "Content-Md5"
  7900. encoder.SetHeader(locationName).String(*v.ContentMD5)
  7901. }
  7902. if v.ExpectedBucketOwner != nil {
  7903. locationName := "X-Amz-Expected-Bucket-Owner"
  7904. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  7905. }
  7906. return nil
  7907. }
  7908. type awsRestxml_serializeOpUpdateBucketMetadataJournalTableConfiguration struct {
  7909. }
  7910. func (*awsRestxml_serializeOpUpdateBucketMetadataJournalTableConfiguration) ID() string {
  7911. return "OperationSerializer"
  7912. }
  7913. func (m *awsRestxml_serializeOpUpdateBucketMetadataJournalTableConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  7914. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  7915. ) {
  7916. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  7917. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  7918. defer endTimer()
  7919. defer span.End()
  7920. request, ok := in.Request.(*smithyhttp.Request)
  7921. if !ok {
  7922. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  7923. }
  7924. input, ok := in.Parameters.(*UpdateBucketMetadataJournalTableConfigurationInput)
  7925. _ = input
  7926. if !ok {
  7927. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  7928. }
  7929. opPath, opQuery := httpbinding.SplitURI("/?metadataJournalTable")
  7930. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  7931. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  7932. request.Method = "PUT"
  7933. var restEncoder *httpbinding.Encoder
  7934. if request.URL.RawPath == "" {
  7935. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  7936. } else {
  7937. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  7938. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  7939. }
  7940. if err != nil {
  7941. return out, metadata, &smithy.SerializationError{Err: err}
  7942. }
  7943. if err := awsRestxml_serializeOpHttpBindingsUpdateBucketMetadataJournalTableConfigurationInput(input, restEncoder); err != nil {
  7944. return out, metadata, &smithy.SerializationError{Err: err}
  7945. }
  7946. if input.JournalTableConfiguration != nil {
  7947. if !restEncoder.HasHeader("Content-Type") {
  7948. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  7949. restEncoder.SetHeader("Content-Type").String("application/xml")
  7950. }
  7951. xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil))
  7952. payloadRootAttr := []smithyxml.Attr{}
  7953. payloadRoot := smithyxml.StartElement{
  7954. Name: smithyxml.Name{
  7955. Local: "JournalTableConfiguration",
  7956. },
  7957. Attr: payloadRootAttr,
  7958. }
  7959. payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/"))
  7960. if err := awsRestxml_serializeDocumentJournalTableConfigurationUpdates(input.JournalTableConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil {
  7961. return out, metadata, &smithy.SerializationError{Err: err}
  7962. }
  7963. payload := bytes.NewReader(xmlEncoder.Bytes())
  7964. if request, err = request.SetStream(payload); err != nil {
  7965. return out, metadata, &smithy.SerializationError{Err: err}
  7966. }
  7967. }
  7968. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  7969. return out, metadata, &smithy.SerializationError{Err: err}
  7970. }
  7971. in.Request = request
  7972. endTimer()
  7973. span.End()
  7974. return next.HandleSerialize(ctx, in)
  7975. }
  7976. func awsRestxml_serializeOpHttpBindingsUpdateBucketMetadataJournalTableConfigurationInput(v *UpdateBucketMetadataJournalTableConfigurationInput, encoder *httpbinding.Encoder) error {
  7977. if v == nil {
  7978. return fmt.Errorf("unsupported serialization of nil %T", v)
  7979. }
  7980. if len(v.ChecksumAlgorithm) > 0 {
  7981. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  7982. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  7983. }
  7984. if v.ContentMD5 != nil {
  7985. locationName := "Content-Md5"
  7986. encoder.SetHeader(locationName).String(*v.ContentMD5)
  7987. }
  7988. if v.ExpectedBucketOwner != nil {
  7989. locationName := "X-Amz-Expected-Bucket-Owner"
  7990. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  7991. }
  7992. return nil
  7993. }
  7994. type awsRestxml_serializeOpUploadPart struct {
  7995. }
  7996. func (*awsRestxml_serializeOpUploadPart) ID() string {
  7997. return "OperationSerializer"
  7998. }
  7999. func (m *awsRestxml_serializeOpUploadPart) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  8000. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  8001. ) {
  8002. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  8003. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  8004. defer endTimer()
  8005. defer span.End()
  8006. request, ok := in.Request.(*smithyhttp.Request)
  8007. if !ok {
  8008. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  8009. }
  8010. input, ok := in.Parameters.(*UploadPartInput)
  8011. _ = input
  8012. if !ok {
  8013. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  8014. }
  8015. opPath, opQuery := httpbinding.SplitURI("/{Key+}?x-id=UploadPart")
  8016. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  8017. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  8018. request.Method = "PUT"
  8019. var restEncoder *httpbinding.Encoder
  8020. if request.URL.RawPath == "" {
  8021. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  8022. } else {
  8023. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  8024. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  8025. }
  8026. if err != nil {
  8027. return out, metadata, &smithy.SerializationError{Err: err}
  8028. }
  8029. if err := awsRestxml_serializeOpHttpBindingsUploadPartInput(input, restEncoder); err != nil {
  8030. return out, metadata, &smithy.SerializationError{Err: err}
  8031. }
  8032. if !restEncoder.HasHeader("Content-Type") {
  8033. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  8034. restEncoder.SetHeader("Content-Type").String("application/octet-stream")
  8035. }
  8036. if input.Body != nil {
  8037. payload := input.Body
  8038. if request, err = request.SetStream(payload); err != nil {
  8039. return out, metadata, &smithy.SerializationError{Err: err}
  8040. }
  8041. }
  8042. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  8043. return out, metadata, &smithy.SerializationError{Err: err}
  8044. }
  8045. in.Request = request
  8046. endTimer()
  8047. span.End()
  8048. return next.HandleSerialize(ctx, in)
  8049. }
  8050. func awsRestxml_serializeOpHttpBindingsUploadPartInput(v *UploadPartInput, encoder *httpbinding.Encoder) error {
  8051. if v == nil {
  8052. return fmt.Errorf("unsupported serialization of nil %T", v)
  8053. }
  8054. if len(v.ChecksumAlgorithm) > 0 {
  8055. locationName := "X-Amz-Sdk-Checksum-Algorithm"
  8056. encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm))
  8057. }
  8058. if v.ChecksumCRC32 != nil {
  8059. locationName := "X-Amz-Checksum-Crc32"
  8060. encoder.SetHeader(locationName).String(*v.ChecksumCRC32)
  8061. }
  8062. if v.ChecksumCRC32C != nil {
  8063. locationName := "X-Amz-Checksum-Crc32c"
  8064. encoder.SetHeader(locationName).String(*v.ChecksumCRC32C)
  8065. }
  8066. if v.ChecksumCRC64NVME != nil {
  8067. locationName := "X-Amz-Checksum-Crc64nvme"
  8068. encoder.SetHeader(locationName).String(*v.ChecksumCRC64NVME)
  8069. }
  8070. if v.ChecksumSHA1 != nil {
  8071. locationName := "X-Amz-Checksum-Sha1"
  8072. encoder.SetHeader(locationName).String(*v.ChecksumSHA1)
  8073. }
  8074. if v.ChecksumSHA256 != nil {
  8075. locationName := "X-Amz-Checksum-Sha256"
  8076. encoder.SetHeader(locationName).String(*v.ChecksumSHA256)
  8077. }
  8078. if v.ContentLength != nil {
  8079. locationName := "Content-Length"
  8080. encoder.SetHeader(locationName).Long(*v.ContentLength)
  8081. }
  8082. if v.ContentMD5 != nil {
  8083. locationName := "Content-Md5"
  8084. encoder.SetHeader(locationName).String(*v.ContentMD5)
  8085. }
  8086. if v.ExpectedBucketOwner != nil {
  8087. locationName := "X-Amz-Expected-Bucket-Owner"
  8088. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  8089. }
  8090. if v.Key == nil || len(*v.Key) == 0 {
  8091. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  8092. }
  8093. if v.Key != nil {
  8094. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  8095. return err
  8096. }
  8097. }
  8098. if v.PartNumber != nil {
  8099. encoder.SetQuery("partNumber").Integer(*v.PartNumber)
  8100. }
  8101. if len(v.RequestPayer) > 0 {
  8102. locationName := "X-Amz-Request-Payer"
  8103. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  8104. }
  8105. if v.SSECustomerAlgorithm != nil {
  8106. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  8107. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  8108. }
  8109. if v.SSECustomerKey != nil {
  8110. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  8111. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  8112. }
  8113. if v.SSECustomerKeyMD5 != nil {
  8114. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  8115. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  8116. }
  8117. if v.UploadId != nil {
  8118. encoder.SetQuery("uploadId").String(*v.UploadId)
  8119. }
  8120. return nil
  8121. }
  8122. type awsRestxml_serializeOpUploadPartCopy struct {
  8123. }
  8124. func (*awsRestxml_serializeOpUploadPartCopy) ID() string {
  8125. return "OperationSerializer"
  8126. }
  8127. func (m *awsRestxml_serializeOpUploadPartCopy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  8128. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  8129. ) {
  8130. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  8131. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  8132. defer endTimer()
  8133. defer span.End()
  8134. request, ok := in.Request.(*smithyhttp.Request)
  8135. if !ok {
  8136. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  8137. }
  8138. input, ok := in.Parameters.(*UploadPartCopyInput)
  8139. _ = input
  8140. if !ok {
  8141. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  8142. }
  8143. opPath, opQuery := httpbinding.SplitURI("/{Key+}?x-id=UploadPartCopy")
  8144. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  8145. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  8146. request.Method = "PUT"
  8147. var restEncoder *httpbinding.Encoder
  8148. if request.URL.RawPath == "" {
  8149. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  8150. } else {
  8151. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  8152. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  8153. }
  8154. if err != nil {
  8155. return out, metadata, &smithy.SerializationError{Err: err}
  8156. }
  8157. if err := awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(input, restEncoder); err != nil {
  8158. return out, metadata, &smithy.SerializationError{Err: err}
  8159. }
  8160. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  8161. return out, metadata, &smithy.SerializationError{Err: err}
  8162. }
  8163. in.Request = request
  8164. endTimer()
  8165. span.End()
  8166. return next.HandleSerialize(ctx, in)
  8167. }
  8168. func awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(v *UploadPartCopyInput, encoder *httpbinding.Encoder) error {
  8169. if v == nil {
  8170. return fmt.Errorf("unsupported serialization of nil %T", v)
  8171. }
  8172. if v.CopySource != nil {
  8173. locationName := "X-Amz-Copy-Source"
  8174. encoder.SetHeader(locationName).String(*v.CopySource)
  8175. }
  8176. if v.CopySourceIfMatch != nil {
  8177. locationName := "X-Amz-Copy-Source-If-Match"
  8178. encoder.SetHeader(locationName).String(*v.CopySourceIfMatch)
  8179. }
  8180. if v.CopySourceIfModifiedSince != nil {
  8181. locationName := "X-Amz-Copy-Source-If-Modified-Since"
  8182. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfModifiedSince))
  8183. }
  8184. if v.CopySourceIfNoneMatch != nil {
  8185. locationName := "X-Amz-Copy-Source-If-None-Match"
  8186. encoder.SetHeader(locationName).String(*v.CopySourceIfNoneMatch)
  8187. }
  8188. if v.CopySourceIfUnmodifiedSince != nil {
  8189. locationName := "X-Amz-Copy-Source-If-Unmodified-Since"
  8190. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfUnmodifiedSince))
  8191. }
  8192. if v.CopySourceRange != nil {
  8193. locationName := "X-Amz-Copy-Source-Range"
  8194. encoder.SetHeader(locationName).String(*v.CopySourceRange)
  8195. }
  8196. if v.CopySourceSSECustomerAlgorithm != nil {
  8197. locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm"
  8198. encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerAlgorithm)
  8199. }
  8200. if v.CopySourceSSECustomerKey != nil {
  8201. locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key"
  8202. encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKey)
  8203. }
  8204. if v.CopySourceSSECustomerKeyMD5 != nil {
  8205. locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5"
  8206. encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKeyMD5)
  8207. }
  8208. if v.ExpectedBucketOwner != nil {
  8209. locationName := "X-Amz-Expected-Bucket-Owner"
  8210. encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner)
  8211. }
  8212. if v.ExpectedSourceBucketOwner != nil {
  8213. locationName := "X-Amz-Source-Expected-Bucket-Owner"
  8214. encoder.SetHeader(locationName).String(*v.ExpectedSourceBucketOwner)
  8215. }
  8216. if v.Key == nil || len(*v.Key) == 0 {
  8217. return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")}
  8218. }
  8219. if v.Key != nil {
  8220. if err := encoder.SetURI("Key").String(*v.Key); err != nil {
  8221. return err
  8222. }
  8223. }
  8224. if v.PartNumber != nil {
  8225. encoder.SetQuery("partNumber").Integer(*v.PartNumber)
  8226. }
  8227. if len(v.RequestPayer) > 0 {
  8228. locationName := "X-Amz-Request-Payer"
  8229. encoder.SetHeader(locationName).String(string(v.RequestPayer))
  8230. }
  8231. if v.SSECustomerAlgorithm != nil {
  8232. locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm"
  8233. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  8234. }
  8235. if v.SSECustomerKey != nil {
  8236. locationName := "X-Amz-Server-Side-Encryption-Customer-Key"
  8237. encoder.SetHeader(locationName).String(*v.SSECustomerKey)
  8238. }
  8239. if v.SSECustomerKeyMD5 != nil {
  8240. locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  8241. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  8242. }
  8243. if v.UploadId != nil {
  8244. encoder.SetQuery("uploadId").String(*v.UploadId)
  8245. }
  8246. return nil
  8247. }
  8248. type awsRestxml_serializeOpWriteGetObjectResponse struct {
  8249. }
  8250. func (*awsRestxml_serializeOpWriteGetObjectResponse) ID() string {
  8251. return "OperationSerializer"
  8252. }
  8253. func (m *awsRestxml_serializeOpWriteGetObjectResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
  8254. out middleware.SerializeOutput, metadata middleware.Metadata, err error,
  8255. ) {
  8256. _, span := tracing.StartSpan(ctx, "OperationSerializer")
  8257. endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
  8258. defer endTimer()
  8259. defer span.End()
  8260. request, ok := in.Request.(*smithyhttp.Request)
  8261. if !ok {
  8262. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
  8263. }
  8264. input, ok := in.Parameters.(*WriteGetObjectResponseInput)
  8265. _ = input
  8266. if !ok {
  8267. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
  8268. }
  8269. opPath, opQuery := httpbinding.SplitURI("/WriteGetObjectResponse")
  8270. request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
  8271. request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
  8272. request.Method = "POST"
  8273. var restEncoder *httpbinding.Encoder
  8274. if request.URL.RawPath == "" {
  8275. restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
  8276. } else {
  8277. request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
  8278. restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
  8279. }
  8280. if err != nil {
  8281. return out, metadata, &smithy.SerializationError{Err: err}
  8282. }
  8283. if err := awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(input, restEncoder); err != nil {
  8284. return out, metadata, &smithy.SerializationError{Err: err}
  8285. }
  8286. if !restEncoder.HasHeader("Content-Type") {
  8287. ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
  8288. restEncoder.SetHeader("Content-Type").String("application/octet-stream")
  8289. }
  8290. if input.Body != nil {
  8291. payload := input.Body
  8292. if request, err = request.SetStream(payload); err != nil {
  8293. return out, metadata, &smithy.SerializationError{Err: err}
  8294. }
  8295. }
  8296. if request.Request, err = restEncoder.Encode(request.Request); err != nil {
  8297. return out, metadata, &smithy.SerializationError{Err: err}
  8298. }
  8299. in.Request = request
  8300. endTimer()
  8301. span.End()
  8302. return next.HandleSerialize(ctx, in)
  8303. }
  8304. func awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(v *WriteGetObjectResponseInput, encoder *httpbinding.Encoder) error {
  8305. if v == nil {
  8306. return fmt.Errorf("unsupported serialization of nil %T", v)
  8307. }
  8308. if v.AcceptRanges != nil {
  8309. locationName := "X-Amz-Fwd-Header-Accept-Ranges"
  8310. encoder.SetHeader(locationName).String(*v.AcceptRanges)
  8311. }
  8312. if v.BucketKeyEnabled != nil {
  8313. locationName := "X-Amz-Fwd-Header-X-Amz-Server-Side-Encryption-Bucket-Key-Enabled"
  8314. encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled)
  8315. }
  8316. if v.CacheControl != nil {
  8317. locationName := "X-Amz-Fwd-Header-Cache-Control"
  8318. encoder.SetHeader(locationName).String(*v.CacheControl)
  8319. }
  8320. if v.ChecksumCRC32 != nil {
  8321. locationName := "X-Amz-Fwd-Header-X-Amz-Checksum-Crc32"
  8322. encoder.SetHeader(locationName).String(*v.ChecksumCRC32)
  8323. }
  8324. if v.ChecksumCRC32C != nil {
  8325. locationName := "X-Amz-Fwd-Header-X-Amz-Checksum-Crc32c"
  8326. encoder.SetHeader(locationName).String(*v.ChecksumCRC32C)
  8327. }
  8328. if v.ChecksumCRC64NVME != nil {
  8329. locationName := "X-Amz-Fwd-Header-X-Amz-Checksum-Crc64nvme"
  8330. encoder.SetHeader(locationName).String(*v.ChecksumCRC64NVME)
  8331. }
  8332. if v.ChecksumSHA1 != nil {
  8333. locationName := "X-Amz-Fwd-Header-X-Amz-Checksum-Sha1"
  8334. encoder.SetHeader(locationName).String(*v.ChecksumSHA1)
  8335. }
  8336. if v.ChecksumSHA256 != nil {
  8337. locationName := "X-Amz-Fwd-Header-X-Amz-Checksum-Sha256"
  8338. encoder.SetHeader(locationName).String(*v.ChecksumSHA256)
  8339. }
  8340. if v.ContentDisposition != nil {
  8341. locationName := "X-Amz-Fwd-Header-Content-Disposition"
  8342. encoder.SetHeader(locationName).String(*v.ContentDisposition)
  8343. }
  8344. if v.ContentEncoding != nil {
  8345. locationName := "X-Amz-Fwd-Header-Content-Encoding"
  8346. encoder.SetHeader(locationName).String(*v.ContentEncoding)
  8347. }
  8348. if v.ContentLanguage != nil {
  8349. locationName := "X-Amz-Fwd-Header-Content-Language"
  8350. encoder.SetHeader(locationName).String(*v.ContentLanguage)
  8351. }
  8352. if v.ContentLength != nil {
  8353. locationName := "Content-Length"
  8354. encoder.SetHeader(locationName).Long(*v.ContentLength)
  8355. }
  8356. if v.ContentRange != nil {
  8357. locationName := "X-Amz-Fwd-Header-Content-Range"
  8358. encoder.SetHeader(locationName).String(*v.ContentRange)
  8359. }
  8360. if v.ContentType != nil {
  8361. locationName := "X-Amz-Fwd-Header-Content-Type"
  8362. encoder.SetHeader(locationName).String(*v.ContentType)
  8363. }
  8364. if v.DeleteMarker != nil {
  8365. locationName := "X-Amz-Fwd-Header-X-Amz-Delete-Marker"
  8366. encoder.SetHeader(locationName).Boolean(*v.DeleteMarker)
  8367. }
  8368. if v.ErrorCode != nil {
  8369. locationName := "X-Amz-Fwd-Error-Code"
  8370. encoder.SetHeader(locationName).String(*v.ErrorCode)
  8371. }
  8372. if v.ErrorMessage != nil {
  8373. locationName := "X-Amz-Fwd-Error-Message"
  8374. encoder.SetHeader(locationName).String(*v.ErrorMessage)
  8375. }
  8376. if v.ETag != nil {
  8377. locationName := "X-Amz-Fwd-Header-Etag"
  8378. encoder.SetHeader(locationName).String(*v.ETag)
  8379. }
  8380. if v.Expiration != nil {
  8381. locationName := "X-Amz-Fwd-Header-X-Amz-Expiration"
  8382. encoder.SetHeader(locationName).String(*v.Expiration)
  8383. }
  8384. if v.Expires != nil {
  8385. locationName := "X-Amz-Fwd-Header-Expires"
  8386. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires))
  8387. }
  8388. if v.LastModified != nil {
  8389. locationName := "X-Amz-Fwd-Header-Last-Modified"
  8390. encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.LastModified))
  8391. }
  8392. if v.Metadata != nil {
  8393. hv := encoder.Headers("X-Amz-Meta-")
  8394. for mapKey, mapVal := range v.Metadata {
  8395. hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal)
  8396. }
  8397. }
  8398. if v.MissingMeta != nil {
  8399. locationName := "X-Amz-Fwd-Header-X-Amz-Missing-Meta"
  8400. encoder.SetHeader(locationName).Integer(*v.MissingMeta)
  8401. }
  8402. if len(v.ObjectLockLegalHoldStatus) > 0 {
  8403. locationName := "X-Amz-Fwd-Header-X-Amz-Object-Lock-Legal-Hold"
  8404. encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus))
  8405. }
  8406. if len(v.ObjectLockMode) > 0 {
  8407. locationName := "X-Amz-Fwd-Header-X-Amz-Object-Lock-Mode"
  8408. encoder.SetHeader(locationName).String(string(v.ObjectLockMode))
  8409. }
  8410. if v.ObjectLockRetainUntilDate != nil {
  8411. locationName := "X-Amz-Fwd-Header-X-Amz-Object-Lock-Retain-Until-Date"
  8412. encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.ObjectLockRetainUntilDate))
  8413. }
  8414. if v.PartsCount != nil {
  8415. locationName := "X-Amz-Fwd-Header-X-Amz-Mp-Parts-Count"
  8416. encoder.SetHeader(locationName).Integer(*v.PartsCount)
  8417. }
  8418. if len(v.ReplicationStatus) > 0 {
  8419. locationName := "X-Amz-Fwd-Header-X-Amz-Replication-Status"
  8420. encoder.SetHeader(locationName).String(string(v.ReplicationStatus))
  8421. }
  8422. if len(v.RequestCharged) > 0 {
  8423. locationName := "X-Amz-Fwd-Header-X-Amz-Request-Charged"
  8424. encoder.SetHeader(locationName).String(string(v.RequestCharged))
  8425. }
  8426. if v.RequestRoute != nil {
  8427. locationName := "X-Amz-Request-Route"
  8428. encoder.SetHeader(locationName).String(*v.RequestRoute)
  8429. }
  8430. if v.RequestToken != nil {
  8431. locationName := "X-Amz-Request-Token"
  8432. encoder.SetHeader(locationName).String(*v.RequestToken)
  8433. }
  8434. if v.Restore != nil {
  8435. locationName := "X-Amz-Fwd-Header-X-Amz-Restore"
  8436. encoder.SetHeader(locationName).String(*v.Restore)
  8437. }
  8438. if len(v.ServerSideEncryption) > 0 {
  8439. locationName := "X-Amz-Fwd-Header-X-Amz-Server-Side-Encryption"
  8440. encoder.SetHeader(locationName).String(string(v.ServerSideEncryption))
  8441. }
  8442. if v.SSECustomerAlgorithm != nil {
  8443. locationName := "X-Amz-Fwd-Header-X-Amz-Server-Side-Encryption-Customer-Algorithm"
  8444. encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm)
  8445. }
  8446. if v.SSECustomerKeyMD5 != nil {
  8447. locationName := "X-Amz-Fwd-Header-X-Amz-Server-Side-Encryption-Customer-Key-Md5"
  8448. encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5)
  8449. }
  8450. if v.SSEKMSKeyId != nil {
  8451. locationName := "X-Amz-Fwd-Header-X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id"
  8452. encoder.SetHeader(locationName).String(*v.SSEKMSKeyId)
  8453. }
  8454. if v.StatusCode != nil {
  8455. locationName := "X-Amz-Fwd-Status"
  8456. encoder.SetHeader(locationName).Integer(*v.StatusCode)
  8457. }
  8458. if len(v.StorageClass) > 0 {
  8459. locationName := "X-Amz-Fwd-Header-X-Amz-Storage-Class"
  8460. encoder.SetHeader(locationName).String(string(v.StorageClass))
  8461. }
  8462. if v.TagCount != nil {
  8463. locationName := "X-Amz-Fwd-Header-X-Amz-Tagging-Count"
  8464. encoder.SetHeader(locationName).Integer(*v.TagCount)
  8465. }
  8466. if v.VersionId != nil {
  8467. locationName := "X-Amz-Fwd-Header-X-Amz-Version-Id"
  8468. encoder.SetHeader(locationName).String(*v.VersionId)
  8469. }
  8470. return nil
  8471. }
  8472. func awsRestxml_serializeDocumentAbortIncompleteMultipartUpload(v *types.AbortIncompleteMultipartUpload, value smithyxml.Value) error {
  8473. defer value.Close()
  8474. if v.DaysAfterInitiation != nil {
  8475. rootAttr := []smithyxml.Attr{}
  8476. root := smithyxml.StartElement{
  8477. Name: smithyxml.Name{
  8478. Local: "DaysAfterInitiation",
  8479. },
  8480. Attr: rootAttr,
  8481. }
  8482. el := value.MemberElement(root)
  8483. el.Integer(*v.DaysAfterInitiation)
  8484. }
  8485. return nil
  8486. }
  8487. func awsRestxml_serializeDocumentAccelerateConfiguration(v *types.AccelerateConfiguration, value smithyxml.Value) error {
  8488. defer value.Close()
  8489. if len(v.Status) > 0 {
  8490. rootAttr := []smithyxml.Attr{}
  8491. root := smithyxml.StartElement{
  8492. Name: smithyxml.Name{
  8493. Local: "Status",
  8494. },
  8495. Attr: rootAttr,
  8496. }
  8497. el := value.MemberElement(root)
  8498. el.String(string(v.Status))
  8499. }
  8500. return nil
  8501. }
  8502. func awsRestxml_serializeDocumentAccessControlPolicy(v *types.AccessControlPolicy, value smithyxml.Value) error {
  8503. defer value.Close()
  8504. if v.Grants != nil {
  8505. rootAttr := []smithyxml.Attr{}
  8506. root := smithyxml.StartElement{
  8507. Name: smithyxml.Name{
  8508. Local: "AccessControlList",
  8509. },
  8510. Attr: rootAttr,
  8511. }
  8512. el := value.MemberElement(root)
  8513. if err := awsRestxml_serializeDocumentGrants(v.Grants, el); err != nil {
  8514. return err
  8515. }
  8516. }
  8517. if v.Owner != nil {
  8518. rootAttr := []smithyxml.Attr{}
  8519. root := smithyxml.StartElement{
  8520. Name: smithyxml.Name{
  8521. Local: "Owner",
  8522. },
  8523. Attr: rootAttr,
  8524. }
  8525. el := value.MemberElement(root)
  8526. if err := awsRestxml_serializeDocumentOwner(v.Owner, el); err != nil {
  8527. return err
  8528. }
  8529. }
  8530. return nil
  8531. }
  8532. func awsRestxml_serializeDocumentAccessControlTranslation(v *types.AccessControlTranslation, value smithyxml.Value) error {
  8533. defer value.Close()
  8534. if len(v.Owner) > 0 {
  8535. rootAttr := []smithyxml.Attr{}
  8536. root := smithyxml.StartElement{
  8537. Name: smithyxml.Name{
  8538. Local: "Owner",
  8539. },
  8540. Attr: rootAttr,
  8541. }
  8542. el := value.MemberElement(root)
  8543. el.String(string(v.Owner))
  8544. }
  8545. return nil
  8546. }
  8547. func awsRestxml_serializeDocumentAllowedHeaders(v []string, value smithyxml.Value) error {
  8548. var array *smithyxml.Array
  8549. if !value.IsFlattened() {
  8550. defer value.Close()
  8551. }
  8552. array = value.Array()
  8553. for i := range v {
  8554. am := array.Member()
  8555. am.String(v[i])
  8556. }
  8557. return nil
  8558. }
  8559. func awsRestxml_serializeDocumentAllowedMethods(v []string, value smithyxml.Value) error {
  8560. var array *smithyxml.Array
  8561. if !value.IsFlattened() {
  8562. defer value.Close()
  8563. }
  8564. array = value.Array()
  8565. for i := range v {
  8566. am := array.Member()
  8567. am.String(v[i])
  8568. }
  8569. return nil
  8570. }
  8571. func awsRestxml_serializeDocumentAllowedOrigins(v []string, value smithyxml.Value) error {
  8572. var array *smithyxml.Array
  8573. if !value.IsFlattened() {
  8574. defer value.Close()
  8575. }
  8576. array = value.Array()
  8577. for i := range v {
  8578. am := array.Member()
  8579. am.String(v[i])
  8580. }
  8581. return nil
  8582. }
  8583. func awsRestxml_serializeDocumentAnalyticsAndOperator(v *types.AnalyticsAndOperator, value smithyxml.Value) error {
  8584. defer value.Close()
  8585. if v.Prefix != nil {
  8586. rootAttr := []smithyxml.Attr{}
  8587. root := smithyxml.StartElement{
  8588. Name: smithyxml.Name{
  8589. Local: "Prefix",
  8590. },
  8591. Attr: rootAttr,
  8592. }
  8593. el := value.MemberElement(root)
  8594. el.String(*v.Prefix)
  8595. }
  8596. if v.Tags != nil {
  8597. rootAttr := []smithyxml.Attr{}
  8598. root := smithyxml.StartElement{
  8599. Name: smithyxml.Name{
  8600. Local: "Tag",
  8601. },
  8602. Attr: rootAttr,
  8603. }
  8604. el := value.FlattenedElement(root)
  8605. if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil {
  8606. return err
  8607. }
  8608. }
  8609. return nil
  8610. }
  8611. func awsRestxml_serializeDocumentAnalyticsConfiguration(v *types.AnalyticsConfiguration, value smithyxml.Value) error {
  8612. defer value.Close()
  8613. if v.Filter != nil {
  8614. rootAttr := []smithyxml.Attr{}
  8615. root := smithyxml.StartElement{
  8616. Name: smithyxml.Name{
  8617. Local: "Filter",
  8618. },
  8619. Attr: rootAttr,
  8620. }
  8621. el := value.MemberElement(root)
  8622. if err := awsRestxml_serializeDocumentAnalyticsFilter(v.Filter, el); err != nil {
  8623. return err
  8624. }
  8625. }
  8626. if v.Id != nil {
  8627. rootAttr := []smithyxml.Attr{}
  8628. root := smithyxml.StartElement{
  8629. Name: smithyxml.Name{
  8630. Local: "Id",
  8631. },
  8632. Attr: rootAttr,
  8633. }
  8634. el := value.MemberElement(root)
  8635. el.String(*v.Id)
  8636. }
  8637. if v.StorageClassAnalysis != nil {
  8638. rootAttr := []smithyxml.Attr{}
  8639. root := smithyxml.StartElement{
  8640. Name: smithyxml.Name{
  8641. Local: "StorageClassAnalysis",
  8642. },
  8643. Attr: rootAttr,
  8644. }
  8645. el := value.MemberElement(root)
  8646. if err := awsRestxml_serializeDocumentStorageClassAnalysis(v.StorageClassAnalysis, el); err != nil {
  8647. return err
  8648. }
  8649. }
  8650. return nil
  8651. }
  8652. func awsRestxml_serializeDocumentAnalyticsExportDestination(v *types.AnalyticsExportDestination, value smithyxml.Value) error {
  8653. defer value.Close()
  8654. if v.S3BucketDestination != nil {
  8655. rootAttr := []smithyxml.Attr{}
  8656. root := smithyxml.StartElement{
  8657. Name: smithyxml.Name{
  8658. Local: "S3BucketDestination",
  8659. },
  8660. Attr: rootAttr,
  8661. }
  8662. el := value.MemberElement(root)
  8663. if err := awsRestxml_serializeDocumentAnalyticsS3BucketDestination(v.S3BucketDestination, el); err != nil {
  8664. return err
  8665. }
  8666. }
  8667. return nil
  8668. }
  8669. func awsRestxml_serializeDocumentAnalyticsFilter(v types.AnalyticsFilter, value smithyxml.Value) error {
  8670. defer value.Close()
  8671. switch uv := v.(type) {
  8672. case *types.AnalyticsFilterMemberAnd:
  8673. customMemberNameAttr := []smithyxml.Attr{}
  8674. customMemberName := smithyxml.StartElement{
  8675. Name: smithyxml.Name{
  8676. Local: "And",
  8677. },
  8678. Attr: customMemberNameAttr,
  8679. }
  8680. av := value.MemberElement(customMemberName)
  8681. if err := awsRestxml_serializeDocumentAnalyticsAndOperator(&uv.Value, av); err != nil {
  8682. return err
  8683. }
  8684. case *types.AnalyticsFilterMemberPrefix:
  8685. customMemberNameAttr := []smithyxml.Attr{}
  8686. customMemberName := smithyxml.StartElement{
  8687. Name: smithyxml.Name{
  8688. Local: "Prefix",
  8689. },
  8690. Attr: customMemberNameAttr,
  8691. }
  8692. av := value.MemberElement(customMemberName)
  8693. av.String(uv.Value)
  8694. case *types.AnalyticsFilterMemberTag:
  8695. customMemberNameAttr := []smithyxml.Attr{}
  8696. customMemberName := smithyxml.StartElement{
  8697. Name: smithyxml.Name{
  8698. Local: "Tag",
  8699. },
  8700. Attr: customMemberNameAttr,
  8701. }
  8702. av := value.MemberElement(customMemberName)
  8703. if err := awsRestxml_serializeDocumentTag(&uv.Value, av); err != nil {
  8704. return err
  8705. }
  8706. default:
  8707. return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
  8708. }
  8709. return nil
  8710. }
  8711. func awsRestxml_serializeDocumentAnalyticsS3BucketDestination(v *types.AnalyticsS3BucketDestination, value smithyxml.Value) error {
  8712. defer value.Close()
  8713. if v.Bucket != nil {
  8714. rootAttr := []smithyxml.Attr{}
  8715. root := smithyxml.StartElement{
  8716. Name: smithyxml.Name{
  8717. Local: "Bucket",
  8718. },
  8719. Attr: rootAttr,
  8720. }
  8721. el := value.MemberElement(root)
  8722. el.String(*v.Bucket)
  8723. }
  8724. if v.BucketAccountId != nil {
  8725. rootAttr := []smithyxml.Attr{}
  8726. root := smithyxml.StartElement{
  8727. Name: smithyxml.Name{
  8728. Local: "BucketAccountId",
  8729. },
  8730. Attr: rootAttr,
  8731. }
  8732. el := value.MemberElement(root)
  8733. el.String(*v.BucketAccountId)
  8734. }
  8735. if len(v.Format) > 0 {
  8736. rootAttr := []smithyxml.Attr{}
  8737. root := smithyxml.StartElement{
  8738. Name: smithyxml.Name{
  8739. Local: "Format",
  8740. },
  8741. Attr: rootAttr,
  8742. }
  8743. el := value.MemberElement(root)
  8744. el.String(string(v.Format))
  8745. }
  8746. if v.Prefix != nil {
  8747. rootAttr := []smithyxml.Attr{}
  8748. root := smithyxml.StartElement{
  8749. Name: smithyxml.Name{
  8750. Local: "Prefix",
  8751. },
  8752. Attr: rootAttr,
  8753. }
  8754. el := value.MemberElement(root)
  8755. el.String(*v.Prefix)
  8756. }
  8757. return nil
  8758. }
  8759. func awsRestxml_serializeDocumentBucketInfo(v *types.BucketInfo, value smithyxml.Value) error {
  8760. defer value.Close()
  8761. if len(v.DataRedundancy) > 0 {
  8762. rootAttr := []smithyxml.Attr{}
  8763. root := smithyxml.StartElement{
  8764. Name: smithyxml.Name{
  8765. Local: "DataRedundancy",
  8766. },
  8767. Attr: rootAttr,
  8768. }
  8769. el := value.MemberElement(root)
  8770. el.String(string(v.DataRedundancy))
  8771. }
  8772. if len(v.Type) > 0 {
  8773. rootAttr := []smithyxml.Attr{}
  8774. root := smithyxml.StartElement{
  8775. Name: smithyxml.Name{
  8776. Local: "Type",
  8777. },
  8778. Attr: rootAttr,
  8779. }
  8780. el := value.MemberElement(root)
  8781. el.String(string(v.Type))
  8782. }
  8783. return nil
  8784. }
  8785. func awsRestxml_serializeDocumentBucketLifecycleConfiguration(v *types.BucketLifecycleConfiguration, value smithyxml.Value) error {
  8786. defer value.Close()
  8787. if v.Rules != nil {
  8788. rootAttr := []smithyxml.Attr{}
  8789. root := smithyxml.StartElement{
  8790. Name: smithyxml.Name{
  8791. Local: "Rule",
  8792. },
  8793. Attr: rootAttr,
  8794. }
  8795. el := value.FlattenedElement(root)
  8796. if err := awsRestxml_serializeDocumentLifecycleRules(v.Rules, el); err != nil {
  8797. return err
  8798. }
  8799. }
  8800. return nil
  8801. }
  8802. func awsRestxml_serializeDocumentBucketLoggingStatus(v *types.BucketLoggingStatus, value smithyxml.Value) error {
  8803. defer value.Close()
  8804. if v.LoggingEnabled != nil {
  8805. rootAttr := []smithyxml.Attr{}
  8806. root := smithyxml.StartElement{
  8807. Name: smithyxml.Name{
  8808. Local: "LoggingEnabled",
  8809. },
  8810. Attr: rootAttr,
  8811. }
  8812. el := value.MemberElement(root)
  8813. if err := awsRestxml_serializeDocumentLoggingEnabled(v.LoggingEnabled, el); err != nil {
  8814. return err
  8815. }
  8816. }
  8817. return nil
  8818. }
  8819. func awsRestxml_serializeDocumentCompletedMultipartUpload(v *types.CompletedMultipartUpload, value smithyxml.Value) error {
  8820. defer value.Close()
  8821. if v.Parts != nil {
  8822. rootAttr := []smithyxml.Attr{}
  8823. root := smithyxml.StartElement{
  8824. Name: smithyxml.Name{
  8825. Local: "Part",
  8826. },
  8827. Attr: rootAttr,
  8828. }
  8829. el := value.FlattenedElement(root)
  8830. if err := awsRestxml_serializeDocumentCompletedPartList(v.Parts, el); err != nil {
  8831. return err
  8832. }
  8833. }
  8834. return nil
  8835. }
  8836. func awsRestxml_serializeDocumentCompletedPart(v *types.CompletedPart, value smithyxml.Value) error {
  8837. defer value.Close()
  8838. if v.ChecksumCRC32 != nil {
  8839. rootAttr := []smithyxml.Attr{}
  8840. root := smithyxml.StartElement{
  8841. Name: smithyxml.Name{
  8842. Local: "ChecksumCRC32",
  8843. },
  8844. Attr: rootAttr,
  8845. }
  8846. el := value.MemberElement(root)
  8847. el.String(*v.ChecksumCRC32)
  8848. }
  8849. if v.ChecksumCRC32C != nil {
  8850. rootAttr := []smithyxml.Attr{}
  8851. root := smithyxml.StartElement{
  8852. Name: smithyxml.Name{
  8853. Local: "ChecksumCRC32C",
  8854. },
  8855. Attr: rootAttr,
  8856. }
  8857. el := value.MemberElement(root)
  8858. el.String(*v.ChecksumCRC32C)
  8859. }
  8860. if v.ChecksumCRC64NVME != nil {
  8861. rootAttr := []smithyxml.Attr{}
  8862. root := smithyxml.StartElement{
  8863. Name: smithyxml.Name{
  8864. Local: "ChecksumCRC64NVME",
  8865. },
  8866. Attr: rootAttr,
  8867. }
  8868. el := value.MemberElement(root)
  8869. el.String(*v.ChecksumCRC64NVME)
  8870. }
  8871. if v.ChecksumSHA1 != nil {
  8872. rootAttr := []smithyxml.Attr{}
  8873. root := smithyxml.StartElement{
  8874. Name: smithyxml.Name{
  8875. Local: "ChecksumSHA1",
  8876. },
  8877. Attr: rootAttr,
  8878. }
  8879. el := value.MemberElement(root)
  8880. el.String(*v.ChecksumSHA1)
  8881. }
  8882. if v.ChecksumSHA256 != nil {
  8883. rootAttr := []smithyxml.Attr{}
  8884. root := smithyxml.StartElement{
  8885. Name: smithyxml.Name{
  8886. Local: "ChecksumSHA256",
  8887. },
  8888. Attr: rootAttr,
  8889. }
  8890. el := value.MemberElement(root)
  8891. el.String(*v.ChecksumSHA256)
  8892. }
  8893. if v.ETag != nil {
  8894. rootAttr := []smithyxml.Attr{}
  8895. root := smithyxml.StartElement{
  8896. Name: smithyxml.Name{
  8897. Local: "ETag",
  8898. },
  8899. Attr: rootAttr,
  8900. }
  8901. el := value.MemberElement(root)
  8902. el.String(*v.ETag)
  8903. }
  8904. if v.PartNumber != nil {
  8905. rootAttr := []smithyxml.Attr{}
  8906. root := smithyxml.StartElement{
  8907. Name: smithyxml.Name{
  8908. Local: "PartNumber",
  8909. },
  8910. Attr: rootAttr,
  8911. }
  8912. el := value.MemberElement(root)
  8913. el.Integer(*v.PartNumber)
  8914. }
  8915. return nil
  8916. }
  8917. func awsRestxml_serializeDocumentCompletedPartList(v []types.CompletedPart, value smithyxml.Value) error {
  8918. var array *smithyxml.Array
  8919. if !value.IsFlattened() {
  8920. defer value.Close()
  8921. }
  8922. array = value.Array()
  8923. for i := range v {
  8924. am := array.Member()
  8925. if err := awsRestxml_serializeDocumentCompletedPart(&v[i], am); err != nil {
  8926. return err
  8927. }
  8928. }
  8929. return nil
  8930. }
  8931. func awsRestxml_serializeDocumentCondition(v *types.Condition, value smithyxml.Value) error {
  8932. defer value.Close()
  8933. if v.HttpErrorCodeReturnedEquals != nil {
  8934. rootAttr := []smithyxml.Attr{}
  8935. root := smithyxml.StartElement{
  8936. Name: smithyxml.Name{
  8937. Local: "HttpErrorCodeReturnedEquals",
  8938. },
  8939. Attr: rootAttr,
  8940. }
  8941. el := value.MemberElement(root)
  8942. el.String(*v.HttpErrorCodeReturnedEquals)
  8943. }
  8944. if v.KeyPrefixEquals != nil {
  8945. rootAttr := []smithyxml.Attr{}
  8946. root := smithyxml.StartElement{
  8947. Name: smithyxml.Name{
  8948. Local: "KeyPrefixEquals",
  8949. },
  8950. Attr: rootAttr,
  8951. }
  8952. el := value.MemberElement(root)
  8953. el.String(*v.KeyPrefixEquals)
  8954. }
  8955. return nil
  8956. }
  8957. func awsRestxml_serializeDocumentCORSConfiguration(v *types.CORSConfiguration, value smithyxml.Value) error {
  8958. defer value.Close()
  8959. if v.CORSRules != nil {
  8960. rootAttr := []smithyxml.Attr{}
  8961. root := smithyxml.StartElement{
  8962. Name: smithyxml.Name{
  8963. Local: "CORSRule",
  8964. },
  8965. Attr: rootAttr,
  8966. }
  8967. el := value.FlattenedElement(root)
  8968. if err := awsRestxml_serializeDocumentCORSRules(v.CORSRules, el); err != nil {
  8969. return err
  8970. }
  8971. }
  8972. return nil
  8973. }
  8974. func awsRestxml_serializeDocumentCORSRule(v *types.CORSRule, value smithyxml.Value) error {
  8975. defer value.Close()
  8976. if v.AllowedHeaders != nil {
  8977. rootAttr := []smithyxml.Attr{}
  8978. root := smithyxml.StartElement{
  8979. Name: smithyxml.Name{
  8980. Local: "AllowedHeader",
  8981. },
  8982. Attr: rootAttr,
  8983. }
  8984. el := value.FlattenedElement(root)
  8985. if err := awsRestxml_serializeDocumentAllowedHeaders(v.AllowedHeaders, el); err != nil {
  8986. return err
  8987. }
  8988. }
  8989. if v.AllowedMethods != nil {
  8990. rootAttr := []smithyxml.Attr{}
  8991. root := smithyxml.StartElement{
  8992. Name: smithyxml.Name{
  8993. Local: "AllowedMethod",
  8994. },
  8995. Attr: rootAttr,
  8996. }
  8997. el := value.FlattenedElement(root)
  8998. if err := awsRestxml_serializeDocumentAllowedMethods(v.AllowedMethods, el); err != nil {
  8999. return err
  9000. }
  9001. }
  9002. if v.AllowedOrigins != nil {
  9003. rootAttr := []smithyxml.Attr{}
  9004. root := smithyxml.StartElement{
  9005. Name: smithyxml.Name{
  9006. Local: "AllowedOrigin",
  9007. },
  9008. Attr: rootAttr,
  9009. }
  9010. el := value.FlattenedElement(root)
  9011. if err := awsRestxml_serializeDocumentAllowedOrigins(v.AllowedOrigins, el); err != nil {
  9012. return err
  9013. }
  9014. }
  9015. if v.ExposeHeaders != nil {
  9016. rootAttr := []smithyxml.Attr{}
  9017. root := smithyxml.StartElement{
  9018. Name: smithyxml.Name{
  9019. Local: "ExposeHeader",
  9020. },
  9021. Attr: rootAttr,
  9022. }
  9023. el := value.FlattenedElement(root)
  9024. if err := awsRestxml_serializeDocumentExposeHeaders(v.ExposeHeaders, el); err != nil {
  9025. return err
  9026. }
  9027. }
  9028. if v.ID != nil {
  9029. rootAttr := []smithyxml.Attr{}
  9030. root := smithyxml.StartElement{
  9031. Name: smithyxml.Name{
  9032. Local: "ID",
  9033. },
  9034. Attr: rootAttr,
  9035. }
  9036. el := value.MemberElement(root)
  9037. el.String(*v.ID)
  9038. }
  9039. if v.MaxAgeSeconds != nil {
  9040. rootAttr := []smithyxml.Attr{}
  9041. root := smithyxml.StartElement{
  9042. Name: smithyxml.Name{
  9043. Local: "MaxAgeSeconds",
  9044. },
  9045. Attr: rootAttr,
  9046. }
  9047. el := value.MemberElement(root)
  9048. el.Integer(*v.MaxAgeSeconds)
  9049. }
  9050. return nil
  9051. }
  9052. func awsRestxml_serializeDocumentCORSRules(v []types.CORSRule, value smithyxml.Value) error {
  9053. var array *smithyxml.Array
  9054. if !value.IsFlattened() {
  9055. defer value.Close()
  9056. }
  9057. array = value.Array()
  9058. for i := range v {
  9059. am := array.Member()
  9060. if err := awsRestxml_serializeDocumentCORSRule(&v[i], am); err != nil {
  9061. return err
  9062. }
  9063. }
  9064. return nil
  9065. }
  9066. func awsRestxml_serializeDocumentCreateBucketConfiguration(v *types.CreateBucketConfiguration, value smithyxml.Value) error {
  9067. defer value.Close()
  9068. if v.Bucket != nil {
  9069. rootAttr := []smithyxml.Attr{}
  9070. root := smithyxml.StartElement{
  9071. Name: smithyxml.Name{
  9072. Local: "Bucket",
  9073. },
  9074. Attr: rootAttr,
  9075. }
  9076. el := value.MemberElement(root)
  9077. if err := awsRestxml_serializeDocumentBucketInfo(v.Bucket, el); err != nil {
  9078. return err
  9079. }
  9080. }
  9081. if v.Location != nil {
  9082. rootAttr := []smithyxml.Attr{}
  9083. root := smithyxml.StartElement{
  9084. Name: smithyxml.Name{
  9085. Local: "Location",
  9086. },
  9087. Attr: rootAttr,
  9088. }
  9089. el := value.MemberElement(root)
  9090. if err := awsRestxml_serializeDocumentLocationInfo(v.Location, el); err != nil {
  9091. return err
  9092. }
  9093. }
  9094. if len(v.LocationConstraint) > 0 {
  9095. rootAttr := []smithyxml.Attr{}
  9096. root := smithyxml.StartElement{
  9097. Name: smithyxml.Name{
  9098. Local: "LocationConstraint",
  9099. },
  9100. Attr: rootAttr,
  9101. }
  9102. el := value.MemberElement(root)
  9103. el.String(string(v.LocationConstraint))
  9104. }
  9105. if v.Tags != nil {
  9106. rootAttr := []smithyxml.Attr{}
  9107. root := smithyxml.StartElement{
  9108. Name: smithyxml.Name{
  9109. Local: "Tags",
  9110. },
  9111. Attr: rootAttr,
  9112. }
  9113. el := value.MemberElement(root)
  9114. if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil {
  9115. return err
  9116. }
  9117. }
  9118. return nil
  9119. }
  9120. func awsRestxml_serializeDocumentCSVInput(v *types.CSVInput, value smithyxml.Value) error {
  9121. defer value.Close()
  9122. if v.AllowQuotedRecordDelimiter != nil {
  9123. rootAttr := []smithyxml.Attr{}
  9124. root := smithyxml.StartElement{
  9125. Name: smithyxml.Name{
  9126. Local: "AllowQuotedRecordDelimiter",
  9127. },
  9128. Attr: rootAttr,
  9129. }
  9130. el := value.MemberElement(root)
  9131. el.Boolean(*v.AllowQuotedRecordDelimiter)
  9132. }
  9133. if v.Comments != nil {
  9134. rootAttr := []smithyxml.Attr{}
  9135. root := smithyxml.StartElement{
  9136. Name: smithyxml.Name{
  9137. Local: "Comments",
  9138. },
  9139. Attr: rootAttr,
  9140. }
  9141. el := value.MemberElement(root)
  9142. el.String(*v.Comments)
  9143. }
  9144. if v.FieldDelimiter != nil {
  9145. rootAttr := []smithyxml.Attr{}
  9146. root := smithyxml.StartElement{
  9147. Name: smithyxml.Name{
  9148. Local: "FieldDelimiter",
  9149. },
  9150. Attr: rootAttr,
  9151. }
  9152. el := value.MemberElement(root)
  9153. el.String(*v.FieldDelimiter)
  9154. }
  9155. if len(v.FileHeaderInfo) > 0 {
  9156. rootAttr := []smithyxml.Attr{}
  9157. root := smithyxml.StartElement{
  9158. Name: smithyxml.Name{
  9159. Local: "FileHeaderInfo",
  9160. },
  9161. Attr: rootAttr,
  9162. }
  9163. el := value.MemberElement(root)
  9164. el.String(string(v.FileHeaderInfo))
  9165. }
  9166. if v.QuoteCharacter != nil {
  9167. rootAttr := []smithyxml.Attr{}
  9168. root := smithyxml.StartElement{
  9169. Name: smithyxml.Name{
  9170. Local: "QuoteCharacter",
  9171. },
  9172. Attr: rootAttr,
  9173. }
  9174. el := value.MemberElement(root)
  9175. el.String(*v.QuoteCharacter)
  9176. }
  9177. if v.QuoteEscapeCharacter != nil {
  9178. rootAttr := []smithyxml.Attr{}
  9179. root := smithyxml.StartElement{
  9180. Name: smithyxml.Name{
  9181. Local: "QuoteEscapeCharacter",
  9182. },
  9183. Attr: rootAttr,
  9184. }
  9185. el := value.MemberElement(root)
  9186. el.String(*v.QuoteEscapeCharacter)
  9187. }
  9188. if v.RecordDelimiter != nil {
  9189. rootAttr := []smithyxml.Attr{}
  9190. root := smithyxml.StartElement{
  9191. Name: smithyxml.Name{
  9192. Local: "RecordDelimiter",
  9193. },
  9194. Attr: rootAttr,
  9195. }
  9196. el := value.MemberElement(root)
  9197. el.String(*v.RecordDelimiter)
  9198. }
  9199. return nil
  9200. }
  9201. func awsRestxml_serializeDocumentCSVOutput(v *types.CSVOutput, value smithyxml.Value) error {
  9202. defer value.Close()
  9203. if v.FieldDelimiter != nil {
  9204. rootAttr := []smithyxml.Attr{}
  9205. root := smithyxml.StartElement{
  9206. Name: smithyxml.Name{
  9207. Local: "FieldDelimiter",
  9208. },
  9209. Attr: rootAttr,
  9210. }
  9211. el := value.MemberElement(root)
  9212. el.String(*v.FieldDelimiter)
  9213. }
  9214. if v.QuoteCharacter != nil {
  9215. rootAttr := []smithyxml.Attr{}
  9216. root := smithyxml.StartElement{
  9217. Name: smithyxml.Name{
  9218. Local: "QuoteCharacter",
  9219. },
  9220. Attr: rootAttr,
  9221. }
  9222. el := value.MemberElement(root)
  9223. el.String(*v.QuoteCharacter)
  9224. }
  9225. if v.QuoteEscapeCharacter != nil {
  9226. rootAttr := []smithyxml.Attr{}
  9227. root := smithyxml.StartElement{
  9228. Name: smithyxml.Name{
  9229. Local: "QuoteEscapeCharacter",
  9230. },
  9231. Attr: rootAttr,
  9232. }
  9233. el := value.MemberElement(root)
  9234. el.String(*v.QuoteEscapeCharacter)
  9235. }
  9236. if len(v.QuoteFields) > 0 {
  9237. rootAttr := []smithyxml.Attr{}
  9238. root := smithyxml.StartElement{
  9239. Name: smithyxml.Name{
  9240. Local: "QuoteFields",
  9241. },
  9242. Attr: rootAttr,
  9243. }
  9244. el := value.MemberElement(root)
  9245. el.String(string(v.QuoteFields))
  9246. }
  9247. if v.RecordDelimiter != nil {
  9248. rootAttr := []smithyxml.Attr{}
  9249. root := smithyxml.StartElement{
  9250. Name: smithyxml.Name{
  9251. Local: "RecordDelimiter",
  9252. },
  9253. Attr: rootAttr,
  9254. }
  9255. el := value.MemberElement(root)
  9256. el.String(*v.RecordDelimiter)
  9257. }
  9258. return nil
  9259. }
  9260. func awsRestxml_serializeDocumentDefaultRetention(v *types.DefaultRetention, value smithyxml.Value) error {
  9261. defer value.Close()
  9262. if v.Days != nil {
  9263. rootAttr := []smithyxml.Attr{}
  9264. root := smithyxml.StartElement{
  9265. Name: smithyxml.Name{
  9266. Local: "Days",
  9267. },
  9268. Attr: rootAttr,
  9269. }
  9270. el := value.MemberElement(root)
  9271. el.Integer(*v.Days)
  9272. }
  9273. if len(v.Mode) > 0 {
  9274. rootAttr := []smithyxml.Attr{}
  9275. root := smithyxml.StartElement{
  9276. Name: smithyxml.Name{
  9277. Local: "Mode",
  9278. },
  9279. Attr: rootAttr,
  9280. }
  9281. el := value.MemberElement(root)
  9282. el.String(string(v.Mode))
  9283. }
  9284. if v.Years != nil {
  9285. rootAttr := []smithyxml.Attr{}
  9286. root := smithyxml.StartElement{
  9287. Name: smithyxml.Name{
  9288. Local: "Years",
  9289. },
  9290. Attr: rootAttr,
  9291. }
  9292. el := value.MemberElement(root)
  9293. el.Integer(*v.Years)
  9294. }
  9295. return nil
  9296. }
  9297. func awsRestxml_serializeDocumentDelete(v *types.Delete, value smithyxml.Value) error {
  9298. defer value.Close()
  9299. if v.Objects != nil {
  9300. rootAttr := []smithyxml.Attr{}
  9301. root := smithyxml.StartElement{
  9302. Name: smithyxml.Name{
  9303. Local: "Object",
  9304. },
  9305. Attr: rootAttr,
  9306. }
  9307. el := value.FlattenedElement(root)
  9308. if err := awsRestxml_serializeDocumentObjectIdentifierList(v.Objects, el); err != nil {
  9309. return err
  9310. }
  9311. }
  9312. if v.Quiet != nil {
  9313. rootAttr := []smithyxml.Attr{}
  9314. root := smithyxml.StartElement{
  9315. Name: smithyxml.Name{
  9316. Local: "Quiet",
  9317. },
  9318. Attr: rootAttr,
  9319. }
  9320. el := value.MemberElement(root)
  9321. el.Boolean(*v.Quiet)
  9322. }
  9323. return nil
  9324. }
  9325. func awsRestxml_serializeDocumentDeleteMarkerReplication(v *types.DeleteMarkerReplication, value smithyxml.Value) error {
  9326. defer value.Close()
  9327. if len(v.Status) > 0 {
  9328. rootAttr := []smithyxml.Attr{}
  9329. root := smithyxml.StartElement{
  9330. Name: smithyxml.Name{
  9331. Local: "Status",
  9332. },
  9333. Attr: rootAttr,
  9334. }
  9335. el := value.MemberElement(root)
  9336. el.String(string(v.Status))
  9337. }
  9338. return nil
  9339. }
  9340. func awsRestxml_serializeDocumentDestination(v *types.Destination, value smithyxml.Value) error {
  9341. defer value.Close()
  9342. if v.AccessControlTranslation != nil {
  9343. rootAttr := []smithyxml.Attr{}
  9344. root := smithyxml.StartElement{
  9345. Name: smithyxml.Name{
  9346. Local: "AccessControlTranslation",
  9347. },
  9348. Attr: rootAttr,
  9349. }
  9350. el := value.MemberElement(root)
  9351. if err := awsRestxml_serializeDocumentAccessControlTranslation(v.AccessControlTranslation, el); err != nil {
  9352. return err
  9353. }
  9354. }
  9355. if v.Account != nil {
  9356. rootAttr := []smithyxml.Attr{}
  9357. root := smithyxml.StartElement{
  9358. Name: smithyxml.Name{
  9359. Local: "Account",
  9360. },
  9361. Attr: rootAttr,
  9362. }
  9363. el := value.MemberElement(root)
  9364. el.String(*v.Account)
  9365. }
  9366. if v.Bucket != nil {
  9367. rootAttr := []smithyxml.Attr{}
  9368. root := smithyxml.StartElement{
  9369. Name: smithyxml.Name{
  9370. Local: "Bucket",
  9371. },
  9372. Attr: rootAttr,
  9373. }
  9374. el := value.MemberElement(root)
  9375. el.String(*v.Bucket)
  9376. }
  9377. if v.EncryptionConfiguration != nil {
  9378. rootAttr := []smithyxml.Attr{}
  9379. root := smithyxml.StartElement{
  9380. Name: smithyxml.Name{
  9381. Local: "EncryptionConfiguration",
  9382. },
  9383. Attr: rootAttr,
  9384. }
  9385. el := value.MemberElement(root)
  9386. if err := awsRestxml_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, el); err != nil {
  9387. return err
  9388. }
  9389. }
  9390. if v.Metrics != nil {
  9391. rootAttr := []smithyxml.Attr{}
  9392. root := smithyxml.StartElement{
  9393. Name: smithyxml.Name{
  9394. Local: "Metrics",
  9395. },
  9396. Attr: rootAttr,
  9397. }
  9398. el := value.MemberElement(root)
  9399. if err := awsRestxml_serializeDocumentMetrics(v.Metrics, el); err != nil {
  9400. return err
  9401. }
  9402. }
  9403. if v.ReplicationTime != nil {
  9404. rootAttr := []smithyxml.Attr{}
  9405. root := smithyxml.StartElement{
  9406. Name: smithyxml.Name{
  9407. Local: "ReplicationTime",
  9408. },
  9409. Attr: rootAttr,
  9410. }
  9411. el := value.MemberElement(root)
  9412. if err := awsRestxml_serializeDocumentReplicationTime(v.ReplicationTime, el); err != nil {
  9413. return err
  9414. }
  9415. }
  9416. if len(v.StorageClass) > 0 {
  9417. rootAttr := []smithyxml.Attr{}
  9418. root := smithyxml.StartElement{
  9419. Name: smithyxml.Name{
  9420. Local: "StorageClass",
  9421. },
  9422. Attr: rootAttr,
  9423. }
  9424. el := value.MemberElement(root)
  9425. el.String(string(v.StorageClass))
  9426. }
  9427. return nil
  9428. }
  9429. func awsRestxml_serializeDocumentEncryption(v *types.Encryption, value smithyxml.Value) error {
  9430. defer value.Close()
  9431. if len(v.EncryptionType) > 0 {
  9432. rootAttr := []smithyxml.Attr{}
  9433. root := smithyxml.StartElement{
  9434. Name: smithyxml.Name{
  9435. Local: "EncryptionType",
  9436. },
  9437. Attr: rootAttr,
  9438. }
  9439. el := value.MemberElement(root)
  9440. el.String(string(v.EncryptionType))
  9441. }
  9442. if v.KMSContext != nil {
  9443. rootAttr := []smithyxml.Attr{}
  9444. root := smithyxml.StartElement{
  9445. Name: smithyxml.Name{
  9446. Local: "KMSContext",
  9447. },
  9448. Attr: rootAttr,
  9449. }
  9450. el := value.MemberElement(root)
  9451. el.String(*v.KMSContext)
  9452. }
  9453. if v.KMSKeyId != nil {
  9454. rootAttr := []smithyxml.Attr{}
  9455. root := smithyxml.StartElement{
  9456. Name: smithyxml.Name{
  9457. Local: "KMSKeyId",
  9458. },
  9459. Attr: rootAttr,
  9460. }
  9461. el := value.MemberElement(root)
  9462. el.String(*v.KMSKeyId)
  9463. }
  9464. return nil
  9465. }
  9466. func awsRestxml_serializeDocumentEncryptionConfiguration(v *types.EncryptionConfiguration, value smithyxml.Value) error {
  9467. defer value.Close()
  9468. if v.ReplicaKmsKeyID != nil {
  9469. rootAttr := []smithyxml.Attr{}
  9470. root := smithyxml.StartElement{
  9471. Name: smithyxml.Name{
  9472. Local: "ReplicaKmsKeyID",
  9473. },
  9474. Attr: rootAttr,
  9475. }
  9476. el := value.MemberElement(root)
  9477. el.String(*v.ReplicaKmsKeyID)
  9478. }
  9479. return nil
  9480. }
  9481. func awsRestxml_serializeDocumentErrorDocument(v *types.ErrorDocument, value smithyxml.Value) error {
  9482. defer value.Close()
  9483. if v.Key != nil {
  9484. rootAttr := []smithyxml.Attr{}
  9485. root := smithyxml.StartElement{
  9486. Name: smithyxml.Name{
  9487. Local: "Key",
  9488. },
  9489. Attr: rootAttr,
  9490. }
  9491. el := value.MemberElement(root)
  9492. el.String(*v.Key)
  9493. }
  9494. return nil
  9495. }
  9496. func awsRestxml_serializeDocumentEventBridgeConfiguration(v *types.EventBridgeConfiguration, value smithyxml.Value) error {
  9497. defer value.Close()
  9498. return nil
  9499. }
  9500. func awsRestxml_serializeDocumentEventList(v []types.Event, value smithyxml.Value) error {
  9501. var array *smithyxml.Array
  9502. if !value.IsFlattened() {
  9503. defer value.Close()
  9504. }
  9505. array = value.Array()
  9506. for i := range v {
  9507. am := array.Member()
  9508. am.String(string(v[i]))
  9509. }
  9510. return nil
  9511. }
  9512. func awsRestxml_serializeDocumentExistingObjectReplication(v *types.ExistingObjectReplication, value smithyxml.Value) error {
  9513. defer value.Close()
  9514. if len(v.Status) > 0 {
  9515. rootAttr := []smithyxml.Attr{}
  9516. root := smithyxml.StartElement{
  9517. Name: smithyxml.Name{
  9518. Local: "Status",
  9519. },
  9520. Attr: rootAttr,
  9521. }
  9522. el := value.MemberElement(root)
  9523. el.String(string(v.Status))
  9524. }
  9525. return nil
  9526. }
  9527. func awsRestxml_serializeDocumentExposeHeaders(v []string, value smithyxml.Value) error {
  9528. var array *smithyxml.Array
  9529. if !value.IsFlattened() {
  9530. defer value.Close()
  9531. }
  9532. array = value.Array()
  9533. for i := range v {
  9534. am := array.Member()
  9535. am.String(v[i])
  9536. }
  9537. return nil
  9538. }
  9539. func awsRestxml_serializeDocumentFilterRule(v *types.FilterRule, value smithyxml.Value) error {
  9540. defer value.Close()
  9541. if len(v.Name) > 0 {
  9542. rootAttr := []smithyxml.Attr{}
  9543. root := smithyxml.StartElement{
  9544. Name: smithyxml.Name{
  9545. Local: "Name",
  9546. },
  9547. Attr: rootAttr,
  9548. }
  9549. el := value.MemberElement(root)
  9550. el.String(string(v.Name))
  9551. }
  9552. if v.Value != nil {
  9553. rootAttr := []smithyxml.Attr{}
  9554. root := smithyxml.StartElement{
  9555. Name: smithyxml.Name{
  9556. Local: "Value",
  9557. },
  9558. Attr: rootAttr,
  9559. }
  9560. el := value.MemberElement(root)
  9561. el.String(*v.Value)
  9562. }
  9563. return nil
  9564. }
  9565. func awsRestxml_serializeDocumentFilterRuleList(v []types.FilterRule, value smithyxml.Value) error {
  9566. var array *smithyxml.Array
  9567. if !value.IsFlattened() {
  9568. defer value.Close()
  9569. }
  9570. array = value.Array()
  9571. for i := range v {
  9572. am := array.Member()
  9573. if err := awsRestxml_serializeDocumentFilterRule(&v[i], am); err != nil {
  9574. return err
  9575. }
  9576. }
  9577. return nil
  9578. }
  9579. func awsRestxml_serializeDocumentGlacierJobParameters(v *types.GlacierJobParameters, value smithyxml.Value) error {
  9580. defer value.Close()
  9581. if len(v.Tier) > 0 {
  9582. rootAttr := []smithyxml.Attr{}
  9583. root := smithyxml.StartElement{
  9584. Name: smithyxml.Name{
  9585. Local: "Tier",
  9586. },
  9587. Attr: rootAttr,
  9588. }
  9589. el := value.MemberElement(root)
  9590. el.String(string(v.Tier))
  9591. }
  9592. return nil
  9593. }
  9594. func awsRestxml_serializeDocumentGrant(v *types.Grant, value smithyxml.Value) error {
  9595. defer value.Close()
  9596. if v.Grantee != nil {
  9597. rootAttr := []smithyxml.Attr{}
  9598. rootAttr = append(rootAttr, smithyxml.NewNamespaceAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance"))
  9599. if len(v.Grantee.Type) > 0 {
  9600. var av string
  9601. av = string(v.Grantee.Type)
  9602. rootAttr = append(rootAttr, smithyxml.NewAttribute("xsi:type", av))
  9603. }
  9604. root := smithyxml.StartElement{
  9605. Name: smithyxml.Name{
  9606. Local: "Grantee",
  9607. },
  9608. Attr: rootAttr,
  9609. }
  9610. el := value.MemberElement(root)
  9611. if err := awsRestxml_serializeDocumentGrantee(v.Grantee, el); err != nil {
  9612. return err
  9613. }
  9614. }
  9615. if len(v.Permission) > 0 {
  9616. rootAttr := []smithyxml.Attr{}
  9617. root := smithyxml.StartElement{
  9618. Name: smithyxml.Name{
  9619. Local: "Permission",
  9620. },
  9621. Attr: rootAttr,
  9622. }
  9623. el := value.MemberElement(root)
  9624. el.String(string(v.Permission))
  9625. }
  9626. return nil
  9627. }
  9628. func awsRestxml_serializeDocumentGrantee(v *types.Grantee, value smithyxml.Value) error {
  9629. defer value.Close()
  9630. if v.DisplayName != nil {
  9631. rootAttr := []smithyxml.Attr{}
  9632. root := smithyxml.StartElement{
  9633. Name: smithyxml.Name{
  9634. Local: "DisplayName",
  9635. },
  9636. Attr: rootAttr,
  9637. }
  9638. el := value.MemberElement(root)
  9639. el.String(*v.DisplayName)
  9640. }
  9641. if v.EmailAddress != nil {
  9642. rootAttr := []smithyxml.Attr{}
  9643. root := smithyxml.StartElement{
  9644. Name: smithyxml.Name{
  9645. Local: "EmailAddress",
  9646. },
  9647. Attr: rootAttr,
  9648. }
  9649. el := value.MemberElement(root)
  9650. el.String(*v.EmailAddress)
  9651. }
  9652. if v.ID != nil {
  9653. rootAttr := []smithyxml.Attr{}
  9654. root := smithyxml.StartElement{
  9655. Name: smithyxml.Name{
  9656. Local: "ID",
  9657. },
  9658. Attr: rootAttr,
  9659. }
  9660. el := value.MemberElement(root)
  9661. el.String(*v.ID)
  9662. }
  9663. if v.URI != nil {
  9664. rootAttr := []smithyxml.Attr{}
  9665. root := smithyxml.StartElement{
  9666. Name: smithyxml.Name{
  9667. Local: "URI",
  9668. },
  9669. Attr: rootAttr,
  9670. }
  9671. el := value.MemberElement(root)
  9672. el.String(*v.URI)
  9673. }
  9674. return nil
  9675. }
  9676. func awsRestxml_serializeDocumentGrants(v []types.Grant, value smithyxml.Value) error {
  9677. var array *smithyxml.Array
  9678. if !value.IsFlattened() {
  9679. defer value.Close()
  9680. }
  9681. customMemberNameAttr := []smithyxml.Attr{}
  9682. customMemberName := smithyxml.StartElement{
  9683. Name: smithyxml.Name{
  9684. Local: "Grant",
  9685. },
  9686. Attr: customMemberNameAttr,
  9687. }
  9688. array = value.ArrayWithCustomName(customMemberName)
  9689. for i := range v {
  9690. am := array.Member()
  9691. if err := awsRestxml_serializeDocumentGrant(&v[i], am); err != nil {
  9692. return err
  9693. }
  9694. }
  9695. return nil
  9696. }
  9697. func awsRestxml_serializeDocumentIndexDocument(v *types.IndexDocument, value smithyxml.Value) error {
  9698. defer value.Close()
  9699. if v.Suffix != nil {
  9700. rootAttr := []smithyxml.Attr{}
  9701. root := smithyxml.StartElement{
  9702. Name: smithyxml.Name{
  9703. Local: "Suffix",
  9704. },
  9705. Attr: rootAttr,
  9706. }
  9707. el := value.MemberElement(root)
  9708. el.String(*v.Suffix)
  9709. }
  9710. return nil
  9711. }
  9712. func awsRestxml_serializeDocumentInputSerialization(v *types.InputSerialization, value smithyxml.Value) error {
  9713. defer value.Close()
  9714. if len(v.CompressionType) > 0 {
  9715. rootAttr := []smithyxml.Attr{}
  9716. root := smithyxml.StartElement{
  9717. Name: smithyxml.Name{
  9718. Local: "CompressionType",
  9719. },
  9720. Attr: rootAttr,
  9721. }
  9722. el := value.MemberElement(root)
  9723. el.String(string(v.CompressionType))
  9724. }
  9725. if v.CSV != nil {
  9726. rootAttr := []smithyxml.Attr{}
  9727. root := smithyxml.StartElement{
  9728. Name: smithyxml.Name{
  9729. Local: "CSV",
  9730. },
  9731. Attr: rootAttr,
  9732. }
  9733. el := value.MemberElement(root)
  9734. if err := awsRestxml_serializeDocumentCSVInput(v.CSV, el); err != nil {
  9735. return err
  9736. }
  9737. }
  9738. if v.JSON != nil {
  9739. rootAttr := []smithyxml.Attr{}
  9740. root := smithyxml.StartElement{
  9741. Name: smithyxml.Name{
  9742. Local: "JSON",
  9743. },
  9744. Attr: rootAttr,
  9745. }
  9746. el := value.MemberElement(root)
  9747. if err := awsRestxml_serializeDocumentJSONInput(v.JSON, el); err != nil {
  9748. return err
  9749. }
  9750. }
  9751. if v.Parquet != nil {
  9752. rootAttr := []smithyxml.Attr{}
  9753. root := smithyxml.StartElement{
  9754. Name: smithyxml.Name{
  9755. Local: "Parquet",
  9756. },
  9757. Attr: rootAttr,
  9758. }
  9759. el := value.MemberElement(root)
  9760. if err := awsRestxml_serializeDocumentParquetInput(v.Parquet, el); err != nil {
  9761. return err
  9762. }
  9763. }
  9764. return nil
  9765. }
  9766. func awsRestxml_serializeDocumentIntelligentTieringAndOperator(v *types.IntelligentTieringAndOperator, value smithyxml.Value) error {
  9767. defer value.Close()
  9768. if v.Prefix != nil {
  9769. rootAttr := []smithyxml.Attr{}
  9770. root := smithyxml.StartElement{
  9771. Name: smithyxml.Name{
  9772. Local: "Prefix",
  9773. },
  9774. Attr: rootAttr,
  9775. }
  9776. el := value.MemberElement(root)
  9777. el.String(*v.Prefix)
  9778. }
  9779. if v.Tags != nil {
  9780. rootAttr := []smithyxml.Attr{}
  9781. root := smithyxml.StartElement{
  9782. Name: smithyxml.Name{
  9783. Local: "Tag",
  9784. },
  9785. Attr: rootAttr,
  9786. }
  9787. el := value.FlattenedElement(root)
  9788. if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil {
  9789. return err
  9790. }
  9791. }
  9792. return nil
  9793. }
  9794. func awsRestxml_serializeDocumentIntelligentTieringConfiguration(v *types.IntelligentTieringConfiguration, value smithyxml.Value) error {
  9795. defer value.Close()
  9796. if v.Filter != nil {
  9797. rootAttr := []smithyxml.Attr{}
  9798. root := smithyxml.StartElement{
  9799. Name: smithyxml.Name{
  9800. Local: "Filter",
  9801. },
  9802. Attr: rootAttr,
  9803. }
  9804. el := value.MemberElement(root)
  9805. if err := awsRestxml_serializeDocumentIntelligentTieringFilter(v.Filter, el); err != nil {
  9806. return err
  9807. }
  9808. }
  9809. if v.Id != nil {
  9810. rootAttr := []smithyxml.Attr{}
  9811. root := smithyxml.StartElement{
  9812. Name: smithyxml.Name{
  9813. Local: "Id",
  9814. },
  9815. Attr: rootAttr,
  9816. }
  9817. el := value.MemberElement(root)
  9818. el.String(*v.Id)
  9819. }
  9820. if len(v.Status) > 0 {
  9821. rootAttr := []smithyxml.Attr{}
  9822. root := smithyxml.StartElement{
  9823. Name: smithyxml.Name{
  9824. Local: "Status",
  9825. },
  9826. Attr: rootAttr,
  9827. }
  9828. el := value.MemberElement(root)
  9829. el.String(string(v.Status))
  9830. }
  9831. if v.Tierings != nil {
  9832. rootAttr := []smithyxml.Attr{}
  9833. root := smithyxml.StartElement{
  9834. Name: smithyxml.Name{
  9835. Local: "Tiering",
  9836. },
  9837. Attr: rootAttr,
  9838. }
  9839. el := value.FlattenedElement(root)
  9840. if err := awsRestxml_serializeDocumentTieringList(v.Tierings, el); err != nil {
  9841. return err
  9842. }
  9843. }
  9844. return nil
  9845. }
  9846. func awsRestxml_serializeDocumentIntelligentTieringFilter(v *types.IntelligentTieringFilter, value smithyxml.Value) error {
  9847. defer value.Close()
  9848. if v.And != nil {
  9849. rootAttr := []smithyxml.Attr{}
  9850. root := smithyxml.StartElement{
  9851. Name: smithyxml.Name{
  9852. Local: "And",
  9853. },
  9854. Attr: rootAttr,
  9855. }
  9856. el := value.MemberElement(root)
  9857. if err := awsRestxml_serializeDocumentIntelligentTieringAndOperator(v.And, el); err != nil {
  9858. return err
  9859. }
  9860. }
  9861. if v.Prefix != nil {
  9862. rootAttr := []smithyxml.Attr{}
  9863. root := smithyxml.StartElement{
  9864. Name: smithyxml.Name{
  9865. Local: "Prefix",
  9866. },
  9867. Attr: rootAttr,
  9868. }
  9869. el := value.MemberElement(root)
  9870. el.String(*v.Prefix)
  9871. }
  9872. if v.Tag != nil {
  9873. rootAttr := []smithyxml.Attr{}
  9874. root := smithyxml.StartElement{
  9875. Name: smithyxml.Name{
  9876. Local: "Tag",
  9877. },
  9878. Attr: rootAttr,
  9879. }
  9880. el := value.MemberElement(root)
  9881. if err := awsRestxml_serializeDocumentTag(v.Tag, el); err != nil {
  9882. return err
  9883. }
  9884. }
  9885. return nil
  9886. }
  9887. func awsRestxml_serializeDocumentInventoryConfiguration(v *types.InventoryConfiguration, value smithyxml.Value) error {
  9888. defer value.Close()
  9889. if v.Destination != nil {
  9890. rootAttr := []smithyxml.Attr{}
  9891. root := smithyxml.StartElement{
  9892. Name: smithyxml.Name{
  9893. Local: "Destination",
  9894. },
  9895. Attr: rootAttr,
  9896. }
  9897. el := value.MemberElement(root)
  9898. if err := awsRestxml_serializeDocumentInventoryDestination(v.Destination, el); err != nil {
  9899. return err
  9900. }
  9901. }
  9902. if v.Filter != nil {
  9903. rootAttr := []smithyxml.Attr{}
  9904. root := smithyxml.StartElement{
  9905. Name: smithyxml.Name{
  9906. Local: "Filter",
  9907. },
  9908. Attr: rootAttr,
  9909. }
  9910. el := value.MemberElement(root)
  9911. if err := awsRestxml_serializeDocumentInventoryFilter(v.Filter, el); err != nil {
  9912. return err
  9913. }
  9914. }
  9915. if v.Id != nil {
  9916. rootAttr := []smithyxml.Attr{}
  9917. root := smithyxml.StartElement{
  9918. Name: smithyxml.Name{
  9919. Local: "Id",
  9920. },
  9921. Attr: rootAttr,
  9922. }
  9923. el := value.MemberElement(root)
  9924. el.String(*v.Id)
  9925. }
  9926. if len(v.IncludedObjectVersions) > 0 {
  9927. rootAttr := []smithyxml.Attr{}
  9928. root := smithyxml.StartElement{
  9929. Name: smithyxml.Name{
  9930. Local: "IncludedObjectVersions",
  9931. },
  9932. Attr: rootAttr,
  9933. }
  9934. el := value.MemberElement(root)
  9935. el.String(string(v.IncludedObjectVersions))
  9936. }
  9937. if v.IsEnabled != nil {
  9938. rootAttr := []smithyxml.Attr{}
  9939. root := smithyxml.StartElement{
  9940. Name: smithyxml.Name{
  9941. Local: "IsEnabled",
  9942. },
  9943. Attr: rootAttr,
  9944. }
  9945. el := value.MemberElement(root)
  9946. el.Boolean(*v.IsEnabled)
  9947. }
  9948. if v.OptionalFields != nil {
  9949. rootAttr := []smithyxml.Attr{}
  9950. root := smithyxml.StartElement{
  9951. Name: smithyxml.Name{
  9952. Local: "OptionalFields",
  9953. },
  9954. Attr: rootAttr,
  9955. }
  9956. el := value.MemberElement(root)
  9957. if err := awsRestxml_serializeDocumentInventoryOptionalFields(v.OptionalFields, el); err != nil {
  9958. return err
  9959. }
  9960. }
  9961. if v.Schedule != nil {
  9962. rootAttr := []smithyxml.Attr{}
  9963. root := smithyxml.StartElement{
  9964. Name: smithyxml.Name{
  9965. Local: "Schedule",
  9966. },
  9967. Attr: rootAttr,
  9968. }
  9969. el := value.MemberElement(root)
  9970. if err := awsRestxml_serializeDocumentInventorySchedule(v.Schedule, el); err != nil {
  9971. return err
  9972. }
  9973. }
  9974. return nil
  9975. }
  9976. func awsRestxml_serializeDocumentInventoryDestination(v *types.InventoryDestination, value smithyxml.Value) error {
  9977. defer value.Close()
  9978. if v.S3BucketDestination != nil {
  9979. rootAttr := []smithyxml.Attr{}
  9980. root := smithyxml.StartElement{
  9981. Name: smithyxml.Name{
  9982. Local: "S3BucketDestination",
  9983. },
  9984. Attr: rootAttr,
  9985. }
  9986. el := value.MemberElement(root)
  9987. if err := awsRestxml_serializeDocumentInventoryS3BucketDestination(v.S3BucketDestination, el); err != nil {
  9988. return err
  9989. }
  9990. }
  9991. return nil
  9992. }
  9993. func awsRestxml_serializeDocumentInventoryEncryption(v *types.InventoryEncryption, value smithyxml.Value) error {
  9994. defer value.Close()
  9995. if v.SSEKMS != nil {
  9996. rootAttr := []smithyxml.Attr{}
  9997. root := smithyxml.StartElement{
  9998. Name: smithyxml.Name{
  9999. Local: "SSE-KMS",
  10000. },
  10001. Attr: rootAttr,
  10002. }
  10003. el := value.MemberElement(root)
  10004. if err := awsRestxml_serializeDocumentSSEKMS(v.SSEKMS, el); err != nil {
  10005. return err
  10006. }
  10007. }
  10008. if v.SSES3 != nil {
  10009. rootAttr := []smithyxml.Attr{}
  10010. root := smithyxml.StartElement{
  10011. Name: smithyxml.Name{
  10012. Local: "SSE-S3",
  10013. },
  10014. Attr: rootAttr,
  10015. }
  10016. el := value.MemberElement(root)
  10017. if err := awsRestxml_serializeDocumentSSES3(v.SSES3, el); err != nil {
  10018. return err
  10019. }
  10020. }
  10021. return nil
  10022. }
  10023. func awsRestxml_serializeDocumentInventoryFilter(v *types.InventoryFilter, value smithyxml.Value) error {
  10024. defer value.Close()
  10025. if v.Prefix != nil {
  10026. rootAttr := []smithyxml.Attr{}
  10027. root := smithyxml.StartElement{
  10028. Name: smithyxml.Name{
  10029. Local: "Prefix",
  10030. },
  10031. Attr: rootAttr,
  10032. }
  10033. el := value.MemberElement(root)
  10034. el.String(*v.Prefix)
  10035. }
  10036. return nil
  10037. }
  10038. func awsRestxml_serializeDocumentInventoryOptionalFields(v []types.InventoryOptionalField, value smithyxml.Value) error {
  10039. var array *smithyxml.Array
  10040. if !value.IsFlattened() {
  10041. defer value.Close()
  10042. }
  10043. customMemberNameAttr := []smithyxml.Attr{}
  10044. customMemberName := smithyxml.StartElement{
  10045. Name: smithyxml.Name{
  10046. Local: "Field",
  10047. },
  10048. Attr: customMemberNameAttr,
  10049. }
  10050. array = value.ArrayWithCustomName(customMemberName)
  10051. for i := range v {
  10052. am := array.Member()
  10053. am.String(string(v[i]))
  10054. }
  10055. return nil
  10056. }
  10057. func awsRestxml_serializeDocumentInventoryS3BucketDestination(v *types.InventoryS3BucketDestination, value smithyxml.Value) error {
  10058. defer value.Close()
  10059. if v.AccountId != nil {
  10060. rootAttr := []smithyxml.Attr{}
  10061. root := smithyxml.StartElement{
  10062. Name: smithyxml.Name{
  10063. Local: "AccountId",
  10064. },
  10065. Attr: rootAttr,
  10066. }
  10067. el := value.MemberElement(root)
  10068. el.String(*v.AccountId)
  10069. }
  10070. if v.Bucket != nil {
  10071. rootAttr := []smithyxml.Attr{}
  10072. root := smithyxml.StartElement{
  10073. Name: smithyxml.Name{
  10074. Local: "Bucket",
  10075. },
  10076. Attr: rootAttr,
  10077. }
  10078. el := value.MemberElement(root)
  10079. el.String(*v.Bucket)
  10080. }
  10081. if v.Encryption != nil {
  10082. rootAttr := []smithyxml.Attr{}
  10083. root := smithyxml.StartElement{
  10084. Name: smithyxml.Name{
  10085. Local: "Encryption",
  10086. },
  10087. Attr: rootAttr,
  10088. }
  10089. el := value.MemberElement(root)
  10090. if err := awsRestxml_serializeDocumentInventoryEncryption(v.Encryption, el); err != nil {
  10091. return err
  10092. }
  10093. }
  10094. if len(v.Format) > 0 {
  10095. rootAttr := []smithyxml.Attr{}
  10096. root := smithyxml.StartElement{
  10097. Name: smithyxml.Name{
  10098. Local: "Format",
  10099. },
  10100. Attr: rootAttr,
  10101. }
  10102. el := value.MemberElement(root)
  10103. el.String(string(v.Format))
  10104. }
  10105. if v.Prefix != nil {
  10106. rootAttr := []smithyxml.Attr{}
  10107. root := smithyxml.StartElement{
  10108. Name: smithyxml.Name{
  10109. Local: "Prefix",
  10110. },
  10111. Attr: rootAttr,
  10112. }
  10113. el := value.MemberElement(root)
  10114. el.String(*v.Prefix)
  10115. }
  10116. return nil
  10117. }
  10118. func awsRestxml_serializeDocumentInventorySchedule(v *types.InventorySchedule, value smithyxml.Value) error {
  10119. defer value.Close()
  10120. if len(v.Frequency) > 0 {
  10121. rootAttr := []smithyxml.Attr{}
  10122. root := smithyxml.StartElement{
  10123. Name: smithyxml.Name{
  10124. Local: "Frequency",
  10125. },
  10126. Attr: rootAttr,
  10127. }
  10128. el := value.MemberElement(root)
  10129. el.String(string(v.Frequency))
  10130. }
  10131. return nil
  10132. }
  10133. func awsRestxml_serializeDocumentInventoryTableConfiguration(v *types.InventoryTableConfiguration, value smithyxml.Value) error {
  10134. defer value.Close()
  10135. if len(v.ConfigurationState) > 0 {
  10136. rootAttr := []smithyxml.Attr{}
  10137. root := smithyxml.StartElement{
  10138. Name: smithyxml.Name{
  10139. Local: "ConfigurationState",
  10140. },
  10141. Attr: rootAttr,
  10142. }
  10143. el := value.MemberElement(root)
  10144. el.String(string(v.ConfigurationState))
  10145. }
  10146. if v.EncryptionConfiguration != nil {
  10147. rootAttr := []smithyxml.Attr{}
  10148. root := smithyxml.StartElement{
  10149. Name: smithyxml.Name{
  10150. Local: "EncryptionConfiguration",
  10151. },
  10152. Attr: rootAttr,
  10153. }
  10154. el := value.MemberElement(root)
  10155. if err := awsRestxml_serializeDocumentMetadataTableEncryptionConfiguration(v.EncryptionConfiguration, el); err != nil {
  10156. return err
  10157. }
  10158. }
  10159. return nil
  10160. }
  10161. func awsRestxml_serializeDocumentInventoryTableConfigurationUpdates(v *types.InventoryTableConfigurationUpdates, value smithyxml.Value) error {
  10162. defer value.Close()
  10163. if len(v.ConfigurationState) > 0 {
  10164. rootAttr := []smithyxml.Attr{}
  10165. root := smithyxml.StartElement{
  10166. Name: smithyxml.Name{
  10167. Local: "ConfigurationState",
  10168. },
  10169. Attr: rootAttr,
  10170. }
  10171. el := value.MemberElement(root)
  10172. el.String(string(v.ConfigurationState))
  10173. }
  10174. if v.EncryptionConfiguration != nil {
  10175. rootAttr := []smithyxml.Attr{}
  10176. root := smithyxml.StartElement{
  10177. Name: smithyxml.Name{
  10178. Local: "EncryptionConfiguration",
  10179. },
  10180. Attr: rootAttr,
  10181. }
  10182. el := value.MemberElement(root)
  10183. if err := awsRestxml_serializeDocumentMetadataTableEncryptionConfiguration(v.EncryptionConfiguration, el); err != nil {
  10184. return err
  10185. }
  10186. }
  10187. return nil
  10188. }
  10189. func awsRestxml_serializeDocumentJournalTableConfiguration(v *types.JournalTableConfiguration, value smithyxml.Value) error {
  10190. defer value.Close()
  10191. if v.EncryptionConfiguration != nil {
  10192. rootAttr := []smithyxml.Attr{}
  10193. root := smithyxml.StartElement{
  10194. Name: smithyxml.Name{
  10195. Local: "EncryptionConfiguration",
  10196. },
  10197. Attr: rootAttr,
  10198. }
  10199. el := value.MemberElement(root)
  10200. if err := awsRestxml_serializeDocumentMetadataTableEncryptionConfiguration(v.EncryptionConfiguration, el); err != nil {
  10201. return err
  10202. }
  10203. }
  10204. if v.RecordExpiration != nil {
  10205. rootAttr := []smithyxml.Attr{}
  10206. root := smithyxml.StartElement{
  10207. Name: smithyxml.Name{
  10208. Local: "RecordExpiration",
  10209. },
  10210. Attr: rootAttr,
  10211. }
  10212. el := value.MemberElement(root)
  10213. if err := awsRestxml_serializeDocumentRecordExpiration(v.RecordExpiration, el); err != nil {
  10214. return err
  10215. }
  10216. }
  10217. return nil
  10218. }
  10219. func awsRestxml_serializeDocumentJournalTableConfigurationUpdates(v *types.JournalTableConfigurationUpdates, value smithyxml.Value) error {
  10220. defer value.Close()
  10221. if v.RecordExpiration != nil {
  10222. rootAttr := []smithyxml.Attr{}
  10223. root := smithyxml.StartElement{
  10224. Name: smithyxml.Name{
  10225. Local: "RecordExpiration",
  10226. },
  10227. Attr: rootAttr,
  10228. }
  10229. el := value.MemberElement(root)
  10230. if err := awsRestxml_serializeDocumentRecordExpiration(v.RecordExpiration, el); err != nil {
  10231. return err
  10232. }
  10233. }
  10234. return nil
  10235. }
  10236. func awsRestxml_serializeDocumentJSONInput(v *types.JSONInput, value smithyxml.Value) error {
  10237. defer value.Close()
  10238. if len(v.Type) > 0 {
  10239. rootAttr := []smithyxml.Attr{}
  10240. root := smithyxml.StartElement{
  10241. Name: smithyxml.Name{
  10242. Local: "Type",
  10243. },
  10244. Attr: rootAttr,
  10245. }
  10246. el := value.MemberElement(root)
  10247. el.String(string(v.Type))
  10248. }
  10249. return nil
  10250. }
  10251. func awsRestxml_serializeDocumentJSONOutput(v *types.JSONOutput, value smithyxml.Value) error {
  10252. defer value.Close()
  10253. if v.RecordDelimiter != nil {
  10254. rootAttr := []smithyxml.Attr{}
  10255. root := smithyxml.StartElement{
  10256. Name: smithyxml.Name{
  10257. Local: "RecordDelimiter",
  10258. },
  10259. Attr: rootAttr,
  10260. }
  10261. el := value.MemberElement(root)
  10262. el.String(*v.RecordDelimiter)
  10263. }
  10264. return nil
  10265. }
  10266. func awsRestxml_serializeDocumentLambdaFunctionConfiguration(v *types.LambdaFunctionConfiguration, value smithyxml.Value) error {
  10267. defer value.Close()
  10268. if v.Events != nil {
  10269. rootAttr := []smithyxml.Attr{}
  10270. root := smithyxml.StartElement{
  10271. Name: smithyxml.Name{
  10272. Local: "Event",
  10273. },
  10274. Attr: rootAttr,
  10275. }
  10276. el := value.FlattenedElement(root)
  10277. if err := awsRestxml_serializeDocumentEventList(v.Events, el); err != nil {
  10278. return err
  10279. }
  10280. }
  10281. if v.Filter != nil {
  10282. rootAttr := []smithyxml.Attr{}
  10283. root := smithyxml.StartElement{
  10284. Name: smithyxml.Name{
  10285. Local: "Filter",
  10286. },
  10287. Attr: rootAttr,
  10288. }
  10289. el := value.MemberElement(root)
  10290. if err := awsRestxml_serializeDocumentNotificationConfigurationFilter(v.Filter, el); err != nil {
  10291. return err
  10292. }
  10293. }
  10294. if v.Id != nil {
  10295. rootAttr := []smithyxml.Attr{}
  10296. root := smithyxml.StartElement{
  10297. Name: smithyxml.Name{
  10298. Local: "Id",
  10299. },
  10300. Attr: rootAttr,
  10301. }
  10302. el := value.MemberElement(root)
  10303. el.String(*v.Id)
  10304. }
  10305. if v.LambdaFunctionArn != nil {
  10306. rootAttr := []smithyxml.Attr{}
  10307. root := smithyxml.StartElement{
  10308. Name: smithyxml.Name{
  10309. Local: "CloudFunction",
  10310. },
  10311. Attr: rootAttr,
  10312. }
  10313. el := value.MemberElement(root)
  10314. el.String(*v.LambdaFunctionArn)
  10315. }
  10316. return nil
  10317. }
  10318. func awsRestxml_serializeDocumentLambdaFunctionConfigurationList(v []types.LambdaFunctionConfiguration, value smithyxml.Value) error {
  10319. var array *smithyxml.Array
  10320. if !value.IsFlattened() {
  10321. defer value.Close()
  10322. }
  10323. array = value.Array()
  10324. for i := range v {
  10325. am := array.Member()
  10326. if err := awsRestxml_serializeDocumentLambdaFunctionConfiguration(&v[i], am); err != nil {
  10327. return err
  10328. }
  10329. }
  10330. return nil
  10331. }
  10332. func awsRestxml_serializeDocumentLifecycleExpiration(v *types.LifecycleExpiration, value smithyxml.Value) error {
  10333. defer value.Close()
  10334. if v.Date != nil {
  10335. rootAttr := []smithyxml.Attr{}
  10336. root := smithyxml.StartElement{
  10337. Name: smithyxml.Name{
  10338. Local: "Date",
  10339. },
  10340. Attr: rootAttr,
  10341. }
  10342. el := value.MemberElement(root)
  10343. el.String(smithytime.FormatDateTime(*v.Date))
  10344. }
  10345. if v.Days != nil {
  10346. rootAttr := []smithyxml.Attr{}
  10347. root := smithyxml.StartElement{
  10348. Name: smithyxml.Name{
  10349. Local: "Days",
  10350. },
  10351. Attr: rootAttr,
  10352. }
  10353. el := value.MemberElement(root)
  10354. el.Integer(*v.Days)
  10355. }
  10356. if v.ExpiredObjectDeleteMarker != nil {
  10357. rootAttr := []smithyxml.Attr{}
  10358. root := smithyxml.StartElement{
  10359. Name: smithyxml.Name{
  10360. Local: "ExpiredObjectDeleteMarker",
  10361. },
  10362. Attr: rootAttr,
  10363. }
  10364. el := value.MemberElement(root)
  10365. el.Boolean(*v.ExpiredObjectDeleteMarker)
  10366. }
  10367. return nil
  10368. }
  10369. func awsRestxml_serializeDocumentLifecycleRule(v *types.LifecycleRule, value smithyxml.Value) error {
  10370. defer value.Close()
  10371. if v.AbortIncompleteMultipartUpload != nil {
  10372. rootAttr := []smithyxml.Attr{}
  10373. root := smithyxml.StartElement{
  10374. Name: smithyxml.Name{
  10375. Local: "AbortIncompleteMultipartUpload",
  10376. },
  10377. Attr: rootAttr,
  10378. }
  10379. el := value.MemberElement(root)
  10380. if err := awsRestxml_serializeDocumentAbortIncompleteMultipartUpload(v.AbortIncompleteMultipartUpload, el); err != nil {
  10381. return err
  10382. }
  10383. }
  10384. if v.Expiration != nil {
  10385. rootAttr := []smithyxml.Attr{}
  10386. root := smithyxml.StartElement{
  10387. Name: smithyxml.Name{
  10388. Local: "Expiration",
  10389. },
  10390. Attr: rootAttr,
  10391. }
  10392. el := value.MemberElement(root)
  10393. if err := awsRestxml_serializeDocumentLifecycleExpiration(v.Expiration, el); err != nil {
  10394. return err
  10395. }
  10396. }
  10397. if v.Filter != nil {
  10398. rootAttr := []smithyxml.Attr{}
  10399. root := smithyxml.StartElement{
  10400. Name: smithyxml.Name{
  10401. Local: "Filter",
  10402. },
  10403. Attr: rootAttr,
  10404. }
  10405. el := value.MemberElement(root)
  10406. if err := awsRestxml_serializeDocumentLifecycleRuleFilter(v.Filter, el); err != nil {
  10407. return err
  10408. }
  10409. }
  10410. if v.ID != nil {
  10411. rootAttr := []smithyxml.Attr{}
  10412. root := smithyxml.StartElement{
  10413. Name: smithyxml.Name{
  10414. Local: "ID",
  10415. },
  10416. Attr: rootAttr,
  10417. }
  10418. el := value.MemberElement(root)
  10419. el.String(*v.ID)
  10420. }
  10421. if v.NoncurrentVersionExpiration != nil {
  10422. rootAttr := []smithyxml.Attr{}
  10423. root := smithyxml.StartElement{
  10424. Name: smithyxml.Name{
  10425. Local: "NoncurrentVersionExpiration",
  10426. },
  10427. Attr: rootAttr,
  10428. }
  10429. el := value.MemberElement(root)
  10430. if err := awsRestxml_serializeDocumentNoncurrentVersionExpiration(v.NoncurrentVersionExpiration, el); err != nil {
  10431. return err
  10432. }
  10433. }
  10434. if v.NoncurrentVersionTransitions != nil {
  10435. rootAttr := []smithyxml.Attr{}
  10436. root := smithyxml.StartElement{
  10437. Name: smithyxml.Name{
  10438. Local: "NoncurrentVersionTransition",
  10439. },
  10440. Attr: rootAttr,
  10441. }
  10442. el := value.FlattenedElement(root)
  10443. if err := awsRestxml_serializeDocumentNoncurrentVersionTransitionList(v.NoncurrentVersionTransitions, el); err != nil {
  10444. return err
  10445. }
  10446. }
  10447. if v.Prefix != nil {
  10448. rootAttr := []smithyxml.Attr{}
  10449. root := smithyxml.StartElement{
  10450. Name: smithyxml.Name{
  10451. Local: "Prefix",
  10452. },
  10453. Attr: rootAttr,
  10454. }
  10455. el := value.MemberElement(root)
  10456. el.String(*v.Prefix)
  10457. }
  10458. if len(v.Status) > 0 {
  10459. rootAttr := []smithyxml.Attr{}
  10460. root := smithyxml.StartElement{
  10461. Name: smithyxml.Name{
  10462. Local: "Status",
  10463. },
  10464. Attr: rootAttr,
  10465. }
  10466. el := value.MemberElement(root)
  10467. el.String(string(v.Status))
  10468. }
  10469. if v.Transitions != nil {
  10470. rootAttr := []smithyxml.Attr{}
  10471. root := smithyxml.StartElement{
  10472. Name: smithyxml.Name{
  10473. Local: "Transition",
  10474. },
  10475. Attr: rootAttr,
  10476. }
  10477. el := value.FlattenedElement(root)
  10478. if err := awsRestxml_serializeDocumentTransitionList(v.Transitions, el); err != nil {
  10479. return err
  10480. }
  10481. }
  10482. return nil
  10483. }
  10484. func awsRestxml_serializeDocumentLifecycleRuleAndOperator(v *types.LifecycleRuleAndOperator, value smithyxml.Value) error {
  10485. defer value.Close()
  10486. if v.ObjectSizeGreaterThan != nil {
  10487. rootAttr := []smithyxml.Attr{}
  10488. root := smithyxml.StartElement{
  10489. Name: smithyxml.Name{
  10490. Local: "ObjectSizeGreaterThan",
  10491. },
  10492. Attr: rootAttr,
  10493. }
  10494. el := value.MemberElement(root)
  10495. el.Long(*v.ObjectSizeGreaterThan)
  10496. }
  10497. if v.ObjectSizeLessThan != nil {
  10498. rootAttr := []smithyxml.Attr{}
  10499. root := smithyxml.StartElement{
  10500. Name: smithyxml.Name{
  10501. Local: "ObjectSizeLessThan",
  10502. },
  10503. Attr: rootAttr,
  10504. }
  10505. el := value.MemberElement(root)
  10506. el.Long(*v.ObjectSizeLessThan)
  10507. }
  10508. if v.Prefix != nil {
  10509. rootAttr := []smithyxml.Attr{}
  10510. root := smithyxml.StartElement{
  10511. Name: smithyxml.Name{
  10512. Local: "Prefix",
  10513. },
  10514. Attr: rootAttr,
  10515. }
  10516. el := value.MemberElement(root)
  10517. el.String(*v.Prefix)
  10518. }
  10519. if v.Tags != nil {
  10520. rootAttr := []smithyxml.Attr{}
  10521. root := smithyxml.StartElement{
  10522. Name: smithyxml.Name{
  10523. Local: "Tag",
  10524. },
  10525. Attr: rootAttr,
  10526. }
  10527. el := value.FlattenedElement(root)
  10528. if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil {
  10529. return err
  10530. }
  10531. }
  10532. return nil
  10533. }
  10534. func awsRestxml_serializeDocumentLifecycleRuleFilter(v *types.LifecycleRuleFilter, value smithyxml.Value) error {
  10535. defer value.Close()
  10536. if v.And != nil {
  10537. rootAttr := []smithyxml.Attr{}
  10538. root := smithyxml.StartElement{
  10539. Name: smithyxml.Name{
  10540. Local: "And",
  10541. },
  10542. Attr: rootAttr,
  10543. }
  10544. el := value.MemberElement(root)
  10545. if err := awsRestxml_serializeDocumentLifecycleRuleAndOperator(v.And, el); err != nil {
  10546. return err
  10547. }
  10548. }
  10549. if v.ObjectSizeGreaterThan != nil {
  10550. rootAttr := []smithyxml.Attr{}
  10551. root := smithyxml.StartElement{
  10552. Name: smithyxml.Name{
  10553. Local: "ObjectSizeGreaterThan",
  10554. },
  10555. Attr: rootAttr,
  10556. }
  10557. el := value.MemberElement(root)
  10558. el.Long(*v.ObjectSizeGreaterThan)
  10559. }
  10560. if v.ObjectSizeLessThan != nil {
  10561. rootAttr := []smithyxml.Attr{}
  10562. root := smithyxml.StartElement{
  10563. Name: smithyxml.Name{
  10564. Local: "ObjectSizeLessThan",
  10565. },
  10566. Attr: rootAttr,
  10567. }
  10568. el := value.MemberElement(root)
  10569. el.Long(*v.ObjectSizeLessThan)
  10570. }
  10571. if v.Prefix != nil {
  10572. rootAttr := []smithyxml.Attr{}
  10573. root := smithyxml.StartElement{
  10574. Name: smithyxml.Name{
  10575. Local: "Prefix",
  10576. },
  10577. Attr: rootAttr,
  10578. }
  10579. el := value.MemberElement(root)
  10580. el.String(*v.Prefix)
  10581. }
  10582. if v.Tag != nil {
  10583. rootAttr := []smithyxml.Attr{}
  10584. root := smithyxml.StartElement{
  10585. Name: smithyxml.Name{
  10586. Local: "Tag",
  10587. },
  10588. Attr: rootAttr,
  10589. }
  10590. el := value.MemberElement(root)
  10591. if err := awsRestxml_serializeDocumentTag(v.Tag, el); err != nil {
  10592. return err
  10593. }
  10594. }
  10595. return nil
  10596. }
  10597. func awsRestxml_serializeDocumentLifecycleRules(v []types.LifecycleRule, value smithyxml.Value) error {
  10598. var array *smithyxml.Array
  10599. if !value.IsFlattened() {
  10600. defer value.Close()
  10601. }
  10602. array = value.Array()
  10603. for i := range v {
  10604. am := array.Member()
  10605. if err := awsRestxml_serializeDocumentLifecycleRule(&v[i], am); err != nil {
  10606. return err
  10607. }
  10608. }
  10609. return nil
  10610. }
  10611. func awsRestxml_serializeDocumentLocationInfo(v *types.LocationInfo, value smithyxml.Value) error {
  10612. defer value.Close()
  10613. if v.Name != nil {
  10614. rootAttr := []smithyxml.Attr{}
  10615. root := smithyxml.StartElement{
  10616. Name: smithyxml.Name{
  10617. Local: "Name",
  10618. },
  10619. Attr: rootAttr,
  10620. }
  10621. el := value.MemberElement(root)
  10622. el.String(*v.Name)
  10623. }
  10624. if len(v.Type) > 0 {
  10625. rootAttr := []smithyxml.Attr{}
  10626. root := smithyxml.StartElement{
  10627. Name: smithyxml.Name{
  10628. Local: "Type",
  10629. },
  10630. Attr: rootAttr,
  10631. }
  10632. el := value.MemberElement(root)
  10633. el.String(string(v.Type))
  10634. }
  10635. return nil
  10636. }
  10637. func awsRestxml_serializeDocumentLoggingEnabled(v *types.LoggingEnabled, value smithyxml.Value) error {
  10638. defer value.Close()
  10639. if v.TargetBucket != nil {
  10640. rootAttr := []smithyxml.Attr{}
  10641. root := smithyxml.StartElement{
  10642. Name: smithyxml.Name{
  10643. Local: "TargetBucket",
  10644. },
  10645. Attr: rootAttr,
  10646. }
  10647. el := value.MemberElement(root)
  10648. el.String(*v.TargetBucket)
  10649. }
  10650. if v.TargetGrants != nil {
  10651. rootAttr := []smithyxml.Attr{}
  10652. root := smithyxml.StartElement{
  10653. Name: smithyxml.Name{
  10654. Local: "TargetGrants",
  10655. },
  10656. Attr: rootAttr,
  10657. }
  10658. el := value.MemberElement(root)
  10659. if err := awsRestxml_serializeDocumentTargetGrants(v.TargetGrants, el); err != nil {
  10660. return err
  10661. }
  10662. }
  10663. if v.TargetObjectKeyFormat != nil {
  10664. rootAttr := []smithyxml.Attr{}
  10665. root := smithyxml.StartElement{
  10666. Name: smithyxml.Name{
  10667. Local: "TargetObjectKeyFormat",
  10668. },
  10669. Attr: rootAttr,
  10670. }
  10671. el := value.MemberElement(root)
  10672. if err := awsRestxml_serializeDocumentTargetObjectKeyFormat(v.TargetObjectKeyFormat, el); err != nil {
  10673. return err
  10674. }
  10675. }
  10676. if v.TargetPrefix != nil {
  10677. rootAttr := []smithyxml.Attr{}
  10678. root := smithyxml.StartElement{
  10679. Name: smithyxml.Name{
  10680. Local: "TargetPrefix",
  10681. },
  10682. Attr: rootAttr,
  10683. }
  10684. el := value.MemberElement(root)
  10685. el.String(*v.TargetPrefix)
  10686. }
  10687. return nil
  10688. }
  10689. func awsRestxml_serializeDocumentMetadataConfiguration(v *types.MetadataConfiguration, value smithyxml.Value) error {
  10690. defer value.Close()
  10691. if v.InventoryTableConfiguration != nil {
  10692. rootAttr := []smithyxml.Attr{}
  10693. root := smithyxml.StartElement{
  10694. Name: smithyxml.Name{
  10695. Local: "InventoryTableConfiguration",
  10696. },
  10697. Attr: rootAttr,
  10698. }
  10699. el := value.MemberElement(root)
  10700. if err := awsRestxml_serializeDocumentInventoryTableConfiguration(v.InventoryTableConfiguration, el); err != nil {
  10701. return err
  10702. }
  10703. }
  10704. if v.JournalTableConfiguration != nil {
  10705. rootAttr := []smithyxml.Attr{}
  10706. root := smithyxml.StartElement{
  10707. Name: smithyxml.Name{
  10708. Local: "JournalTableConfiguration",
  10709. },
  10710. Attr: rootAttr,
  10711. }
  10712. el := value.MemberElement(root)
  10713. if err := awsRestxml_serializeDocumentJournalTableConfiguration(v.JournalTableConfiguration, el); err != nil {
  10714. return err
  10715. }
  10716. }
  10717. return nil
  10718. }
  10719. func awsRestxml_serializeDocumentMetadataEntry(v *types.MetadataEntry, value smithyxml.Value) error {
  10720. defer value.Close()
  10721. if v.Name != nil {
  10722. rootAttr := []smithyxml.Attr{}
  10723. root := smithyxml.StartElement{
  10724. Name: smithyxml.Name{
  10725. Local: "Name",
  10726. },
  10727. Attr: rootAttr,
  10728. }
  10729. el := value.MemberElement(root)
  10730. el.String(*v.Name)
  10731. }
  10732. if v.Value != nil {
  10733. rootAttr := []smithyxml.Attr{}
  10734. root := smithyxml.StartElement{
  10735. Name: smithyxml.Name{
  10736. Local: "Value",
  10737. },
  10738. Attr: rootAttr,
  10739. }
  10740. el := value.MemberElement(root)
  10741. el.String(*v.Value)
  10742. }
  10743. return nil
  10744. }
  10745. func awsRestxml_serializeDocumentMetadataTableConfiguration(v *types.MetadataTableConfiguration, value smithyxml.Value) error {
  10746. defer value.Close()
  10747. if v.S3TablesDestination != nil {
  10748. rootAttr := []smithyxml.Attr{}
  10749. root := smithyxml.StartElement{
  10750. Name: smithyxml.Name{
  10751. Local: "S3TablesDestination",
  10752. },
  10753. Attr: rootAttr,
  10754. }
  10755. el := value.MemberElement(root)
  10756. if err := awsRestxml_serializeDocumentS3TablesDestination(v.S3TablesDestination, el); err != nil {
  10757. return err
  10758. }
  10759. }
  10760. return nil
  10761. }
  10762. func awsRestxml_serializeDocumentMetadataTableEncryptionConfiguration(v *types.MetadataTableEncryptionConfiguration, value smithyxml.Value) error {
  10763. defer value.Close()
  10764. if v.KmsKeyArn != nil {
  10765. rootAttr := []smithyxml.Attr{}
  10766. root := smithyxml.StartElement{
  10767. Name: smithyxml.Name{
  10768. Local: "KmsKeyArn",
  10769. },
  10770. Attr: rootAttr,
  10771. }
  10772. el := value.MemberElement(root)
  10773. el.String(*v.KmsKeyArn)
  10774. }
  10775. if len(v.SseAlgorithm) > 0 {
  10776. rootAttr := []smithyxml.Attr{}
  10777. root := smithyxml.StartElement{
  10778. Name: smithyxml.Name{
  10779. Local: "SseAlgorithm",
  10780. },
  10781. Attr: rootAttr,
  10782. }
  10783. el := value.MemberElement(root)
  10784. el.String(string(v.SseAlgorithm))
  10785. }
  10786. return nil
  10787. }
  10788. func awsRestxml_serializeDocumentMetrics(v *types.Metrics, value smithyxml.Value) error {
  10789. defer value.Close()
  10790. if v.EventThreshold != nil {
  10791. rootAttr := []smithyxml.Attr{}
  10792. root := smithyxml.StartElement{
  10793. Name: smithyxml.Name{
  10794. Local: "EventThreshold",
  10795. },
  10796. Attr: rootAttr,
  10797. }
  10798. el := value.MemberElement(root)
  10799. if err := awsRestxml_serializeDocumentReplicationTimeValue(v.EventThreshold, el); err != nil {
  10800. return err
  10801. }
  10802. }
  10803. if len(v.Status) > 0 {
  10804. rootAttr := []smithyxml.Attr{}
  10805. root := smithyxml.StartElement{
  10806. Name: smithyxml.Name{
  10807. Local: "Status",
  10808. },
  10809. Attr: rootAttr,
  10810. }
  10811. el := value.MemberElement(root)
  10812. el.String(string(v.Status))
  10813. }
  10814. return nil
  10815. }
  10816. func awsRestxml_serializeDocumentMetricsAndOperator(v *types.MetricsAndOperator, value smithyxml.Value) error {
  10817. defer value.Close()
  10818. if v.AccessPointArn != nil {
  10819. rootAttr := []smithyxml.Attr{}
  10820. root := smithyxml.StartElement{
  10821. Name: smithyxml.Name{
  10822. Local: "AccessPointArn",
  10823. },
  10824. Attr: rootAttr,
  10825. }
  10826. el := value.MemberElement(root)
  10827. el.String(*v.AccessPointArn)
  10828. }
  10829. if v.Prefix != nil {
  10830. rootAttr := []smithyxml.Attr{}
  10831. root := smithyxml.StartElement{
  10832. Name: smithyxml.Name{
  10833. Local: "Prefix",
  10834. },
  10835. Attr: rootAttr,
  10836. }
  10837. el := value.MemberElement(root)
  10838. el.String(*v.Prefix)
  10839. }
  10840. if v.Tags != nil {
  10841. rootAttr := []smithyxml.Attr{}
  10842. root := smithyxml.StartElement{
  10843. Name: smithyxml.Name{
  10844. Local: "Tag",
  10845. },
  10846. Attr: rootAttr,
  10847. }
  10848. el := value.FlattenedElement(root)
  10849. if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil {
  10850. return err
  10851. }
  10852. }
  10853. return nil
  10854. }
  10855. func awsRestxml_serializeDocumentMetricsConfiguration(v *types.MetricsConfiguration, value smithyxml.Value) error {
  10856. defer value.Close()
  10857. if v.Filter != nil {
  10858. rootAttr := []smithyxml.Attr{}
  10859. root := smithyxml.StartElement{
  10860. Name: smithyxml.Name{
  10861. Local: "Filter",
  10862. },
  10863. Attr: rootAttr,
  10864. }
  10865. el := value.MemberElement(root)
  10866. if err := awsRestxml_serializeDocumentMetricsFilter(v.Filter, el); err != nil {
  10867. return err
  10868. }
  10869. }
  10870. if v.Id != nil {
  10871. rootAttr := []smithyxml.Attr{}
  10872. root := smithyxml.StartElement{
  10873. Name: smithyxml.Name{
  10874. Local: "Id",
  10875. },
  10876. Attr: rootAttr,
  10877. }
  10878. el := value.MemberElement(root)
  10879. el.String(*v.Id)
  10880. }
  10881. return nil
  10882. }
  10883. func awsRestxml_serializeDocumentMetricsFilter(v types.MetricsFilter, value smithyxml.Value) error {
  10884. defer value.Close()
  10885. switch uv := v.(type) {
  10886. case *types.MetricsFilterMemberAccessPointArn:
  10887. customMemberNameAttr := []smithyxml.Attr{}
  10888. customMemberName := smithyxml.StartElement{
  10889. Name: smithyxml.Name{
  10890. Local: "AccessPointArn",
  10891. },
  10892. Attr: customMemberNameAttr,
  10893. }
  10894. av := value.MemberElement(customMemberName)
  10895. av.String(uv.Value)
  10896. case *types.MetricsFilterMemberAnd:
  10897. customMemberNameAttr := []smithyxml.Attr{}
  10898. customMemberName := smithyxml.StartElement{
  10899. Name: smithyxml.Name{
  10900. Local: "And",
  10901. },
  10902. Attr: customMemberNameAttr,
  10903. }
  10904. av := value.MemberElement(customMemberName)
  10905. if err := awsRestxml_serializeDocumentMetricsAndOperator(&uv.Value, av); err != nil {
  10906. return err
  10907. }
  10908. case *types.MetricsFilterMemberPrefix:
  10909. customMemberNameAttr := []smithyxml.Attr{}
  10910. customMemberName := smithyxml.StartElement{
  10911. Name: smithyxml.Name{
  10912. Local: "Prefix",
  10913. },
  10914. Attr: customMemberNameAttr,
  10915. }
  10916. av := value.MemberElement(customMemberName)
  10917. av.String(uv.Value)
  10918. case *types.MetricsFilterMemberTag:
  10919. customMemberNameAttr := []smithyxml.Attr{}
  10920. customMemberName := smithyxml.StartElement{
  10921. Name: smithyxml.Name{
  10922. Local: "Tag",
  10923. },
  10924. Attr: customMemberNameAttr,
  10925. }
  10926. av := value.MemberElement(customMemberName)
  10927. if err := awsRestxml_serializeDocumentTag(&uv.Value, av); err != nil {
  10928. return err
  10929. }
  10930. default:
  10931. return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
  10932. }
  10933. return nil
  10934. }
  10935. func awsRestxml_serializeDocumentNoncurrentVersionExpiration(v *types.NoncurrentVersionExpiration, value smithyxml.Value) error {
  10936. defer value.Close()
  10937. if v.NewerNoncurrentVersions != nil {
  10938. rootAttr := []smithyxml.Attr{}
  10939. root := smithyxml.StartElement{
  10940. Name: smithyxml.Name{
  10941. Local: "NewerNoncurrentVersions",
  10942. },
  10943. Attr: rootAttr,
  10944. }
  10945. el := value.MemberElement(root)
  10946. el.Integer(*v.NewerNoncurrentVersions)
  10947. }
  10948. if v.NoncurrentDays != nil {
  10949. rootAttr := []smithyxml.Attr{}
  10950. root := smithyxml.StartElement{
  10951. Name: smithyxml.Name{
  10952. Local: "NoncurrentDays",
  10953. },
  10954. Attr: rootAttr,
  10955. }
  10956. el := value.MemberElement(root)
  10957. el.Integer(*v.NoncurrentDays)
  10958. }
  10959. return nil
  10960. }
  10961. func awsRestxml_serializeDocumentNoncurrentVersionTransition(v *types.NoncurrentVersionTransition, value smithyxml.Value) error {
  10962. defer value.Close()
  10963. if v.NewerNoncurrentVersions != nil {
  10964. rootAttr := []smithyxml.Attr{}
  10965. root := smithyxml.StartElement{
  10966. Name: smithyxml.Name{
  10967. Local: "NewerNoncurrentVersions",
  10968. },
  10969. Attr: rootAttr,
  10970. }
  10971. el := value.MemberElement(root)
  10972. el.Integer(*v.NewerNoncurrentVersions)
  10973. }
  10974. if v.NoncurrentDays != nil {
  10975. rootAttr := []smithyxml.Attr{}
  10976. root := smithyxml.StartElement{
  10977. Name: smithyxml.Name{
  10978. Local: "NoncurrentDays",
  10979. },
  10980. Attr: rootAttr,
  10981. }
  10982. el := value.MemberElement(root)
  10983. el.Integer(*v.NoncurrentDays)
  10984. }
  10985. if len(v.StorageClass) > 0 {
  10986. rootAttr := []smithyxml.Attr{}
  10987. root := smithyxml.StartElement{
  10988. Name: smithyxml.Name{
  10989. Local: "StorageClass",
  10990. },
  10991. Attr: rootAttr,
  10992. }
  10993. el := value.MemberElement(root)
  10994. el.String(string(v.StorageClass))
  10995. }
  10996. return nil
  10997. }
  10998. func awsRestxml_serializeDocumentNoncurrentVersionTransitionList(v []types.NoncurrentVersionTransition, value smithyxml.Value) error {
  10999. var array *smithyxml.Array
  11000. if !value.IsFlattened() {
  11001. defer value.Close()
  11002. }
  11003. array = value.Array()
  11004. for i := range v {
  11005. am := array.Member()
  11006. if err := awsRestxml_serializeDocumentNoncurrentVersionTransition(&v[i], am); err != nil {
  11007. return err
  11008. }
  11009. }
  11010. return nil
  11011. }
  11012. func awsRestxml_serializeDocumentNotificationConfiguration(v *types.NotificationConfiguration, value smithyxml.Value) error {
  11013. defer value.Close()
  11014. if v.EventBridgeConfiguration != nil {
  11015. rootAttr := []smithyxml.Attr{}
  11016. root := smithyxml.StartElement{
  11017. Name: smithyxml.Name{
  11018. Local: "EventBridgeConfiguration",
  11019. },
  11020. Attr: rootAttr,
  11021. }
  11022. el := value.MemberElement(root)
  11023. if err := awsRestxml_serializeDocumentEventBridgeConfiguration(v.EventBridgeConfiguration, el); err != nil {
  11024. return err
  11025. }
  11026. }
  11027. if v.LambdaFunctionConfigurations != nil {
  11028. rootAttr := []smithyxml.Attr{}
  11029. root := smithyxml.StartElement{
  11030. Name: smithyxml.Name{
  11031. Local: "CloudFunctionConfiguration",
  11032. },
  11033. Attr: rootAttr,
  11034. }
  11035. el := value.FlattenedElement(root)
  11036. if err := awsRestxml_serializeDocumentLambdaFunctionConfigurationList(v.LambdaFunctionConfigurations, el); err != nil {
  11037. return err
  11038. }
  11039. }
  11040. if v.QueueConfigurations != nil {
  11041. rootAttr := []smithyxml.Attr{}
  11042. root := smithyxml.StartElement{
  11043. Name: smithyxml.Name{
  11044. Local: "QueueConfiguration",
  11045. },
  11046. Attr: rootAttr,
  11047. }
  11048. el := value.FlattenedElement(root)
  11049. if err := awsRestxml_serializeDocumentQueueConfigurationList(v.QueueConfigurations, el); err != nil {
  11050. return err
  11051. }
  11052. }
  11053. if v.TopicConfigurations != nil {
  11054. rootAttr := []smithyxml.Attr{}
  11055. root := smithyxml.StartElement{
  11056. Name: smithyxml.Name{
  11057. Local: "TopicConfiguration",
  11058. },
  11059. Attr: rootAttr,
  11060. }
  11061. el := value.FlattenedElement(root)
  11062. if err := awsRestxml_serializeDocumentTopicConfigurationList(v.TopicConfigurations, el); err != nil {
  11063. return err
  11064. }
  11065. }
  11066. return nil
  11067. }
  11068. func awsRestxml_serializeDocumentNotificationConfigurationFilter(v *types.NotificationConfigurationFilter, value smithyxml.Value) error {
  11069. defer value.Close()
  11070. if v.Key != nil {
  11071. rootAttr := []smithyxml.Attr{}
  11072. root := smithyxml.StartElement{
  11073. Name: smithyxml.Name{
  11074. Local: "S3Key",
  11075. },
  11076. Attr: rootAttr,
  11077. }
  11078. el := value.MemberElement(root)
  11079. if err := awsRestxml_serializeDocumentS3KeyFilter(v.Key, el); err != nil {
  11080. return err
  11081. }
  11082. }
  11083. return nil
  11084. }
  11085. func awsRestxml_serializeDocumentObjectIdentifier(v *types.ObjectIdentifier, value smithyxml.Value) error {
  11086. defer value.Close()
  11087. if v.ETag != nil {
  11088. rootAttr := []smithyxml.Attr{}
  11089. root := smithyxml.StartElement{
  11090. Name: smithyxml.Name{
  11091. Local: "ETag",
  11092. },
  11093. Attr: rootAttr,
  11094. }
  11095. el := value.MemberElement(root)
  11096. el.String(*v.ETag)
  11097. }
  11098. if v.Key != nil {
  11099. rootAttr := []smithyxml.Attr{}
  11100. root := smithyxml.StartElement{
  11101. Name: smithyxml.Name{
  11102. Local: "Key",
  11103. },
  11104. Attr: rootAttr,
  11105. }
  11106. el := value.MemberElement(root)
  11107. el.String(*v.Key)
  11108. }
  11109. if v.LastModifiedTime != nil {
  11110. rootAttr := []smithyxml.Attr{}
  11111. root := smithyxml.StartElement{
  11112. Name: smithyxml.Name{
  11113. Local: "LastModifiedTime",
  11114. },
  11115. Attr: rootAttr,
  11116. }
  11117. el := value.MemberElement(root)
  11118. el.String(smithytime.FormatHTTPDate(*v.LastModifiedTime))
  11119. }
  11120. if v.Size != nil {
  11121. rootAttr := []smithyxml.Attr{}
  11122. root := smithyxml.StartElement{
  11123. Name: smithyxml.Name{
  11124. Local: "Size",
  11125. },
  11126. Attr: rootAttr,
  11127. }
  11128. el := value.MemberElement(root)
  11129. el.Long(*v.Size)
  11130. }
  11131. if v.VersionId != nil {
  11132. rootAttr := []smithyxml.Attr{}
  11133. root := smithyxml.StartElement{
  11134. Name: smithyxml.Name{
  11135. Local: "VersionId",
  11136. },
  11137. Attr: rootAttr,
  11138. }
  11139. el := value.MemberElement(root)
  11140. el.String(*v.VersionId)
  11141. }
  11142. return nil
  11143. }
  11144. func awsRestxml_serializeDocumentObjectIdentifierList(v []types.ObjectIdentifier, value smithyxml.Value) error {
  11145. var array *smithyxml.Array
  11146. if !value.IsFlattened() {
  11147. defer value.Close()
  11148. }
  11149. array = value.Array()
  11150. for i := range v {
  11151. am := array.Member()
  11152. if err := awsRestxml_serializeDocumentObjectIdentifier(&v[i], am); err != nil {
  11153. return err
  11154. }
  11155. }
  11156. return nil
  11157. }
  11158. func awsRestxml_serializeDocumentObjectLockConfiguration(v *types.ObjectLockConfiguration, value smithyxml.Value) error {
  11159. defer value.Close()
  11160. if len(v.ObjectLockEnabled) > 0 {
  11161. rootAttr := []smithyxml.Attr{}
  11162. root := smithyxml.StartElement{
  11163. Name: smithyxml.Name{
  11164. Local: "ObjectLockEnabled",
  11165. },
  11166. Attr: rootAttr,
  11167. }
  11168. el := value.MemberElement(root)
  11169. el.String(string(v.ObjectLockEnabled))
  11170. }
  11171. if v.Rule != nil {
  11172. rootAttr := []smithyxml.Attr{}
  11173. root := smithyxml.StartElement{
  11174. Name: smithyxml.Name{
  11175. Local: "Rule",
  11176. },
  11177. Attr: rootAttr,
  11178. }
  11179. el := value.MemberElement(root)
  11180. if err := awsRestxml_serializeDocumentObjectLockRule(v.Rule, el); err != nil {
  11181. return err
  11182. }
  11183. }
  11184. return nil
  11185. }
  11186. func awsRestxml_serializeDocumentObjectLockLegalHold(v *types.ObjectLockLegalHold, value smithyxml.Value) error {
  11187. defer value.Close()
  11188. if len(v.Status) > 0 {
  11189. rootAttr := []smithyxml.Attr{}
  11190. root := smithyxml.StartElement{
  11191. Name: smithyxml.Name{
  11192. Local: "Status",
  11193. },
  11194. Attr: rootAttr,
  11195. }
  11196. el := value.MemberElement(root)
  11197. el.String(string(v.Status))
  11198. }
  11199. return nil
  11200. }
  11201. func awsRestxml_serializeDocumentObjectLockRetention(v *types.ObjectLockRetention, value smithyxml.Value) error {
  11202. defer value.Close()
  11203. if len(v.Mode) > 0 {
  11204. rootAttr := []smithyxml.Attr{}
  11205. root := smithyxml.StartElement{
  11206. Name: smithyxml.Name{
  11207. Local: "Mode",
  11208. },
  11209. Attr: rootAttr,
  11210. }
  11211. el := value.MemberElement(root)
  11212. el.String(string(v.Mode))
  11213. }
  11214. if v.RetainUntilDate != nil {
  11215. rootAttr := []smithyxml.Attr{}
  11216. root := smithyxml.StartElement{
  11217. Name: smithyxml.Name{
  11218. Local: "RetainUntilDate",
  11219. },
  11220. Attr: rootAttr,
  11221. }
  11222. el := value.MemberElement(root)
  11223. el.String(smithytime.FormatDateTime(*v.RetainUntilDate))
  11224. }
  11225. return nil
  11226. }
  11227. func awsRestxml_serializeDocumentObjectLockRule(v *types.ObjectLockRule, value smithyxml.Value) error {
  11228. defer value.Close()
  11229. if v.DefaultRetention != nil {
  11230. rootAttr := []smithyxml.Attr{}
  11231. root := smithyxml.StartElement{
  11232. Name: smithyxml.Name{
  11233. Local: "DefaultRetention",
  11234. },
  11235. Attr: rootAttr,
  11236. }
  11237. el := value.MemberElement(root)
  11238. if err := awsRestxml_serializeDocumentDefaultRetention(v.DefaultRetention, el); err != nil {
  11239. return err
  11240. }
  11241. }
  11242. return nil
  11243. }
  11244. func awsRestxml_serializeDocumentOutputLocation(v *types.OutputLocation, value smithyxml.Value) error {
  11245. defer value.Close()
  11246. if v.S3 != nil {
  11247. rootAttr := []smithyxml.Attr{}
  11248. root := smithyxml.StartElement{
  11249. Name: smithyxml.Name{
  11250. Local: "S3",
  11251. },
  11252. Attr: rootAttr,
  11253. }
  11254. el := value.MemberElement(root)
  11255. if err := awsRestxml_serializeDocumentS3Location(v.S3, el); err != nil {
  11256. return err
  11257. }
  11258. }
  11259. return nil
  11260. }
  11261. func awsRestxml_serializeDocumentOutputSerialization(v *types.OutputSerialization, value smithyxml.Value) error {
  11262. defer value.Close()
  11263. if v.CSV != nil {
  11264. rootAttr := []smithyxml.Attr{}
  11265. root := smithyxml.StartElement{
  11266. Name: smithyxml.Name{
  11267. Local: "CSV",
  11268. },
  11269. Attr: rootAttr,
  11270. }
  11271. el := value.MemberElement(root)
  11272. if err := awsRestxml_serializeDocumentCSVOutput(v.CSV, el); err != nil {
  11273. return err
  11274. }
  11275. }
  11276. if v.JSON != nil {
  11277. rootAttr := []smithyxml.Attr{}
  11278. root := smithyxml.StartElement{
  11279. Name: smithyxml.Name{
  11280. Local: "JSON",
  11281. },
  11282. Attr: rootAttr,
  11283. }
  11284. el := value.MemberElement(root)
  11285. if err := awsRestxml_serializeDocumentJSONOutput(v.JSON, el); err != nil {
  11286. return err
  11287. }
  11288. }
  11289. return nil
  11290. }
  11291. func awsRestxml_serializeDocumentOwner(v *types.Owner, value smithyxml.Value) error {
  11292. defer value.Close()
  11293. if v.DisplayName != nil {
  11294. rootAttr := []smithyxml.Attr{}
  11295. root := smithyxml.StartElement{
  11296. Name: smithyxml.Name{
  11297. Local: "DisplayName",
  11298. },
  11299. Attr: rootAttr,
  11300. }
  11301. el := value.MemberElement(root)
  11302. el.String(*v.DisplayName)
  11303. }
  11304. if v.ID != nil {
  11305. rootAttr := []smithyxml.Attr{}
  11306. root := smithyxml.StartElement{
  11307. Name: smithyxml.Name{
  11308. Local: "ID",
  11309. },
  11310. Attr: rootAttr,
  11311. }
  11312. el := value.MemberElement(root)
  11313. el.String(*v.ID)
  11314. }
  11315. return nil
  11316. }
  11317. func awsRestxml_serializeDocumentOwnershipControls(v *types.OwnershipControls, value smithyxml.Value) error {
  11318. defer value.Close()
  11319. if v.Rules != nil {
  11320. rootAttr := []smithyxml.Attr{}
  11321. root := smithyxml.StartElement{
  11322. Name: smithyxml.Name{
  11323. Local: "Rule",
  11324. },
  11325. Attr: rootAttr,
  11326. }
  11327. el := value.FlattenedElement(root)
  11328. if err := awsRestxml_serializeDocumentOwnershipControlsRules(v.Rules, el); err != nil {
  11329. return err
  11330. }
  11331. }
  11332. return nil
  11333. }
  11334. func awsRestxml_serializeDocumentOwnershipControlsRule(v *types.OwnershipControlsRule, value smithyxml.Value) error {
  11335. defer value.Close()
  11336. if len(v.ObjectOwnership) > 0 {
  11337. rootAttr := []smithyxml.Attr{}
  11338. root := smithyxml.StartElement{
  11339. Name: smithyxml.Name{
  11340. Local: "ObjectOwnership",
  11341. },
  11342. Attr: rootAttr,
  11343. }
  11344. el := value.MemberElement(root)
  11345. el.String(string(v.ObjectOwnership))
  11346. }
  11347. return nil
  11348. }
  11349. func awsRestxml_serializeDocumentOwnershipControlsRules(v []types.OwnershipControlsRule, value smithyxml.Value) error {
  11350. var array *smithyxml.Array
  11351. if !value.IsFlattened() {
  11352. defer value.Close()
  11353. }
  11354. array = value.Array()
  11355. for i := range v {
  11356. am := array.Member()
  11357. if err := awsRestxml_serializeDocumentOwnershipControlsRule(&v[i], am); err != nil {
  11358. return err
  11359. }
  11360. }
  11361. return nil
  11362. }
  11363. func awsRestxml_serializeDocumentParquetInput(v *types.ParquetInput, value smithyxml.Value) error {
  11364. defer value.Close()
  11365. return nil
  11366. }
  11367. func awsRestxml_serializeDocumentPartitionedPrefix(v *types.PartitionedPrefix, value smithyxml.Value) error {
  11368. defer value.Close()
  11369. if len(v.PartitionDateSource) > 0 {
  11370. rootAttr := []smithyxml.Attr{}
  11371. root := smithyxml.StartElement{
  11372. Name: smithyxml.Name{
  11373. Local: "PartitionDateSource",
  11374. },
  11375. Attr: rootAttr,
  11376. }
  11377. el := value.MemberElement(root)
  11378. el.String(string(v.PartitionDateSource))
  11379. }
  11380. return nil
  11381. }
  11382. func awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v *types.PublicAccessBlockConfiguration, value smithyxml.Value) error {
  11383. defer value.Close()
  11384. if v.BlockPublicAcls != nil {
  11385. rootAttr := []smithyxml.Attr{}
  11386. root := smithyxml.StartElement{
  11387. Name: smithyxml.Name{
  11388. Local: "BlockPublicAcls",
  11389. },
  11390. Attr: rootAttr,
  11391. }
  11392. el := value.MemberElement(root)
  11393. el.Boolean(*v.BlockPublicAcls)
  11394. }
  11395. if v.BlockPublicPolicy != nil {
  11396. rootAttr := []smithyxml.Attr{}
  11397. root := smithyxml.StartElement{
  11398. Name: smithyxml.Name{
  11399. Local: "BlockPublicPolicy",
  11400. },
  11401. Attr: rootAttr,
  11402. }
  11403. el := value.MemberElement(root)
  11404. el.Boolean(*v.BlockPublicPolicy)
  11405. }
  11406. if v.IgnorePublicAcls != nil {
  11407. rootAttr := []smithyxml.Attr{}
  11408. root := smithyxml.StartElement{
  11409. Name: smithyxml.Name{
  11410. Local: "IgnorePublicAcls",
  11411. },
  11412. Attr: rootAttr,
  11413. }
  11414. el := value.MemberElement(root)
  11415. el.Boolean(*v.IgnorePublicAcls)
  11416. }
  11417. if v.RestrictPublicBuckets != nil {
  11418. rootAttr := []smithyxml.Attr{}
  11419. root := smithyxml.StartElement{
  11420. Name: smithyxml.Name{
  11421. Local: "RestrictPublicBuckets",
  11422. },
  11423. Attr: rootAttr,
  11424. }
  11425. el := value.MemberElement(root)
  11426. el.Boolean(*v.RestrictPublicBuckets)
  11427. }
  11428. return nil
  11429. }
  11430. func awsRestxml_serializeDocumentQueueConfiguration(v *types.QueueConfiguration, value smithyxml.Value) error {
  11431. defer value.Close()
  11432. if v.Events != nil {
  11433. rootAttr := []smithyxml.Attr{}
  11434. root := smithyxml.StartElement{
  11435. Name: smithyxml.Name{
  11436. Local: "Event",
  11437. },
  11438. Attr: rootAttr,
  11439. }
  11440. el := value.FlattenedElement(root)
  11441. if err := awsRestxml_serializeDocumentEventList(v.Events, el); err != nil {
  11442. return err
  11443. }
  11444. }
  11445. if v.Filter != nil {
  11446. rootAttr := []smithyxml.Attr{}
  11447. root := smithyxml.StartElement{
  11448. Name: smithyxml.Name{
  11449. Local: "Filter",
  11450. },
  11451. Attr: rootAttr,
  11452. }
  11453. el := value.MemberElement(root)
  11454. if err := awsRestxml_serializeDocumentNotificationConfigurationFilter(v.Filter, el); err != nil {
  11455. return err
  11456. }
  11457. }
  11458. if v.Id != nil {
  11459. rootAttr := []smithyxml.Attr{}
  11460. root := smithyxml.StartElement{
  11461. Name: smithyxml.Name{
  11462. Local: "Id",
  11463. },
  11464. Attr: rootAttr,
  11465. }
  11466. el := value.MemberElement(root)
  11467. el.String(*v.Id)
  11468. }
  11469. if v.QueueArn != nil {
  11470. rootAttr := []smithyxml.Attr{}
  11471. root := smithyxml.StartElement{
  11472. Name: smithyxml.Name{
  11473. Local: "Queue",
  11474. },
  11475. Attr: rootAttr,
  11476. }
  11477. el := value.MemberElement(root)
  11478. el.String(*v.QueueArn)
  11479. }
  11480. return nil
  11481. }
  11482. func awsRestxml_serializeDocumentQueueConfigurationList(v []types.QueueConfiguration, value smithyxml.Value) error {
  11483. var array *smithyxml.Array
  11484. if !value.IsFlattened() {
  11485. defer value.Close()
  11486. }
  11487. array = value.Array()
  11488. for i := range v {
  11489. am := array.Member()
  11490. if err := awsRestxml_serializeDocumentQueueConfiguration(&v[i], am); err != nil {
  11491. return err
  11492. }
  11493. }
  11494. return nil
  11495. }
  11496. func awsRestxml_serializeDocumentRecordExpiration(v *types.RecordExpiration, value smithyxml.Value) error {
  11497. defer value.Close()
  11498. if v.Days != nil {
  11499. rootAttr := []smithyxml.Attr{}
  11500. root := smithyxml.StartElement{
  11501. Name: smithyxml.Name{
  11502. Local: "Days",
  11503. },
  11504. Attr: rootAttr,
  11505. }
  11506. el := value.MemberElement(root)
  11507. el.Integer(*v.Days)
  11508. }
  11509. if len(v.Expiration) > 0 {
  11510. rootAttr := []smithyxml.Attr{}
  11511. root := smithyxml.StartElement{
  11512. Name: smithyxml.Name{
  11513. Local: "Expiration",
  11514. },
  11515. Attr: rootAttr,
  11516. }
  11517. el := value.MemberElement(root)
  11518. el.String(string(v.Expiration))
  11519. }
  11520. return nil
  11521. }
  11522. func awsRestxml_serializeDocumentRedirect(v *types.Redirect, value smithyxml.Value) error {
  11523. defer value.Close()
  11524. if v.HostName != nil {
  11525. rootAttr := []smithyxml.Attr{}
  11526. root := smithyxml.StartElement{
  11527. Name: smithyxml.Name{
  11528. Local: "HostName",
  11529. },
  11530. Attr: rootAttr,
  11531. }
  11532. el := value.MemberElement(root)
  11533. el.String(*v.HostName)
  11534. }
  11535. if v.HttpRedirectCode != nil {
  11536. rootAttr := []smithyxml.Attr{}
  11537. root := smithyxml.StartElement{
  11538. Name: smithyxml.Name{
  11539. Local: "HttpRedirectCode",
  11540. },
  11541. Attr: rootAttr,
  11542. }
  11543. el := value.MemberElement(root)
  11544. el.String(*v.HttpRedirectCode)
  11545. }
  11546. if len(v.Protocol) > 0 {
  11547. rootAttr := []smithyxml.Attr{}
  11548. root := smithyxml.StartElement{
  11549. Name: smithyxml.Name{
  11550. Local: "Protocol",
  11551. },
  11552. Attr: rootAttr,
  11553. }
  11554. el := value.MemberElement(root)
  11555. el.String(string(v.Protocol))
  11556. }
  11557. if v.ReplaceKeyPrefixWith != nil {
  11558. rootAttr := []smithyxml.Attr{}
  11559. root := smithyxml.StartElement{
  11560. Name: smithyxml.Name{
  11561. Local: "ReplaceKeyPrefixWith",
  11562. },
  11563. Attr: rootAttr,
  11564. }
  11565. el := value.MemberElement(root)
  11566. el.String(*v.ReplaceKeyPrefixWith)
  11567. }
  11568. if v.ReplaceKeyWith != nil {
  11569. rootAttr := []smithyxml.Attr{}
  11570. root := smithyxml.StartElement{
  11571. Name: smithyxml.Name{
  11572. Local: "ReplaceKeyWith",
  11573. },
  11574. Attr: rootAttr,
  11575. }
  11576. el := value.MemberElement(root)
  11577. el.String(*v.ReplaceKeyWith)
  11578. }
  11579. return nil
  11580. }
  11581. func awsRestxml_serializeDocumentRedirectAllRequestsTo(v *types.RedirectAllRequestsTo, value smithyxml.Value) error {
  11582. defer value.Close()
  11583. if v.HostName != nil {
  11584. rootAttr := []smithyxml.Attr{}
  11585. root := smithyxml.StartElement{
  11586. Name: smithyxml.Name{
  11587. Local: "HostName",
  11588. },
  11589. Attr: rootAttr,
  11590. }
  11591. el := value.MemberElement(root)
  11592. el.String(*v.HostName)
  11593. }
  11594. if len(v.Protocol) > 0 {
  11595. rootAttr := []smithyxml.Attr{}
  11596. root := smithyxml.StartElement{
  11597. Name: smithyxml.Name{
  11598. Local: "Protocol",
  11599. },
  11600. Attr: rootAttr,
  11601. }
  11602. el := value.MemberElement(root)
  11603. el.String(string(v.Protocol))
  11604. }
  11605. return nil
  11606. }
  11607. func awsRestxml_serializeDocumentReplicaModifications(v *types.ReplicaModifications, value smithyxml.Value) error {
  11608. defer value.Close()
  11609. if len(v.Status) > 0 {
  11610. rootAttr := []smithyxml.Attr{}
  11611. root := smithyxml.StartElement{
  11612. Name: smithyxml.Name{
  11613. Local: "Status",
  11614. },
  11615. Attr: rootAttr,
  11616. }
  11617. el := value.MemberElement(root)
  11618. el.String(string(v.Status))
  11619. }
  11620. return nil
  11621. }
  11622. func awsRestxml_serializeDocumentReplicationConfiguration(v *types.ReplicationConfiguration, value smithyxml.Value) error {
  11623. defer value.Close()
  11624. if v.Role != nil {
  11625. rootAttr := []smithyxml.Attr{}
  11626. root := smithyxml.StartElement{
  11627. Name: smithyxml.Name{
  11628. Local: "Role",
  11629. },
  11630. Attr: rootAttr,
  11631. }
  11632. el := value.MemberElement(root)
  11633. el.String(*v.Role)
  11634. }
  11635. if v.Rules != nil {
  11636. rootAttr := []smithyxml.Attr{}
  11637. root := smithyxml.StartElement{
  11638. Name: smithyxml.Name{
  11639. Local: "Rule",
  11640. },
  11641. Attr: rootAttr,
  11642. }
  11643. el := value.FlattenedElement(root)
  11644. if err := awsRestxml_serializeDocumentReplicationRules(v.Rules, el); err != nil {
  11645. return err
  11646. }
  11647. }
  11648. return nil
  11649. }
  11650. func awsRestxml_serializeDocumentReplicationRule(v *types.ReplicationRule, value smithyxml.Value) error {
  11651. defer value.Close()
  11652. if v.DeleteMarkerReplication != nil {
  11653. rootAttr := []smithyxml.Attr{}
  11654. root := smithyxml.StartElement{
  11655. Name: smithyxml.Name{
  11656. Local: "DeleteMarkerReplication",
  11657. },
  11658. Attr: rootAttr,
  11659. }
  11660. el := value.MemberElement(root)
  11661. if err := awsRestxml_serializeDocumentDeleteMarkerReplication(v.DeleteMarkerReplication, el); err != nil {
  11662. return err
  11663. }
  11664. }
  11665. if v.Destination != nil {
  11666. rootAttr := []smithyxml.Attr{}
  11667. root := smithyxml.StartElement{
  11668. Name: smithyxml.Name{
  11669. Local: "Destination",
  11670. },
  11671. Attr: rootAttr,
  11672. }
  11673. el := value.MemberElement(root)
  11674. if err := awsRestxml_serializeDocumentDestination(v.Destination, el); err != nil {
  11675. return err
  11676. }
  11677. }
  11678. if v.ExistingObjectReplication != nil {
  11679. rootAttr := []smithyxml.Attr{}
  11680. root := smithyxml.StartElement{
  11681. Name: smithyxml.Name{
  11682. Local: "ExistingObjectReplication",
  11683. },
  11684. Attr: rootAttr,
  11685. }
  11686. el := value.MemberElement(root)
  11687. if err := awsRestxml_serializeDocumentExistingObjectReplication(v.ExistingObjectReplication, el); err != nil {
  11688. return err
  11689. }
  11690. }
  11691. if v.Filter != nil {
  11692. rootAttr := []smithyxml.Attr{}
  11693. root := smithyxml.StartElement{
  11694. Name: smithyxml.Name{
  11695. Local: "Filter",
  11696. },
  11697. Attr: rootAttr,
  11698. }
  11699. el := value.MemberElement(root)
  11700. if err := awsRestxml_serializeDocumentReplicationRuleFilter(v.Filter, el); err != nil {
  11701. return err
  11702. }
  11703. }
  11704. if v.ID != nil {
  11705. rootAttr := []smithyxml.Attr{}
  11706. root := smithyxml.StartElement{
  11707. Name: smithyxml.Name{
  11708. Local: "ID",
  11709. },
  11710. Attr: rootAttr,
  11711. }
  11712. el := value.MemberElement(root)
  11713. el.String(*v.ID)
  11714. }
  11715. if v.Prefix != nil {
  11716. rootAttr := []smithyxml.Attr{}
  11717. root := smithyxml.StartElement{
  11718. Name: smithyxml.Name{
  11719. Local: "Prefix",
  11720. },
  11721. Attr: rootAttr,
  11722. }
  11723. el := value.MemberElement(root)
  11724. el.String(*v.Prefix)
  11725. }
  11726. if v.Priority != nil {
  11727. rootAttr := []smithyxml.Attr{}
  11728. root := smithyxml.StartElement{
  11729. Name: smithyxml.Name{
  11730. Local: "Priority",
  11731. },
  11732. Attr: rootAttr,
  11733. }
  11734. el := value.MemberElement(root)
  11735. el.Integer(*v.Priority)
  11736. }
  11737. if v.SourceSelectionCriteria != nil {
  11738. rootAttr := []smithyxml.Attr{}
  11739. root := smithyxml.StartElement{
  11740. Name: smithyxml.Name{
  11741. Local: "SourceSelectionCriteria",
  11742. },
  11743. Attr: rootAttr,
  11744. }
  11745. el := value.MemberElement(root)
  11746. if err := awsRestxml_serializeDocumentSourceSelectionCriteria(v.SourceSelectionCriteria, el); err != nil {
  11747. return err
  11748. }
  11749. }
  11750. if len(v.Status) > 0 {
  11751. rootAttr := []smithyxml.Attr{}
  11752. root := smithyxml.StartElement{
  11753. Name: smithyxml.Name{
  11754. Local: "Status",
  11755. },
  11756. Attr: rootAttr,
  11757. }
  11758. el := value.MemberElement(root)
  11759. el.String(string(v.Status))
  11760. }
  11761. return nil
  11762. }
  11763. func awsRestxml_serializeDocumentReplicationRuleAndOperator(v *types.ReplicationRuleAndOperator, value smithyxml.Value) error {
  11764. defer value.Close()
  11765. if v.Prefix != nil {
  11766. rootAttr := []smithyxml.Attr{}
  11767. root := smithyxml.StartElement{
  11768. Name: smithyxml.Name{
  11769. Local: "Prefix",
  11770. },
  11771. Attr: rootAttr,
  11772. }
  11773. el := value.MemberElement(root)
  11774. el.String(*v.Prefix)
  11775. }
  11776. if v.Tags != nil {
  11777. rootAttr := []smithyxml.Attr{}
  11778. root := smithyxml.StartElement{
  11779. Name: smithyxml.Name{
  11780. Local: "Tag",
  11781. },
  11782. Attr: rootAttr,
  11783. }
  11784. el := value.FlattenedElement(root)
  11785. if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil {
  11786. return err
  11787. }
  11788. }
  11789. return nil
  11790. }
  11791. func awsRestxml_serializeDocumentReplicationRuleFilter(v *types.ReplicationRuleFilter, value smithyxml.Value) error {
  11792. defer value.Close()
  11793. if v.And != nil {
  11794. rootAttr := []smithyxml.Attr{}
  11795. root := smithyxml.StartElement{
  11796. Name: smithyxml.Name{
  11797. Local: "And",
  11798. },
  11799. Attr: rootAttr,
  11800. }
  11801. el := value.MemberElement(root)
  11802. if err := awsRestxml_serializeDocumentReplicationRuleAndOperator(v.And, el); err != nil {
  11803. return err
  11804. }
  11805. }
  11806. if v.Prefix != nil {
  11807. rootAttr := []smithyxml.Attr{}
  11808. root := smithyxml.StartElement{
  11809. Name: smithyxml.Name{
  11810. Local: "Prefix",
  11811. },
  11812. Attr: rootAttr,
  11813. }
  11814. el := value.MemberElement(root)
  11815. el.String(*v.Prefix)
  11816. }
  11817. if v.Tag != nil {
  11818. rootAttr := []smithyxml.Attr{}
  11819. root := smithyxml.StartElement{
  11820. Name: smithyxml.Name{
  11821. Local: "Tag",
  11822. },
  11823. Attr: rootAttr,
  11824. }
  11825. el := value.MemberElement(root)
  11826. if err := awsRestxml_serializeDocumentTag(v.Tag, el); err != nil {
  11827. return err
  11828. }
  11829. }
  11830. return nil
  11831. }
  11832. func awsRestxml_serializeDocumentReplicationRules(v []types.ReplicationRule, value smithyxml.Value) error {
  11833. var array *smithyxml.Array
  11834. if !value.IsFlattened() {
  11835. defer value.Close()
  11836. }
  11837. array = value.Array()
  11838. for i := range v {
  11839. am := array.Member()
  11840. if err := awsRestxml_serializeDocumentReplicationRule(&v[i], am); err != nil {
  11841. return err
  11842. }
  11843. }
  11844. return nil
  11845. }
  11846. func awsRestxml_serializeDocumentReplicationTime(v *types.ReplicationTime, value smithyxml.Value) error {
  11847. defer value.Close()
  11848. if len(v.Status) > 0 {
  11849. rootAttr := []smithyxml.Attr{}
  11850. root := smithyxml.StartElement{
  11851. Name: smithyxml.Name{
  11852. Local: "Status",
  11853. },
  11854. Attr: rootAttr,
  11855. }
  11856. el := value.MemberElement(root)
  11857. el.String(string(v.Status))
  11858. }
  11859. if v.Time != nil {
  11860. rootAttr := []smithyxml.Attr{}
  11861. root := smithyxml.StartElement{
  11862. Name: smithyxml.Name{
  11863. Local: "Time",
  11864. },
  11865. Attr: rootAttr,
  11866. }
  11867. el := value.MemberElement(root)
  11868. if err := awsRestxml_serializeDocumentReplicationTimeValue(v.Time, el); err != nil {
  11869. return err
  11870. }
  11871. }
  11872. return nil
  11873. }
  11874. func awsRestxml_serializeDocumentReplicationTimeValue(v *types.ReplicationTimeValue, value smithyxml.Value) error {
  11875. defer value.Close()
  11876. if v.Minutes != nil {
  11877. rootAttr := []smithyxml.Attr{}
  11878. root := smithyxml.StartElement{
  11879. Name: smithyxml.Name{
  11880. Local: "Minutes",
  11881. },
  11882. Attr: rootAttr,
  11883. }
  11884. el := value.MemberElement(root)
  11885. el.Integer(*v.Minutes)
  11886. }
  11887. return nil
  11888. }
  11889. func awsRestxml_serializeDocumentRequestPaymentConfiguration(v *types.RequestPaymentConfiguration, value smithyxml.Value) error {
  11890. defer value.Close()
  11891. if len(v.Payer) > 0 {
  11892. rootAttr := []smithyxml.Attr{}
  11893. root := smithyxml.StartElement{
  11894. Name: smithyxml.Name{
  11895. Local: "Payer",
  11896. },
  11897. Attr: rootAttr,
  11898. }
  11899. el := value.MemberElement(root)
  11900. el.String(string(v.Payer))
  11901. }
  11902. return nil
  11903. }
  11904. func awsRestxml_serializeDocumentRequestProgress(v *types.RequestProgress, value smithyxml.Value) error {
  11905. defer value.Close()
  11906. if v.Enabled != nil {
  11907. rootAttr := []smithyxml.Attr{}
  11908. root := smithyxml.StartElement{
  11909. Name: smithyxml.Name{
  11910. Local: "Enabled",
  11911. },
  11912. Attr: rootAttr,
  11913. }
  11914. el := value.MemberElement(root)
  11915. el.Boolean(*v.Enabled)
  11916. }
  11917. return nil
  11918. }
  11919. func awsRestxml_serializeDocumentRestoreRequest(v *types.RestoreRequest, value smithyxml.Value) error {
  11920. defer value.Close()
  11921. if v.Days != nil {
  11922. rootAttr := []smithyxml.Attr{}
  11923. root := smithyxml.StartElement{
  11924. Name: smithyxml.Name{
  11925. Local: "Days",
  11926. },
  11927. Attr: rootAttr,
  11928. }
  11929. el := value.MemberElement(root)
  11930. el.Integer(*v.Days)
  11931. }
  11932. if v.Description != nil {
  11933. rootAttr := []smithyxml.Attr{}
  11934. root := smithyxml.StartElement{
  11935. Name: smithyxml.Name{
  11936. Local: "Description",
  11937. },
  11938. Attr: rootAttr,
  11939. }
  11940. el := value.MemberElement(root)
  11941. el.String(*v.Description)
  11942. }
  11943. if v.GlacierJobParameters != nil {
  11944. rootAttr := []smithyxml.Attr{}
  11945. root := smithyxml.StartElement{
  11946. Name: smithyxml.Name{
  11947. Local: "GlacierJobParameters",
  11948. },
  11949. Attr: rootAttr,
  11950. }
  11951. el := value.MemberElement(root)
  11952. if err := awsRestxml_serializeDocumentGlacierJobParameters(v.GlacierJobParameters, el); err != nil {
  11953. return err
  11954. }
  11955. }
  11956. if v.OutputLocation != nil {
  11957. rootAttr := []smithyxml.Attr{}
  11958. root := smithyxml.StartElement{
  11959. Name: smithyxml.Name{
  11960. Local: "OutputLocation",
  11961. },
  11962. Attr: rootAttr,
  11963. }
  11964. el := value.MemberElement(root)
  11965. if err := awsRestxml_serializeDocumentOutputLocation(v.OutputLocation, el); err != nil {
  11966. return err
  11967. }
  11968. }
  11969. if v.SelectParameters != nil {
  11970. rootAttr := []smithyxml.Attr{}
  11971. root := smithyxml.StartElement{
  11972. Name: smithyxml.Name{
  11973. Local: "SelectParameters",
  11974. },
  11975. Attr: rootAttr,
  11976. }
  11977. el := value.MemberElement(root)
  11978. if err := awsRestxml_serializeDocumentSelectParameters(v.SelectParameters, el); err != nil {
  11979. return err
  11980. }
  11981. }
  11982. if len(v.Tier) > 0 {
  11983. rootAttr := []smithyxml.Attr{}
  11984. root := smithyxml.StartElement{
  11985. Name: smithyxml.Name{
  11986. Local: "Tier",
  11987. },
  11988. Attr: rootAttr,
  11989. }
  11990. el := value.MemberElement(root)
  11991. el.String(string(v.Tier))
  11992. }
  11993. if len(v.Type) > 0 {
  11994. rootAttr := []smithyxml.Attr{}
  11995. root := smithyxml.StartElement{
  11996. Name: smithyxml.Name{
  11997. Local: "Type",
  11998. },
  11999. Attr: rootAttr,
  12000. }
  12001. el := value.MemberElement(root)
  12002. el.String(string(v.Type))
  12003. }
  12004. return nil
  12005. }
  12006. func awsRestxml_serializeDocumentRoutingRule(v *types.RoutingRule, value smithyxml.Value) error {
  12007. defer value.Close()
  12008. if v.Condition != nil {
  12009. rootAttr := []smithyxml.Attr{}
  12010. root := smithyxml.StartElement{
  12011. Name: smithyxml.Name{
  12012. Local: "Condition",
  12013. },
  12014. Attr: rootAttr,
  12015. }
  12016. el := value.MemberElement(root)
  12017. if err := awsRestxml_serializeDocumentCondition(v.Condition, el); err != nil {
  12018. return err
  12019. }
  12020. }
  12021. if v.Redirect != nil {
  12022. rootAttr := []smithyxml.Attr{}
  12023. root := smithyxml.StartElement{
  12024. Name: smithyxml.Name{
  12025. Local: "Redirect",
  12026. },
  12027. Attr: rootAttr,
  12028. }
  12029. el := value.MemberElement(root)
  12030. if err := awsRestxml_serializeDocumentRedirect(v.Redirect, el); err != nil {
  12031. return err
  12032. }
  12033. }
  12034. return nil
  12035. }
  12036. func awsRestxml_serializeDocumentRoutingRules(v []types.RoutingRule, value smithyxml.Value) error {
  12037. var array *smithyxml.Array
  12038. if !value.IsFlattened() {
  12039. defer value.Close()
  12040. }
  12041. customMemberNameAttr := []smithyxml.Attr{}
  12042. customMemberName := smithyxml.StartElement{
  12043. Name: smithyxml.Name{
  12044. Local: "RoutingRule",
  12045. },
  12046. Attr: customMemberNameAttr,
  12047. }
  12048. array = value.ArrayWithCustomName(customMemberName)
  12049. for i := range v {
  12050. am := array.Member()
  12051. if err := awsRestxml_serializeDocumentRoutingRule(&v[i], am); err != nil {
  12052. return err
  12053. }
  12054. }
  12055. return nil
  12056. }
  12057. func awsRestxml_serializeDocumentS3KeyFilter(v *types.S3KeyFilter, value smithyxml.Value) error {
  12058. defer value.Close()
  12059. if v.FilterRules != nil {
  12060. rootAttr := []smithyxml.Attr{}
  12061. root := smithyxml.StartElement{
  12062. Name: smithyxml.Name{
  12063. Local: "FilterRule",
  12064. },
  12065. Attr: rootAttr,
  12066. }
  12067. el := value.FlattenedElement(root)
  12068. if err := awsRestxml_serializeDocumentFilterRuleList(v.FilterRules, el); err != nil {
  12069. return err
  12070. }
  12071. }
  12072. return nil
  12073. }
  12074. func awsRestxml_serializeDocumentS3Location(v *types.S3Location, value smithyxml.Value) error {
  12075. defer value.Close()
  12076. if v.AccessControlList != nil {
  12077. rootAttr := []smithyxml.Attr{}
  12078. root := smithyxml.StartElement{
  12079. Name: smithyxml.Name{
  12080. Local: "AccessControlList",
  12081. },
  12082. Attr: rootAttr,
  12083. }
  12084. el := value.MemberElement(root)
  12085. if err := awsRestxml_serializeDocumentGrants(v.AccessControlList, el); err != nil {
  12086. return err
  12087. }
  12088. }
  12089. if v.BucketName != nil {
  12090. rootAttr := []smithyxml.Attr{}
  12091. root := smithyxml.StartElement{
  12092. Name: smithyxml.Name{
  12093. Local: "BucketName",
  12094. },
  12095. Attr: rootAttr,
  12096. }
  12097. el := value.MemberElement(root)
  12098. el.String(*v.BucketName)
  12099. }
  12100. if len(v.CannedACL) > 0 {
  12101. rootAttr := []smithyxml.Attr{}
  12102. root := smithyxml.StartElement{
  12103. Name: smithyxml.Name{
  12104. Local: "CannedACL",
  12105. },
  12106. Attr: rootAttr,
  12107. }
  12108. el := value.MemberElement(root)
  12109. el.String(string(v.CannedACL))
  12110. }
  12111. if v.Encryption != nil {
  12112. rootAttr := []smithyxml.Attr{}
  12113. root := smithyxml.StartElement{
  12114. Name: smithyxml.Name{
  12115. Local: "Encryption",
  12116. },
  12117. Attr: rootAttr,
  12118. }
  12119. el := value.MemberElement(root)
  12120. if err := awsRestxml_serializeDocumentEncryption(v.Encryption, el); err != nil {
  12121. return err
  12122. }
  12123. }
  12124. if v.Prefix != nil {
  12125. rootAttr := []smithyxml.Attr{}
  12126. root := smithyxml.StartElement{
  12127. Name: smithyxml.Name{
  12128. Local: "Prefix",
  12129. },
  12130. Attr: rootAttr,
  12131. }
  12132. el := value.MemberElement(root)
  12133. el.String(*v.Prefix)
  12134. }
  12135. if len(v.StorageClass) > 0 {
  12136. rootAttr := []smithyxml.Attr{}
  12137. root := smithyxml.StartElement{
  12138. Name: smithyxml.Name{
  12139. Local: "StorageClass",
  12140. },
  12141. Attr: rootAttr,
  12142. }
  12143. el := value.MemberElement(root)
  12144. el.String(string(v.StorageClass))
  12145. }
  12146. if v.Tagging != nil {
  12147. rootAttr := []smithyxml.Attr{}
  12148. root := smithyxml.StartElement{
  12149. Name: smithyxml.Name{
  12150. Local: "Tagging",
  12151. },
  12152. Attr: rootAttr,
  12153. }
  12154. el := value.MemberElement(root)
  12155. if err := awsRestxml_serializeDocumentTagging(v.Tagging, el); err != nil {
  12156. return err
  12157. }
  12158. }
  12159. if v.UserMetadata != nil {
  12160. rootAttr := []smithyxml.Attr{}
  12161. root := smithyxml.StartElement{
  12162. Name: smithyxml.Name{
  12163. Local: "UserMetadata",
  12164. },
  12165. Attr: rootAttr,
  12166. }
  12167. el := value.MemberElement(root)
  12168. if err := awsRestxml_serializeDocumentUserMetadata(v.UserMetadata, el); err != nil {
  12169. return err
  12170. }
  12171. }
  12172. return nil
  12173. }
  12174. func awsRestxml_serializeDocumentS3TablesDestination(v *types.S3TablesDestination, value smithyxml.Value) error {
  12175. defer value.Close()
  12176. if v.TableBucketArn != nil {
  12177. rootAttr := []smithyxml.Attr{}
  12178. root := smithyxml.StartElement{
  12179. Name: smithyxml.Name{
  12180. Local: "TableBucketArn",
  12181. },
  12182. Attr: rootAttr,
  12183. }
  12184. el := value.MemberElement(root)
  12185. el.String(*v.TableBucketArn)
  12186. }
  12187. if v.TableName != nil {
  12188. rootAttr := []smithyxml.Attr{}
  12189. root := smithyxml.StartElement{
  12190. Name: smithyxml.Name{
  12191. Local: "TableName",
  12192. },
  12193. Attr: rootAttr,
  12194. }
  12195. el := value.MemberElement(root)
  12196. el.String(*v.TableName)
  12197. }
  12198. return nil
  12199. }
  12200. func awsRestxml_serializeDocumentScanRange(v *types.ScanRange, value smithyxml.Value) error {
  12201. defer value.Close()
  12202. if v.End != nil {
  12203. rootAttr := []smithyxml.Attr{}
  12204. root := smithyxml.StartElement{
  12205. Name: smithyxml.Name{
  12206. Local: "End",
  12207. },
  12208. Attr: rootAttr,
  12209. }
  12210. el := value.MemberElement(root)
  12211. el.Long(*v.End)
  12212. }
  12213. if v.Start != nil {
  12214. rootAttr := []smithyxml.Attr{}
  12215. root := smithyxml.StartElement{
  12216. Name: smithyxml.Name{
  12217. Local: "Start",
  12218. },
  12219. Attr: rootAttr,
  12220. }
  12221. el := value.MemberElement(root)
  12222. el.Long(*v.Start)
  12223. }
  12224. return nil
  12225. }
  12226. func awsRestxml_serializeDocumentSelectParameters(v *types.SelectParameters, value smithyxml.Value) error {
  12227. defer value.Close()
  12228. if v.Expression != nil {
  12229. rootAttr := []smithyxml.Attr{}
  12230. root := smithyxml.StartElement{
  12231. Name: smithyxml.Name{
  12232. Local: "Expression",
  12233. },
  12234. Attr: rootAttr,
  12235. }
  12236. el := value.MemberElement(root)
  12237. el.String(*v.Expression)
  12238. }
  12239. if len(v.ExpressionType) > 0 {
  12240. rootAttr := []smithyxml.Attr{}
  12241. root := smithyxml.StartElement{
  12242. Name: smithyxml.Name{
  12243. Local: "ExpressionType",
  12244. },
  12245. Attr: rootAttr,
  12246. }
  12247. el := value.MemberElement(root)
  12248. el.String(string(v.ExpressionType))
  12249. }
  12250. if v.InputSerialization != nil {
  12251. rootAttr := []smithyxml.Attr{}
  12252. root := smithyxml.StartElement{
  12253. Name: smithyxml.Name{
  12254. Local: "InputSerialization",
  12255. },
  12256. Attr: rootAttr,
  12257. }
  12258. el := value.MemberElement(root)
  12259. if err := awsRestxml_serializeDocumentInputSerialization(v.InputSerialization, el); err != nil {
  12260. return err
  12261. }
  12262. }
  12263. if v.OutputSerialization != nil {
  12264. rootAttr := []smithyxml.Attr{}
  12265. root := smithyxml.StartElement{
  12266. Name: smithyxml.Name{
  12267. Local: "OutputSerialization",
  12268. },
  12269. Attr: rootAttr,
  12270. }
  12271. el := value.MemberElement(root)
  12272. if err := awsRestxml_serializeDocumentOutputSerialization(v.OutputSerialization, el); err != nil {
  12273. return err
  12274. }
  12275. }
  12276. return nil
  12277. }
  12278. func awsRestxml_serializeDocumentServerSideEncryptionByDefault(v *types.ServerSideEncryptionByDefault, value smithyxml.Value) error {
  12279. defer value.Close()
  12280. if v.KMSMasterKeyID != nil {
  12281. rootAttr := []smithyxml.Attr{}
  12282. root := smithyxml.StartElement{
  12283. Name: smithyxml.Name{
  12284. Local: "KMSMasterKeyID",
  12285. },
  12286. Attr: rootAttr,
  12287. }
  12288. el := value.MemberElement(root)
  12289. el.String(*v.KMSMasterKeyID)
  12290. }
  12291. if len(v.SSEAlgorithm) > 0 {
  12292. rootAttr := []smithyxml.Attr{}
  12293. root := smithyxml.StartElement{
  12294. Name: smithyxml.Name{
  12295. Local: "SSEAlgorithm",
  12296. },
  12297. Attr: rootAttr,
  12298. }
  12299. el := value.MemberElement(root)
  12300. el.String(string(v.SSEAlgorithm))
  12301. }
  12302. return nil
  12303. }
  12304. func awsRestxml_serializeDocumentServerSideEncryptionConfiguration(v *types.ServerSideEncryptionConfiguration, value smithyxml.Value) error {
  12305. defer value.Close()
  12306. if v.Rules != nil {
  12307. rootAttr := []smithyxml.Attr{}
  12308. root := smithyxml.StartElement{
  12309. Name: smithyxml.Name{
  12310. Local: "Rule",
  12311. },
  12312. Attr: rootAttr,
  12313. }
  12314. el := value.FlattenedElement(root)
  12315. if err := awsRestxml_serializeDocumentServerSideEncryptionRules(v.Rules, el); err != nil {
  12316. return err
  12317. }
  12318. }
  12319. return nil
  12320. }
  12321. func awsRestxml_serializeDocumentServerSideEncryptionRule(v *types.ServerSideEncryptionRule, value smithyxml.Value) error {
  12322. defer value.Close()
  12323. if v.ApplyServerSideEncryptionByDefault != nil {
  12324. rootAttr := []smithyxml.Attr{}
  12325. root := smithyxml.StartElement{
  12326. Name: smithyxml.Name{
  12327. Local: "ApplyServerSideEncryptionByDefault",
  12328. },
  12329. Attr: rootAttr,
  12330. }
  12331. el := value.MemberElement(root)
  12332. if err := awsRestxml_serializeDocumentServerSideEncryptionByDefault(v.ApplyServerSideEncryptionByDefault, el); err != nil {
  12333. return err
  12334. }
  12335. }
  12336. if v.BucketKeyEnabled != nil {
  12337. rootAttr := []smithyxml.Attr{}
  12338. root := smithyxml.StartElement{
  12339. Name: smithyxml.Name{
  12340. Local: "BucketKeyEnabled",
  12341. },
  12342. Attr: rootAttr,
  12343. }
  12344. el := value.MemberElement(root)
  12345. el.Boolean(*v.BucketKeyEnabled)
  12346. }
  12347. return nil
  12348. }
  12349. func awsRestxml_serializeDocumentServerSideEncryptionRules(v []types.ServerSideEncryptionRule, value smithyxml.Value) error {
  12350. var array *smithyxml.Array
  12351. if !value.IsFlattened() {
  12352. defer value.Close()
  12353. }
  12354. array = value.Array()
  12355. for i := range v {
  12356. am := array.Member()
  12357. if err := awsRestxml_serializeDocumentServerSideEncryptionRule(&v[i], am); err != nil {
  12358. return err
  12359. }
  12360. }
  12361. return nil
  12362. }
  12363. func awsRestxml_serializeDocumentSimplePrefix(v *types.SimplePrefix, value smithyxml.Value) error {
  12364. defer value.Close()
  12365. return nil
  12366. }
  12367. func awsRestxml_serializeDocumentSourceSelectionCriteria(v *types.SourceSelectionCriteria, value smithyxml.Value) error {
  12368. defer value.Close()
  12369. if v.ReplicaModifications != nil {
  12370. rootAttr := []smithyxml.Attr{}
  12371. root := smithyxml.StartElement{
  12372. Name: smithyxml.Name{
  12373. Local: "ReplicaModifications",
  12374. },
  12375. Attr: rootAttr,
  12376. }
  12377. el := value.MemberElement(root)
  12378. if err := awsRestxml_serializeDocumentReplicaModifications(v.ReplicaModifications, el); err != nil {
  12379. return err
  12380. }
  12381. }
  12382. if v.SseKmsEncryptedObjects != nil {
  12383. rootAttr := []smithyxml.Attr{}
  12384. root := smithyxml.StartElement{
  12385. Name: smithyxml.Name{
  12386. Local: "SseKmsEncryptedObjects",
  12387. },
  12388. Attr: rootAttr,
  12389. }
  12390. el := value.MemberElement(root)
  12391. if err := awsRestxml_serializeDocumentSseKmsEncryptedObjects(v.SseKmsEncryptedObjects, el); err != nil {
  12392. return err
  12393. }
  12394. }
  12395. return nil
  12396. }
  12397. func awsRestxml_serializeDocumentSSEKMS(v *types.SSEKMS, value smithyxml.Value) error {
  12398. defer value.Close()
  12399. if v.KeyId != nil {
  12400. rootAttr := []smithyxml.Attr{}
  12401. root := smithyxml.StartElement{
  12402. Name: smithyxml.Name{
  12403. Local: "KeyId",
  12404. },
  12405. Attr: rootAttr,
  12406. }
  12407. el := value.MemberElement(root)
  12408. el.String(*v.KeyId)
  12409. }
  12410. return nil
  12411. }
  12412. func awsRestxml_serializeDocumentSseKmsEncryptedObjects(v *types.SseKmsEncryptedObjects, value smithyxml.Value) error {
  12413. defer value.Close()
  12414. if len(v.Status) > 0 {
  12415. rootAttr := []smithyxml.Attr{}
  12416. root := smithyxml.StartElement{
  12417. Name: smithyxml.Name{
  12418. Local: "Status",
  12419. },
  12420. Attr: rootAttr,
  12421. }
  12422. el := value.MemberElement(root)
  12423. el.String(string(v.Status))
  12424. }
  12425. return nil
  12426. }
  12427. func awsRestxml_serializeDocumentSSES3(v *types.SSES3, value smithyxml.Value) error {
  12428. defer value.Close()
  12429. return nil
  12430. }
  12431. func awsRestxml_serializeDocumentStorageClassAnalysis(v *types.StorageClassAnalysis, value smithyxml.Value) error {
  12432. defer value.Close()
  12433. if v.DataExport != nil {
  12434. rootAttr := []smithyxml.Attr{}
  12435. root := smithyxml.StartElement{
  12436. Name: smithyxml.Name{
  12437. Local: "DataExport",
  12438. },
  12439. Attr: rootAttr,
  12440. }
  12441. el := value.MemberElement(root)
  12442. if err := awsRestxml_serializeDocumentStorageClassAnalysisDataExport(v.DataExport, el); err != nil {
  12443. return err
  12444. }
  12445. }
  12446. return nil
  12447. }
  12448. func awsRestxml_serializeDocumentStorageClassAnalysisDataExport(v *types.StorageClassAnalysisDataExport, value smithyxml.Value) error {
  12449. defer value.Close()
  12450. if v.Destination != nil {
  12451. rootAttr := []smithyxml.Attr{}
  12452. root := smithyxml.StartElement{
  12453. Name: smithyxml.Name{
  12454. Local: "Destination",
  12455. },
  12456. Attr: rootAttr,
  12457. }
  12458. el := value.MemberElement(root)
  12459. if err := awsRestxml_serializeDocumentAnalyticsExportDestination(v.Destination, el); err != nil {
  12460. return err
  12461. }
  12462. }
  12463. if len(v.OutputSchemaVersion) > 0 {
  12464. rootAttr := []smithyxml.Attr{}
  12465. root := smithyxml.StartElement{
  12466. Name: smithyxml.Name{
  12467. Local: "OutputSchemaVersion",
  12468. },
  12469. Attr: rootAttr,
  12470. }
  12471. el := value.MemberElement(root)
  12472. el.String(string(v.OutputSchemaVersion))
  12473. }
  12474. return nil
  12475. }
  12476. func awsRestxml_serializeDocumentTag(v *types.Tag, value smithyxml.Value) error {
  12477. defer value.Close()
  12478. if v.Key != nil {
  12479. rootAttr := []smithyxml.Attr{}
  12480. root := smithyxml.StartElement{
  12481. Name: smithyxml.Name{
  12482. Local: "Key",
  12483. },
  12484. Attr: rootAttr,
  12485. }
  12486. el := value.MemberElement(root)
  12487. el.String(*v.Key)
  12488. }
  12489. if v.Value != nil {
  12490. rootAttr := []smithyxml.Attr{}
  12491. root := smithyxml.StartElement{
  12492. Name: smithyxml.Name{
  12493. Local: "Value",
  12494. },
  12495. Attr: rootAttr,
  12496. }
  12497. el := value.MemberElement(root)
  12498. el.String(*v.Value)
  12499. }
  12500. return nil
  12501. }
  12502. func awsRestxml_serializeDocumentTagging(v *types.Tagging, value smithyxml.Value) error {
  12503. defer value.Close()
  12504. if v.TagSet != nil {
  12505. rootAttr := []smithyxml.Attr{}
  12506. root := smithyxml.StartElement{
  12507. Name: smithyxml.Name{
  12508. Local: "TagSet",
  12509. },
  12510. Attr: rootAttr,
  12511. }
  12512. el := value.MemberElement(root)
  12513. if err := awsRestxml_serializeDocumentTagSet(v.TagSet, el); err != nil {
  12514. return err
  12515. }
  12516. }
  12517. return nil
  12518. }
  12519. func awsRestxml_serializeDocumentTagSet(v []types.Tag, value smithyxml.Value) error {
  12520. var array *smithyxml.Array
  12521. if !value.IsFlattened() {
  12522. defer value.Close()
  12523. }
  12524. customMemberNameAttr := []smithyxml.Attr{}
  12525. customMemberName := smithyxml.StartElement{
  12526. Name: smithyxml.Name{
  12527. Local: "Tag",
  12528. },
  12529. Attr: customMemberNameAttr,
  12530. }
  12531. array = value.ArrayWithCustomName(customMemberName)
  12532. for i := range v {
  12533. am := array.Member()
  12534. if err := awsRestxml_serializeDocumentTag(&v[i], am); err != nil {
  12535. return err
  12536. }
  12537. }
  12538. return nil
  12539. }
  12540. func awsRestxml_serializeDocumentTargetGrant(v *types.TargetGrant, value smithyxml.Value) error {
  12541. defer value.Close()
  12542. if v.Grantee != nil {
  12543. rootAttr := []smithyxml.Attr{}
  12544. rootAttr = append(rootAttr, smithyxml.NewNamespaceAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance"))
  12545. if len(v.Grantee.Type) > 0 {
  12546. var av string
  12547. av = string(v.Grantee.Type)
  12548. rootAttr = append(rootAttr, smithyxml.NewAttribute("xsi:type", av))
  12549. }
  12550. root := smithyxml.StartElement{
  12551. Name: smithyxml.Name{
  12552. Local: "Grantee",
  12553. },
  12554. Attr: rootAttr,
  12555. }
  12556. el := value.MemberElement(root)
  12557. if err := awsRestxml_serializeDocumentGrantee(v.Grantee, el); err != nil {
  12558. return err
  12559. }
  12560. }
  12561. if len(v.Permission) > 0 {
  12562. rootAttr := []smithyxml.Attr{}
  12563. root := smithyxml.StartElement{
  12564. Name: smithyxml.Name{
  12565. Local: "Permission",
  12566. },
  12567. Attr: rootAttr,
  12568. }
  12569. el := value.MemberElement(root)
  12570. el.String(string(v.Permission))
  12571. }
  12572. return nil
  12573. }
  12574. func awsRestxml_serializeDocumentTargetGrants(v []types.TargetGrant, value smithyxml.Value) error {
  12575. var array *smithyxml.Array
  12576. if !value.IsFlattened() {
  12577. defer value.Close()
  12578. }
  12579. customMemberNameAttr := []smithyxml.Attr{}
  12580. customMemberName := smithyxml.StartElement{
  12581. Name: smithyxml.Name{
  12582. Local: "Grant",
  12583. },
  12584. Attr: customMemberNameAttr,
  12585. }
  12586. array = value.ArrayWithCustomName(customMemberName)
  12587. for i := range v {
  12588. am := array.Member()
  12589. if err := awsRestxml_serializeDocumentTargetGrant(&v[i], am); err != nil {
  12590. return err
  12591. }
  12592. }
  12593. return nil
  12594. }
  12595. func awsRestxml_serializeDocumentTargetObjectKeyFormat(v *types.TargetObjectKeyFormat, value smithyxml.Value) error {
  12596. defer value.Close()
  12597. if v.PartitionedPrefix != nil {
  12598. rootAttr := []smithyxml.Attr{}
  12599. root := smithyxml.StartElement{
  12600. Name: smithyxml.Name{
  12601. Local: "PartitionedPrefix",
  12602. },
  12603. Attr: rootAttr,
  12604. }
  12605. el := value.MemberElement(root)
  12606. if err := awsRestxml_serializeDocumentPartitionedPrefix(v.PartitionedPrefix, el); err != nil {
  12607. return err
  12608. }
  12609. }
  12610. if v.SimplePrefix != nil {
  12611. rootAttr := []smithyxml.Attr{}
  12612. root := smithyxml.StartElement{
  12613. Name: smithyxml.Name{
  12614. Local: "SimplePrefix",
  12615. },
  12616. Attr: rootAttr,
  12617. }
  12618. el := value.MemberElement(root)
  12619. if err := awsRestxml_serializeDocumentSimplePrefix(v.SimplePrefix, el); err != nil {
  12620. return err
  12621. }
  12622. }
  12623. return nil
  12624. }
  12625. func awsRestxml_serializeDocumentTiering(v *types.Tiering, value smithyxml.Value) error {
  12626. defer value.Close()
  12627. if len(v.AccessTier) > 0 {
  12628. rootAttr := []smithyxml.Attr{}
  12629. root := smithyxml.StartElement{
  12630. Name: smithyxml.Name{
  12631. Local: "AccessTier",
  12632. },
  12633. Attr: rootAttr,
  12634. }
  12635. el := value.MemberElement(root)
  12636. el.String(string(v.AccessTier))
  12637. }
  12638. if v.Days != nil {
  12639. rootAttr := []smithyxml.Attr{}
  12640. root := smithyxml.StartElement{
  12641. Name: smithyxml.Name{
  12642. Local: "Days",
  12643. },
  12644. Attr: rootAttr,
  12645. }
  12646. el := value.MemberElement(root)
  12647. el.Integer(*v.Days)
  12648. }
  12649. return nil
  12650. }
  12651. func awsRestxml_serializeDocumentTieringList(v []types.Tiering, value smithyxml.Value) error {
  12652. var array *smithyxml.Array
  12653. if !value.IsFlattened() {
  12654. defer value.Close()
  12655. }
  12656. array = value.Array()
  12657. for i := range v {
  12658. am := array.Member()
  12659. if err := awsRestxml_serializeDocumentTiering(&v[i], am); err != nil {
  12660. return err
  12661. }
  12662. }
  12663. return nil
  12664. }
  12665. func awsRestxml_serializeDocumentTopicConfiguration(v *types.TopicConfiguration, value smithyxml.Value) error {
  12666. defer value.Close()
  12667. if v.Events != nil {
  12668. rootAttr := []smithyxml.Attr{}
  12669. root := smithyxml.StartElement{
  12670. Name: smithyxml.Name{
  12671. Local: "Event",
  12672. },
  12673. Attr: rootAttr,
  12674. }
  12675. el := value.FlattenedElement(root)
  12676. if err := awsRestxml_serializeDocumentEventList(v.Events, el); err != nil {
  12677. return err
  12678. }
  12679. }
  12680. if v.Filter != nil {
  12681. rootAttr := []smithyxml.Attr{}
  12682. root := smithyxml.StartElement{
  12683. Name: smithyxml.Name{
  12684. Local: "Filter",
  12685. },
  12686. Attr: rootAttr,
  12687. }
  12688. el := value.MemberElement(root)
  12689. if err := awsRestxml_serializeDocumentNotificationConfigurationFilter(v.Filter, el); err != nil {
  12690. return err
  12691. }
  12692. }
  12693. if v.Id != nil {
  12694. rootAttr := []smithyxml.Attr{}
  12695. root := smithyxml.StartElement{
  12696. Name: smithyxml.Name{
  12697. Local: "Id",
  12698. },
  12699. Attr: rootAttr,
  12700. }
  12701. el := value.MemberElement(root)
  12702. el.String(*v.Id)
  12703. }
  12704. if v.TopicArn != nil {
  12705. rootAttr := []smithyxml.Attr{}
  12706. root := smithyxml.StartElement{
  12707. Name: smithyxml.Name{
  12708. Local: "Topic",
  12709. },
  12710. Attr: rootAttr,
  12711. }
  12712. el := value.MemberElement(root)
  12713. el.String(*v.TopicArn)
  12714. }
  12715. return nil
  12716. }
  12717. func awsRestxml_serializeDocumentTopicConfigurationList(v []types.TopicConfiguration, value smithyxml.Value) error {
  12718. var array *smithyxml.Array
  12719. if !value.IsFlattened() {
  12720. defer value.Close()
  12721. }
  12722. array = value.Array()
  12723. for i := range v {
  12724. am := array.Member()
  12725. if err := awsRestxml_serializeDocumentTopicConfiguration(&v[i], am); err != nil {
  12726. return err
  12727. }
  12728. }
  12729. return nil
  12730. }
  12731. func awsRestxml_serializeDocumentTransition(v *types.Transition, value smithyxml.Value) error {
  12732. defer value.Close()
  12733. if v.Date != nil {
  12734. rootAttr := []smithyxml.Attr{}
  12735. root := smithyxml.StartElement{
  12736. Name: smithyxml.Name{
  12737. Local: "Date",
  12738. },
  12739. Attr: rootAttr,
  12740. }
  12741. el := value.MemberElement(root)
  12742. el.String(smithytime.FormatDateTime(*v.Date))
  12743. }
  12744. if v.Days != nil {
  12745. rootAttr := []smithyxml.Attr{}
  12746. root := smithyxml.StartElement{
  12747. Name: smithyxml.Name{
  12748. Local: "Days",
  12749. },
  12750. Attr: rootAttr,
  12751. }
  12752. el := value.MemberElement(root)
  12753. el.Integer(*v.Days)
  12754. }
  12755. if len(v.StorageClass) > 0 {
  12756. rootAttr := []smithyxml.Attr{}
  12757. root := smithyxml.StartElement{
  12758. Name: smithyxml.Name{
  12759. Local: "StorageClass",
  12760. },
  12761. Attr: rootAttr,
  12762. }
  12763. el := value.MemberElement(root)
  12764. el.String(string(v.StorageClass))
  12765. }
  12766. return nil
  12767. }
  12768. func awsRestxml_serializeDocumentTransitionList(v []types.Transition, value smithyxml.Value) error {
  12769. var array *smithyxml.Array
  12770. if !value.IsFlattened() {
  12771. defer value.Close()
  12772. }
  12773. array = value.Array()
  12774. for i := range v {
  12775. am := array.Member()
  12776. if err := awsRestxml_serializeDocumentTransition(&v[i], am); err != nil {
  12777. return err
  12778. }
  12779. }
  12780. return nil
  12781. }
  12782. func awsRestxml_serializeDocumentUserMetadata(v []types.MetadataEntry, value smithyxml.Value) error {
  12783. var array *smithyxml.Array
  12784. if !value.IsFlattened() {
  12785. defer value.Close()
  12786. }
  12787. customMemberNameAttr := []smithyxml.Attr{}
  12788. customMemberName := smithyxml.StartElement{
  12789. Name: smithyxml.Name{
  12790. Local: "MetadataEntry",
  12791. },
  12792. Attr: customMemberNameAttr,
  12793. }
  12794. array = value.ArrayWithCustomName(customMemberName)
  12795. for i := range v {
  12796. am := array.Member()
  12797. if err := awsRestxml_serializeDocumentMetadataEntry(&v[i], am); err != nil {
  12798. return err
  12799. }
  12800. }
  12801. return nil
  12802. }
  12803. func awsRestxml_serializeDocumentVersioningConfiguration(v *types.VersioningConfiguration, value smithyxml.Value) error {
  12804. defer value.Close()
  12805. if len(v.MFADelete) > 0 {
  12806. rootAttr := []smithyxml.Attr{}
  12807. root := smithyxml.StartElement{
  12808. Name: smithyxml.Name{
  12809. Local: "MfaDelete",
  12810. },
  12811. Attr: rootAttr,
  12812. }
  12813. el := value.MemberElement(root)
  12814. el.String(string(v.MFADelete))
  12815. }
  12816. if len(v.Status) > 0 {
  12817. rootAttr := []smithyxml.Attr{}
  12818. root := smithyxml.StartElement{
  12819. Name: smithyxml.Name{
  12820. Local: "Status",
  12821. },
  12822. Attr: rootAttr,
  12823. }
  12824. el := value.MemberElement(root)
  12825. el.String(string(v.Status))
  12826. }
  12827. return nil
  12828. }
  12829. func awsRestxml_serializeDocumentWebsiteConfiguration(v *types.WebsiteConfiguration, value smithyxml.Value) error {
  12830. defer value.Close()
  12831. if v.ErrorDocument != nil {
  12832. rootAttr := []smithyxml.Attr{}
  12833. root := smithyxml.StartElement{
  12834. Name: smithyxml.Name{
  12835. Local: "ErrorDocument",
  12836. },
  12837. Attr: rootAttr,
  12838. }
  12839. el := value.MemberElement(root)
  12840. if err := awsRestxml_serializeDocumentErrorDocument(v.ErrorDocument, el); err != nil {
  12841. return err
  12842. }
  12843. }
  12844. if v.IndexDocument != nil {
  12845. rootAttr := []smithyxml.Attr{}
  12846. root := smithyxml.StartElement{
  12847. Name: smithyxml.Name{
  12848. Local: "IndexDocument",
  12849. },
  12850. Attr: rootAttr,
  12851. }
  12852. el := value.MemberElement(root)
  12853. if err := awsRestxml_serializeDocumentIndexDocument(v.IndexDocument, el); err != nil {
  12854. return err
  12855. }
  12856. }
  12857. if v.RedirectAllRequestsTo != nil {
  12858. rootAttr := []smithyxml.Attr{}
  12859. root := smithyxml.StartElement{
  12860. Name: smithyxml.Name{
  12861. Local: "RedirectAllRequestsTo",
  12862. },
  12863. Attr: rootAttr,
  12864. }
  12865. el := value.MemberElement(root)
  12866. if err := awsRestxml_serializeDocumentRedirectAllRequestsTo(v.RedirectAllRequestsTo, el); err != nil {
  12867. return err
  12868. }
  12869. }
  12870. if v.RoutingRules != nil {
  12871. rootAttr := []smithyxml.Attr{}
  12872. root := smithyxml.StartElement{
  12873. Name: smithyxml.Name{
  12874. Local: "RoutingRules",
  12875. },
  12876. Attr: rootAttr,
  12877. }
  12878. el := value.MemberElement(root)
  12879. if err := awsRestxml_serializeDocumentRoutingRules(v.RoutingRules, el); err != nil {
  12880. return err
  12881. }
  12882. }
  12883. return nil
  12884. }