youtube-gen.go 805 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761
  1. // Package youtube provides access to the YouTube Data API.
  2. //
  3. // See https://developers.google.com/youtube/v3
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/youtube/v3"
  8. // ...
  9. // youtubeService, err := youtube.New(oauthHttpClient)
  10. package youtube // import "google.golang.org/api/youtube/v3"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "youtube:v3"
  41. const apiName = "youtube"
  42. const apiVersion = "v3"
  43. const basePath = "https://www.googleapis.com/youtube/v3/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your YouTube account
  47. YoutubeScope = "https://www.googleapis.com/auth/youtube"
  48. // Manage your YouTube account
  49. YoutubeForceSslScope = "https://www.googleapis.com/auth/youtube.force-ssl"
  50. // View your YouTube account
  51. YoutubeReadonlyScope = "https://www.googleapis.com/auth/youtube.readonly"
  52. // Manage your YouTube videos
  53. YoutubeUploadScope = "https://www.googleapis.com/auth/youtube.upload"
  54. // View and manage your assets and associated content on YouTube
  55. YoutubepartnerScope = "https://www.googleapis.com/auth/youtubepartner"
  56. // View private information of your YouTube channel relevant during the
  57. // audit process with a YouTube partner
  58. YoutubepartnerChannelAuditScope = "https://www.googleapis.com/auth/youtubepartner-channel-audit"
  59. )
  60. func New(client *http.Client) (*Service, error) {
  61. if client == nil {
  62. return nil, errors.New("client is nil")
  63. }
  64. s := &Service{client: client, BasePath: basePath}
  65. s.Activities = NewActivitiesService(s)
  66. s.Captions = NewCaptionsService(s)
  67. s.ChannelBanners = NewChannelBannersService(s)
  68. s.ChannelSections = NewChannelSectionsService(s)
  69. s.Channels = NewChannelsService(s)
  70. s.CommentThreads = NewCommentThreadsService(s)
  71. s.Comments = NewCommentsService(s)
  72. s.FanFundingEvents = NewFanFundingEventsService(s)
  73. s.GuideCategories = NewGuideCategoriesService(s)
  74. s.I18nLanguages = NewI18nLanguagesService(s)
  75. s.I18nRegions = NewI18nRegionsService(s)
  76. s.LiveBroadcasts = NewLiveBroadcastsService(s)
  77. s.LiveChatBans = NewLiveChatBansService(s)
  78. s.LiveChatMessages = NewLiveChatMessagesService(s)
  79. s.LiveChatModerators = NewLiveChatModeratorsService(s)
  80. s.LiveStreams = NewLiveStreamsService(s)
  81. s.PlaylistItems = NewPlaylistItemsService(s)
  82. s.Playlists = NewPlaylistsService(s)
  83. s.Search = NewSearchService(s)
  84. s.Sponsors = NewSponsorsService(s)
  85. s.Subscriptions = NewSubscriptionsService(s)
  86. s.Thumbnails = NewThumbnailsService(s)
  87. s.VideoAbuseReportReasons = NewVideoAbuseReportReasonsService(s)
  88. s.VideoCategories = NewVideoCategoriesService(s)
  89. s.Videos = NewVideosService(s)
  90. s.Watermarks = NewWatermarksService(s)
  91. return s, nil
  92. }
  93. type Service struct {
  94. client *http.Client
  95. BasePath string // API endpoint base URL
  96. UserAgent string // optional additional User-Agent fragment
  97. Activities *ActivitiesService
  98. Captions *CaptionsService
  99. ChannelBanners *ChannelBannersService
  100. ChannelSections *ChannelSectionsService
  101. Channels *ChannelsService
  102. CommentThreads *CommentThreadsService
  103. Comments *CommentsService
  104. FanFundingEvents *FanFundingEventsService
  105. GuideCategories *GuideCategoriesService
  106. I18nLanguages *I18nLanguagesService
  107. I18nRegions *I18nRegionsService
  108. LiveBroadcasts *LiveBroadcastsService
  109. LiveChatBans *LiveChatBansService
  110. LiveChatMessages *LiveChatMessagesService
  111. LiveChatModerators *LiveChatModeratorsService
  112. LiveStreams *LiveStreamsService
  113. PlaylistItems *PlaylistItemsService
  114. Playlists *PlaylistsService
  115. Search *SearchService
  116. Sponsors *SponsorsService
  117. Subscriptions *SubscriptionsService
  118. Thumbnails *ThumbnailsService
  119. VideoAbuseReportReasons *VideoAbuseReportReasonsService
  120. VideoCategories *VideoCategoriesService
  121. Videos *VideosService
  122. Watermarks *WatermarksService
  123. }
  124. func (s *Service) userAgent() string {
  125. if s.UserAgent == "" {
  126. return googleapi.UserAgent
  127. }
  128. return googleapi.UserAgent + " " + s.UserAgent
  129. }
  130. func NewActivitiesService(s *Service) *ActivitiesService {
  131. rs := &ActivitiesService{s: s}
  132. return rs
  133. }
  134. type ActivitiesService struct {
  135. s *Service
  136. }
  137. func NewCaptionsService(s *Service) *CaptionsService {
  138. rs := &CaptionsService{s: s}
  139. return rs
  140. }
  141. type CaptionsService struct {
  142. s *Service
  143. }
  144. func NewChannelBannersService(s *Service) *ChannelBannersService {
  145. rs := &ChannelBannersService{s: s}
  146. return rs
  147. }
  148. type ChannelBannersService struct {
  149. s *Service
  150. }
  151. func NewChannelSectionsService(s *Service) *ChannelSectionsService {
  152. rs := &ChannelSectionsService{s: s}
  153. return rs
  154. }
  155. type ChannelSectionsService struct {
  156. s *Service
  157. }
  158. func NewChannelsService(s *Service) *ChannelsService {
  159. rs := &ChannelsService{s: s}
  160. return rs
  161. }
  162. type ChannelsService struct {
  163. s *Service
  164. }
  165. func NewCommentThreadsService(s *Service) *CommentThreadsService {
  166. rs := &CommentThreadsService{s: s}
  167. return rs
  168. }
  169. type CommentThreadsService struct {
  170. s *Service
  171. }
  172. func NewCommentsService(s *Service) *CommentsService {
  173. rs := &CommentsService{s: s}
  174. return rs
  175. }
  176. type CommentsService struct {
  177. s *Service
  178. }
  179. func NewFanFundingEventsService(s *Service) *FanFundingEventsService {
  180. rs := &FanFundingEventsService{s: s}
  181. return rs
  182. }
  183. type FanFundingEventsService struct {
  184. s *Service
  185. }
  186. func NewGuideCategoriesService(s *Service) *GuideCategoriesService {
  187. rs := &GuideCategoriesService{s: s}
  188. return rs
  189. }
  190. type GuideCategoriesService struct {
  191. s *Service
  192. }
  193. func NewI18nLanguagesService(s *Service) *I18nLanguagesService {
  194. rs := &I18nLanguagesService{s: s}
  195. return rs
  196. }
  197. type I18nLanguagesService struct {
  198. s *Service
  199. }
  200. func NewI18nRegionsService(s *Service) *I18nRegionsService {
  201. rs := &I18nRegionsService{s: s}
  202. return rs
  203. }
  204. type I18nRegionsService struct {
  205. s *Service
  206. }
  207. func NewLiveBroadcastsService(s *Service) *LiveBroadcastsService {
  208. rs := &LiveBroadcastsService{s: s}
  209. return rs
  210. }
  211. type LiveBroadcastsService struct {
  212. s *Service
  213. }
  214. func NewLiveChatBansService(s *Service) *LiveChatBansService {
  215. rs := &LiveChatBansService{s: s}
  216. return rs
  217. }
  218. type LiveChatBansService struct {
  219. s *Service
  220. }
  221. func NewLiveChatMessagesService(s *Service) *LiveChatMessagesService {
  222. rs := &LiveChatMessagesService{s: s}
  223. return rs
  224. }
  225. type LiveChatMessagesService struct {
  226. s *Service
  227. }
  228. func NewLiveChatModeratorsService(s *Service) *LiveChatModeratorsService {
  229. rs := &LiveChatModeratorsService{s: s}
  230. return rs
  231. }
  232. type LiveChatModeratorsService struct {
  233. s *Service
  234. }
  235. func NewLiveStreamsService(s *Service) *LiveStreamsService {
  236. rs := &LiveStreamsService{s: s}
  237. return rs
  238. }
  239. type LiveStreamsService struct {
  240. s *Service
  241. }
  242. func NewPlaylistItemsService(s *Service) *PlaylistItemsService {
  243. rs := &PlaylistItemsService{s: s}
  244. return rs
  245. }
  246. type PlaylistItemsService struct {
  247. s *Service
  248. }
  249. func NewPlaylistsService(s *Service) *PlaylistsService {
  250. rs := &PlaylistsService{s: s}
  251. return rs
  252. }
  253. type PlaylistsService struct {
  254. s *Service
  255. }
  256. func NewSearchService(s *Service) *SearchService {
  257. rs := &SearchService{s: s}
  258. return rs
  259. }
  260. type SearchService struct {
  261. s *Service
  262. }
  263. func NewSponsorsService(s *Service) *SponsorsService {
  264. rs := &SponsorsService{s: s}
  265. return rs
  266. }
  267. type SponsorsService struct {
  268. s *Service
  269. }
  270. func NewSubscriptionsService(s *Service) *SubscriptionsService {
  271. rs := &SubscriptionsService{s: s}
  272. return rs
  273. }
  274. type SubscriptionsService struct {
  275. s *Service
  276. }
  277. func NewThumbnailsService(s *Service) *ThumbnailsService {
  278. rs := &ThumbnailsService{s: s}
  279. return rs
  280. }
  281. type ThumbnailsService struct {
  282. s *Service
  283. }
  284. func NewVideoAbuseReportReasonsService(s *Service) *VideoAbuseReportReasonsService {
  285. rs := &VideoAbuseReportReasonsService{s: s}
  286. return rs
  287. }
  288. type VideoAbuseReportReasonsService struct {
  289. s *Service
  290. }
  291. func NewVideoCategoriesService(s *Service) *VideoCategoriesService {
  292. rs := &VideoCategoriesService{s: s}
  293. return rs
  294. }
  295. type VideoCategoriesService struct {
  296. s *Service
  297. }
  298. func NewVideosService(s *Service) *VideosService {
  299. rs := &VideosService{s: s}
  300. return rs
  301. }
  302. type VideosService struct {
  303. s *Service
  304. }
  305. func NewWatermarksService(s *Service) *WatermarksService {
  306. rs := &WatermarksService{s: s}
  307. return rs
  308. }
  309. type WatermarksService struct {
  310. s *Service
  311. }
  312. // AccessPolicy: Rights management policy for YouTube resources.
  313. type AccessPolicy struct {
  314. // Allowed: The value of allowed indicates whether the access to the
  315. // policy is allowed or denied by default.
  316. Allowed bool `json:"allowed,omitempty"`
  317. // Exception: A list of region codes that identify countries where the
  318. // default policy do not apply.
  319. Exception []string `json:"exception,omitempty"`
  320. // ForceSendFields is a list of field names (e.g. "Allowed") to
  321. // unconditionally include in API requests. By default, fields with
  322. // empty values are omitted from API requests. However, any non-pointer,
  323. // non-interface field appearing in ForceSendFields will be sent to the
  324. // server regardless of whether the field is empty or not. This may be
  325. // used to include empty fields in Patch requests.
  326. ForceSendFields []string `json:"-"`
  327. }
  328. func (s *AccessPolicy) MarshalJSON() ([]byte, error) {
  329. type noMethod AccessPolicy
  330. raw := noMethod(*s)
  331. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  332. }
  333. // Activity: An activity resource contains information about an action
  334. // that a particular channel, or user, has taken on YouTube.The actions
  335. // reported in activity feeds include rating a video, sharing a video,
  336. // marking a video as a favorite, commenting on a video, uploading a
  337. // video, and so forth. Each activity resource identifies the type of
  338. // action, the channel associated with the action, and the resource(s)
  339. // associated with the action, such as the video that was rated or
  340. // uploaded.
  341. type Activity struct {
  342. // ContentDetails: The contentDetails object contains information about
  343. // the content associated with the activity. For example, if the
  344. // snippet.type value is videoRated, then the contentDetails object's
  345. // content identifies the rated video.
  346. ContentDetails *ActivityContentDetails `json:"contentDetails,omitempty"`
  347. // Etag: Etag of this resource.
  348. Etag string `json:"etag,omitempty"`
  349. // Id: The ID that YouTube uses to uniquely identify the activity.
  350. Id string `json:"id,omitempty"`
  351. // Kind: Identifies what kind of resource this is. Value: the fixed
  352. // string "youtube#activity".
  353. Kind string `json:"kind,omitempty"`
  354. // Snippet: The snippet object contains basic details about the
  355. // activity, including the activity's type and group ID.
  356. Snippet *ActivitySnippet `json:"snippet,omitempty"`
  357. // ServerResponse contains the HTTP response code and headers from the
  358. // server.
  359. googleapi.ServerResponse `json:"-"`
  360. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  361. // unconditionally include in API requests. By default, fields with
  362. // empty values are omitted from API requests. However, any non-pointer,
  363. // non-interface field appearing in ForceSendFields will be sent to the
  364. // server regardless of whether the field is empty or not. This may be
  365. // used to include empty fields in Patch requests.
  366. ForceSendFields []string `json:"-"`
  367. }
  368. func (s *Activity) MarshalJSON() ([]byte, error) {
  369. type noMethod Activity
  370. raw := noMethod(*s)
  371. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  372. }
  373. // ActivityContentDetails: Details about the content of an activity: the
  374. // video that was shared, the channel that was subscribed to, etc.
  375. type ActivityContentDetails struct {
  376. // Bulletin: The bulletin object contains details about a channel
  377. // bulletin post. This object is only present if the snippet.type is
  378. // bulletin.
  379. Bulletin *ActivityContentDetailsBulletin `json:"bulletin,omitempty"`
  380. // ChannelItem: The channelItem object contains details about a resource
  381. // which was added to a channel. This property is only present if the
  382. // snippet.type is channelItem.
  383. ChannelItem *ActivityContentDetailsChannelItem `json:"channelItem,omitempty"`
  384. // Comment: The comment object contains information about a resource
  385. // that received a comment. This property is only present if the
  386. // snippet.type is comment.
  387. Comment *ActivityContentDetailsComment `json:"comment,omitempty"`
  388. // Favorite: The favorite object contains information about a video that
  389. // was marked as a favorite video. This property is only present if the
  390. // snippet.type is favorite.
  391. Favorite *ActivityContentDetailsFavorite `json:"favorite,omitempty"`
  392. // Like: The like object contains information about a resource that
  393. // received a positive (like) rating. This property is only present if
  394. // the snippet.type is like.
  395. Like *ActivityContentDetailsLike `json:"like,omitempty"`
  396. // PlaylistItem: The playlistItem object contains information about a
  397. // new playlist item. This property is only present if the snippet.type
  398. // is playlistItem.
  399. PlaylistItem *ActivityContentDetailsPlaylistItem `json:"playlistItem,omitempty"`
  400. // PromotedItem: The promotedItem object contains details about a
  401. // resource which is being promoted. This property is only present if
  402. // the snippet.type is promotedItem.
  403. PromotedItem *ActivityContentDetailsPromotedItem `json:"promotedItem,omitempty"`
  404. // Recommendation: The recommendation object contains information about
  405. // a recommended resource. This property is only present if the
  406. // snippet.type is recommendation.
  407. Recommendation *ActivityContentDetailsRecommendation `json:"recommendation,omitempty"`
  408. // Social: The social object contains details about a social network
  409. // post. This property is only present if the snippet.type is social.
  410. Social *ActivityContentDetailsSocial `json:"social,omitempty"`
  411. // Subscription: The subscription object contains information about a
  412. // channel that a user subscribed to. This property is only present if
  413. // the snippet.type is subscription.
  414. Subscription *ActivityContentDetailsSubscription `json:"subscription,omitempty"`
  415. // Upload: The upload object contains information about the uploaded
  416. // video. This property is only present if the snippet.type is upload.
  417. Upload *ActivityContentDetailsUpload `json:"upload,omitempty"`
  418. // ForceSendFields is a list of field names (e.g. "Bulletin") to
  419. // unconditionally include in API requests. By default, fields with
  420. // empty values are omitted from API requests. However, any non-pointer,
  421. // non-interface field appearing in ForceSendFields will be sent to the
  422. // server regardless of whether the field is empty or not. This may be
  423. // used to include empty fields in Patch requests.
  424. ForceSendFields []string `json:"-"`
  425. }
  426. func (s *ActivityContentDetails) MarshalJSON() ([]byte, error) {
  427. type noMethod ActivityContentDetails
  428. raw := noMethod(*s)
  429. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  430. }
  431. // ActivityContentDetailsBulletin: Details about a channel bulletin
  432. // post.
  433. type ActivityContentDetailsBulletin struct {
  434. // ResourceId: The resourceId object contains information that
  435. // identifies the resource associated with a bulletin post.
  436. ResourceId *ResourceId `json:"resourceId,omitempty"`
  437. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  438. // unconditionally include in API requests. By default, fields with
  439. // empty values are omitted from API requests. However, any non-pointer,
  440. // non-interface field appearing in ForceSendFields will be sent to the
  441. // server regardless of whether the field is empty or not. This may be
  442. // used to include empty fields in Patch requests.
  443. ForceSendFields []string `json:"-"`
  444. }
  445. func (s *ActivityContentDetailsBulletin) MarshalJSON() ([]byte, error) {
  446. type noMethod ActivityContentDetailsBulletin
  447. raw := noMethod(*s)
  448. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  449. }
  450. // ActivityContentDetailsChannelItem: Details about a resource which was
  451. // added to a channel.
  452. type ActivityContentDetailsChannelItem struct {
  453. // ResourceId: The resourceId object contains information that
  454. // identifies the resource that was added to the channel.
  455. ResourceId *ResourceId `json:"resourceId,omitempty"`
  456. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  457. // unconditionally include in API requests. By default, fields with
  458. // empty values are omitted from API requests. However, any non-pointer,
  459. // non-interface field appearing in ForceSendFields will be sent to the
  460. // server regardless of whether the field is empty or not. This may be
  461. // used to include empty fields in Patch requests.
  462. ForceSendFields []string `json:"-"`
  463. }
  464. func (s *ActivityContentDetailsChannelItem) MarshalJSON() ([]byte, error) {
  465. type noMethod ActivityContentDetailsChannelItem
  466. raw := noMethod(*s)
  467. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  468. }
  469. // ActivityContentDetailsComment: Information about a resource that
  470. // received a comment.
  471. type ActivityContentDetailsComment struct {
  472. // ResourceId: The resourceId object contains information that
  473. // identifies the resource associated with the comment.
  474. ResourceId *ResourceId `json:"resourceId,omitempty"`
  475. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  476. // unconditionally include in API requests. By default, fields with
  477. // empty values are omitted from API requests. However, any non-pointer,
  478. // non-interface field appearing in ForceSendFields will be sent to the
  479. // server regardless of whether the field is empty or not. This may be
  480. // used to include empty fields in Patch requests.
  481. ForceSendFields []string `json:"-"`
  482. }
  483. func (s *ActivityContentDetailsComment) MarshalJSON() ([]byte, error) {
  484. type noMethod ActivityContentDetailsComment
  485. raw := noMethod(*s)
  486. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  487. }
  488. // ActivityContentDetailsFavorite: Information about a video that was
  489. // marked as a favorite video.
  490. type ActivityContentDetailsFavorite struct {
  491. // ResourceId: The resourceId object contains information that
  492. // identifies the resource that was marked as a favorite.
  493. ResourceId *ResourceId `json:"resourceId,omitempty"`
  494. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  495. // unconditionally include in API requests. By default, fields with
  496. // empty values are omitted from API requests. However, any non-pointer,
  497. // non-interface field appearing in ForceSendFields will be sent to the
  498. // server regardless of whether the field is empty or not. This may be
  499. // used to include empty fields in Patch requests.
  500. ForceSendFields []string `json:"-"`
  501. }
  502. func (s *ActivityContentDetailsFavorite) MarshalJSON() ([]byte, error) {
  503. type noMethod ActivityContentDetailsFavorite
  504. raw := noMethod(*s)
  505. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  506. }
  507. // ActivityContentDetailsLike: Information about a resource that
  508. // received a positive (like) rating.
  509. type ActivityContentDetailsLike struct {
  510. // ResourceId: The resourceId object contains information that
  511. // identifies the rated resource.
  512. ResourceId *ResourceId `json:"resourceId,omitempty"`
  513. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  514. // unconditionally include in API requests. By default, fields with
  515. // empty values are omitted from API requests. However, any non-pointer,
  516. // non-interface field appearing in ForceSendFields will be sent to the
  517. // server regardless of whether the field is empty or not. This may be
  518. // used to include empty fields in Patch requests.
  519. ForceSendFields []string `json:"-"`
  520. }
  521. func (s *ActivityContentDetailsLike) MarshalJSON() ([]byte, error) {
  522. type noMethod ActivityContentDetailsLike
  523. raw := noMethod(*s)
  524. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  525. }
  526. // ActivityContentDetailsPlaylistItem: Information about a new playlist
  527. // item.
  528. type ActivityContentDetailsPlaylistItem struct {
  529. // PlaylistId: The value that YouTube uses to uniquely identify the
  530. // playlist.
  531. PlaylistId string `json:"playlistId,omitempty"`
  532. // PlaylistItemId: ID of the item within the playlist.
  533. PlaylistItemId string `json:"playlistItemId,omitempty"`
  534. // ResourceId: The resourceId object contains information about the
  535. // resource that was added to the playlist.
  536. ResourceId *ResourceId `json:"resourceId,omitempty"`
  537. // ForceSendFields is a list of field names (e.g. "PlaylistId") to
  538. // unconditionally include in API requests. By default, fields with
  539. // empty values are omitted from API requests. However, any non-pointer,
  540. // non-interface field appearing in ForceSendFields will be sent to the
  541. // server regardless of whether the field is empty or not. This may be
  542. // used to include empty fields in Patch requests.
  543. ForceSendFields []string `json:"-"`
  544. }
  545. func (s *ActivityContentDetailsPlaylistItem) MarshalJSON() ([]byte, error) {
  546. type noMethod ActivityContentDetailsPlaylistItem
  547. raw := noMethod(*s)
  548. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  549. }
  550. // ActivityContentDetailsPromotedItem: Details about a resource which is
  551. // being promoted.
  552. type ActivityContentDetailsPromotedItem struct {
  553. // AdTag: The URL the client should fetch to request a promoted item.
  554. AdTag string `json:"adTag,omitempty"`
  555. // ClickTrackingUrl: The URL the client should ping to indicate that the
  556. // user clicked through on this promoted item.
  557. ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
  558. // CreativeViewUrl: The URL the client should ping to indicate that the
  559. // user was shown this promoted item.
  560. CreativeViewUrl string `json:"creativeViewUrl,omitempty"`
  561. // CtaType: The type of call-to-action, a message to the user indicating
  562. // action that can be taken.
  563. //
  564. // Possible values:
  565. // "unspecified"
  566. // "visitAdvertiserSite"
  567. CtaType string `json:"ctaType,omitempty"`
  568. // CustomCtaButtonText: The custom call-to-action button text. If
  569. // specified, it will override the default button text for the cta_type.
  570. CustomCtaButtonText string `json:"customCtaButtonText,omitempty"`
  571. // DescriptionText: The text description to accompany the promoted item.
  572. DescriptionText string `json:"descriptionText,omitempty"`
  573. // DestinationUrl: The URL the client should direct the user to, if the
  574. // user chooses to visit the advertiser's website.
  575. DestinationUrl string `json:"destinationUrl,omitempty"`
  576. // ForecastingUrl: The list of forecasting URLs. The client should ping
  577. // all of these URLs when a promoted item is not available, to indicate
  578. // that a promoted item could have been shown.
  579. ForecastingUrl []string `json:"forecastingUrl,omitempty"`
  580. // ImpressionUrl: The list of impression URLs. The client should ping
  581. // all of these URLs to indicate that the user was shown this promoted
  582. // item.
  583. ImpressionUrl []string `json:"impressionUrl,omitempty"`
  584. // VideoId: The ID that YouTube uses to uniquely identify the promoted
  585. // video.
  586. VideoId string `json:"videoId,omitempty"`
  587. // ForceSendFields is a list of field names (e.g. "AdTag") to
  588. // unconditionally include in API requests. By default, fields with
  589. // empty values are omitted from API requests. However, any non-pointer,
  590. // non-interface field appearing in ForceSendFields will be sent to the
  591. // server regardless of whether the field is empty or not. This may be
  592. // used to include empty fields in Patch requests.
  593. ForceSendFields []string `json:"-"`
  594. }
  595. func (s *ActivityContentDetailsPromotedItem) MarshalJSON() ([]byte, error) {
  596. type noMethod ActivityContentDetailsPromotedItem
  597. raw := noMethod(*s)
  598. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  599. }
  600. // ActivityContentDetailsRecommendation: Information that identifies the
  601. // recommended resource.
  602. type ActivityContentDetailsRecommendation struct {
  603. // Reason: The reason that the resource is recommended to the user.
  604. //
  605. // Possible values:
  606. // "unspecified"
  607. // "videoFavorited"
  608. // "videoLiked"
  609. // "videoWatched"
  610. Reason string `json:"reason,omitempty"`
  611. // ResourceId: The resourceId object contains information that
  612. // identifies the recommended resource.
  613. ResourceId *ResourceId `json:"resourceId,omitempty"`
  614. // SeedResourceId: The seedResourceId object contains information about
  615. // the resource that caused the recommendation.
  616. SeedResourceId *ResourceId `json:"seedResourceId,omitempty"`
  617. // ForceSendFields is a list of field names (e.g. "Reason") to
  618. // unconditionally include in API requests. By default, fields with
  619. // empty values are omitted from API requests. However, any non-pointer,
  620. // non-interface field appearing in ForceSendFields will be sent to the
  621. // server regardless of whether the field is empty or not. This may be
  622. // used to include empty fields in Patch requests.
  623. ForceSendFields []string `json:"-"`
  624. }
  625. func (s *ActivityContentDetailsRecommendation) MarshalJSON() ([]byte, error) {
  626. type noMethod ActivityContentDetailsRecommendation
  627. raw := noMethod(*s)
  628. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  629. }
  630. // ActivityContentDetailsSocial: Details about a social network post.
  631. type ActivityContentDetailsSocial struct {
  632. // Author: The author of the social network post.
  633. Author string `json:"author,omitempty"`
  634. // ImageUrl: An image of the post's author.
  635. ImageUrl string `json:"imageUrl,omitempty"`
  636. // ReferenceUrl: The URL of the social network post.
  637. ReferenceUrl string `json:"referenceUrl,omitempty"`
  638. // ResourceId: The resourceId object encapsulates information that
  639. // identifies the resource associated with a social network post.
  640. ResourceId *ResourceId `json:"resourceId,omitempty"`
  641. // Type: The name of the social network.
  642. //
  643. // Possible values:
  644. // "facebook"
  645. // "googlePlus"
  646. // "twitter"
  647. // "unspecified"
  648. Type string `json:"type,omitempty"`
  649. // ForceSendFields is a list of field names (e.g. "Author") to
  650. // unconditionally include in API requests. By default, fields with
  651. // empty values are omitted from API requests. However, any non-pointer,
  652. // non-interface field appearing in ForceSendFields will be sent to the
  653. // server regardless of whether the field is empty or not. This may be
  654. // used to include empty fields in Patch requests.
  655. ForceSendFields []string `json:"-"`
  656. }
  657. func (s *ActivityContentDetailsSocial) MarshalJSON() ([]byte, error) {
  658. type noMethod ActivityContentDetailsSocial
  659. raw := noMethod(*s)
  660. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  661. }
  662. // ActivityContentDetailsSubscription: Information about a channel that
  663. // a user subscribed to.
  664. type ActivityContentDetailsSubscription struct {
  665. // ResourceId: The resourceId object contains information that
  666. // identifies the resource that the user subscribed to.
  667. ResourceId *ResourceId `json:"resourceId,omitempty"`
  668. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  669. // unconditionally include in API requests. By default, fields with
  670. // empty values are omitted from API requests. However, any non-pointer,
  671. // non-interface field appearing in ForceSendFields will be sent to the
  672. // server regardless of whether the field is empty or not. This may be
  673. // used to include empty fields in Patch requests.
  674. ForceSendFields []string `json:"-"`
  675. }
  676. func (s *ActivityContentDetailsSubscription) MarshalJSON() ([]byte, error) {
  677. type noMethod ActivityContentDetailsSubscription
  678. raw := noMethod(*s)
  679. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  680. }
  681. // ActivityContentDetailsUpload: Information about the uploaded video.
  682. type ActivityContentDetailsUpload struct {
  683. // VideoId: The ID that YouTube uses to uniquely identify the uploaded
  684. // video.
  685. VideoId string `json:"videoId,omitempty"`
  686. // ForceSendFields is a list of field names (e.g. "VideoId") to
  687. // unconditionally include in API requests. By default, fields with
  688. // empty values are omitted from API requests. However, any non-pointer,
  689. // non-interface field appearing in ForceSendFields will be sent to the
  690. // server regardless of whether the field is empty or not. This may be
  691. // used to include empty fields in Patch requests.
  692. ForceSendFields []string `json:"-"`
  693. }
  694. func (s *ActivityContentDetailsUpload) MarshalJSON() ([]byte, error) {
  695. type noMethod ActivityContentDetailsUpload
  696. raw := noMethod(*s)
  697. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  698. }
  699. type ActivityListResponse struct {
  700. // Etag: Etag of this resource.
  701. Etag string `json:"etag,omitempty"`
  702. // EventId: Serialized EventId of the request which produced this
  703. // response.
  704. EventId string `json:"eventId,omitempty"`
  705. // Items: A list of activities, or events, that match the request
  706. // criteria.
  707. Items []*Activity `json:"items,omitempty"`
  708. // Kind: Identifies what kind of resource this is. Value: the fixed
  709. // string "youtube#activityListResponse".
  710. Kind string `json:"kind,omitempty"`
  711. // NextPageToken: The token that can be used as the value of the
  712. // pageToken parameter to retrieve the next page in the result set.
  713. NextPageToken string `json:"nextPageToken,omitempty"`
  714. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  715. // PrevPageToken: The token that can be used as the value of the
  716. // pageToken parameter to retrieve the previous page in the result set.
  717. PrevPageToken string `json:"prevPageToken,omitempty"`
  718. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  719. // VisitorId: The visitorId identifies the visitor.
  720. VisitorId string `json:"visitorId,omitempty"`
  721. // ServerResponse contains the HTTP response code and headers from the
  722. // server.
  723. googleapi.ServerResponse `json:"-"`
  724. // ForceSendFields is a list of field names (e.g. "Etag") to
  725. // unconditionally include in API requests. By default, fields with
  726. // empty values are omitted from API requests. However, any non-pointer,
  727. // non-interface field appearing in ForceSendFields will be sent to the
  728. // server regardless of whether the field is empty or not. This may be
  729. // used to include empty fields in Patch requests.
  730. ForceSendFields []string `json:"-"`
  731. }
  732. func (s *ActivityListResponse) MarshalJSON() ([]byte, error) {
  733. type noMethod ActivityListResponse
  734. raw := noMethod(*s)
  735. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  736. }
  737. // ActivitySnippet: Basic details about an activity, including title,
  738. // description, thumbnails, activity type and group.
  739. type ActivitySnippet struct {
  740. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  741. // associated with the activity.
  742. ChannelId string `json:"channelId,omitempty"`
  743. // ChannelTitle: Channel title for the channel responsible for this
  744. // activity
  745. ChannelTitle string `json:"channelTitle,omitempty"`
  746. // Description: The description of the resource primarily associated
  747. // with the activity.
  748. Description string `json:"description,omitempty"`
  749. // GroupId: The group ID associated with the activity. A group ID
  750. // identifies user events that are associated with the same user and
  751. // resource. For example, if a user rates a video and marks the same
  752. // video as a favorite, the entries for those events would have the same
  753. // group ID in the user's activity feed. In your user interface, you can
  754. // avoid repetition by grouping events with the same groupId value.
  755. GroupId string `json:"groupId,omitempty"`
  756. // PublishedAt: The date and time that the video was uploaded. The value
  757. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  758. PublishedAt string `json:"publishedAt,omitempty"`
  759. // Thumbnails: A map of thumbnail images associated with the resource
  760. // that is primarily associated with the activity. For each object in
  761. // the map, the key is the name of the thumbnail image, and the value is
  762. // an object that contains other information about the thumbnail.
  763. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  764. // Title: The title of the resource primarily associated with the
  765. // activity.
  766. Title string `json:"title,omitempty"`
  767. // Type: The type of activity that the resource describes.
  768. //
  769. // Possible values:
  770. // "bulletin"
  771. // "channelItem"
  772. // "comment"
  773. // "favorite"
  774. // "like"
  775. // "playlistItem"
  776. // "promotedItem"
  777. // "recommendation"
  778. // "social"
  779. // "subscription"
  780. // "upload"
  781. Type string `json:"type,omitempty"`
  782. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  783. // unconditionally include in API requests. By default, fields with
  784. // empty values are omitted from API requests. However, any non-pointer,
  785. // non-interface field appearing in ForceSendFields will be sent to the
  786. // server regardless of whether the field is empty or not. This may be
  787. // used to include empty fields in Patch requests.
  788. ForceSendFields []string `json:"-"`
  789. }
  790. func (s *ActivitySnippet) MarshalJSON() ([]byte, error) {
  791. type noMethod ActivitySnippet
  792. raw := noMethod(*s)
  793. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  794. }
  795. // Caption: A caption resource represents a YouTube caption track. A
  796. // caption track is associated with exactly one YouTube video.
  797. type Caption struct {
  798. // Etag: Etag of this resource.
  799. Etag string `json:"etag,omitempty"`
  800. // Id: The ID that YouTube uses to uniquely identify the caption track.
  801. Id string `json:"id,omitempty"`
  802. // Kind: Identifies what kind of resource this is. Value: the fixed
  803. // string "youtube#caption".
  804. Kind string `json:"kind,omitempty"`
  805. // Snippet: The snippet object contains basic details about the caption.
  806. Snippet *CaptionSnippet `json:"snippet,omitempty"`
  807. // ServerResponse contains the HTTP response code and headers from the
  808. // server.
  809. googleapi.ServerResponse `json:"-"`
  810. // ForceSendFields is a list of field names (e.g. "Etag") to
  811. // unconditionally include in API requests. By default, fields with
  812. // empty values are omitted from API requests. However, any non-pointer,
  813. // non-interface field appearing in ForceSendFields will be sent to the
  814. // server regardless of whether the field is empty or not. This may be
  815. // used to include empty fields in Patch requests.
  816. ForceSendFields []string `json:"-"`
  817. }
  818. func (s *Caption) MarshalJSON() ([]byte, error) {
  819. type noMethod Caption
  820. raw := noMethod(*s)
  821. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  822. }
  823. type CaptionListResponse struct {
  824. // Etag: Etag of this resource.
  825. Etag string `json:"etag,omitempty"`
  826. // EventId: Serialized EventId of the request which produced this
  827. // response.
  828. EventId string `json:"eventId,omitempty"`
  829. // Items: A list of captions that match the request criteria.
  830. Items []*Caption `json:"items,omitempty"`
  831. // Kind: Identifies what kind of resource this is. Value: the fixed
  832. // string "youtube#captionListResponse".
  833. Kind string `json:"kind,omitempty"`
  834. // VisitorId: The visitorId identifies the visitor.
  835. VisitorId string `json:"visitorId,omitempty"`
  836. // ServerResponse contains the HTTP response code and headers from the
  837. // server.
  838. googleapi.ServerResponse `json:"-"`
  839. // ForceSendFields is a list of field names (e.g. "Etag") to
  840. // unconditionally include in API requests. By default, fields with
  841. // empty values are omitted from API requests. However, any non-pointer,
  842. // non-interface field appearing in ForceSendFields will be sent to the
  843. // server regardless of whether the field is empty or not. This may be
  844. // used to include empty fields in Patch requests.
  845. ForceSendFields []string `json:"-"`
  846. }
  847. func (s *CaptionListResponse) MarshalJSON() ([]byte, error) {
  848. type noMethod CaptionListResponse
  849. raw := noMethod(*s)
  850. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  851. }
  852. // CaptionSnippet: Basic details about a caption track, such as its
  853. // language and name.
  854. type CaptionSnippet struct {
  855. // AudioTrackType: The type of audio track associated with the caption
  856. // track.
  857. //
  858. // Possible values:
  859. // "commentary"
  860. // "descriptive"
  861. // "primary"
  862. // "unknown"
  863. AudioTrackType string `json:"audioTrackType,omitempty"`
  864. // FailureReason: The reason that YouTube failed to process the caption
  865. // track. This property is only present if the state property's value is
  866. // failed.
  867. //
  868. // Possible values:
  869. // "processingFailed"
  870. // "unknownFormat"
  871. // "unsupportedFormat"
  872. FailureReason string `json:"failureReason,omitempty"`
  873. // IsAutoSynced: Indicates whether YouTube synchronized the caption
  874. // track to the audio track in the video. The value will be true if a
  875. // sync was explicitly requested when the caption track was uploaded.
  876. // For example, when calling the captions.insert or captions.update
  877. // methods, you can set the sync parameter to true to instruct YouTube
  878. // to sync the uploaded track to the video. If the value is false,
  879. // YouTube uses the time codes in the uploaded caption track to
  880. // determine when to display captions.
  881. IsAutoSynced bool `json:"isAutoSynced,omitempty"`
  882. // IsCC: Indicates whether the track contains closed captions for the
  883. // deaf and hard of hearing. The default value is false.
  884. IsCC bool `json:"isCC,omitempty"`
  885. // IsDraft: Indicates whether the caption track is a draft. If the value
  886. // is true, then the track is not publicly visible. The default value is
  887. // false.
  888. IsDraft bool `json:"isDraft,omitempty"`
  889. // IsEasyReader: Indicates whether caption track is formatted for "easy
  890. // reader," meaning it is at a third-grade level for language learners.
  891. // The default value is false.
  892. IsEasyReader bool `json:"isEasyReader,omitempty"`
  893. // IsLarge: Indicates whether the caption track uses large text for the
  894. // vision-impaired. The default value is false.
  895. IsLarge bool `json:"isLarge,omitempty"`
  896. // Language: The language of the caption track. The property value is a
  897. // BCP-47 language tag.
  898. Language string `json:"language,omitempty"`
  899. // LastUpdated: The date and time when the caption track was last
  900. // updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  901. // format.
  902. LastUpdated string `json:"lastUpdated,omitempty"`
  903. // Name: The name of the caption track. The name is intended to be
  904. // visible to the user as an option during playback.
  905. Name string `json:"name,omitempty"`
  906. // Status: The caption track's status.
  907. //
  908. // Possible values:
  909. // "failed"
  910. // "serving"
  911. // "syncing"
  912. Status string `json:"status,omitempty"`
  913. // TrackKind: The caption track's type.
  914. //
  915. // Possible values:
  916. // "ASR"
  917. // "forced"
  918. // "standard"
  919. TrackKind string `json:"trackKind,omitempty"`
  920. // VideoId: The ID that YouTube uses to uniquely identify the video
  921. // associated with the caption track.
  922. VideoId string `json:"videoId,omitempty"`
  923. // ForceSendFields is a list of field names (e.g. "AudioTrackType") to
  924. // unconditionally include in API requests. By default, fields with
  925. // empty values are omitted from API requests. However, any non-pointer,
  926. // non-interface field appearing in ForceSendFields will be sent to the
  927. // server regardless of whether the field is empty or not. This may be
  928. // used to include empty fields in Patch requests.
  929. ForceSendFields []string `json:"-"`
  930. }
  931. func (s *CaptionSnippet) MarshalJSON() ([]byte, error) {
  932. type noMethod CaptionSnippet
  933. raw := noMethod(*s)
  934. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  935. }
  936. // CdnSettings: Brief description of the live stream cdn settings.
  937. type CdnSettings struct {
  938. // Format: The format of the video stream that you are sending to
  939. // Youtube.
  940. Format string `json:"format,omitempty"`
  941. // IngestionInfo: The ingestionInfo object contains information that
  942. // YouTube provides that you need to transmit your RTMP or HTTP stream
  943. // to YouTube.
  944. IngestionInfo *IngestionInfo `json:"ingestionInfo,omitempty"`
  945. // IngestionType: The method or protocol used to transmit the video
  946. // stream.
  947. //
  948. // Possible values:
  949. // "dash"
  950. // "rtmp"
  951. IngestionType string `json:"ingestionType,omitempty"`
  952. // ForceSendFields is a list of field names (e.g. "Format") to
  953. // unconditionally include in API requests. By default, fields with
  954. // empty values are omitted from API requests. However, any non-pointer,
  955. // non-interface field appearing in ForceSendFields will be sent to the
  956. // server regardless of whether the field is empty or not. This may be
  957. // used to include empty fields in Patch requests.
  958. ForceSendFields []string `json:"-"`
  959. }
  960. func (s *CdnSettings) MarshalJSON() ([]byte, error) {
  961. type noMethod CdnSettings
  962. raw := noMethod(*s)
  963. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  964. }
  965. // Channel: A channel resource contains information about a YouTube
  966. // channel.
  967. type Channel struct {
  968. // AuditDetails: The auditionDetails object encapsulates channel data
  969. // that is relevant for YouTube Partners during the audition process.
  970. AuditDetails *ChannelAuditDetails `json:"auditDetails,omitempty"`
  971. // BrandingSettings: The brandingSettings object encapsulates
  972. // information about the branding of the channel.
  973. BrandingSettings *ChannelBrandingSettings `json:"brandingSettings,omitempty"`
  974. // ContentDetails: The contentDetails object encapsulates information
  975. // about the channel's content.
  976. ContentDetails *ChannelContentDetails `json:"contentDetails,omitempty"`
  977. // ContentOwnerDetails: The contentOwnerDetails object encapsulates
  978. // channel data that is relevant for YouTube Partners linked with the
  979. // channel.
  980. ContentOwnerDetails *ChannelContentOwnerDetails `json:"contentOwnerDetails,omitempty"`
  981. // ConversionPings: The conversionPings object encapsulates information
  982. // about conversion pings that need to be respected by the channel.
  983. ConversionPings *ChannelConversionPings `json:"conversionPings,omitempty"`
  984. // Etag: Etag of this resource.
  985. Etag string `json:"etag,omitempty"`
  986. // Id: The ID that YouTube uses to uniquely identify the channel.
  987. Id string `json:"id,omitempty"`
  988. // InvideoPromotion: The invideoPromotion object encapsulates
  989. // information about promotion campaign associated with the channel.
  990. InvideoPromotion *InvideoPromotion `json:"invideoPromotion,omitempty"`
  991. // Kind: Identifies what kind of resource this is. Value: the fixed
  992. // string "youtube#channel".
  993. Kind string `json:"kind,omitempty"`
  994. // Localizations: Localizations for different languages
  995. Localizations map[string]ChannelLocalization `json:"localizations,omitempty"`
  996. // Snippet: The snippet object contains basic details about the channel,
  997. // such as its title, description, and thumbnail images.
  998. Snippet *ChannelSnippet `json:"snippet,omitempty"`
  999. // Statistics: The statistics object encapsulates statistics for the
  1000. // channel.
  1001. Statistics *ChannelStatistics `json:"statistics,omitempty"`
  1002. // Status: The status object encapsulates information about the privacy
  1003. // status of the channel.
  1004. Status *ChannelStatus `json:"status,omitempty"`
  1005. // TopicDetails: The topicDetails object encapsulates information about
  1006. // Freebase topics associated with the channel.
  1007. TopicDetails *ChannelTopicDetails `json:"topicDetails,omitempty"`
  1008. // ServerResponse contains the HTTP response code and headers from the
  1009. // server.
  1010. googleapi.ServerResponse `json:"-"`
  1011. // ForceSendFields is a list of field names (e.g. "AuditDetails") to
  1012. // unconditionally include in API requests. By default, fields with
  1013. // empty values are omitted from API requests. However, any non-pointer,
  1014. // non-interface field appearing in ForceSendFields will be sent to the
  1015. // server regardless of whether the field is empty or not. This may be
  1016. // used to include empty fields in Patch requests.
  1017. ForceSendFields []string `json:"-"`
  1018. }
  1019. func (s *Channel) MarshalJSON() ([]byte, error) {
  1020. type noMethod Channel
  1021. raw := noMethod(*s)
  1022. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1023. }
  1024. // ChannelAuditDetails: The auditDetails object encapsulates channel
  1025. // data that is relevant for YouTube Partners during the audit process.
  1026. type ChannelAuditDetails struct {
  1027. // CommunityGuidelinesGoodStanding: Whether or not the channel respects
  1028. // the community guidelines.
  1029. CommunityGuidelinesGoodStanding bool `json:"communityGuidelinesGoodStanding,omitempty"`
  1030. // ContentIdClaimsGoodStanding: Whether or not the channel has any
  1031. // unresolved claims.
  1032. ContentIdClaimsGoodStanding bool `json:"contentIdClaimsGoodStanding,omitempty"`
  1033. // CopyrightStrikesGoodStanding: Whether or not the channel has any
  1034. // copyright strikes.
  1035. CopyrightStrikesGoodStanding bool `json:"copyrightStrikesGoodStanding,omitempty"`
  1036. // OverallGoodStanding: Describes the general state of the channel. This
  1037. // field will always show if there are any issues whatsoever with the
  1038. // channel. Currently this field represents the result of the logical
  1039. // and operation over the community guidelines good standing, the
  1040. // copyright strikes good standing and the content ID claims good
  1041. // standing, but this may change in the future.
  1042. OverallGoodStanding bool `json:"overallGoodStanding,omitempty"`
  1043. // ForceSendFields is a list of field names (e.g.
  1044. // "CommunityGuidelinesGoodStanding") to unconditionally include in API
  1045. // requests. By default, fields with empty values are omitted from API
  1046. // requests. However, any non-pointer, non-interface field appearing in
  1047. // ForceSendFields will be sent to the server regardless of whether the
  1048. // field is empty or not. This may be used to include empty fields in
  1049. // Patch requests.
  1050. ForceSendFields []string `json:"-"`
  1051. }
  1052. func (s *ChannelAuditDetails) MarshalJSON() ([]byte, error) {
  1053. type noMethod ChannelAuditDetails
  1054. raw := noMethod(*s)
  1055. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1056. }
  1057. // ChannelBannerResource: A channel banner returned as the response to a
  1058. // channel_banner.insert call.
  1059. type ChannelBannerResource struct {
  1060. // Etag: Etag of this resource.
  1061. Etag string `json:"etag,omitempty"`
  1062. // Kind: Identifies what kind of resource this is. Value: the fixed
  1063. // string "youtube#channelBannerResource".
  1064. Kind string `json:"kind,omitempty"`
  1065. // Url: The URL of this banner image.
  1066. Url string `json:"url,omitempty"`
  1067. // ServerResponse contains the HTTP response code and headers from the
  1068. // server.
  1069. googleapi.ServerResponse `json:"-"`
  1070. // ForceSendFields is a list of field names (e.g. "Etag") to
  1071. // unconditionally include in API requests. By default, fields with
  1072. // empty values are omitted from API requests. However, any non-pointer,
  1073. // non-interface field appearing in ForceSendFields will be sent to the
  1074. // server regardless of whether the field is empty or not. This may be
  1075. // used to include empty fields in Patch requests.
  1076. ForceSendFields []string `json:"-"`
  1077. }
  1078. func (s *ChannelBannerResource) MarshalJSON() ([]byte, error) {
  1079. type noMethod ChannelBannerResource
  1080. raw := noMethod(*s)
  1081. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1082. }
  1083. // ChannelBrandingSettings: Branding properties of a YouTube channel.
  1084. type ChannelBrandingSettings struct {
  1085. // Channel: Branding properties for the channel view.
  1086. Channel *ChannelSettings `json:"channel,omitempty"`
  1087. // Hints: Additional experimental branding properties.
  1088. Hints []*PropertyValue `json:"hints,omitempty"`
  1089. // Image: Branding properties for branding images.
  1090. Image *ImageSettings `json:"image,omitempty"`
  1091. // Watch: Branding properties for the watch page.
  1092. Watch *WatchSettings `json:"watch,omitempty"`
  1093. // ForceSendFields is a list of field names (e.g. "Channel") to
  1094. // unconditionally include in API requests. By default, fields with
  1095. // empty values are omitted from API requests. However, any non-pointer,
  1096. // non-interface field appearing in ForceSendFields will be sent to the
  1097. // server regardless of whether the field is empty or not. This may be
  1098. // used to include empty fields in Patch requests.
  1099. ForceSendFields []string `json:"-"`
  1100. }
  1101. func (s *ChannelBrandingSettings) MarshalJSON() ([]byte, error) {
  1102. type noMethod ChannelBrandingSettings
  1103. raw := noMethod(*s)
  1104. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1105. }
  1106. // ChannelContentDetails: Details about the content of a channel.
  1107. type ChannelContentDetails struct {
  1108. // GooglePlusUserId: The googlePlusUserId object identifies the Google+
  1109. // profile ID associated with this channel.
  1110. GooglePlusUserId string `json:"googlePlusUserId,omitempty"`
  1111. RelatedPlaylists *ChannelContentDetailsRelatedPlaylists `json:"relatedPlaylists,omitempty"`
  1112. // ForceSendFields is a list of field names (e.g. "GooglePlusUserId") to
  1113. // unconditionally include in API requests. By default, fields with
  1114. // empty values are omitted from API requests. However, any non-pointer,
  1115. // non-interface field appearing in ForceSendFields will be sent to the
  1116. // server regardless of whether the field is empty or not. This may be
  1117. // used to include empty fields in Patch requests.
  1118. ForceSendFields []string `json:"-"`
  1119. }
  1120. func (s *ChannelContentDetails) MarshalJSON() ([]byte, error) {
  1121. type noMethod ChannelContentDetails
  1122. raw := noMethod(*s)
  1123. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1124. }
  1125. type ChannelContentDetailsRelatedPlaylists struct {
  1126. // Favorites: The ID of the playlist that contains the channel"s
  1127. // favorite videos. Use the playlistItems.insert and
  1128. // playlistItems.delete to add or remove items from that list.
  1129. Favorites string `json:"favorites,omitempty"`
  1130. // Likes: The ID of the playlist that contains the channel"s liked
  1131. // videos. Use the playlistItems.insert and playlistItems.delete to
  1132. // add or remove items from that list.
  1133. Likes string `json:"likes,omitempty"`
  1134. // Uploads: The ID of the playlist that contains the channel"s uploaded
  1135. // videos. Use the videos.insert method to upload new videos and the
  1136. // videos.delete method to delete previously uploaded videos.
  1137. Uploads string `json:"uploads,omitempty"`
  1138. // WatchHistory: The ID of the playlist that contains the channel"s
  1139. // watch history. Use the playlistItems.insert and
  1140. // playlistItems.delete to add or remove items from that list.
  1141. WatchHistory string `json:"watchHistory,omitempty"`
  1142. // WatchLater: The ID of the playlist that contains the channel"s watch
  1143. // later playlist. Use the playlistItems.insert and
  1144. // playlistItems.delete to add or remove items from that list.
  1145. WatchLater string `json:"watchLater,omitempty"`
  1146. // ForceSendFields is a list of field names (e.g. "Favorites") to
  1147. // unconditionally include in API requests. By default, fields with
  1148. // empty values are omitted from API requests. However, any non-pointer,
  1149. // non-interface field appearing in ForceSendFields will be sent to the
  1150. // server regardless of whether the field is empty or not. This may be
  1151. // used to include empty fields in Patch requests.
  1152. ForceSendFields []string `json:"-"`
  1153. }
  1154. func (s *ChannelContentDetailsRelatedPlaylists) MarshalJSON() ([]byte, error) {
  1155. type noMethod ChannelContentDetailsRelatedPlaylists
  1156. raw := noMethod(*s)
  1157. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1158. }
  1159. // ChannelContentOwnerDetails: The contentOwnerDetails object
  1160. // encapsulates channel data that is relevant for YouTube Partners
  1161. // linked with the channel.
  1162. type ChannelContentOwnerDetails struct {
  1163. // ContentOwner: The ID of the content owner linked to the channel.
  1164. ContentOwner string `json:"contentOwner,omitempty"`
  1165. // TimeLinked: The date and time of when the channel was linked to the
  1166. // content owner. The value is specified in ISO 8601
  1167. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  1168. TimeLinked string `json:"timeLinked,omitempty"`
  1169. // ForceSendFields is a list of field names (e.g. "ContentOwner") to
  1170. // unconditionally include in API requests. By default, fields with
  1171. // empty values are omitted from API requests. However, any non-pointer,
  1172. // non-interface field appearing in ForceSendFields will be sent to the
  1173. // server regardless of whether the field is empty or not. This may be
  1174. // used to include empty fields in Patch requests.
  1175. ForceSendFields []string `json:"-"`
  1176. }
  1177. func (s *ChannelContentOwnerDetails) MarshalJSON() ([]byte, error) {
  1178. type noMethod ChannelContentOwnerDetails
  1179. raw := noMethod(*s)
  1180. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1181. }
  1182. // ChannelConversionPing: Pings that the app shall fire (authenticated
  1183. // by biscotti cookie). Each ping has a context, in which the app must
  1184. // fire the ping, and a url identifying the ping.
  1185. type ChannelConversionPing struct {
  1186. // Context: Defines the context of the ping.
  1187. //
  1188. // Possible values:
  1189. // "cview"
  1190. // "subscribe"
  1191. // "unsubscribe"
  1192. Context string `json:"context,omitempty"`
  1193. // ConversionUrl: The url (without the schema) that the player shall
  1194. // send the ping to. It's at caller's descretion to decide which schema
  1195. // to use (http vs https) Example of a returned url:
  1196. // //googleads.g.doubleclick.net/pagead/
  1197. // viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D
  1198. // cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must
  1199. // append biscotti authentication (ms param in case of mobile, for
  1200. // example) to this ping.
  1201. ConversionUrl string `json:"conversionUrl,omitempty"`
  1202. // ForceSendFields is a list of field names (e.g. "Context") to
  1203. // unconditionally include in API requests. By default, fields with
  1204. // empty values are omitted from API requests. However, any non-pointer,
  1205. // non-interface field appearing in ForceSendFields will be sent to the
  1206. // server regardless of whether the field is empty or not. This may be
  1207. // used to include empty fields in Patch requests.
  1208. ForceSendFields []string `json:"-"`
  1209. }
  1210. func (s *ChannelConversionPing) MarshalJSON() ([]byte, error) {
  1211. type noMethod ChannelConversionPing
  1212. raw := noMethod(*s)
  1213. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1214. }
  1215. // ChannelConversionPings: The conversionPings object encapsulates
  1216. // information about conversion pings that need to be respected by the
  1217. // channel.
  1218. type ChannelConversionPings struct {
  1219. // Pings: Pings that the app shall fire (authenticated by biscotti
  1220. // cookie). Each ping has a context, in which the app must fire the
  1221. // ping, and a url identifying the ping.
  1222. Pings []*ChannelConversionPing `json:"pings,omitempty"`
  1223. // ForceSendFields is a list of field names (e.g. "Pings") to
  1224. // unconditionally include in API requests. By default, fields with
  1225. // empty values are omitted from API requests. However, any non-pointer,
  1226. // non-interface field appearing in ForceSendFields will be sent to the
  1227. // server regardless of whether the field is empty or not. This may be
  1228. // used to include empty fields in Patch requests.
  1229. ForceSendFields []string `json:"-"`
  1230. }
  1231. func (s *ChannelConversionPings) MarshalJSON() ([]byte, error) {
  1232. type noMethod ChannelConversionPings
  1233. raw := noMethod(*s)
  1234. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1235. }
  1236. type ChannelListResponse struct {
  1237. // Etag: Etag of this resource.
  1238. Etag string `json:"etag,omitempty"`
  1239. // EventId: Serialized EventId of the request which produced this
  1240. // response.
  1241. EventId string `json:"eventId,omitempty"`
  1242. // Items: A list of channels that match the request criteria.
  1243. Items []*Channel `json:"items,omitempty"`
  1244. // Kind: Identifies what kind of resource this is. Value: the fixed
  1245. // string "youtube#channelListResponse".
  1246. Kind string `json:"kind,omitempty"`
  1247. // NextPageToken: The token that can be used as the value of the
  1248. // pageToken parameter to retrieve the next page in the result set.
  1249. NextPageToken string `json:"nextPageToken,omitempty"`
  1250. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1251. // PrevPageToken: The token that can be used as the value of the
  1252. // pageToken parameter to retrieve the previous page in the result set.
  1253. PrevPageToken string `json:"prevPageToken,omitempty"`
  1254. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1255. // VisitorId: The visitorId identifies the visitor.
  1256. VisitorId string `json:"visitorId,omitempty"`
  1257. // ServerResponse contains the HTTP response code and headers from the
  1258. // server.
  1259. googleapi.ServerResponse `json:"-"`
  1260. // ForceSendFields is a list of field names (e.g. "Etag") to
  1261. // unconditionally include in API requests. By default, fields with
  1262. // empty values are omitted from API requests. However, any non-pointer,
  1263. // non-interface field appearing in ForceSendFields will be sent to the
  1264. // server regardless of whether the field is empty or not. This may be
  1265. // used to include empty fields in Patch requests.
  1266. ForceSendFields []string `json:"-"`
  1267. }
  1268. func (s *ChannelListResponse) MarshalJSON() ([]byte, error) {
  1269. type noMethod ChannelListResponse
  1270. raw := noMethod(*s)
  1271. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1272. }
  1273. // ChannelLocalization: Channel localization setting
  1274. type ChannelLocalization struct {
  1275. // Description: The localized strings for channel's description.
  1276. Description string `json:"description,omitempty"`
  1277. // Title: The localized strings for channel's title.
  1278. Title string `json:"title,omitempty"`
  1279. // ForceSendFields is a list of field names (e.g. "Description") to
  1280. // unconditionally include in API requests. By default, fields with
  1281. // empty values are omitted from API requests. However, any non-pointer,
  1282. // non-interface field appearing in ForceSendFields will be sent to the
  1283. // server regardless of whether the field is empty or not. This may be
  1284. // used to include empty fields in Patch requests.
  1285. ForceSendFields []string `json:"-"`
  1286. }
  1287. func (s *ChannelLocalization) MarshalJSON() ([]byte, error) {
  1288. type noMethod ChannelLocalization
  1289. raw := noMethod(*s)
  1290. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1291. }
  1292. type ChannelProfileDetails struct {
  1293. // ChannelId: The YouTube channel ID.
  1294. ChannelId string `json:"channelId,omitempty"`
  1295. // ChannelUrl: The channel's URL.
  1296. ChannelUrl string `json:"channelUrl,omitempty"`
  1297. // DisplayName: The channel's display name.
  1298. DisplayName string `json:"displayName,omitempty"`
  1299. // ProfileImageUrl: The channels's avatar URL.
  1300. ProfileImageUrl string `json:"profileImageUrl,omitempty"`
  1301. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  1302. // unconditionally include in API requests. By default, fields with
  1303. // empty values are omitted from API requests. However, any non-pointer,
  1304. // non-interface field appearing in ForceSendFields will be sent to the
  1305. // server regardless of whether the field is empty or not. This may be
  1306. // used to include empty fields in Patch requests.
  1307. ForceSendFields []string `json:"-"`
  1308. }
  1309. func (s *ChannelProfileDetails) MarshalJSON() ([]byte, error) {
  1310. type noMethod ChannelProfileDetails
  1311. raw := noMethod(*s)
  1312. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1313. }
  1314. type ChannelSection struct {
  1315. // ContentDetails: The contentDetails object contains details about the
  1316. // channel section content, such as a list of playlists or channels
  1317. // featured in the section.
  1318. ContentDetails *ChannelSectionContentDetails `json:"contentDetails,omitempty"`
  1319. // Etag: Etag of this resource.
  1320. Etag string `json:"etag,omitempty"`
  1321. // Id: The ID that YouTube uses to uniquely identify the channel
  1322. // section.
  1323. Id string `json:"id,omitempty"`
  1324. // Kind: Identifies what kind of resource this is. Value: the fixed
  1325. // string "youtube#channelSection".
  1326. Kind string `json:"kind,omitempty"`
  1327. // Localizations: Localizations for different languages
  1328. Localizations map[string]ChannelSectionLocalization `json:"localizations,omitempty"`
  1329. // Snippet: The snippet object contains basic details about the channel
  1330. // section, such as its type, style and title.
  1331. Snippet *ChannelSectionSnippet `json:"snippet,omitempty"`
  1332. // Targeting: The targeting object contains basic targeting settings
  1333. // about the channel section.
  1334. Targeting *ChannelSectionTargeting `json:"targeting,omitempty"`
  1335. // ServerResponse contains the HTTP response code and headers from the
  1336. // server.
  1337. googleapi.ServerResponse `json:"-"`
  1338. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  1339. // unconditionally include in API requests. By default, fields with
  1340. // empty values are omitted from API requests. However, any non-pointer,
  1341. // non-interface field appearing in ForceSendFields will be sent to the
  1342. // server regardless of whether the field is empty or not. This may be
  1343. // used to include empty fields in Patch requests.
  1344. ForceSendFields []string `json:"-"`
  1345. }
  1346. func (s *ChannelSection) MarshalJSON() ([]byte, error) {
  1347. type noMethod ChannelSection
  1348. raw := noMethod(*s)
  1349. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1350. }
  1351. // ChannelSectionContentDetails: Details about a channelsection,
  1352. // including playlists and channels.
  1353. type ChannelSectionContentDetails struct {
  1354. // Channels: The channel ids for type multiple_channels.
  1355. Channels []string `json:"channels,omitempty"`
  1356. // Playlists: The playlist ids for type single_playlist and
  1357. // multiple_playlists. For singlePlaylist, only one playlistId is
  1358. // allowed.
  1359. Playlists []string `json:"playlists,omitempty"`
  1360. // ForceSendFields is a list of field names (e.g. "Channels") to
  1361. // unconditionally include in API requests. By default, fields with
  1362. // empty values are omitted from API requests. However, any non-pointer,
  1363. // non-interface field appearing in ForceSendFields will be sent to the
  1364. // server regardless of whether the field is empty or not. This may be
  1365. // used to include empty fields in Patch requests.
  1366. ForceSendFields []string `json:"-"`
  1367. }
  1368. func (s *ChannelSectionContentDetails) MarshalJSON() ([]byte, error) {
  1369. type noMethod ChannelSectionContentDetails
  1370. raw := noMethod(*s)
  1371. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1372. }
  1373. type ChannelSectionListResponse struct {
  1374. // Etag: Etag of this resource.
  1375. Etag string `json:"etag,omitempty"`
  1376. // EventId: Serialized EventId of the request which produced this
  1377. // response.
  1378. EventId string `json:"eventId,omitempty"`
  1379. // Items: A list of ChannelSections that match the request criteria.
  1380. Items []*ChannelSection `json:"items,omitempty"`
  1381. // Kind: Identifies what kind of resource this is. Value: the fixed
  1382. // string "youtube#channelSectionListResponse".
  1383. Kind string `json:"kind,omitempty"`
  1384. // VisitorId: The visitorId identifies the visitor.
  1385. VisitorId string `json:"visitorId,omitempty"`
  1386. // ServerResponse contains the HTTP response code and headers from the
  1387. // server.
  1388. googleapi.ServerResponse `json:"-"`
  1389. // ForceSendFields is a list of field names (e.g. "Etag") to
  1390. // unconditionally include in API requests. By default, fields with
  1391. // empty values are omitted from API requests. However, any non-pointer,
  1392. // non-interface field appearing in ForceSendFields will be sent to the
  1393. // server regardless of whether the field is empty or not. This may be
  1394. // used to include empty fields in Patch requests.
  1395. ForceSendFields []string `json:"-"`
  1396. }
  1397. func (s *ChannelSectionListResponse) MarshalJSON() ([]byte, error) {
  1398. type noMethod ChannelSectionListResponse
  1399. raw := noMethod(*s)
  1400. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1401. }
  1402. // ChannelSectionLocalization: ChannelSection localization setting
  1403. type ChannelSectionLocalization struct {
  1404. // Title: The localized strings for channel section's title.
  1405. Title string `json:"title,omitempty"`
  1406. // ForceSendFields is a list of field names (e.g. "Title") to
  1407. // unconditionally include in API requests. By default, fields with
  1408. // empty values are omitted from API requests. However, any non-pointer,
  1409. // non-interface field appearing in ForceSendFields will be sent to the
  1410. // server regardless of whether the field is empty or not. This may be
  1411. // used to include empty fields in Patch requests.
  1412. ForceSendFields []string `json:"-"`
  1413. }
  1414. func (s *ChannelSectionLocalization) MarshalJSON() ([]byte, error) {
  1415. type noMethod ChannelSectionLocalization
  1416. raw := noMethod(*s)
  1417. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1418. }
  1419. // ChannelSectionSnippet: Basic details about a channel section,
  1420. // including title, style and position.
  1421. type ChannelSectionSnippet struct {
  1422. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  1423. // that published the channel section.
  1424. ChannelId string `json:"channelId,omitempty"`
  1425. // DefaultLanguage: The language of the channel section's default title
  1426. // and description.
  1427. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1428. // Localized: Localized title, read-only.
  1429. Localized *ChannelSectionLocalization `json:"localized,omitempty"`
  1430. // Position: The position of the channel section in the channel.
  1431. Position *int64 `json:"position,omitempty"`
  1432. // Style: The style of the channel section.
  1433. //
  1434. // Possible values:
  1435. // "channelsectionStyleUndefined"
  1436. // "horizontalRow"
  1437. // "verticalList"
  1438. Style string `json:"style,omitempty"`
  1439. // Title: The channel section's title for multiple_playlists and
  1440. // multiple_channels.
  1441. Title string `json:"title,omitempty"`
  1442. // Type: The type of the channel section.
  1443. //
  1444. // Possible values:
  1445. // "allPlaylists"
  1446. // "channelsectionTypeUndefined"
  1447. // "completedEvents"
  1448. // "likedPlaylists"
  1449. // "likes"
  1450. // "liveEvents"
  1451. // "multipleChannels"
  1452. // "multiplePlaylists"
  1453. // "popularUploads"
  1454. // "postedPlaylists"
  1455. // "postedVideos"
  1456. // "recentActivity"
  1457. // "recentPosts"
  1458. // "recentUploads"
  1459. // "singlePlaylist"
  1460. // "subscriptions"
  1461. // "upcomingEvents"
  1462. Type string `json:"type,omitempty"`
  1463. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  1464. // unconditionally include in API requests. By default, fields with
  1465. // empty values are omitted from API requests. However, any non-pointer,
  1466. // non-interface field appearing in ForceSendFields will be sent to the
  1467. // server regardless of whether the field is empty or not. This may be
  1468. // used to include empty fields in Patch requests.
  1469. ForceSendFields []string `json:"-"`
  1470. }
  1471. func (s *ChannelSectionSnippet) MarshalJSON() ([]byte, error) {
  1472. type noMethod ChannelSectionSnippet
  1473. raw := noMethod(*s)
  1474. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1475. }
  1476. // ChannelSectionTargeting: ChannelSection targeting setting.
  1477. type ChannelSectionTargeting struct {
  1478. // Countries: The country the channel section is targeting.
  1479. Countries []string `json:"countries,omitempty"`
  1480. // Languages: The language the channel section is targeting.
  1481. Languages []string `json:"languages,omitempty"`
  1482. // Regions: The region the channel section is targeting.
  1483. Regions []string `json:"regions,omitempty"`
  1484. // ForceSendFields is a list of field names (e.g. "Countries") to
  1485. // unconditionally include in API requests. By default, fields with
  1486. // empty values are omitted from API requests. However, any non-pointer,
  1487. // non-interface field appearing in ForceSendFields will be sent to the
  1488. // server regardless of whether the field is empty or not. This may be
  1489. // used to include empty fields in Patch requests.
  1490. ForceSendFields []string `json:"-"`
  1491. }
  1492. func (s *ChannelSectionTargeting) MarshalJSON() ([]byte, error) {
  1493. type noMethod ChannelSectionTargeting
  1494. raw := noMethod(*s)
  1495. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1496. }
  1497. // ChannelSettings: Branding properties for the channel view.
  1498. type ChannelSettings struct {
  1499. // Country: The country of the channel.
  1500. Country string `json:"country,omitempty"`
  1501. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1502. // DefaultTab: Which content tab users should see when viewing the
  1503. // channel.
  1504. DefaultTab string `json:"defaultTab,omitempty"`
  1505. // Description: Specifies the channel description.
  1506. Description string `json:"description,omitempty"`
  1507. // FeaturedChannelsTitle: Title for the featured channels tab.
  1508. FeaturedChannelsTitle string `json:"featuredChannelsTitle,omitempty"`
  1509. // FeaturedChannelsUrls: The list of featured channels.
  1510. FeaturedChannelsUrls []string `json:"featuredChannelsUrls,omitempty"`
  1511. // Keywords: Lists keywords associated with the channel,
  1512. // comma-separated.
  1513. Keywords string `json:"keywords,omitempty"`
  1514. // ModerateComments: Whether user-submitted comments left on the channel
  1515. // page need to be approved by the channel owner to be publicly visible.
  1516. ModerateComments bool `json:"moderateComments,omitempty"`
  1517. // ProfileColor: A prominent color that can be rendered on this channel
  1518. // page.
  1519. ProfileColor string `json:"profileColor,omitempty"`
  1520. // ShowBrowseView: Whether the tab to browse the videos should be
  1521. // displayed.
  1522. ShowBrowseView bool `json:"showBrowseView,omitempty"`
  1523. // ShowRelatedChannels: Whether related channels should be proposed.
  1524. ShowRelatedChannels bool `json:"showRelatedChannels,omitempty"`
  1525. // Title: Specifies the channel title.
  1526. Title string `json:"title,omitempty"`
  1527. // TrackingAnalyticsAccountId: The ID for a Google Analytics account to
  1528. // track and measure traffic to the channels.
  1529. TrackingAnalyticsAccountId string `json:"trackingAnalyticsAccountId,omitempty"`
  1530. // UnsubscribedTrailer: The trailer of the channel, for users that are
  1531. // not subscribers.
  1532. UnsubscribedTrailer string `json:"unsubscribedTrailer,omitempty"`
  1533. // ForceSendFields is a list of field names (e.g. "Country") to
  1534. // unconditionally include in API requests. By default, fields with
  1535. // empty values are omitted from API requests. However, any non-pointer,
  1536. // non-interface field appearing in ForceSendFields will be sent to the
  1537. // server regardless of whether the field is empty or not. This may be
  1538. // used to include empty fields in Patch requests.
  1539. ForceSendFields []string `json:"-"`
  1540. }
  1541. func (s *ChannelSettings) MarshalJSON() ([]byte, error) {
  1542. type noMethod ChannelSettings
  1543. raw := noMethod(*s)
  1544. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1545. }
  1546. // ChannelSnippet: Basic details about a channel, including title,
  1547. // description and thumbnails.
  1548. type ChannelSnippet struct {
  1549. // Country: The country of the channel.
  1550. Country string `json:"country,omitempty"`
  1551. // DefaultLanguage: The language of the channel's default title and
  1552. // description.
  1553. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1554. // Description: The description of the channel.
  1555. Description string `json:"description,omitempty"`
  1556. // Localized: Localized title and description, read-only.
  1557. Localized *ChannelLocalization `json:"localized,omitempty"`
  1558. // PublishedAt: The date and time that the channel was created. The
  1559. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  1560. PublishedAt string `json:"publishedAt,omitempty"`
  1561. // Thumbnails: A map of thumbnail images associated with the channel.
  1562. // For each object in the map, the key is the name of the thumbnail
  1563. // image, and the value is an object that contains other information
  1564. // about the thumbnail.
  1565. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  1566. // Title: The channel's title.
  1567. Title string `json:"title,omitempty"`
  1568. // ForceSendFields is a list of field names (e.g. "Country") to
  1569. // unconditionally include in API requests. By default, fields with
  1570. // empty values are omitted from API requests. However, any non-pointer,
  1571. // non-interface field appearing in ForceSendFields will be sent to the
  1572. // server regardless of whether the field is empty or not. This may be
  1573. // used to include empty fields in Patch requests.
  1574. ForceSendFields []string `json:"-"`
  1575. }
  1576. func (s *ChannelSnippet) MarshalJSON() ([]byte, error) {
  1577. type noMethod ChannelSnippet
  1578. raw := noMethod(*s)
  1579. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1580. }
  1581. // ChannelStatistics: Statistics about a channel: number of subscribers,
  1582. // number of videos in the channel, etc.
  1583. type ChannelStatistics struct {
  1584. // CommentCount: The number of comments for the channel.
  1585. CommentCount uint64 `json:"commentCount,omitempty,string"`
  1586. // HiddenSubscriberCount: Whether or not the number of subscribers is
  1587. // shown for this user.
  1588. HiddenSubscriberCount bool `json:"hiddenSubscriberCount,omitempty"`
  1589. // SubscriberCount: The number of subscribers that the channel has.
  1590. SubscriberCount uint64 `json:"subscriberCount,omitempty,string"`
  1591. // VideoCount: The number of videos uploaded to the channel.
  1592. VideoCount uint64 `json:"videoCount,omitempty,string"`
  1593. // ViewCount: The number of times the channel has been viewed.
  1594. ViewCount uint64 `json:"viewCount,omitempty,string"`
  1595. // ForceSendFields is a list of field names (e.g. "CommentCount") to
  1596. // unconditionally include in API requests. By default, fields with
  1597. // empty values are omitted from API requests. However, any non-pointer,
  1598. // non-interface field appearing in ForceSendFields will be sent to the
  1599. // server regardless of whether the field is empty or not. This may be
  1600. // used to include empty fields in Patch requests.
  1601. ForceSendFields []string `json:"-"`
  1602. }
  1603. func (s *ChannelStatistics) MarshalJSON() ([]byte, error) {
  1604. type noMethod ChannelStatistics
  1605. raw := noMethod(*s)
  1606. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1607. }
  1608. // ChannelStatus: JSON template for the status part of a channel.
  1609. type ChannelStatus struct {
  1610. // IsLinked: If true, then the user is linked to either a YouTube
  1611. // username or G+ account. Otherwise, the user doesn't have a public
  1612. // YouTube identity.
  1613. IsLinked bool `json:"isLinked,omitempty"`
  1614. // LongUploadsStatus: The long uploads status of this channel. See
  1615. //
  1616. // Possible values:
  1617. // "allowed"
  1618. // "disallowed"
  1619. // "eligible"
  1620. // "longUploadsUnspecified"
  1621. LongUploadsStatus string `json:"longUploadsStatus,omitempty"`
  1622. // PrivacyStatus: Privacy status of the channel.
  1623. //
  1624. // Possible values:
  1625. // "private"
  1626. // "public"
  1627. // "unlisted"
  1628. PrivacyStatus string `json:"privacyStatus,omitempty"`
  1629. // ForceSendFields is a list of field names (e.g. "IsLinked") to
  1630. // unconditionally include in API requests. By default, fields with
  1631. // empty values are omitted from API requests. However, any non-pointer,
  1632. // non-interface field appearing in ForceSendFields will be sent to the
  1633. // server regardless of whether the field is empty or not. This may be
  1634. // used to include empty fields in Patch requests.
  1635. ForceSendFields []string `json:"-"`
  1636. }
  1637. func (s *ChannelStatus) MarshalJSON() ([]byte, error) {
  1638. type noMethod ChannelStatus
  1639. raw := noMethod(*s)
  1640. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1641. }
  1642. // ChannelTopicDetails: Freebase topic information related to the
  1643. // channel.
  1644. type ChannelTopicDetails struct {
  1645. // TopicIds: A list of Freebase topic IDs associated with the channel.
  1646. // You can retrieve information about each topic using the Freebase
  1647. // Topic API.
  1648. TopicIds []string `json:"topicIds,omitempty"`
  1649. // ForceSendFields is a list of field names (e.g. "TopicIds") to
  1650. // unconditionally include in API requests. By default, fields with
  1651. // empty values are omitted from API requests. However, any non-pointer,
  1652. // non-interface field appearing in ForceSendFields will be sent to the
  1653. // server regardless of whether the field is empty or not. This may be
  1654. // used to include empty fields in Patch requests.
  1655. ForceSendFields []string `json:"-"`
  1656. }
  1657. func (s *ChannelTopicDetails) MarshalJSON() ([]byte, error) {
  1658. type noMethod ChannelTopicDetails
  1659. raw := noMethod(*s)
  1660. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1661. }
  1662. // Comment: A comment represents a single YouTube comment.
  1663. type Comment struct {
  1664. // Etag: Etag of this resource.
  1665. Etag string `json:"etag,omitempty"`
  1666. // Id: The ID that YouTube uses to uniquely identify the comment.
  1667. Id string `json:"id,omitempty"`
  1668. // Kind: Identifies what kind of resource this is. Value: the fixed
  1669. // string "youtube#comment".
  1670. Kind string `json:"kind,omitempty"`
  1671. // Snippet: The snippet object contains basic details about the comment.
  1672. Snippet *CommentSnippet `json:"snippet,omitempty"`
  1673. // ServerResponse contains the HTTP response code and headers from the
  1674. // server.
  1675. googleapi.ServerResponse `json:"-"`
  1676. // ForceSendFields is a list of field names (e.g. "Etag") to
  1677. // unconditionally include in API requests. By default, fields with
  1678. // empty values are omitted from API requests. However, any non-pointer,
  1679. // non-interface field appearing in ForceSendFields will be sent to the
  1680. // server regardless of whether the field is empty or not. This may be
  1681. // used to include empty fields in Patch requests.
  1682. ForceSendFields []string `json:"-"`
  1683. }
  1684. func (s *Comment) MarshalJSON() ([]byte, error) {
  1685. type noMethod Comment
  1686. raw := noMethod(*s)
  1687. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1688. }
  1689. type CommentListResponse struct {
  1690. // Etag: Etag of this resource.
  1691. Etag string `json:"etag,omitempty"`
  1692. // EventId: Serialized EventId of the request which produced this
  1693. // response.
  1694. EventId string `json:"eventId,omitempty"`
  1695. // Items: A list of comments that match the request criteria.
  1696. Items []*Comment `json:"items,omitempty"`
  1697. // Kind: Identifies what kind of resource this is. Value: the fixed
  1698. // string "youtube#commentListResponse".
  1699. Kind string `json:"kind,omitempty"`
  1700. // NextPageToken: The token that can be used as the value of the
  1701. // pageToken parameter to retrieve the next page in the result set.
  1702. NextPageToken string `json:"nextPageToken,omitempty"`
  1703. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1704. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1705. // VisitorId: The visitorId identifies the visitor.
  1706. VisitorId string `json:"visitorId,omitempty"`
  1707. // ServerResponse contains the HTTP response code and headers from the
  1708. // server.
  1709. googleapi.ServerResponse `json:"-"`
  1710. // ForceSendFields is a list of field names (e.g. "Etag") to
  1711. // unconditionally include in API requests. By default, fields with
  1712. // empty values are omitted from API requests. However, any non-pointer,
  1713. // non-interface field appearing in ForceSendFields will be sent to the
  1714. // server regardless of whether the field is empty or not. This may be
  1715. // used to include empty fields in Patch requests.
  1716. ForceSendFields []string `json:"-"`
  1717. }
  1718. func (s *CommentListResponse) MarshalJSON() ([]byte, error) {
  1719. type noMethod CommentListResponse
  1720. raw := noMethod(*s)
  1721. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1722. }
  1723. // CommentSnippet: Basic details about a comment, such as its author and
  1724. // text.
  1725. type CommentSnippet struct {
  1726. // AuthorChannelId: The id of the author's YouTube channel, if any.
  1727. AuthorChannelId interface{} `json:"authorChannelId,omitempty"`
  1728. // AuthorChannelUrl: Link to the author's YouTube channel, if any.
  1729. AuthorChannelUrl string `json:"authorChannelUrl,omitempty"`
  1730. // AuthorDisplayName: The name of the user who posted the comment.
  1731. AuthorDisplayName string `json:"authorDisplayName,omitempty"`
  1732. // AuthorGoogleplusProfileUrl: Link to the author's Google+ profile, if
  1733. // any.
  1734. AuthorGoogleplusProfileUrl string `json:"authorGoogleplusProfileUrl,omitempty"`
  1735. // AuthorProfileImageUrl: The URL for the avatar of the user who posted
  1736. // the comment.
  1737. AuthorProfileImageUrl string `json:"authorProfileImageUrl,omitempty"`
  1738. // CanRate: Whether the current viewer can rate this comment.
  1739. CanRate bool `json:"canRate,omitempty"`
  1740. // ChannelId: The id of the corresponding YouTube channel. In case of a
  1741. // channel comment this is the channel the comment refers to. In case of
  1742. // a video comment it's the video's channel.
  1743. ChannelId string `json:"channelId,omitempty"`
  1744. // LikeCount: The total number of likes this comment has received.
  1745. LikeCount int64 `json:"likeCount,omitempty"`
  1746. // ModerationStatus: The comment's moderation status. Will not be set if
  1747. // the comments were requested through the id filter.
  1748. //
  1749. // Possible values:
  1750. // "heldForReview"
  1751. // "likelySpam"
  1752. // "published"
  1753. // "rejected"
  1754. ModerationStatus string `json:"moderationStatus,omitempty"`
  1755. // ParentId: The unique id of the parent comment, only set for replies.
  1756. ParentId string `json:"parentId,omitempty"`
  1757. // PublishedAt: The date and time when the comment was orignally
  1758. // published. The value is specified in ISO 8601
  1759. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  1760. PublishedAt string `json:"publishedAt,omitempty"`
  1761. // TextDisplay: The comment's text. The format is either plain text or
  1762. // HTML dependent on what has been requested. Even the plain text
  1763. // representation may differ from the text originally posted in that it
  1764. // may replace video links with video titles etc.
  1765. TextDisplay string `json:"textDisplay,omitempty"`
  1766. // TextOriginal: The comment's original raw text as initially posted or
  1767. // last updated. The original text will only be returned if it is
  1768. // accessible to the viewer, which is only guaranteed if the viewer is
  1769. // the comment's author.
  1770. TextOriginal string `json:"textOriginal,omitempty"`
  1771. // UpdatedAt: The date and time when was last updated . The value is
  1772. // specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  1773. UpdatedAt string `json:"updatedAt,omitempty"`
  1774. // VideoId: The ID of the video the comment refers to, if any.
  1775. VideoId string `json:"videoId,omitempty"`
  1776. // ViewerRating: The rating the viewer has given to this comment. For
  1777. // the time being this will never return RATE_TYPE_DISLIKE and instead
  1778. // return RATE_TYPE_NONE. This may change in the future.
  1779. //
  1780. // Possible values:
  1781. // "dislike"
  1782. // "like"
  1783. // "none"
  1784. // "unspecified"
  1785. ViewerRating string `json:"viewerRating,omitempty"`
  1786. // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to
  1787. // unconditionally include in API requests. By default, fields with
  1788. // empty values are omitted from API requests. However, any non-pointer,
  1789. // non-interface field appearing in ForceSendFields will be sent to the
  1790. // server regardless of whether the field is empty or not. This may be
  1791. // used to include empty fields in Patch requests.
  1792. ForceSendFields []string `json:"-"`
  1793. }
  1794. func (s *CommentSnippet) MarshalJSON() ([]byte, error) {
  1795. type noMethod CommentSnippet
  1796. raw := noMethod(*s)
  1797. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1798. }
  1799. // CommentThread: A comment thread represents information that applies
  1800. // to a top level comment and all its replies. It can also include the
  1801. // top level comment itself and some of the replies.
  1802. type CommentThread struct {
  1803. // Etag: Etag of this resource.
  1804. Etag string `json:"etag,omitempty"`
  1805. // Id: The ID that YouTube uses to uniquely identify the comment thread.
  1806. Id string `json:"id,omitempty"`
  1807. // Kind: Identifies what kind of resource this is. Value: the fixed
  1808. // string "youtube#commentThread".
  1809. Kind string `json:"kind,omitempty"`
  1810. // Replies: The replies object contains a limited number of replies (if
  1811. // any) to the top level comment found in the snippet.
  1812. Replies *CommentThreadReplies `json:"replies,omitempty"`
  1813. // Snippet: The snippet object contains basic details about the comment
  1814. // thread and also the top level comment.
  1815. Snippet *CommentThreadSnippet `json:"snippet,omitempty"`
  1816. // ServerResponse contains the HTTP response code and headers from the
  1817. // server.
  1818. googleapi.ServerResponse `json:"-"`
  1819. // ForceSendFields is a list of field names (e.g. "Etag") to
  1820. // unconditionally include in API requests. By default, fields with
  1821. // empty values are omitted from API requests. However, any non-pointer,
  1822. // non-interface field appearing in ForceSendFields will be sent to the
  1823. // server regardless of whether the field is empty or not. This may be
  1824. // used to include empty fields in Patch requests.
  1825. ForceSendFields []string `json:"-"`
  1826. }
  1827. func (s *CommentThread) MarshalJSON() ([]byte, error) {
  1828. type noMethod CommentThread
  1829. raw := noMethod(*s)
  1830. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1831. }
  1832. type CommentThreadListResponse struct {
  1833. // Etag: Etag of this resource.
  1834. Etag string `json:"etag,omitempty"`
  1835. // EventId: Serialized EventId of the request which produced this
  1836. // response.
  1837. EventId string `json:"eventId,omitempty"`
  1838. // Items: A list of comment threads that match the request criteria.
  1839. Items []*CommentThread `json:"items,omitempty"`
  1840. // Kind: Identifies what kind of resource this is. Value: the fixed
  1841. // string "youtube#commentThreadListResponse".
  1842. Kind string `json:"kind,omitempty"`
  1843. // NextPageToken: The token that can be used as the value of the
  1844. // pageToken parameter to retrieve the next page in the result set.
  1845. NextPageToken string `json:"nextPageToken,omitempty"`
  1846. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1847. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1848. // VisitorId: The visitorId identifies the visitor.
  1849. VisitorId string `json:"visitorId,omitempty"`
  1850. // ServerResponse contains the HTTP response code and headers from the
  1851. // server.
  1852. googleapi.ServerResponse `json:"-"`
  1853. // ForceSendFields is a list of field names (e.g. "Etag") to
  1854. // unconditionally include in API requests. By default, fields with
  1855. // empty values are omitted from API requests. However, any non-pointer,
  1856. // non-interface field appearing in ForceSendFields will be sent to the
  1857. // server regardless of whether the field is empty or not. This may be
  1858. // used to include empty fields in Patch requests.
  1859. ForceSendFields []string `json:"-"`
  1860. }
  1861. func (s *CommentThreadListResponse) MarshalJSON() ([]byte, error) {
  1862. type noMethod CommentThreadListResponse
  1863. raw := noMethod(*s)
  1864. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1865. }
  1866. // CommentThreadReplies: Comments written in (direct or indirect) reply
  1867. // to the top level comment.
  1868. type CommentThreadReplies struct {
  1869. // Comments: A limited number of replies. Unless the number of replies
  1870. // returned equals total_reply_count in the snippet the returned replies
  1871. // are only a subset of the total number of replies.
  1872. Comments []*Comment `json:"comments,omitempty"`
  1873. // ForceSendFields is a list of field names (e.g. "Comments") to
  1874. // unconditionally include in API requests. By default, fields with
  1875. // empty values are omitted from API requests. However, any non-pointer,
  1876. // non-interface field appearing in ForceSendFields will be sent to the
  1877. // server regardless of whether the field is empty or not. This may be
  1878. // used to include empty fields in Patch requests.
  1879. ForceSendFields []string `json:"-"`
  1880. }
  1881. func (s *CommentThreadReplies) MarshalJSON() ([]byte, error) {
  1882. type noMethod CommentThreadReplies
  1883. raw := noMethod(*s)
  1884. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1885. }
  1886. // CommentThreadSnippet: Basic details about a comment thread.
  1887. type CommentThreadSnippet struct {
  1888. // CanReply: Whether the current viewer of the thread can reply to it.
  1889. // This is viewer specific - other viewers may see a different value for
  1890. // this field.
  1891. CanReply bool `json:"canReply,omitempty"`
  1892. // ChannelId: The YouTube channel the comments in the thread refer to or
  1893. // the channel with the video the comments refer to. If video_id isn't
  1894. // set the comments refer to the channel itself.
  1895. ChannelId string `json:"channelId,omitempty"`
  1896. // IsPublic: Whether the thread (and therefore all its comments) is
  1897. // visible to all YouTube users.
  1898. IsPublic bool `json:"isPublic,omitempty"`
  1899. // TopLevelComment: The top level comment of this thread.
  1900. TopLevelComment *Comment `json:"topLevelComment,omitempty"`
  1901. // TotalReplyCount: The total number of replies (not including the top
  1902. // level comment).
  1903. TotalReplyCount int64 `json:"totalReplyCount,omitempty"`
  1904. // VideoId: The ID of the video the comments refer to, if any. No
  1905. // video_id implies a channel discussion comment.
  1906. VideoId string `json:"videoId,omitempty"`
  1907. // ForceSendFields is a list of field names (e.g. "CanReply") to
  1908. // unconditionally include in API requests. By default, fields with
  1909. // empty values are omitted from API requests. However, any non-pointer,
  1910. // non-interface field appearing in ForceSendFields will be sent to the
  1911. // server regardless of whether the field is empty or not. This may be
  1912. // used to include empty fields in Patch requests.
  1913. ForceSendFields []string `json:"-"`
  1914. }
  1915. func (s *CommentThreadSnippet) MarshalJSON() ([]byte, error) {
  1916. type noMethod CommentThreadSnippet
  1917. raw := noMethod(*s)
  1918. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1919. }
  1920. // ContentRating: Ratings schemes. The country-specific ratings are
  1921. // mostly for movies and shows. NEXT_ID: 67
  1922. type ContentRating struct {
  1923. // AcbRating: The video's Australian Classification Board (ACB) or
  1924. // Australian Communications and Media Authority (ACMA) rating. ACMA
  1925. // ratings are used to classify children's television programming.
  1926. //
  1927. // Possible values:
  1928. // "acbC"
  1929. // "acbE"
  1930. // "acbG"
  1931. // "acbM"
  1932. // "acbMa15plus"
  1933. // "acbP"
  1934. // "acbPg"
  1935. // "acbR18plus"
  1936. // "acbUnrated"
  1937. AcbRating string `json:"acbRating,omitempty"`
  1938. // AgcomRating: The video's rating from Italy's Autorità per le
  1939. // Garanzie nelle Comunicazioni (AGCOM).
  1940. //
  1941. // Possible values:
  1942. // "agcomT"
  1943. // "agcomUnrated"
  1944. // "agcomVm14"
  1945. // "agcomVm18"
  1946. AgcomRating string `json:"agcomRating,omitempty"`
  1947. // AnatelRating: The video's Anatel (Asociación Nacional de
  1948. // Televisión) rating for Chilean television.
  1949. //
  1950. // Possible values:
  1951. // "anatelA"
  1952. // "anatelF"
  1953. // "anatelI"
  1954. // "anatelI10"
  1955. // "anatelI12"
  1956. // "anatelI7"
  1957. // "anatelR"
  1958. // "anatelUnrated"
  1959. AnatelRating string `json:"anatelRating,omitempty"`
  1960. // BbfcRating: The video's British Board of Film Classification (BBFC)
  1961. // rating.
  1962. //
  1963. // Possible values:
  1964. // "bbfc12"
  1965. // "bbfc12a"
  1966. // "bbfc15"
  1967. // "bbfc18"
  1968. // "bbfcPg"
  1969. // "bbfcR18"
  1970. // "bbfcU"
  1971. // "bbfcUnrated"
  1972. BbfcRating string `json:"bbfcRating,omitempty"`
  1973. // BfvcRating: The video's rating from Thailand's Board of Film and
  1974. // Video Censors.
  1975. //
  1976. // Possible values:
  1977. // "bfvc13"
  1978. // "bfvc15"
  1979. // "bfvc18"
  1980. // "bfvc20"
  1981. // "bfvcB"
  1982. // "bfvcE"
  1983. // "bfvcG"
  1984. // "bfvcUnrated"
  1985. BfvcRating string `json:"bfvcRating,omitempty"`
  1986. // BmukkRating: The video's rating from the Austrian Board of Media
  1987. // Classification (Bundesministerium für Unterricht, Kunst und Kultur).
  1988. //
  1989. // Possible values:
  1990. // "bmukk10"
  1991. // "bmukk12"
  1992. // "bmukk14"
  1993. // "bmukk16"
  1994. // "bmukk6"
  1995. // "bmukk8"
  1996. // "bmukkAa"
  1997. // "bmukkUnrated"
  1998. BmukkRating string `json:"bmukkRating,omitempty"`
  1999. // CatvRating: Rating system for Canadian TV - Canadian TV
  2000. // Classification System The video's rating from the Canadian
  2001. // Radio-Television and Telecommunications Commission (CRTC) for
  2002. // Canadian English-language broadcasts. For more information, see the
  2003. // Canadian Broadcast Standards Council website.
  2004. //
  2005. // Possible values:
  2006. // "catv14plus"
  2007. // "catv18plus"
  2008. // "catvC"
  2009. // "catvC8"
  2010. // "catvG"
  2011. // "catvPg"
  2012. // "catvUnrated"
  2013. CatvRating string `json:"catvRating,omitempty"`
  2014. // CatvfrRating: The video's rating from the Canadian Radio-Television
  2015. // and Telecommunications Commission (CRTC) for Canadian French-language
  2016. // broadcasts. For more information, see the Canadian Broadcast
  2017. // Standards Council website.
  2018. //
  2019. // Possible values:
  2020. // "catvfr13plus"
  2021. // "catvfr16plus"
  2022. // "catvfr18plus"
  2023. // "catvfr8plus"
  2024. // "catvfrG"
  2025. // "catvfrUnrated"
  2026. CatvfrRating string `json:"catvfrRating,omitempty"`
  2027. // CbfcRating: The video's Central Board of Film Certification (CBFC -
  2028. // India) rating.
  2029. //
  2030. // Possible values:
  2031. // "cbfcA"
  2032. // "cbfcS"
  2033. // "cbfcU"
  2034. // "cbfcUA"
  2035. // "cbfcUnrated"
  2036. CbfcRating string `json:"cbfcRating,omitempty"`
  2037. // CccRating: The video's Consejo de Calificación Cinematográfica
  2038. // (Chile) rating.
  2039. //
  2040. // Possible values:
  2041. // "ccc14"
  2042. // "ccc18"
  2043. // "ccc18s"
  2044. // "ccc18v"
  2045. // "ccc6"
  2046. // "cccTe"
  2047. // "cccUnrated"
  2048. CccRating string `json:"cccRating,omitempty"`
  2049. // CceRating: The video's rating from Portugal's Comissão de
  2050. // Classificação de Espect´culos.
  2051. //
  2052. // Possible values:
  2053. // "cceM12"
  2054. // "cceM16"
  2055. // "cceM18"
  2056. // "cceM4"
  2057. // "cceM6"
  2058. // "cceUnrated"
  2059. CceRating string `json:"cceRating,omitempty"`
  2060. // ChfilmRating: The video's rating in Switzerland.
  2061. //
  2062. // Possible values:
  2063. // "chfilm0"
  2064. // "chfilm12"
  2065. // "chfilm16"
  2066. // "chfilm18"
  2067. // "chfilm6"
  2068. // "chfilmUnrated"
  2069. ChfilmRating string `json:"chfilmRating,omitempty"`
  2070. // ChvrsRating: The video's Canadian Home Video Rating System (CHVRS)
  2071. // rating.
  2072. //
  2073. // Possible values:
  2074. // "chvrs14a"
  2075. // "chvrs18a"
  2076. // "chvrsE"
  2077. // "chvrsG"
  2078. // "chvrsPg"
  2079. // "chvrsR"
  2080. // "chvrsUnrated"
  2081. ChvrsRating string `json:"chvrsRating,omitempty"`
  2082. // CicfRating: The video's rating from the Commission de Contrôle des
  2083. // Films (Belgium).
  2084. //
  2085. // Possible values:
  2086. // "cicfE"
  2087. // "cicfKntEna"
  2088. // "cicfKtEa"
  2089. // "cicfUnrated"
  2090. CicfRating string `json:"cicfRating,omitempty"`
  2091. // CnaRating: The video's rating from Romania's CONSILIUL NATIONAL AL
  2092. // AUDIOVIZUALULUI (CNA).
  2093. //
  2094. // Possible values:
  2095. // "cna12"
  2096. // "cna15"
  2097. // "cna18"
  2098. // "cna18plus"
  2099. // "cnaAp"
  2100. // "cnaUnrated"
  2101. CnaRating string `json:"cnaRating,omitempty"`
  2102. // CncRating: Rating system in France - Commission de classification
  2103. // cinematographique
  2104. //
  2105. // Possible values:
  2106. // "cnc10"
  2107. // "cnc12"
  2108. // "cnc16"
  2109. // "cnc18"
  2110. // "cncE"
  2111. // "cncT"
  2112. // "cncUnrated"
  2113. CncRating string `json:"cncRating,omitempty"`
  2114. // CsaRating: The video's rating from France's Conseil supérieur de
  2115. // l?audiovisuel, which rates broadcast content.
  2116. //
  2117. // Possible values:
  2118. // "csa10"
  2119. // "csa12"
  2120. // "csa16"
  2121. // "csa18"
  2122. // "csaInterdiction"
  2123. // "csaT"
  2124. // "csaUnrated"
  2125. CsaRating string `json:"csaRating,omitempty"`
  2126. // CscfRating: The video's rating from Luxembourg's Commission de
  2127. // surveillance de la classification des films (CSCF).
  2128. //
  2129. // Possible values:
  2130. // "cscf12"
  2131. // "cscf16"
  2132. // "cscf18"
  2133. // "cscf6"
  2134. // "cscf9"
  2135. // "cscfA"
  2136. // "cscfAl"
  2137. // "cscfUnrated"
  2138. CscfRating string `json:"cscfRating,omitempty"`
  2139. // CzfilmRating: The video's rating in the Czech Republic.
  2140. //
  2141. // Possible values:
  2142. // "czfilm12"
  2143. // "czfilm14"
  2144. // "czfilm18"
  2145. // "czfilmU"
  2146. // "czfilmUnrated"
  2147. CzfilmRating string `json:"czfilmRating,omitempty"`
  2148. // DjctqRating: The video's Departamento de Justiça, Classificação,
  2149. // Qualificação e Títulos (DJCQT - Brazil) rating.
  2150. //
  2151. // Possible values:
  2152. // "djctq10"
  2153. // "djctq12"
  2154. // "djctq14"
  2155. // "djctq16"
  2156. // "djctq18"
  2157. // "djctqL"
  2158. // "djctqUnrated"
  2159. DjctqRating string `json:"djctqRating,omitempty"`
  2160. // DjctqRatingReasons: Reasons that explain why the video received its
  2161. // DJCQT (Brazil) rating.
  2162. //
  2163. // Possible values:
  2164. // "djctqCriminalActs"
  2165. // "djctqDrugs"
  2166. // "djctqExplicitSex"
  2167. // "djctqExtremeViolence"
  2168. // "djctqIllegalDrugs"
  2169. // "djctqImpactingContent"
  2170. // "djctqInappropriateLanguage"
  2171. // "djctqLegalDrugs"
  2172. // "djctqNudity"
  2173. // "djctqSex"
  2174. // "djctqSexualContent"
  2175. // "djctqViolence"
  2176. DjctqRatingReasons []string `json:"djctqRatingReasons,omitempty"`
  2177. // EcbmctRating: Rating system in Turkey - Evaluation and Classification
  2178. // Board of the Ministry of Culture and Tourism
  2179. //
  2180. // Possible values:
  2181. // "ecbmct13a"
  2182. // "ecbmct13plus"
  2183. // "ecbmct15a"
  2184. // "ecbmct15plus"
  2185. // "ecbmct18plus"
  2186. // "ecbmct7a"
  2187. // "ecbmct7plus"
  2188. // "ecbmctG"
  2189. // "ecbmctUnrated"
  2190. EcbmctRating string `json:"ecbmctRating,omitempty"`
  2191. // EefilmRating: The video's rating in Estonia.
  2192. //
  2193. // Possible values:
  2194. // "eefilmK12"
  2195. // "eefilmK14"
  2196. // "eefilmK16"
  2197. // "eefilmK6"
  2198. // "eefilmL"
  2199. // "eefilmMs12"
  2200. // "eefilmMs6"
  2201. // "eefilmPere"
  2202. // "eefilmUnrated"
  2203. EefilmRating string `json:"eefilmRating,omitempty"`
  2204. // EgfilmRating: The video's rating in Egypt.
  2205. //
  2206. // Possible values:
  2207. // "egfilm18"
  2208. // "egfilmBn"
  2209. // "egfilmGn"
  2210. // "egfilmUnrated"
  2211. EgfilmRating string `json:"egfilmRating,omitempty"`
  2212. // EirinRating: The video's Eirin (映倫) rating. Eirin is the Japanese
  2213. // rating system.
  2214. //
  2215. // Possible values:
  2216. // "eirinG"
  2217. // "eirinPg12"
  2218. // "eirinR15plus"
  2219. // "eirinR18plus"
  2220. // "eirinUnrated"
  2221. EirinRating string `json:"eirinRating,omitempty"`
  2222. // FcbmRating: The video's rating from Malaysia's Film Censorship Board.
  2223. //
  2224. // Possible values:
  2225. // "fcbm18"
  2226. // "fcbm18pa"
  2227. // "fcbm18pl"
  2228. // "fcbm18sg"
  2229. // "fcbm18sx"
  2230. // "fcbmP13"
  2231. // "fcbmPg13"
  2232. // "fcbmU"
  2233. // "fcbmUnrated"
  2234. FcbmRating string `json:"fcbmRating,omitempty"`
  2235. // FcoRating: The video's rating from Hong Kong's Office for Film,
  2236. // Newspaper and Article Administration.
  2237. //
  2238. // Possible values:
  2239. // "fcoI"
  2240. // "fcoIi"
  2241. // "fcoIia"
  2242. // "fcoIib"
  2243. // "fcoIii"
  2244. // "fcoUnrated"
  2245. FcoRating string `json:"fcoRating,omitempty"`
  2246. // FmocRating: This property has been deprecated. Use the
  2247. // contentDetails.contentRating.cncRating instead.
  2248. //
  2249. // Possible values:
  2250. // "fmoc10"
  2251. // "fmoc12"
  2252. // "fmoc16"
  2253. // "fmoc18"
  2254. // "fmocE"
  2255. // "fmocU"
  2256. // "fmocUnrated"
  2257. FmocRating string `json:"fmocRating,omitempty"`
  2258. // FpbRating: The video's rating from South Africa's Film and
  2259. // Publication Board.
  2260. //
  2261. // Possible values:
  2262. // "fpb10"
  2263. // "fpb1012Pg"
  2264. // "fpb13"
  2265. // "fpb16"
  2266. // "fpb18"
  2267. // "fpb79Pg"
  2268. // "fpbA"
  2269. // "fpbPg"
  2270. // "fpbUnrated"
  2271. // "fpbX18"
  2272. // "fpbXx"
  2273. FpbRating string `json:"fpbRating,omitempty"`
  2274. // FskRating: The video's Freiwillige Selbstkontrolle der Filmwirtschaft
  2275. // (FSK - Germany) rating.
  2276. //
  2277. // Possible values:
  2278. // "fsk0"
  2279. // "fsk12"
  2280. // "fsk16"
  2281. // "fsk18"
  2282. // "fsk6"
  2283. // "fskUnrated"
  2284. FskRating string `json:"fskRating,omitempty"`
  2285. // GrfilmRating: The video's rating in Greece.
  2286. //
  2287. // Possible values:
  2288. // "grfilmE"
  2289. // "grfilmK"
  2290. // "grfilmK13"
  2291. // "grfilmK17"
  2292. // "grfilmUnrated"
  2293. GrfilmRating string `json:"grfilmRating,omitempty"`
  2294. // IcaaRating: The video's Instituto de la Cinematografía y de las
  2295. // Artes Audiovisuales (ICAA - Spain) rating.
  2296. //
  2297. // Possible values:
  2298. // "icaa12"
  2299. // "icaa13"
  2300. // "icaa16"
  2301. // "icaa18"
  2302. // "icaa7"
  2303. // "icaaApta"
  2304. // "icaaUnrated"
  2305. // "icaaX"
  2306. IcaaRating string `json:"icaaRating,omitempty"`
  2307. // IfcoRating: The video's Irish Film Classification Office (IFCO -
  2308. // Ireland) rating. See the IFCO website for more information.
  2309. //
  2310. // Possible values:
  2311. // "ifco12"
  2312. // "ifco12a"
  2313. // "ifco15"
  2314. // "ifco15a"
  2315. // "ifco16"
  2316. // "ifco18"
  2317. // "ifcoG"
  2318. // "ifcoPg"
  2319. // "ifcoUnrated"
  2320. IfcoRating string `json:"ifcoRating,omitempty"`
  2321. // IlfilmRating: The video's rating in Israel.
  2322. //
  2323. // Possible values:
  2324. // "ilfilm12"
  2325. // "ilfilm16"
  2326. // "ilfilm18"
  2327. // "ilfilmAa"
  2328. // "ilfilmUnrated"
  2329. IlfilmRating string `json:"ilfilmRating,omitempty"`
  2330. // IncaaRating: The video's INCAA (Instituto Nacional de Cine y Artes
  2331. // Audiovisuales - Argentina) rating.
  2332. //
  2333. // Possible values:
  2334. // "incaaAtp"
  2335. // "incaaC"
  2336. // "incaaSam13"
  2337. // "incaaSam16"
  2338. // "incaaSam18"
  2339. // "incaaUnrated"
  2340. IncaaRating string `json:"incaaRating,omitempty"`
  2341. // KfcbRating: The video's rating from the Kenya Film Classification
  2342. // Board.
  2343. //
  2344. // Possible values:
  2345. // "kfcb16plus"
  2346. // "kfcbG"
  2347. // "kfcbPg"
  2348. // "kfcbR"
  2349. // "kfcbUnrated"
  2350. KfcbRating string `json:"kfcbRating,omitempty"`
  2351. // KijkwijzerRating: voor de Classificatie van Audiovisuele Media
  2352. // (Netherlands).
  2353. //
  2354. // Possible values:
  2355. // "kijkwijzer12"
  2356. // "kijkwijzer16"
  2357. // "kijkwijzer18"
  2358. // "kijkwijzer6"
  2359. // "kijkwijzer9"
  2360. // "kijkwijzerAl"
  2361. // "kijkwijzerUnrated"
  2362. KijkwijzerRating string `json:"kijkwijzerRating,omitempty"`
  2363. // KmrbRating: The video's Korea Media Rating Board
  2364. // (영상물등급위원회) rating. The KMRB rates videos in South
  2365. // Korea.
  2366. //
  2367. // Possible values:
  2368. // "kmrb12plus"
  2369. // "kmrb15plus"
  2370. // "kmrbAll"
  2371. // "kmrbR"
  2372. // "kmrbTeenr"
  2373. // "kmrbUnrated"
  2374. KmrbRating string `json:"kmrbRating,omitempty"`
  2375. // LsfRating: The video's rating from Indonesia's Lembaga Sensor Film.
  2376. //
  2377. // Possible values:
  2378. // "lsf13"
  2379. // "lsf17"
  2380. // "lsf21"
  2381. // "lsfA"
  2382. // "lsfBo"
  2383. // "lsfD"
  2384. // "lsfR"
  2385. // "lsfSu"
  2386. // "lsfUnrated"
  2387. LsfRating string `json:"lsfRating,omitempty"`
  2388. // MccaaRating: The video's rating from Malta's Film Age-Classification
  2389. // Board.
  2390. //
  2391. // Possible values:
  2392. // "mccaa12"
  2393. // "mccaa12a"
  2394. // "mccaa14"
  2395. // "mccaa15"
  2396. // "mccaa16"
  2397. // "mccaa18"
  2398. // "mccaaPg"
  2399. // "mccaaU"
  2400. // "mccaaUnrated"
  2401. MccaaRating string `json:"mccaaRating,omitempty"`
  2402. // MccypRating: The video's rating from the Danish Film Institute's (Det
  2403. // Danske Filminstitut) Media Council for Children and Young People.
  2404. //
  2405. // Possible values:
  2406. // "mccyp11"
  2407. // "mccyp15"
  2408. // "mccyp7"
  2409. // "mccypA"
  2410. // "mccypUnrated"
  2411. MccypRating string `json:"mccypRating,omitempty"`
  2412. // MdaRating: The video's rating from Singapore's Media Development
  2413. // Authority (MDA) and, specifically, it's Board of Film Censors (BFC).
  2414. //
  2415. // Possible values:
  2416. // "mdaG"
  2417. // "mdaM18"
  2418. // "mdaNc16"
  2419. // "mdaPg"
  2420. // "mdaPg13"
  2421. // "mdaR21"
  2422. // "mdaUnrated"
  2423. MdaRating string `json:"mdaRating,omitempty"`
  2424. // MedietilsynetRating: The video's rating from Medietilsynet, the
  2425. // Norwegian Media Authority.
  2426. //
  2427. // Possible values:
  2428. // "medietilsynet11"
  2429. // "medietilsynet12"
  2430. // "medietilsynet15"
  2431. // "medietilsynet18"
  2432. // "medietilsynet6"
  2433. // "medietilsynet7"
  2434. // "medietilsynet9"
  2435. // "medietilsynetA"
  2436. // "medietilsynetUnrated"
  2437. MedietilsynetRating string `json:"medietilsynetRating,omitempty"`
  2438. // MekuRating: The video's rating from Finland's Kansallinen
  2439. // Audiovisuaalinen Instituutti (National Audiovisual Institute).
  2440. //
  2441. // Possible values:
  2442. // "meku12"
  2443. // "meku16"
  2444. // "meku18"
  2445. // "meku7"
  2446. // "mekuS"
  2447. // "mekuUnrated"
  2448. MekuRating string `json:"mekuRating,omitempty"`
  2449. // MibacRating: The video's rating from the Ministero dei Beni e delle
  2450. // Attività Culturali e del Turismo (Italy).
  2451. //
  2452. // Possible values:
  2453. // "mibacT"
  2454. // "mibacUnrated"
  2455. // "mibacVap"
  2456. // "mibacVm12"
  2457. // "mibacVm14"
  2458. // "mibacVm18"
  2459. MibacRating string `json:"mibacRating,omitempty"`
  2460. // MocRating: The video's Ministerio de Cultura (Colombia) rating.
  2461. //
  2462. // Possible values:
  2463. // "moc12"
  2464. // "moc15"
  2465. // "moc18"
  2466. // "moc7"
  2467. // "mocBanned"
  2468. // "mocE"
  2469. // "mocT"
  2470. // "mocUnrated"
  2471. // "mocX"
  2472. MocRating string `json:"mocRating,omitempty"`
  2473. // MoctwRating: The video's rating from Taiwan's Ministry of Culture
  2474. // (文化部).
  2475. //
  2476. // Possible values:
  2477. // "moctwG"
  2478. // "moctwP"
  2479. // "moctwPg"
  2480. // "moctwR"
  2481. // "moctwUnrated"
  2482. MoctwRating string `json:"moctwRating,omitempty"`
  2483. // MpaaRating: The video's Motion Picture Association of America (MPAA)
  2484. // rating.
  2485. //
  2486. // Possible values:
  2487. // "mpaaG"
  2488. // "mpaaNc17"
  2489. // "mpaaPg"
  2490. // "mpaaPg13"
  2491. // "mpaaR"
  2492. // "mpaaUnrated"
  2493. MpaaRating string `json:"mpaaRating,omitempty"`
  2494. // MtrcbRating: The video's rating from the Movie and Television Review
  2495. // and Classification Board (Philippines).
  2496. //
  2497. // Possible values:
  2498. // "mtrcbG"
  2499. // "mtrcbPg"
  2500. // "mtrcbR13"
  2501. // "mtrcbR16"
  2502. // "mtrcbR18"
  2503. // "mtrcbUnrated"
  2504. // "mtrcbX"
  2505. MtrcbRating string `json:"mtrcbRating,omitempty"`
  2506. // NbcRating: The video's rating from the Maldives National Bureau of
  2507. // Classification.
  2508. //
  2509. // Possible values:
  2510. // "nbc12plus"
  2511. // "nbc15plus"
  2512. // "nbc18plus"
  2513. // "nbc18plusr"
  2514. // "nbcG"
  2515. // "nbcPg"
  2516. // "nbcPu"
  2517. // "nbcUnrated"
  2518. NbcRating string `json:"nbcRating,omitempty"`
  2519. // NbcplRating: The video's rating in Poland.
  2520. //
  2521. // Possible values:
  2522. // "nbcpl18plus"
  2523. // "nbcplI"
  2524. // "nbcplIi"
  2525. // "nbcplIii"
  2526. // "nbcplIv"
  2527. // "nbcplUnrated"
  2528. NbcplRating string `json:"nbcplRating,omitempty"`
  2529. // NfrcRating: The video's rating from the Bulgarian National Film
  2530. // Center.
  2531. //
  2532. // Possible values:
  2533. // "nfrcA"
  2534. // "nfrcB"
  2535. // "nfrcC"
  2536. // "nfrcD"
  2537. // "nfrcUnrated"
  2538. // "nfrcX"
  2539. NfrcRating string `json:"nfrcRating,omitempty"`
  2540. // NfvcbRating: The video's rating from Nigeria's National Film and
  2541. // Video Censors Board.
  2542. //
  2543. // Possible values:
  2544. // "nfvcb12"
  2545. // "nfvcb12a"
  2546. // "nfvcb15"
  2547. // "nfvcb18"
  2548. // "nfvcbG"
  2549. // "nfvcbPg"
  2550. // "nfvcbRe"
  2551. // "nfvcbUnrated"
  2552. NfvcbRating string `json:"nfvcbRating,omitempty"`
  2553. // NkclvRating: The video's rating from the Nacionãlais Kino centrs
  2554. // (National Film Centre of Latvia).
  2555. //
  2556. // Possible values:
  2557. // "nkclv12plus"
  2558. // "nkclv18plus"
  2559. // "nkclv7plus"
  2560. // "nkclvU"
  2561. // "nkclvUnrated"
  2562. NkclvRating string `json:"nkclvRating,omitempty"`
  2563. // OflcRating: The video's Office of Film and Literature Classification
  2564. // (OFLC - New Zealand) rating.
  2565. //
  2566. // Possible values:
  2567. // "oflcG"
  2568. // "oflcM"
  2569. // "oflcPg"
  2570. // "oflcR13"
  2571. // "oflcR15"
  2572. // "oflcR16"
  2573. // "oflcR18"
  2574. // "oflcRp13"
  2575. // "oflcRp16"
  2576. // "oflcUnrated"
  2577. OflcRating string `json:"oflcRating,omitempty"`
  2578. // PefilmRating: The video's rating in Peru.
  2579. //
  2580. // Possible values:
  2581. // "pefilm14"
  2582. // "pefilm18"
  2583. // "pefilmPg"
  2584. // "pefilmPt"
  2585. // "pefilmUnrated"
  2586. PefilmRating string `json:"pefilmRating,omitempty"`
  2587. // RcnofRating: The video's rating from the Hungarian Nemzeti Filmiroda,
  2588. // the Rating Committee of the National Office of Film.
  2589. //
  2590. // Possible values:
  2591. // "rcnofI"
  2592. // "rcnofIi"
  2593. // "rcnofIii"
  2594. // "rcnofIv"
  2595. // "rcnofUnrated"
  2596. // "rcnofV"
  2597. // "rcnofVi"
  2598. RcnofRating string `json:"rcnofRating,omitempty"`
  2599. // ResorteviolenciaRating: The video's rating in Venezuela.
  2600. //
  2601. // Possible values:
  2602. // "resorteviolenciaA"
  2603. // "resorteviolenciaB"
  2604. // "resorteviolenciaC"
  2605. // "resorteviolenciaD"
  2606. // "resorteviolenciaE"
  2607. // "resorteviolenciaUnrated"
  2608. ResorteviolenciaRating string `json:"resorteviolenciaRating,omitempty"`
  2609. // RtcRating: The video's General Directorate of Radio, Television and
  2610. // Cinematography (Mexico) rating.
  2611. //
  2612. // Possible values:
  2613. // "rtcA"
  2614. // "rtcAa"
  2615. // "rtcB"
  2616. // "rtcB15"
  2617. // "rtcC"
  2618. // "rtcD"
  2619. // "rtcUnrated"
  2620. RtcRating string `json:"rtcRating,omitempty"`
  2621. // RteRating: The video's rating from Ireland's Raidió Teilifís
  2622. // Éireann.
  2623. //
  2624. // Possible values:
  2625. // "rteCh"
  2626. // "rteGa"
  2627. // "rteMa"
  2628. // "rtePs"
  2629. // "rteUnrated"
  2630. RteRating string `json:"rteRating,omitempty"`
  2631. // RussiaRating: The video's National Film Registry of the Russian
  2632. // Federation (MKRF - Russia) rating.
  2633. //
  2634. // Possible values:
  2635. // "russia0"
  2636. // "russia12"
  2637. // "russia16"
  2638. // "russia18"
  2639. // "russia6"
  2640. // "russiaUnrated"
  2641. RussiaRating string `json:"russiaRating,omitempty"`
  2642. // SkfilmRating: The video's rating in Slovakia.
  2643. //
  2644. // Possible values:
  2645. // "skfilmG"
  2646. // "skfilmP2"
  2647. // "skfilmP5"
  2648. // "skfilmP8"
  2649. // "skfilmUnrated"
  2650. SkfilmRating string `json:"skfilmRating,omitempty"`
  2651. // SmaisRating: The video's rating in Iceland.
  2652. //
  2653. // Possible values:
  2654. // "smais12"
  2655. // "smais14"
  2656. // "smais16"
  2657. // "smais18"
  2658. // "smais7"
  2659. // "smaisL"
  2660. // "smaisUnrated"
  2661. SmaisRating string `json:"smaisRating,omitempty"`
  2662. // SmsaRating: The video's rating from Statens medieråd (Sweden's
  2663. // National Media Council).
  2664. //
  2665. // Possible values:
  2666. // "smsa11"
  2667. // "smsa15"
  2668. // "smsa7"
  2669. // "smsaA"
  2670. // "smsaUnrated"
  2671. SmsaRating string `json:"smsaRating,omitempty"`
  2672. // TvpgRating: The video's TV Parental Guidelines (TVPG) rating.
  2673. //
  2674. // Possible values:
  2675. // "pg14"
  2676. // "tvpgG"
  2677. // "tvpgMa"
  2678. // "tvpgPg"
  2679. // "tvpgUnrated"
  2680. // "tvpgY"
  2681. // "tvpgY7"
  2682. // "tvpgY7Fv"
  2683. TvpgRating string `json:"tvpgRating,omitempty"`
  2684. // YtRating: A rating that YouTube uses to identify age-restricted
  2685. // content.
  2686. //
  2687. // Possible values:
  2688. // "ytAgeRestricted"
  2689. YtRating string `json:"ytRating,omitempty"`
  2690. // ForceSendFields is a list of field names (e.g. "AcbRating") to
  2691. // unconditionally include in API requests. By default, fields with
  2692. // empty values are omitted from API requests. However, any non-pointer,
  2693. // non-interface field appearing in ForceSendFields will be sent to the
  2694. // server regardless of whether the field is empty or not. This may be
  2695. // used to include empty fields in Patch requests.
  2696. ForceSendFields []string `json:"-"`
  2697. }
  2698. func (s *ContentRating) MarshalJSON() ([]byte, error) {
  2699. type noMethod ContentRating
  2700. raw := noMethod(*s)
  2701. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2702. }
  2703. // FanFundingEvent: A fanFundingEvent resource represents a fan funding
  2704. // event on a YouTube channel. Fan funding events occur when a user
  2705. // gives one-time monetary support to the channel owner.
  2706. type FanFundingEvent struct {
  2707. // Etag: Etag of this resource.
  2708. Etag string `json:"etag,omitempty"`
  2709. // Id: The ID that YouTube assigns to uniquely identify the fan funding
  2710. // event.
  2711. Id string `json:"id,omitempty"`
  2712. // Kind: Identifies what kind of resource this is. Value: the fixed
  2713. // string "youtube#fanFundingEvent".
  2714. Kind string `json:"kind,omitempty"`
  2715. // Snippet: The snippet object contains basic details about the fan
  2716. // funding event.
  2717. Snippet *FanFundingEventSnippet `json:"snippet,omitempty"`
  2718. // ForceSendFields is a list of field names (e.g. "Etag") to
  2719. // unconditionally include in API requests. By default, fields with
  2720. // empty values are omitted from API requests. However, any non-pointer,
  2721. // non-interface field appearing in ForceSendFields will be sent to the
  2722. // server regardless of whether the field is empty or not. This may be
  2723. // used to include empty fields in Patch requests.
  2724. ForceSendFields []string `json:"-"`
  2725. }
  2726. func (s *FanFundingEvent) MarshalJSON() ([]byte, error) {
  2727. type noMethod FanFundingEvent
  2728. raw := noMethod(*s)
  2729. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2730. }
  2731. type FanFundingEventListResponse struct {
  2732. // Etag: Etag of this resource.
  2733. Etag string `json:"etag,omitempty"`
  2734. // EventId: Serialized EventId of the request which produced this
  2735. // response.
  2736. EventId string `json:"eventId,omitempty"`
  2737. // Items: A list of fan funding events that match the request criteria.
  2738. Items []*FanFundingEvent `json:"items,omitempty"`
  2739. // Kind: Identifies what kind of resource this is. Value: the fixed
  2740. // string "youtube#fanFundingEventListResponse".
  2741. Kind string `json:"kind,omitempty"`
  2742. // NextPageToken: The token that can be used as the value of the
  2743. // pageToken parameter to retrieve the next page in the result set.
  2744. NextPageToken string `json:"nextPageToken,omitempty"`
  2745. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2746. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2747. // VisitorId: The visitorId identifies the visitor.
  2748. VisitorId string `json:"visitorId,omitempty"`
  2749. // ServerResponse contains the HTTP response code and headers from the
  2750. // server.
  2751. googleapi.ServerResponse `json:"-"`
  2752. // ForceSendFields is a list of field names (e.g. "Etag") to
  2753. // unconditionally include in API requests. By default, fields with
  2754. // empty values are omitted from API requests. However, any non-pointer,
  2755. // non-interface field appearing in ForceSendFields will be sent to the
  2756. // server regardless of whether the field is empty or not. This may be
  2757. // used to include empty fields in Patch requests.
  2758. ForceSendFields []string `json:"-"`
  2759. }
  2760. func (s *FanFundingEventListResponse) MarshalJSON() ([]byte, error) {
  2761. type noMethod FanFundingEventListResponse
  2762. raw := noMethod(*s)
  2763. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2764. }
  2765. type FanFundingEventSnippet struct {
  2766. // AmountMicros: The amount of funding in micros of fund_currency. e.g.,
  2767. // 1 is represented
  2768. AmountMicros uint64 `json:"amountMicros,omitempty,string"`
  2769. // ChannelId: Channel id where the funding event occurred.
  2770. ChannelId string `json:"channelId,omitempty"`
  2771. // CommentText: The text contents of the comment left by the user.
  2772. CommentText string `json:"commentText,omitempty"`
  2773. // CreatedAt: The date and time when the funding occurred. The value is
  2774. // specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  2775. CreatedAt string `json:"createdAt,omitempty"`
  2776. // Currency: The currency in which the fund was made. ISO 4217.
  2777. Currency string `json:"currency,omitempty"`
  2778. // DisplayString: A rendered string that displays the fund amount and
  2779. // currency (e.g., "$1.00"). The string is rendered for the given
  2780. // language.
  2781. DisplayString string `json:"displayString,omitempty"`
  2782. // SupporterDetails: Details about the supporter. Only filled if the
  2783. // event was made public by the user.
  2784. SupporterDetails *ChannelProfileDetails `json:"supporterDetails,omitempty"`
  2785. // ForceSendFields is a list of field names (e.g. "AmountMicros") to
  2786. // unconditionally include in API requests. By default, fields with
  2787. // empty values are omitted from API requests. However, any non-pointer,
  2788. // non-interface field appearing in ForceSendFields will be sent to the
  2789. // server regardless of whether the field is empty or not. This may be
  2790. // used to include empty fields in Patch requests.
  2791. ForceSendFields []string `json:"-"`
  2792. }
  2793. func (s *FanFundingEventSnippet) MarshalJSON() ([]byte, error) {
  2794. type noMethod FanFundingEventSnippet
  2795. raw := noMethod(*s)
  2796. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2797. }
  2798. // GeoPoint: Geographical coordinates of a point, in WGS84.
  2799. type GeoPoint struct {
  2800. // Altitude: Altitude above the reference ellipsoid, in meters.
  2801. Altitude float64 `json:"altitude,omitempty"`
  2802. // Latitude: Latitude in degrees.
  2803. Latitude float64 `json:"latitude,omitempty"`
  2804. // Longitude: Longitude in degrees.
  2805. Longitude float64 `json:"longitude,omitempty"`
  2806. // ForceSendFields is a list of field names (e.g. "Altitude") to
  2807. // unconditionally include in API requests. By default, fields with
  2808. // empty values are omitted from API requests. However, any non-pointer,
  2809. // non-interface field appearing in ForceSendFields will be sent to the
  2810. // server regardless of whether the field is empty or not. This may be
  2811. // used to include empty fields in Patch requests.
  2812. ForceSendFields []string `json:"-"`
  2813. }
  2814. func (s *GeoPoint) MarshalJSON() ([]byte, error) {
  2815. type noMethod GeoPoint
  2816. raw := noMethod(*s)
  2817. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2818. }
  2819. // GuideCategory: A guideCategory resource identifies a category that
  2820. // YouTube algorithmically assigns based on a channel's content or other
  2821. // indicators, such as the channel's popularity. The list is similar to
  2822. // video categories, with the difference being that a video's uploader
  2823. // can assign a video category but only YouTube can assign a channel
  2824. // category.
  2825. type GuideCategory struct {
  2826. // Etag: Etag of this resource.
  2827. Etag string `json:"etag,omitempty"`
  2828. // Id: The ID that YouTube uses to uniquely identify the guide category.
  2829. Id string `json:"id,omitempty"`
  2830. // Kind: Identifies what kind of resource this is. Value: the fixed
  2831. // string "youtube#guideCategory".
  2832. Kind string `json:"kind,omitempty"`
  2833. // Snippet: The snippet object contains basic details about the
  2834. // category, such as its title.
  2835. Snippet *GuideCategorySnippet `json:"snippet,omitempty"`
  2836. // ForceSendFields is a list of field names (e.g. "Etag") to
  2837. // unconditionally include in API requests. By default, fields with
  2838. // empty values are omitted from API requests. However, any non-pointer,
  2839. // non-interface field appearing in ForceSendFields will be sent to the
  2840. // server regardless of whether the field is empty or not. This may be
  2841. // used to include empty fields in Patch requests.
  2842. ForceSendFields []string `json:"-"`
  2843. }
  2844. func (s *GuideCategory) MarshalJSON() ([]byte, error) {
  2845. type noMethod GuideCategory
  2846. raw := noMethod(*s)
  2847. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2848. }
  2849. type GuideCategoryListResponse struct {
  2850. // Etag: Etag of this resource.
  2851. Etag string `json:"etag,omitempty"`
  2852. // EventId: Serialized EventId of the request which produced this
  2853. // response.
  2854. EventId string `json:"eventId,omitempty"`
  2855. // Items: A list of categories that can be associated with YouTube
  2856. // channels. In this map, the category ID is the map key, and its value
  2857. // is the corresponding guideCategory resource.
  2858. Items []*GuideCategory `json:"items,omitempty"`
  2859. // Kind: Identifies what kind of resource this is. Value: the fixed
  2860. // string "youtube#guideCategoryListResponse".
  2861. Kind string `json:"kind,omitempty"`
  2862. // NextPageToken: The token that can be used as the value of the
  2863. // pageToken parameter to retrieve the next page in the result set.
  2864. NextPageToken string `json:"nextPageToken,omitempty"`
  2865. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2866. // PrevPageToken: The token that can be used as the value of the
  2867. // pageToken parameter to retrieve the previous page in the result set.
  2868. PrevPageToken string `json:"prevPageToken,omitempty"`
  2869. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2870. // VisitorId: The visitorId identifies the visitor.
  2871. VisitorId string `json:"visitorId,omitempty"`
  2872. // ServerResponse contains the HTTP response code and headers from the
  2873. // server.
  2874. googleapi.ServerResponse `json:"-"`
  2875. // ForceSendFields is a list of field names (e.g. "Etag") to
  2876. // unconditionally include in API requests. By default, fields with
  2877. // empty values are omitted from API requests. However, any non-pointer,
  2878. // non-interface field appearing in ForceSendFields will be sent to the
  2879. // server regardless of whether the field is empty or not. This may be
  2880. // used to include empty fields in Patch requests.
  2881. ForceSendFields []string `json:"-"`
  2882. }
  2883. func (s *GuideCategoryListResponse) MarshalJSON() ([]byte, error) {
  2884. type noMethod GuideCategoryListResponse
  2885. raw := noMethod(*s)
  2886. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2887. }
  2888. // GuideCategorySnippet: Basic details about a guide category.
  2889. type GuideCategorySnippet struct {
  2890. ChannelId string `json:"channelId,omitempty"`
  2891. // Title: Description of the guide category.
  2892. Title string `json:"title,omitempty"`
  2893. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  2894. // unconditionally include in API requests. By default, fields with
  2895. // empty values are omitted from API requests. However, any non-pointer,
  2896. // non-interface field appearing in ForceSendFields will be sent to the
  2897. // server regardless of whether the field is empty or not. This may be
  2898. // used to include empty fields in Patch requests.
  2899. ForceSendFields []string `json:"-"`
  2900. }
  2901. func (s *GuideCategorySnippet) MarshalJSON() ([]byte, error) {
  2902. type noMethod GuideCategorySnippet
  2903. raw := noMethod(*s)
  2904. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2905. }
  2906. // I18nLanguage: An i18nLanguage resource identifies a UI language
  2907. // currently supported by YouTube.
  2908. type I18nLanguage struct {
  2909. // Etag: Etag of this resource.
  2910. Etag string `json:"etag,omitempty"`
  2911. // Id: The ID that YouTube uses to uniquely identify the i18n language.
  2912. Id string `json:"id,omitempty"`
  2913. // Kind: Identifies what kind of resource this is. Value: the fixed
  2914. // string "youtube#i18nLanguage".
  2915. Kind string `json:"kind,omitempty"`
  2916. // Snippet: The snippet object contains basic details about the i18n
  2917. // language, such as language code and human-readable name.
  2918. Snippet *I18nLanguageSnippet `json:"snippet,omitempty"`
  2919. // ForceSendFields is a list of field names (e.g. "Etag") to
  2920. // unconditionally include in API requests. By default, fields with
  2921. // empty values are omitted from API requests. However, any non-pointer,
  2922. // non-interface field appearing in ForceSendFields will be sent to the
  2923. // server regardless of whether the field is empty or not. This may be
  2924. // used to include empty fields in Patch requests.
  2925. ForceSendFields []string `json:"-"`
  2926. }
  2927. func (s *I18nLanguage) MarshalJSON() ([]byte, error) {
  2928. type noMethod I18nLanguage
  2929. raw := noMethod(*s)
  2930. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2931. }
  2932. type I18nLanguageListResponse struct {
  2933. // Etag: Etag of this resource.
  2934. Etag string `json:"etag,omitempty"`
  2935. // EventId: Serialized EventId of the request which produced this
  2936. // response.
  2937. EventId string `json:"eventId,omitempty"`
  2938. // Items: A list of supported i18n languages. In this map, the i18n
  2939. // language ID is the map key, and its value is the corresponding
  2940. // i18nLanguage resource.
  2941. Items []*I18nLanguage `json:"items,omitempty"`
  2942. // Kind: Identifies what kind of resource this is. Value: the fixed
  2943. // string "youtube#i18nLanguageListResponse".
  2944. Kind string `json:"kind,omitempty"`
  2945. // VisitorId: The visitorId identifies the visitor.
  2946. VisitorId string `json:"visitorId,omitempty"`
  2947. // ServerResponse contains the HTTP response code and headers from the
  2948. // server.
  2949. googleapi.ServerResponse `json:"-"`
  2950. // ForceSendFields is a list of field names (e.g. "Etag") to
  2951. // unconditionally include in API requests. By default, fields with
  2952. // empty values are omitted from API requests. However, any non-pointer,
  2953. // non-interface field appearing in ForceSendFields will be sent to the
  2954. // server regardless of whether the field is empty or not. This may be
  2955. // used to include empty fields in Patch requests.
  2956. ForceSendFields []string `json:"-"`
  2957. }
  2958. func (s *I18nLanguageListResponse) MarshalJSON() ([]byte, error) {
  2959. type noMethod I18nLanguageListResponse
  2960. raw := noMethod(*s)
  2961. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2962. }
  2963. // I18nLanguageSnippet: Basic details about an i18n language, such as
  2964. // language code and human-readable name.
  2965. type I18nLanguageSnippet struct {
  2966. // Hl: A short BCP-47 code that uniquely identifies a language.
  2967. Hl string `json:"hl,omitempty"`
  2968. // Name: The human-readable name of the language in the language itself.
  2969. Name string `json:"name,omitempty"`
  2970. // ForceSendFields is a list of field names (e.g. "Hl") to
  2971. // unconditionally include in API requests. By default, fields with
  2972. // empty values are omitted from API requests. However, any non-pointer,
  2973. // non-interface field appearing in ForceSendFields will be sent to the
  2974. // server regardless of whether the field is empty or not. This may be
  2975. // used to include empty fields in Patch requests.
  2976. ForceSendFields []string `json:"-"`
  2977. }
  2978. func (s *I18nLanguageSnippet) MarshalJSON() ([]byte, error) {
  2979. type noMethod I18nLanguageSnippet
  2980. raw := noMethod(*s)
  2981. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2982. }
  2983. // I18nRegion: A i18nRegion resource identifies a region where YouTube
  2984. // is available.
  2985. type I18nRegion struct {
  2986. // Etag: Etag of this resource.
  2987. Etag string `json:"etag,omitempty"`
  2988. // Id: The ID that YouTube uses to uniquely identify the i18n region.
  2989. Id string `json:"id,omitempty"`
  2990. // Kind: Identifies what kind of resource this is. Value: the fixed
  2991. // string "youtube#i18nRegion".
  2992. Kind string `json:"kind,omitempty"`
  2993. // Snippet: The snippet object contains basic details about the i18n
  2994. // region, such as region code and human-readable name.
  2995. Snippet *I18nRegionSnippet `json:"snippet,omitempty"`
  2996. // ForceSendFields is a list of field names (e.g. "Etag") to
  2997. // unconditionally include in API requests. By default, fields with
  2998. // empty values are omitted from API requests. However, any non-pointer,
  2999. // non-interface field appearing in ForceSendFields will be sent to the
  3000. // server regardless of whether the field is empty or not. This may be
  3001. // used to include empty fields in Patch requests.
  3002. ForceSendFields []string `json:"-"`
  3003. }
  3004. func (s *I18nRegion) MarshalJSON() ([]byte, error) {
  3005. type noMethod I18nRegion
  3006. raw := noMethod(*s)
  3007. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3008. }
  3009. type I18nRegionListResponse struct {
  3010. // Etag: Etag of this resource.
  3011. Etag string `json:"etag,omitempty"`
  3012. // EventId: Serialized EventId of the request which produced this
  3013. // response.
  3014. EventId string `json:"eventId,omitempty"`
  3015. // Items: A list of regions where YouTube is available. In this map, the
  3016. // i18n region ID is the map key, and its value is the corresponding
  3017. // i18nRegion resource.
  3018. Items []*I18nRegion `json:"items,omitempty"`
  3019. // Kind: Identifies what kind of resource this is. Value: the fixed
  3020. // string "youtube#i18nRegionListResponse".
  3021. Kind string `json:"kind,omitempty"`
  3022. // VisitorId: The visitorId identifies the visitor.
  3023. VisitorId string `json:"visitorId,omitempty"`
  3024. // ServerResponse contains the HTTP response code and headers from the
  3025. // server.
  3026. googleapi.ServerResponse `json:"-"`
  3027. // ForceSendFields is a list of field names (e.g. "Etag") to
  3028. // unconditionally include in API requests. By default, fields with
  3029. // empty values are omitted from API requests. However, any non-pointer,
  3030. // non-interface field appearing in ForceSendFields will be sent to the
  3031. // server regardless of whether the field is empty or not. This may be
  3032. // used to include empty fields in Patch requests.
  3033. ForceSendFields []string `json:"-"`
  3034. }
  3035. func (s *I18nRegionListResponse) MarshalJSON() ([]byte, error) {
  3036. type noMethod I18nRegionListResponse
  3037. raw := noMethod(*s)
  3038. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3039. }
  3040. // I18nRegionSnippet: Basic details about an i18n region, such as region
  3041. // code and human-readable name.
  3042. type I18nRegionSnippet struct {
  3043. // Gl: The region code as a 2-letter ISO country code.
  3044. Gl string `json:"gl,omitempty"`
  3045. // Name: The human-readable name of the region.
  3046. Name string `json:"name,omitempty"`
  3047. // ForceSendFields is a list of field names (e.g. "Gl") to
  3048. // unconditionally include in API requests. By default, fields with
  3049. // empty values are omitted from API requests. However, any non-pointer,
  3050. // non-interface field appearing in ForceSendFields will be sent to the
  3051. // server regardless of whether the field is empty or not. This may be
  3052. // used to include empty fields in Patch requests.
  3053. ForceSendFields []string `json:"-"`
  3054. }
  3055. func (s *I18nRegionSnippet) MarshalJSON() ([]byte, error) {
  3056. type noMethod I18nRegionSnippet
  3057. raw := noMethod(*s)
  3058. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3059. }
  3060. // ImageSettings: Branding properties for images associated with the
  3061. // channel.
  3062. type ImageSettings struct {
  3063. // BackgroundImageUrl: The URL for the background image shown on the
  3064. // video watch page. The image should be 1200px by 615px, with a maximum
  3065. // file size of 128k.
  3066. BackgroundImageUrl *LocalizedProperty `json:"backgroundImageUrl,omitempty"`
  3067. // BannerExternalUrl: This is used only in update requests; if it's set,
  3068. // we use this URL to generate all of the above banner URLs.
  3069. BannerExternalUrl string `json:"bannerExternalUrl,omitempty"`
  3070. // BannerImageUrl: Banner image. Desktop size (1060x175).
  3071. BannerImageUrl string `json:"bannerImageUrl,omitempty"`
  3072. // BannerMobileExtraHdImageUrl: Banner image. Mobile size high
  3073. // resolution (1440x395).
  3074. BannerMobileExtraHdImageUrl string `json:"bannerMobileExtraHdImageUrl,omitempty"`
  3075. // BannerMobileHdImageUrl: Banner image. Mobile size high resolution
  3076. // (1280x360).
  3077. BannerMobileHdImageUrl string `json:"bannerMobileHdImageUrl,omitempty"`
  3078. // BannerMobileImageUrl: Banner image. Mobile size (640x175).
  3079. BannerMobileImageUrl string `json:"bannerMobileImageUrl,omitempty"`
  3080. // BannerMobileLowImageUrl: Banner image. Mobile size low resolution
  3081. // (320x88).
  3082. BannerMobileLowImageUrl string `json:"bannerMobileLowImageUrl,omitempty"`
  3083. // BannerMobileMediumHdImageUrl: Banner image. Mobile size medium/high
  3084. // resolution (960x263).
  3085. BannerMobileMediumHdImageUrl string `json:"bannerMobileMediumHdImageUrl,omitempty"`
  3086. // BannerTabletExtraHdImageUrl: Banner image. Tablet size extra high
  3087. // resolution (2560x424).
  3088. BannerTabletExtraHdImageUrl string `json:"bannerTabletExtraHdImageUrl,omitempty"`
  3089. // BannerTabletHdImageUrl: Banner image. Tablet size high resolution
  3090. // (2276x377).
  3091. BannerTabletHdImageUrl string `json:"bannerTabletHdImageUrl,omitempty"`
  3092. // BannerTabletImageUrl: Banner image. Tablet size (1707x283).
  3093. BannerTabletImageUrl string `json:"bannerTabletImageUrl,omitempty"`
  3094. // BannerTabletLowImageUrl: Banner image. Tablet size low resolution
  3095. // (1138x188).
  3096. BannerTabletLowImageUrl string `json:"bannerTabletLowImageUrl,omitempty"`
  3097. // BannerTvHighImageUrl: Banner image. TV size high resolution
  3098. // (1920x1080).
  3099. BannerTvHighImageUrl string `json:"bannerTvHighImageUrl,omitempty"`
  3100. // BannerTvImageUrl: Banner image. TV size extra high resolution
  3101. // (2120x1192).
  3102. BannerTvImageUrl string `json:"bannerTvImageUrl,omitempty"`
  3103. // BannerTvLowImageUrl: Banner image. TV size low resolution (854x480).
  3104. BannerTvLowImageUrl string `json:"bannerTvLowImageUrl,omitempty"`
  3105. // BannerTvMediumImageUrl: Banner image. TV size medium resolution
  3106. // (1280x720).
  3107. BannerTvMediumImageUrl string `json:"bannerTvMediumImageUrl,omitempty"`
  3108. // LargeBrandedBannerImageImapScript: The image map script for the large
  3109. // banner image.
  3110. LargeBrandedBannerImageImapScript *LocalizedProperty `json:"largeBrandedBannerImageImapScript,omitempty"`
  3111. // LargeBrandedBannerImageUrl: The URL for the 854px by 70px image that
  3112. // appears below the video player in the expanded video view of the
  3113. // video watch page.
  3114. LargeBrandedBannerImageUrl *LocalizedProperty `json:"largeBrandedBannerImageUrl,omitempty"`
  3115. // SmallBrandedBannerImageImapScript: The image map script for the small
  3116. // banner image.
  3117. SmallBrandedBannerImageImapScript *LocalizedProperty `json:"smallBrandedBannerImageImapScript,omitempty"`
  3118. // SmallBrandedBannerImageUrl: The URL for the 640px by 70px banner
  3119. // image that appears below the video player in the default view of the
  3120. // video watch page.
  3121. SmallBrandedBannerImageUrl *LocalizedProperty `json:"smallBrandedBannerImageUrl,omitempty"`
  3122. // TrackingImageUrl: The URL for a 1px by 1px tracking pixel that can be
  3123. // used to collect statistics for views of the channel or video pages.
  3124. TrackingImageUrl string `json:"trackingImageUrl,omitempty"`
  3125. // WatchIconImageUrl: The URL for the image that appears above the
  3126. // top-left corner of the video player. This is a 25-pixel-high image
  3127. // with a flexible width that cannot exceed 170 pixels.
  3128. WatchIconImageUrl string `json:"watchIconImageUrl,omitempty"`
  3129. // ForceSendFields is a list of field names (e.g. "BackgroundImageUrl")
  3130. // to unconditionally include in API requests. By default, fields with
  3131. // empty values are omitted from API requests. However, any non-pointer,
  3132. // non-interface field appearing in ForceSendFields will be sent to the
  3133. // server regardless of whether the field is empty or not. This may be
  3134. // used to include empty fields in Patch requests.
  3135. ForceSendFields []string `json:"-"`
  3136. }
  3137. func (s *ImageSettings) MarshalJSON() ([]byte, error) {
  3138. type noMethod ImageSettings
  3139. raw := noMethod(*s)
  3140. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3141. }
  3142. // IngestionInfo: Describes information necessary for ingesting an RTMP
  3143. // or an HTTP stream.
  3144. type IngestionInfo struct {
  3145. // BackupIngestionAddress: The backup ingestion URL that you should use
  3146. // to stream video to YouTube. You have the option of simultaneously
  3147. // streaming the content that you are sending to the ingestionAddress to
  3148. // this URL.
  3149. BackupIngestionAddress string `json:"backupIngestionAddress,omitempty"`
  3150. // IngestionAddress: The primary ingestion URL that you should use to
  3151. // stream video to YouTube. You must stream video to this
  3152. // URL.
  3153. //
  3154. // Depending on which application or tool you use to encode your video
  3155. // stream, you may need to enter the stream URL and stream name
  3156. // separately or you may need to concatenate them in the following
  3157. // format:
  3158. //
  3159. // STREAM_URL/STREAM_NAME
  3160. IngestionAddress string `json:"ingestionAddress,omitempty"`
  3161. // StreamName: The HTTP or RTMP stream name that YouTube assigns to the
  3162. // video stream.
  3163. StreamName string `json:"streamName,omitempty"`
  3164. // ForceSendFields is a list of field names (e.g.
  3165. // "BackupIngestionAddress") to unconditionally include in API requests.
  3166. // By default, fields with empty values are omitted from API requests.
  3167. // However, any non-pointer, non-interface field appearing in
  3168. // ForceSendFields will be sent to the server regardless of whether the
  3169. // field is empty or not. This may be used to include empty fields in
  3170. // Patch requests.
  3171. ForceSendFields []string `json:"-"`
  3172. }
  3173. func (s *IngestionInfo) MarshalJSON() ([]byte, error) {
  3174. type noMethod IngestionInfo
  3175. raw := noMethod(*s)
  3176. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3177. }
  3178. type InvideoBranding struct {
  3179. ImageBytes string `json:"imageBytes,omitempty"`
  3180. ImageUrl string `json:"imageUrl,omitempty"`
  3181. Position *InvideoPosition `json:"position,omitempty"`
  3182. TargetChannelId string `json:"targetChannelId,omitempty"`
  3183. Timing *InvideoTiming `json:"timing,omitempty"`
  3184. // ForceSendFields is a list of field names (e.g. "ImageBytes") to
  3185. // unconditionally include in API requests. By default, fields with
  3186. // empty values are omitted from API requests. However, any non-pointer,
  3187. // non-interface field appearing in ForceSendFields will be sent to the
  3188. // server regardless of whether the field is empty or not. This may be
  3189. // used to include empty fields in Patch requests.
  3190. ForceSendFields []string `json:"-"`
  3191. }
  3192. func (s *InvideoBranding) MarshalJSON() ([]byte, error) {
  3193. type noMethod InvideoBranding
  3194. raw := noMethod(*s)
  3195. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3196. }
  3197. // InvideoPosition: Describes the spatial position of a visual widget
  3198. // inside a video. It is a union of various position types, out of which
  3199. // only will be set one.
  3200. type InvideoPosition struct {
  3201. // CornerPosition: Describes in which corner of the video the visual
  3202. // widget will appear.
  3203. //
  3204. // Possible values:
  3205. // "bottomLeft"
  3206. // "bottomRight"
  3207. // "topLeft"
  3208. // "topRight"
  3209. CornerPosition string `json:"cornerPosition,omitempty"`
  3210. // Type: Defines the position type.
  3211. //
  3212. // Possible values:
  3213. // "corner"
  3214. Type string `json:"type,omitempty"`
  3215. // ForceSendFields is a list of field names (e.g. "CornerPosition") to
  3216. // unconditionally include in API requests. By default, fields with
  3217. // empty values are omitted from API requests. However, any non-pointer,
  3218. // non-interface field appearing in ForceSendFields will be sent to the
  3219. // server regardless of whether the field is empty or not. This may be
  3220. // used to include empty fields in Patch requests.
  3221. ForceSendFields []string `json:"-"`
  3222. }
  3223. func (s *InvideoPosition) MarshalJSON() ([]byte, error) {
  3224. type noMethod InvideoPosition
  3225. raw := noMethod(*s)
  3226. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3227. }
  3228. // InvideoPromotion: Describes an invideo promotion campaign consisting
  3229. // of multiple promoted items. A campaign belongs to a single
  3230. // channel_id.
  3231. type InvideoPromotion struct {
  3232. // DefaultTiming: The default temporal position within the video where
  3233. // the promoted item will be displayed. Can be overriden by more
  3234. // specific timing in the item.
  3235. DefaultTiming *InvideoTiming `json:"defaultTiming,omitempty"`
  3236. // Items: List of promoted items in decreasing priority.
  3237. Items []*PromotedItem `json:"items,omitempty"`
  3238. // Position: The spatial position within the video where the promoted
  3239. // item will be displayed.
  3240. Position *InvideoPosition `json:"position,omitempty"`
  3241. // UseSmartTiming: Indicates whether the channel's promotional campaign
  3242. // uses "smart timing." This feature attempts to show promotions at a
  3243. // point in the video when they are more likely to be clicked and less
  3244. // likely to disrupt the viewing experience. This feature also picks up
  3245. // a single promotion to show on each video.
  3246. UseSmartTiming bool `json:"useSmartTiming,omitempty"`
  3247. // ForceSendFields is a list of field names (e.g. "DefaultTiming") to
  3248. // unconditionally include in API requests. By default, fields with
  3249. // empty values are omitted from API requests. However, any non-pointer,
  3250. // non-interface field appearing in ForceSendFields will be sent to the
  3251. // server regardless of whether the field is empty or not. This may be
  3252. // used to include empty fields in Patch requests.
  3253. ForceSendFields []string `json:"-"`
  3254. }
  3255. func (s *InvideoPromotion) MarshalJSON() ([]byte, error) {
  3256. type noMethod InvideoPromotion
  3257. raw := noMethod(*s)
  3258. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3259. }
  3260. // InvideoTiming: Describes a temporal position of a visual widget
  3261. // inside a video.
  3262. type InvideoTiming struct {
  3263. // DurationMs: Defines the duration in milliseconds for which the
  3264. // promotion should be displayed. If missing, the client should use the
  3265. // default.
  3266. DurationMs uint64 `json:"durationMs,omitempty,string"`
  3267. // OffsetMs: Defines the time at which the promotion will appear.
  3268. // Depending on the value of type the value of the offsetMs field will
  3269. // represent a time offset from the start or from the end of the video,
  3270. // expressed in milliseconds.
  3271. OffsetMs uint64 `json:"offsetMs,omitempty,string"`
  3272. // Type: Describes a timing type. If the value is offsetFromStart, then
  3273. // the offsetMs field represents an offset from the start of the video.
  3274. // If the value is offsetFromEnd, then the offsetMs field represents an
  3275. // offset from the end of the video.
  3276. //
  3277. // Possible values:
  3278. // "offsetFromEnd"
  3279. // "offsetFromStart"
  3280. Type string `json:"type,omitempty"`
  3281. // ForceSendFields is a list of field names (e.g. "DurationMs") to
  3282. // unconditionally include in API requests. By default, fields with
  3283. // empty values are omitted from API requests. However, any non-pointer,
  3284. // non-interface field appearing in ForceSendFields will be sent to the
  3285. // server regardless of whether the field is empty or not. This may be
  3286. // used to include empty fields in Patch requests.
  3287. ForceSendFields []string `json:"-"`
  3288. }
  3289. func (s *InvideoTiming) MarshalJSON() ([]byte, error) {
  3290. type noMethod InvideoTiming
  3291. raw := noMethod(*s)
  3292. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3293. }
  3294. type LanguageTag struct {
  3295. Value string `json:"value,omitempty"`
  3296. // ForceSendFields is a list of field names (e.g. "Value") to
  3297. // unconditionally include in API requests. By default, fields with
  3298. // empty values are omitted from API requests. However, any non-pointer,
  3299. // non-interface field appearing in ForceSendFields will be sent to the
  3300. // server regardless of whether the field is empty or not. This may be
  3301. // used to include empty fields in Patch requests.
  3302. ForceSendFields []string `json:"-"`
  3303. }
  3304. func (s *LanguageTag) MarshalJSON() ([]byte, error) {
  3305. type noMethod LanguageTag
  3306. raw := noMethod(*s)
  3307. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3308. }
  3309. // LiveBroadcast: A liveBroadcast resource represents an event that will
  3310. // be streamed, via live video, on YouTube.
  3311. type LiveBroadcast struct {
  3312. // ContentDetails: The contentDetails object contains information about
  3313. // the event's video content, such as whether the content can be shown
  3314. // in an embedded video player or if it will be archived and therefore
  3315. // available for viewing after the event has concluded.
  3316. ContentDetails *LiveBroadcastContentDetails `json:"contentDetails,omitempty"`
  3317. // Etag: Etag of this resource.
  3318. Etag string `json:"etag,omitempty"`
  3319. // Id: The ID that YouTube assigns to uniquely identify the broadcast.
  3320. Id string `json:"id,omitempty"`
  3321. // Kind: Identifies what kind of resource this is. Value: the fixed
  3322. // string "youtube#liveBroadcast".
  3323. Kind string `json:"kind,omitempty"`
  3324. // Snippet: The snippet object contains basic details about the event,
  3325. // including its title, description, start time, and end time.
  3326. Snippet *LiveBroadcastSnippet `json:"snippet,omitempty"`
  3327. // Statistics: The statistics object contains info about the event's
  3328. // current stats. These include concurrent viewers and total chat count.
  3329. // Statistics can change (in either direction) during the lifetime of an
  3330. // event. Statistics are only returned while the event is live.
  3331. Statistics *LiveBroadcastStatistics `json:"statistics,omitempty"`
  3332. // Status: The status object contains information about the event's
  3333. // status.
  3334. Status *LiveBroadcastStatus `json:"status,omitempty"`
  3335. TopicDetails *LiveBroadcastTopicDetails `json:"topicDetails,omitempty"`
  3336. // ServerResponse contains the HTTP response code and headers from the
  3337. // server.
  3338. googleapi.ServerResponse `json:"-"`
  3339. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  3340. // unconditionally include in API requests. By default, fields with
  3341. // empty values are omitted from API requests. However, any non-pointer,
  3342. // non-interface field appearing in ForceSendFields will be sent to the
  3343. // server regardless of whether the field is empty or not. This may be
  3344. // used to include empty fields in Patch requests.
  3345. ForceSendFields []string `json:"-"`
  3346. }
  3347. func (s *LiveBroadcast) MarshalJSON() ([]byte, error) {
  3348. type noMethod LiveBroadcast
  3349. raw := noMethod(*s)
  3350. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3351. }
  3352. // LiveBroadcastContentDetails: Detailed settings of a broadcast.
  3353. type LiveBroadcastContentDetails struct {
  3354. // BoundStreamId: This value uniquely identifies the live stream bound
  3355. // to the broadcast.
  3356. BoundStreamId string `json:"boundStreamId,omitempty"`
  3357. // Possible values:
  3358. // "closedCaptionsDisabled"
  3359. // "closedCaptionsEmbedded"
  3360. // "closedCaptionsHttpPost"
  3361. ClosedCaptionsType string `json:"closedCaptionsType,omitempty"`
  3362. // EnableClosedCaptions: This setting indicates whether HTTP POST closed
  3363. // captioning is enabled for this broadcast. The ingestion URL of the
  3364. // closed captions is returned through the liveStreams API. This is
  3365. // mutually exclusive with using the closed_captions_type property, and
  3366. // is equivalent to setting closed_captions_type to
  3367. // CLOSED_CAPTIONS_HTTP_POST.
  3368. EnableClosedCaptions bool `json:"enableClosedCaptions,omitempty"`
  3369. // EnableContentEncryption: This setting indicates whether YouTube
  3370. // should enable content encryption for the broadcast.
  3371. EnableContentEncryption bool `json:"enableContentEncryption,omitempty"`
  3372. // EnableDvr: This setting determines whether viewers can access DVR
  3373. // controls while watching the video. DVR controls enable the viewer to
  3374. // control the video playback experience by pausing, rewinding, or fast
  3375. // forwarding content. The default value for this property is
  3376. // true.
  3377. //
  3378. //
  3379. //
  3380. // Important: You must set the value to true and also set the
  3381. // enableArchive property's value to true if you want to make playback
  3382. // available immediately after the broadcast ends.
  3383. EnableDvr bool `json:"enableDvr,omitempty"`
  3384. // EnableEmbed: This setting indicates whether the broadcast video can
  3385. // be played in an embedded player. If you choose to archive the video
  3386. // (using the enableArchive property), this setting will also apply to
  3387. // the archived video.
  3388. EnableEmbed bool `json:"enableEmbed,omitempty"`
  3389. // EnableLowLatency: Indicates whether this broadcast has low latency
  3390. // enabled.
  3391. EnableLowLatency bool `json:"enableLowLatency,omitempty"`
  3392. // MonitorStream: The monitorStream object contains information about
  3393. // the monitor stream, which the broadcaster can use to review the event
  3394. // content before the broadcast stream is shown publicly.
  3395. MonitorStream *MonitorStreamInfo `json:"monitorStream,omitempty"`
  3396. // RecordFromStart: Automatically start recording after the event goes
  3397. // live. The default value for this property is true.
  3398. //
  3399. //
  3400. //
  3401. // Important: You must also set the enableDvr property's value to true
  3402. // if you want the playback to be available immediately after the
  3403. // broadcast ends. If you set this property's value to true but do not
  3404. // also set the enableDvr property to true, there may be a delay of
  3405. // around one day before the archived video will be available for
  3406. // playback.
  3407. RecordFromStart bool `json:"recordFromStart,omitempty"`
  3408. // StartWithSlate: This setting indicates whether the broadcast should
  3409. // automatically begin with an in-stream slate when you update the
  3410. // broadcast's status to live. After updating the status, you then need
  3411. // to send a liveCuepoints.insert request that sets the cuepoint's
  3412. // eventState to end to remove the in-stream slate and make your
  3413. // broadcast stream visible to viewers.
  3414. StartWithSlate bool `json:"startWithSlate,omitempty"`
  3415. // ForceSendFields is a list of field names (e.g. "BoundStreamId") to
  3416. // unconditionally include in API requests. By default, fields with
  3417. // empty values are omitted from API requests. However, any non-pointer,
  3418. // non-interface field appearing in ForceSendFields will be sent to the
  3419. // server regardless of whether the field is empty or not. This may be
  3420. // used to include empty fields in Patch requests.
  3421. ForceSendFields []string `json:"-"`
  3422. }
  3423. func (s *LiveBroadcastContentDetails) MarshalJSON() ([]byte, error) {
  3424. type noMethod LiveBroadcastContentDetails
  3425. raw := noMethod(*s)
  3426. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3427. }
  3428. type LiveBroadcastListResponse struct {
  3429. // Etag: Etag of this resource.
  3430. Etag string `json:"etag,omitempty"`
  3431. // EventId: Serialized EventId of the request which produced this
  3432. // response.
  3433. EventId string `json:"eventId,omitempty"`
  3434. // Items: A list of broadcasts that match the request criteria.
  3435. Items []*LiveBroadcast `json:"items,omitempty"`
  3436. // Kind: Identifies what kind of resource this is. Value: the fixed
  3437. // string "youtube#liveBroadcastListResponse".
  3438. Kind string `json:"kind,omitempty"`
  3439. // NextPageToken: The token that can be used as the value of the
  3440. // pageToken parameter to retrieve the next page in the result set.
  3441. NextPageToken string `json:"nextPageToken,omitempty"`
  3442. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  3443. // PrevPageToken: The token that can be used as the value of the
  3444. // pageToken parameter to retrieve the previous page in the result set.
  3445. PrevPageToken string `json:"prevPageToken,omitempty"`
  3446. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  3447. // VisitorId: The visitorId identifies the visitor.
  3448. VisitorId string `json:"visitorId,omitempty"`
  3449. // ServerResponse contains the HTTP response code and headers from the
  3450. // server.
  3451. googleapi.ServerResponse `json:"-"`
  3452. // ForceSendFields is a list of field names (e.g. "Etag") to
  3453. // unconditionally include in API requests. By default, fields with
  3454. // empty values are omitted from API requests. However, any non-pointer,
  3455. // non-interface field appearing in ForceSendFields will be sent to the
  3456. // server regardless of whether the field is empty or not. This may be
  3457. // used to include empty fields in Patch requests.
  3458. ForceSendFields []string `json:"-"`
  3459. }
  3460. func (s *LiveBroadcastListResponse) MarshalJSON() ([]byte, error) {
  3461. type noMethod LiveBroadcastListResponse
  3462. raw := noMethod(*s)
  3463. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3464. }
  3465. type LiveBroadcastSnippet struct {
  3466. // ActualEndTime: The date and time that the broadcast actually ended.
  3467. // This information is only available once the broadcast's state is
  3468. // complete. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  3469. // format.
  3470. ActualEndTime string `json:"actualEndTime,omitempty"`
  3471. // ActualStartTime: The date and time that the broadcast actually
  3472. // started. This information is only available once the broadcast's
  3473. // state is live. The value is specified in ISO 8601
  3474. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  3475. ActualStartTime string `json:"actualStartTime,omitempty"`
  3476. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  3477. // that is publishing the broadcast.
  3478. ChannelId string `json:"channelId,omitempty"`
  3479. // Description: The broadcast's description. As with the title, you can
  3480. // set this field by modifying the broadcast resource or by setting the
  3481. // description field of the corresponding video resource.
  3482. Description string `json:"description,omitempty"`
  3483. IsDefaultBroadcast bool `json:"isDefaultBroadcast,omitempty"`
  3484. // LiveChatId: The id of the live chat for this broadcast.
  3485. LiveChatId string `json:"liveChatId,omitempty"`
  3486. // PublishedAt: The date and time that the broadcast was added to
  3487. // YouTube's live broadcast schedule. The value is specified in ISO 8601
  3488. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  3489. PublishedAt string `json:"publishedAt,omitempty"`
  3490. // ScheduledEndTime: The date and time that the broadcast is scheduled
  3491. // to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  3492. // format.
  3493. ScheduledEndTime string `json:"scheduledEndTime,omitempty"`
  3494. // ScheduledStartTime: The date and time that the broadcast is scheduled
  3495. // to start. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  3496. // format.
  3497. ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
  3498. // Thumbnails: A map of thumbnail images associated with the broadcast.
  3499. // For each nested object in this object, the key is the name of the
  3500. // thumbnail image, and the value is an object that contains other
  3501. // information about the thumbnail.
  3502. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  3503. // Title: The broadcast's title. Note that the broadcast represents
  3504. // exactly one YouTube video. You can set this field by modifying the
  3505. // broadcast resource or by setting the title field of the corresponding
  3506. // video resource.
  3507. Title string `json:"title,omitempty"`
  3508. // ForceSendFields is a list of field names (e.g. "ActualEndTime") to
  3509. // unconditionally include in API requests. By default, fields with
  3510. // empty values are omitted from API requests. However, any non-pointer,
  3511. // non-interface field appearing in ForceSendFields will be sent to the
  3512. // server regardless of whether the field is empty or not. This may be
  3513. // used to include empty fields in Patch requests.
  3514. ForceSendFields []string `json:"-"`
  3515. }
  3516. func (s *LiveBroadcastSnippet) MarshalJSON() ([]byte, error) {
  3517. type noMethod LiveBroadcastSnippet
  3518. raw := noMethod(*s)
  3519. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3520. }
  3521. // LiveBroadcastStatistics: Statistics about the live broadcast. These
  3522. // represent a snapshot of the values at the time of the request.
  3523. // Statistics are only returned for live broadcasts.
  3524. type LiveBroadcastStatistics struct {
  3525. // ConcurrentViewers: The number of viewers currently watching the
  3526. // broadcast. The property and its value will be present if the
  3527. // broadcast has current viewers and the broadcast owner has not hidden
  3528. // the viewcount for the video. Note that YouTube stops tracking the
  3529. // number of concurrent viewers for a broadcast when the broadcast ends.
  3530. // So, this property would not identify the number of viewers watching
  3531. // an archived video of a live broadcast that already ended.
  3532. ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"`
  3533. // TotalChatCount: The total number of live chat messages currently on
  3534. // the broadcast. The property and its value will be present if the
  3535. // broadcast is public, has the live chat feature enabled, and has at
  3536. // least one message. Note that this field will not be filled after the
  3537. // broadcast ends. So this property would not identify the number of
  3538. // chat messages for an archived video of a completed live broadcast.
  3539. TotalChatCount uint64 `json:"totalChatCount,omitempty,string"`
  3540. // ForceSendFields is a list of field names (e.g. "ConcurrentViewers")
  3541. // to unconditionally include in API requests. By default, fields with
  3542. // empty values are omitted from API requests. However, any non-pointer,
  3543. // non-interface field appearing in ForceSendFields will be sent to the
  3544. // server regardless of whether the field is empty or not. This may be
  3545. // used to include empty fields in Patch requests.
  3546. ForceSendFields []string `json:"-"`
  3547. }
  3548. func (s *LiveBroadcastStatistics) MarshalJSON() ([]byte, error) {
  3549. type noMethod LiveBroadcastStatistics
  3550. raw := noMethod(*s)
  3551. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3552. }
  3553. type LiveBroadcastStatus struct {
  3554. // LifeCycleStatus: The broadcast's status. The status can be updated
  3555. // using the API's liveBroadcasts.transition method.
  3556. //
  3557. // Possible values:
  3558. // "abandoned"
  3559. // "complete"
  3560. // "completeStarting"
  3561. // "created"
  3562. // "live"
  3563. // "liveStarting"
  3564. // "ready"
  3565. // "reclaimed"
  3566. // "revoked"
  3567. // "testStarting"
  3568. // "testing"
  3569. LifeCycleStatus string `json:"lifeCycleStatus,omitempty"`
  3570. // LiveBroadcastPriority: Priority of the live broadcast event (internal
  3571. // state).
  3572. //
  3573. // Possible values:
  3574. // "high"
  3575. // "low"
  3576. // "normal"
  3577. LiveBroadcastPriority string `json:"liveBroadcastPriority,omitempty"`
  3578. // PrivacyStatus: The broadcast's privacy status. Note that the
  3579. // broadcast represents exactly one YouTube video, so the privacy
  3580. // settings are identical to those supported for videos. In addition,
  3581. // you can set this field by modifying the broadcast resource or by
  3582. // setting the privacyStatus field of the corresponding video resource.
  3583. //
  3584. // Possible values:
  3585. // "private"
  3586. // "public"
  3587. // "unlisted"
  3588. PrivacyStatus string `json:"privacyStatus,omitempty"`
  3589. // RecordingStatus: The broadcast's recording status.
  3590. //
  3591. // Possible values:
  3592. // "notRecording"
  3593. // "recorded"
  3594. // "recording"
  3595. RecordingStatus string `json:"recordingStatus,omitempty"`
  3596. // ForceSendFields is a list of field names (e.g. "LifeCycleStatus") to
  3597. // unconditionally include in API requests. By default, fields with
  3598. // empty values are omitted from API requests. However, any non-pointer,
  3599. // non-interface field appearing in ForceSendFields will be sent to the
  3600. // server regardless of whether the field is empty or not. This may be
  3601. // used to include empty fields in Patch requests.
  3602. ForceSendFields []string `json:"-"`
  3603. }
  3604. func (s *LiveBroadcastStatus) MarshalJSON() ([]byte, error) {
  3605. type noMethod LiveBroadcastStatus
  3606. raw := noMethod(*s)
  3607. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3608. }
  3609. type LiveBroadcastTopic struct {
  3610. // Snippet: Information about the topic matched.
  3611. Snippet *LiveBroadcastTopicSnippet `json:"snippet,omitempty"`
  3612. // Type: The type of the topic.
  3613. //
  3614. // Possible values:
  3615. // "videoGame"
  3616. Type string `json:"type,omitempty"`
  3617. // Unmatched: If this flag is set it means that we have not been able to
  3618. // match the topic title and type provided to a known entity.
  3619. Unmatched bool `json:"unmatched,omitempty"`
  3620. // ForceSendFields is a list of field names (e.g. "Snippet") to
  3621. // unconditionally include in API requests. By default, fields with
  3622. // empty values are omitted from API requests. However, any non-pointer,
  3623. // non-interface field appearing in ForceSendFields will be sent to the
  3624. // server regardless of whether the field is empty or not. This may be
  3625. // used to include empty fields in Patch requests.
  3626. ForceSendFields []string `json:"-"`
  3627. }
  3628. func (s *LiveBroadcastTopic) MarshalJSON() ([]byte, error) {
  3629. type noMethod LiveBroadcastTopic
  3630. raw := noMethod(*s)
  3631. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3632. }
  3633. type LiveBroadcastTopicDetails struct {
  3634. Topics []*LiveBroadcastTopic `json:"topics,omitempty"`
  3635. // ForceSendFields is a list of field names (e.g. "Topics") to
  3636. // unconditionally include in API requests. By default, fields with
  3637. // empty values are omitted from API requests. However, any non-pointer,
  3638. // non-interface field appearing in ForceSendFields will be sent to the
  3639. // server regardless of whether the field is empty or not. This may be
  3640. // used to include empty fields in Patch requests.
  3641. ForceSendFields []string `json:"-"`
  3642. }
  3643. func (s *LiveBroadcastTopicDetails) MarshalJSON() ([]byte, error) {
  3644. type noMethod LiveBroadcastTopicDetails
  3645. raw := noMethod(*s)
  3646. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3647. }
  3648. type LiveBroadcastTopicSnippet struct {
  3649. // Name: The name of the topic.
  3650. Name string `json:"name,omitempty"`
  3651. // ReleaseDate: The date at which the topic was released. Filled for
  3652. // types: videoGame
  3653. ReleaseDate string `json:"releaseDate,omitempty"`
  3654. // ForceSendFields is a list of field names (e.g. "Name") to
  3655. // unconditionally include in API requests. By default, fields with
  3656. // empty values are omitted from API requests. However, any non-pointer,
  3657. // non-interface field appearing in ForceSendFields will be sent to the
  3658. // server regardless of whether the field is empty or not. This may be
  3659. // used to include empty fields in Patch requests.
  3660. ForceSendFields []string `json:"-"`
  3661. }
  3662. func (s *LiveBroadcastTopicSnippet) MarshalJSON() ([]byte, error) {
  3663. type noMethod LiveBroadcastTopicSnippet
  3664. raw := noMethod(*s)
  3665. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3666. }
  3667. // LiveChatBan: A liveChatBan resource represents a ban for a YouTube
  3668. // live chat.
  3669. type LiveChatBan struct {
  3670. // Etag: Etag of this resource.
  3671. Etag string `json:"etag,omitempty"`
  3672. // Id: The ID that YouTube assigns to uniquely identify the ban.
  3673. Id string `json:"id,omitempty"`
  3674. // Kind: Identifies what kind of resource this is. Value: the fixed
  3675. // string "youtube#liveChatBan".
  3676. Kind string `json:"kind,omitempty"`
  3677. // Snippet: The snippet object contains basic details about the ban.
  3678. Snippet *LiveChatBanSnippet `json:"snippet,omitempty"`
  3679. // ServerResponse contains the HTTP response code and headers from the
  3680. // server.
  3681. googleapi.ServerResponse `json:"-"`
  3682. // ForceSendFields is a list of field names (e.g. "Etag") to
  3683. // unconditionally include in API requests. By default, fields with
  3684. // empty values are omitted from API requests. However, any non-pointer,
  3685. // non-interface field appearing in ForceSendFields will be sent to the
  3686. // server regardless of whether the field is empty or not. This may be
  3687. // used to include empty fields in Patch requests.
  3688. ForceSendFields []string `json:"-"`
  3689. }
  3690. func (s *LiveChatBan) MarshalJSON() ([]byte, error) {
  3691. type noMethod LiveChatBan
  3692. raw := noMethod(*s)
  3693. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3694. }
  3695. type LiveChatBanSnippet struct {
  3696. // BanDurationSeconds: The duration of a ban, only filled if the ban has
  3697. // type TEMPORARY.
  3698. BanDurationSeconds uint64 `json:"banDurationSeconds,omitempty,string"`
  3699. BannedUserDetails *ChannelProfileDetails `json:"bannedUserDetails,omitempty"`
  3700. // LiveChatId: The chat this ban is pertinent to.
  3701. LiveChatId string `json:"liveChatId,omitempty"`
  3702. // Type: The type of ban.
  3703. //
  3704. // Possible values:
  3705. // "permanent"
  3706. // "temporary"
  3707. Type string `json:"type,omitempty"`
  3708. // ForceSendFields is a list of field names (e.g. "BanDurationSeconds")
  3709. // to unconditionally include in API requests. By default, fields with
  3710. // empty values are omitted from API requests. However, any non-pointer,
  3711. // non-interface field appearing in ForceSendFields will be sent to the
  3712. // server regardless of whether the field is empty or not. This may be
  3713. // used to include empty fields in Patch requests.
  3714. ForceSendFields []string `json:"-"`
  3715. }
  3716. func (s *LiveChatBanSnippet) MarshalJSON() ([]byte, error) {
  3717. type noMethod LiveChatBanSnippet
  3718. raw := noMethod(*s)
  3719. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3720. }
  3721. type LiveChatFanFundingEventDetails struct {
  3722. // AmountDisplayString: A rendered string that displays the fund amount
  3723. // and currency to the user.
  3724. AmountDisplayString string `json:"amountDisplayString,omitempty"`
  3725. // AmountMicros: The amount of the fund.
  3726. AmountMicros uint64 `json:"amountMicros,omitempty,string"`
  3727. // Currency: The currency in which the fund was made.
  3728. Currency string `json:"currency,omitempty"`
  3729. // UserComment: The comment added by the user to this fan funding event.
  3730. UserComment string `json:"userComment,omitempty"`
  3731. // ForceSendFields is a list of field names (e.g. "AmountDisplayString")
  3732. // to unconditionally include in API requests. By default, fields with
  3733. // empty values are omitted from API requests. However, any non-pointer,
  3734. // non-interface field appearing in ForceSendFields will be sent to the
  3735. // server regardless of whether the field is empty or not. This may be
  3736. // used to include empty fields in Patch requests.
  3737. ForceSendFields []string `json:"-"`
  3738. }
  3739. func (s *LiveChatFanFundingEventDetails) MarshalJSON() ([]byte, error) {
  3740. type noMethod LiveChatFanFundingEventDetails
  3741. raw := noMethod(*s)
  3742. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3743. }
  3744. // LiveChatMessage: A liveChatMessage resource represents a chat message
  3745. // in a YouTube Live Chat.
  3746. type LiveChatMessage struct {
  3747. // AuthorDetails: The authorDetails object contains basic details about
  3748. // the user that posted this message.
  3749. AuthorDetails *LiveChatMessageAuthorDetails `json:"authorDetails,omitempty"`
  3750. // Etag: Etag of this resource.
  3751. Etag string `json:"etag,omitempty"`
  3752. // Id: The ID that YouTube assigns to uniquely identify the message.
  3753. Id string `json:"id,omitempty"`
  3754. // Kind: Identifies what kind of resource this is. Value: the fixed
  3755. // string "youtube#liveChatMessage".
  3756. Kind string `json:"kind,omitempty"`
  3757. // Snippet: The snippet object contains basic details about the message.
  3758. Snippet *LiveChatMessageSnippet `json:"snippet,omitempty"`
  3759. // ServerResponse contains the HTTP response code and headers from the
  3760. // server.
  3761. googleapi.ServerResponse `json:"-"`
  3762. // ForceSendFields is a list of field names (e.g. "AuthorDetails") to
  3763. // unconditionally include in API requests. By default, fields with
  3764. // empty values are omitted from API requests. However, any non-pointer,
  3765. // non-interface field appearing in ForceSendFields will be sent to the
  3766. // server regardless of whether the field is empty or not. This may be
  3767. // used to include empty fields in Patch requests.
  3768. ForceSendFields []string `json:"-"`
  3769. }
  3770. func (s *LiveChatMessage) MarshalJSON() ([]byte, error) {
  3771. type noMethod LiveChatMessage
  3772. raw := noMethod(*s)
  3773. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3774. }
  3775. type LiveChatMessageAuthorDetails struct {
  3776. // ChannelId: The YouTube channel ID.
  3777. ChannelId string `json:"channelId,omitempty"`
  3778. // ChannelUrl: The channel's URL.
  3779. ChannelUrl string `json:"channelUrl,omitempty"`
  3780. // DisplayName: The channel's display name.
  3781. DisplayName string `json:"displayName,omitempty"`
  3782. // IsChatModerator: Whether the author is a moderator of the live chat.
  3783. IsChatModerator bool `json:"isChatModerator,omitempty"`
  3784. // IsChatOwner: Whether the author is the owner of the live chat.
  3785. IsChatOwner bool `json:"isChatOwner,omitempty"`
  3786. // IsChatSponsor: Whether the author is a sponsor of the live chat.
  3787. IsChatSponsor bool `json:"isChatSponsor,omitempty"`
  3788. // IsVerified: Whether the author's identity has been verified by
  3789. // YouTube.
  3790. IsVerified bool `json:"isVerified,omitempty"`
  3791. // ProfileImageUrl: The channels's avatar URL.
  3792. ProfileImageUrl string `json:"profileImageUrl,omitempty"`
  3793. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  3794. // unconditionally include in API requests. By default, fields with
  3795. // empty values are omitted from API requests. However, any non-pointer,
  3796. // non-interface field appearing in ForceSendFields will be sent to the
  3797. // server regardless of whether the field is empty or not. This may be
  3798. // used to include empty fields in Patch requests.
  3799. ForceSendFields []string `json:"-"`
  3800. }
  3801. func (s *LiveChatMessageAuthorDetails) MarshalJSON() ([]byte, error) {
  3802. type noMethod LiveChatMessageAuthorDetails
  3803. raw := noMethod(*s)
  3804. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3805. }
  3806. type LiveChatMessageListResponse struct {
  3807. // Etag: Etag of this resource.
  3808. Etag string `json:"etag,omitempty"`
  3809. // EventId: Serialized EventId of the request which produced this
  3810. // response.
  3811. EventId string `json:"eventId,omitempty"`
  3812. // Items: A list of live chat messages.
  3813. Items []*LiveChatMessage `json:"items,omitempty"`
  3814. // Kind: Identifies what kind of resource this is. Value: the fixed
  3815. // string "youtube#liveChatMessageListResponse".
  3816. Kind string `json:"kind,omitempty"`
  3817. // NextPageToken: The token that can be used as the value of the
  3818. // pageToken parameter to retrieve the next page in the result set.
  3819. NextPageToken string `json:"nextPageToken,omitempty"`
  3820. // OfflineAt: The date and time when the underlying stream went offline.
  3821. // The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  3822. OfflineAt string `json:"offlineAt,omitempty"`
  3823. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  3824. // PollingIntervalMillis: The amount of time the client should wait
  3825. // before polling again.
  3826. PollingIntervalMillis int64 `json:"pollingIntervalMillis,omitempty"`
  3827. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  3828. // VisitorId: The visitorId identifies the visitor.
  3829. VisitorId string `json:"visitorId,omitempty"`
  3830. // ServerResponse contains the HTTP response code and headers from the
  3831. // server.
  3832. googleapi.ServerResponse `json:"-"`
  3833. // ForceSendFields is a list of field names (e.g. "Etag") to
  3834. // unconditionally include in API requests. By default, fields with
  3835. // empty values are omitted from API requests. However, any non-pointer,
  3836. // non-interface field appearing in ForceSendFields will be sent to the
  3837. // server regardless of whether the field is empty or not. This may be
  3838. // used to include empty fields in Patch requests.
  3839. ForceSendFields []string `json:"-"`
  3840. }
  3841. func (s *LiveChatMessageListResponse) MarshalJSON() ([]byte, error) {
  3842. type noMethod LiveChatMessageListResponse
  3843. raw := noMethod(*s)
  3844. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3845. }
  3846. type LiveChatMessageSnippet struct {
  3847. // AuthorChannelId: The ID of the user that authored this message, this
  3848. // field is not always filled. textMessageEvent - the user that wrote
  3849. // the message fanFundingEvent - the user that funded the broadcast
  3850. // newSponsorEvent - the user that just became a sponsor
  3851. AuthorChannelId string `json:"authorChannelId,omitempty"`
  3852. // DisplayMessage: Contains a string that can be displayed to the user.
  3853. // If this field is not present the message is silent, at the moment
  3854. // only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent.
  3855. DisplayMessage string `json:"displayMessage,omitempty"`
  3856. // FanFundingEventDetails: Details about the funding event, this is only
  3857. // set if the type is 'fanFundingEvent'.
  3858. FanFundingEventDetails *LiveChatFanFundingEventDetails `json:"fanFundingEventDetails,omitempty"`
  3859. // HasDisplayContent: Whether the message has display content that
  3860. // should be displayed to users.
  3861. HasDisplayContent bool `json:"hasDisplayContent,omitempty"`
  3862. LiveChatId string `json:"liveChatId,omitempty"`
  3863. // PublishedAt: The date and time when the message was orignally
  3864. // published. The value is specified in ISO 8601
  3865. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  3866. PublishedAt string `json:"publishedAt,omitempty"`
  3867. // TextMessageDetails: Details about the text message, this is only set
  3868. // if the type is 'textMessageEvent'.
  3869. TextMessageDetails *LiveChatTextMessageDetails `json:"textMessageDetails,omitempty"`
  3870. // Type: The type of message, this will always be present, it determines
  3871. // the contents of the message as well as which fields will be present.
  3872. //
  3873. // Possible values:
  3874. // "chatEndedEvent"
  3875. // "fanFundingEvent"
  3876. // "newSponsorEvent"
  3877. // "sponsorOnlyModeEndedEvent"
  3878. // "sponsorOnlyModeStartedEvent"
  3879. // "textMessageEvent"
  3880. // "tombstone"
  3881. Type string `json:"type,omitempty"`
  3882. // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to
  3883. // unconditionally include in API requests. By default, fields with
  3884. // empty values are omitted from API requests. However, any non-pointer,
  3885. // non-interface field appearing in ForceSendFields will be sent to the
  3886. // server regardless of whether the field is empty or not. This may be
  3887. // used to include empty fields in Patch requests.
  3888. ForceSendFields []string `json:"-"`
  3889. }
  3890. func (s *LiveChatMessageSnippet) MarshalJSON() ([]byte, error) {
  3891. type noMethod LiveChatMessageSnippet
  3892. raw := noMethod(*s)
  3893. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3894. }
  3895. // LiveChatModerator: A liveChatModerator resource represents a
  3896. // moderator for a YouTube live chat. A chat moderator has the ability
  3897. // to ban/unban users from a chat, remove message, etc.
  3898. type LiveChatModerator struct {
  3899. // Etag: Etag of this resource.
  3900. Etag string `json:"etag,omitempty"`
  3901. // Id: The ID that YouTube assigns to uniquely identify the moderator.
  3902. Id string `json:"id,omitempty"`
  3903. // Kind: Identifies what kind of resource this is. Value: the fixed
  3904. // string "youtube#liveChatModerator".
  3905. Kind string `json:"kind,omitempty"`
  3906. // Snippet: The snippet object contains basic details about the
  3907. // moderator.
  3908. Snippet *LiveChatModeratorSnippet `json:"snippet,omitempty"`
  3909. // ServerResponse contains the HTTP response code and headers from the
  3910. // server.
  3911. googleapi.ServerResponse `json:"-"`
  3912. // ForceSendFields is a list of field names (e.g. "Etag") to
  3913. // unconditionally include in API requests. By default, fields with
  3914. // empty values are omitted from API requests. However, any non-pointer,
  3915. // non-interface field appearing in ForceSendFields will be sent to the
  3916. // server regardless of whether the field is empty or not. This may be
  3917. // used to include empty fields in Patch requests.
  3918. ForceSendFields []string `json:"-"`
  3919. }
  3920. func (s *LiveChatModerator) MarshalJSON() ([]byte, error) {
  3921. type noMethod LiveChatModerator
  3922. raw := noMethod(*s)
  3923. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3924. }
  3925. type LiveChatModeratorListResponse struct {
  3926. // Etag: Etag of this resource.
  3927. Etag string `json:"etag,omitempty"`
  3928. // EventId: Serialized EventId of the request which produced this
  3929. // response.
  3930. EventId string `json:"eventId,omitempty"`
  3931. // Items: A list of moderators that match the request criteria.
  3932. Items []*LiveChatModerator `json:"items,omitempty"`
  3933. // Kind: Identifies what kind of resource this is. Value: the fixed
  3934. // string "youtube#liveChatModeratorListResponse".
  3935. Kind string `json:"kind,omitempty"`
  3936. // NextPageToken: The token that can be used as the value of the
  3937. // pageToken parameter to retrieve the next page in the result set.
  3938. NextPageToken string `json:"nextPageToken,omitempty"`
  3939. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  3940. // PrevPageToken: The token that can be used as the value of the
  3941. // pageToken parameter to retrieve the previous page in the result set.
  3942. PrevPageToken string `json:"prevPageToken,omitempty"`
  3943. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  3944. // VisitorId: The visitorId identifies the visitor.
  3945. VisitorId string `json:"visitorId,omitempty"`
  3946. // ServerResponse contains the HTTP response code and headers from the
  3947. // server.
  3948. googleapi.ServerResponse `json:"-"`
  3949. // ForceSendFields is a list of field names (e.g. "Etag") to
  3950. // unconditionally include in API requests. By default, fields with
  3951. // empty values are omitted from API requests. However, any non-pointer,
  3952. // non-interface field appearing in ForceSendFields will be sent to the
  3953. // server regardless of whether the field is empty or not. This may be
  3954. // used to include empty fields in Patch requests.
  3955. ForceSendFields []string `json:"-"`
  3956. }
  3957. func (s *LiveChatModeratorListResponse) MarshalJSON() ([]byte, error) {
  3958. type noMethod LiveChatModeratorListResponse
  3959. raw := noMethod(*s)
  3960. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3961. }
  3962. type LiveChatModeratorSnippet struct {
  3963. // LiveChatId: The ID of the live chat this moderator can act on.
  3964. LiveChatId string `json:"liveChatId,omitempty"`
  3965. // ModeratorDetails: Details about the moderator.
  3966. ModeratorDetails *ChannelProfileDetails `json:"moderatorDetails,omitempty"`
  3967. // ForceSendFields is a list of field names (e.g. "LiveChatId") to
  3968. // unconditionally include in API requests. By default, fields with
  3969. // empty values are omitted from API requests. However, any non-pointer,
  3970. // non-interface field appearing in ForceSendFields will be sent to the
  3971. // server regardless of whether the field is empty or not. This may be
  3972. // used to include empty fields in Patch requests.
  3973. ForceSendFields []string `json:"-"`
  3974. }
  3975. func (s *LiveChatModeratorSnippet) MarshalJSON() ([]byte, error) {
  3976. type noMethod LiveChatModeratorSnippet
  3977. raw := noMethod(*s)
  3978. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3979. }
  3980. type LiveChatTextMessageDetails struct {
  3981. // MessageText: The user's message.
  3982. MessageText string `json:"messageText,omitempty"`
  3983. // ForceSendFields is a list of field names (e.g. "MessageText") to
  3984. // unconditionally include in API requests. By default, fields with
  3985. // empty values are omitted from API requests. However, any non-pointer,
  3986. // non-interface field appearing in ForceSendFields will be sent to the
  3987. // server regardless of whether the field is empty or not. This may be
  3988. // used to include empty fields in Patch requests.
  3989. ForceSendFields []string `json:"-"`
  3990. }
  3991. func (s *LiveChatTextMessageDetails) MarshalJSON() ([]byte, error) {
  3992. type noMethod LiveChatTextMessageDetails
  3993. raw := noMethod(*s)
  3994. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3995. }
  3996. // LiveStream: A live stream describes a live ingestion point.
  3997. type LiveStream struct {
  3998. // Cdn: The cdn object defines the live stream's content delivery
  3999. // network (CDN) settings. These settings provide details about the
  4000. // manner in which you stream your content to YouTube.
  4001. Cdn *CdnSettings `json:"cdn,omitempty"`
  4002. // ContentDetails: The content_details object contains information about
  4003. // the stream, including the closed captions ingestion URL.
  4004. ContentDetails *LiveStreamContentDetails `json:"contentDetails,omitempty"`
  4005. // Etag: Etag of this resource.
  4006. Etag string `json:"etag,omitempty"`
  4007. // Id: The ID that YouTube assigns to uniquely identify the stream.
  4008. Id string `json:"id,omitempty"`
  4009. // Kind: Identifies what kind of resource this is. Value: the fixed
  4010. // string "youtube#liveStream".
  4011. Kind string `json:"kind,omitempty"`
  4012. // Snippet: The snippet object contains basic details about the stream,
  4013. // including its channel, title, and description.
  4014. Snippet *LiveStreamSnippet `json:"snippet,omitempty"`
  4015. // Status: The status object contains information about live stream's
  4016. // status.
  4017. Status *LiveStreamStatus `json:"status,omitempty"`
  4018. // ServerResponse contains the HTTP response code and headers from the
  4019. // server.
  4020. googleapi.ServerResponse `json:"-"`
  4021. // ForceSendFields is a list of field names (e.g. "Cdn") to
  4022. // unconditionally include in API requests. By default, fields with
  4023. // empty values are omitted from API requests. However, any non-pointer,
  4024. // non-interface field appearing in ForceSendFields will be sent to the
  4025. // server regardless of whether the field is empty or not. This may be
  4026. // used to include empty fields in Patch requests.
  4027. ForceSendFields []string `json:"-"`
  4028. }
  4029. func (s *LiveStream) MarshalJSON() ([]byte, error) {
  4030. type noMethod LiveStream
  4031. raw := noMethod(*s)
  4032. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4033. }
  4034. type LiveStreamConfigurationIssue struct {
  4035. // Description: The long-form description of the issue and how to
  4036. // resolve it.
  4037. Description string `json:"description,omitempty"`
  4038. // Reason: The short-form reason for this issue.
  4039. Reason string `json:"reason,omitempty"`
  4040. // Severity: How severe this issue is to the stream.
  4041. //
  4042. // Possible values:
  4043. // "error"
  4044. // "info"
  4045. // "warning"
  4046. Severity string `json:"severity,omitempty"`
  4047. // Type: The kind of error happening.
  4048. //
  4049. // Possible values:
  4050. // "audioBitrateHigh"
  4051. // "audioBitrateLow"
  4052. // "audioBitrateMismatch"
  4053. // "audioCodec"
  4054. // "audioCodecMismatch"
  4055. // "audioSampleRate"
  4056. // "audioSampleRateMismatch"
  4057. // "audioStereoMismatch"
  4058. // "audioTooManyChannels"
  4059. // "badContainer"
  4060. // "bitrateHigh"
  4061. // "bitrateLow"
  4062. // "frameRateHigh"
  4063. // "framerateMismatch"
  4064. // "gopMismatch"
  4065. // "gopSizeLong"
  4066. // "gopSizeOver"
  4067. // "gopSizeShort"
  4068. // "interlacedVideo"
  4069. // "multipleAudioStreams"
  4070. // "multipleVideoStreams"
  4071. // "noAudioStream"
  4072. // "noVideoStream"
  4073. // "openGop"
  4074. // "resolutionMismatch"
  4075. // "videoBitrateMismatch"
  4076. // "videoCodec"
  4077. // "videoCodecMismatch"
  4078. // "videoIngestionStarved"
  4079. // "videoInterlaceMismatch"
  4080. // "videoProfileMismatch"
  4081. // "videoResolutionSuboptimal"
  4082. // "videoResolutionUnsupported"
  4083. Type string `json:"type,omitempty"`
  4084. // ForceSendFields is a list of field names (e.g. "Description") to
  4085. // unconditionally include in API requests. By default, fields with
  4086. // empty values are omitted from API requests. However, any non-pointer,
  4087. // non-interface field appearing in ForceSendFields will be sent to the
  4088. // server regardless of whether the field is empty or not. This may be
  4089. // used to include empty fields in Patch requests.
  4090. ForceSendFields []string `json:"-"`
  4091. }
  4092. func (s *LiveStreamConfigurationIssue) MarshalJSON() ([]byte, error) {
  4093. type noMethod LiveStreamConfigurationIssue
  4094. raw := noMethod(*s)
  4095. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4096. }
  4097. // LiveStreamContentDetails: Detailed settings of a stream.
  4098. type LiveStreamContentDetails struct {
  4099. // ClosedCaptionsIngestionUrl: The ingestion URL where the closed
  4100. // captions of this stream are sent.
  4101. ClosedCaptionsIngestionUrl string `json:"closedCaptionsIngestionUrl,omitempty"`
  4102. // IsReusable: Indicates whether the stream is reusable, which means
  4103. // that it can be bound to multiple broadcasts. It is common for
  4104. // broadcasters to reuse the same stream for many different broadcasts
  4105. // if those broadcasts occur at different times.
  4106. //
  4107. // If you set this value to false, then the stream will not be reusable,
  4108. // which means that it can only be bound to one broadcast. Non-reusable
  4109. // streams differ from reusable streams in the following ways:
  4110. // - A non-reusable stream can only be bound to one broadcast.
  4111. // - A non-reusable stream might be deleted by an automated process
  4112. // after the broadcast ends.
  4113. // - The liveStreams.list method does not list non-reusable streams if
  4114. // you call the method and set the mine parameter to true. The only way
  4115. // to use that method to retrieve the resource for a non-reusable stream
  4116. // is to use the id parameter to identify the stream.
  4117. IsReusable bool `json:"isReusable,omitempty"`
  4118. // ForceSendFields is a list of field names (e.g.
  4119. // "ClosedCaptionsIngestionUrl") to unconditionally include in API
  4120. // requests. By default, fields with empty values are omitted from API
  4121. // requests. However, any non-pointer, non-interface field appearing in
  4122. // ForceSendFields will be sent to the server regardless of whether the
  4123. // field is empty or not. This may be used to include empty fields in
  4124. // Patch requests.
  4125. ForceSendFields []string `json:"-"`
  4126. }
  4127. func (s *LiveStreamContentDetails) MarshalJSON() ([]byte, error) {
  4128. type noMethod LiveStreamContentDetails
  4129. raw := noMethod(*s)
  4130. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4131. }
  4132. type LiveStreamHealthStatus struct {
  4133. // ConfigurationIssues: The configurations issues on this stream
  4134. ConfigurationIssues []*LiveStreamConfigurationIssue `json:"configurationIssues,omitempty"`
  4135. // LastUpdateTimeSeconds: The last time this status was updated (in
  4136. // seconds)
  4137. LastUpdateTimeSeconds uint64 `json:"lastUpdateTimeSeconds,omitempty,string"`
  4138. // Status: The status code of this stream
  4139. //
  4140. // Possible values:
  4141. // "bad"
  4142. // "good"
  4143. // "noData"
  4144. // "ok"
  4145. // "revoked"
  4146. Status string `json:"status,omitempty"`
  4147. // ForceSendFields is a list of field names (e.g. "ConfigurationIssues")
  4148. // to unconditionally include in API requests. By default, fields with
  4149. // empty values are omitted from API requests. However, any non-pointer,
  4150. // non-interface field appearing in ForceSendFields will be sent to the
  4151. // server regardless of whether the field is empty or not. This may be
  4152. // used to include empty fields in Patch requests.
  4153. ForceSendFields []string `json:"-"`
  4154. }
  4155. func (s *LiveStreamHealthStatus) MarshalJSON() ([]byte, error) {
  4156. type noMethod LiveStreamHealthStatus
  4157. raw := noMethod(*s)
  4158. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4159. }
  4160. type LiveStreamListResponse struct {
  4161. // Etag: Etag of this resource.
  4162. Etag string `json:"etag,omitempty"`
  4163. // EventId: Serialized EventId of the request which produced this
  4164. // response.
  4165. EventId string `json:"eventId,omitempty"`
  4166. // Items: A list of live streams that match the request criteria.
  4167. Items []*LiveStream `json:"items,omitempty"`
  4168. // Kind: Identifies what kind of resource this is. Value: the fixed
  4169. // string "youtube#liveStreamListResponse".
  4170. Kind string `json:"kind,omitempty"`
  4171. // NextPageToken: The token that can be used as the value of the
  4172. // pageToken parameter to retrieve the next page in the result set.
  4173. NextPageToken string `json:"nextPageToken,omitempty"`
  4174. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  4175. // PrevPageToken: The token that can be used as the value of the
  4176. // pageToken parameter to retrieve the previous page in the result set.
  4177. PrevPageToken string `json:"prevPageToken,omitempty"`
  4178. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  4179. // VisitorId: The visitorId identifies the visitor.
  4180. VisitorId string `json:"visitorId,omitempty"`
  4181. // ServerResponse contains the HTTP response code and headers from the
  4182. // server.
  4183. googleapi.ServerResponse `json:"-"`
  4184. // ForceSendFields is a list of field names (e.g. "Etag") to
  4185. // unconditionally include in API requests. By default, fields with
  4186. // empty values are omitted from API requests. However, any non-pointer,
  4187. // non-interface field appearing in ForceSendFields will be sent to the
  4188. // server regardless of whether the field is empty or not. This may be
  4189. // used to include empty fields in Patch requests.
  4190. ForceSendFields []string `json:"-"`
  4191. }
  4192. func (s *LiveStreamListResponse) MarshalJSON() ([]byte, error) {
  4193. type noMethod LiveStreamListResponse
  4194. raw := noMethod(*s)
  4195. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4196. }
  4197. type LiveStreamSnippet struct {
  4198. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  4199. // that is transmitting the stream.
  4200. ChannelId string `json:"channelId,omitempty"`
  4201. // Description: The stream's description. The value cannot be longer
  4202. // than 10000 characters.
  4203. Description string `json:"description,omitempty"`
  4204. IsDefaultStream bool `json:"isDefaultStream,omitempty"`
  4205. // PublishedAt: The date and time that the stream was created. The value
  4206. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  4207. PublishedAt string `json:"publishedAt,omitempty"`
  4208. // Title: The stream's title. The value must be between 1 and 128
  4209. // characters long.
  4210. Title string `json:"title,omitempty"`
  4211. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  4212. // unconditionally include in API requests. By default, fields with
  4213. // empty values are omitted from API requests. However, any non-pointer,
  4214. // non-interface field appearing in ForceSendFields will be sent to the
  4215. // server regardless of whether the field is empty or not. This may be
  4216. // used to include empty fields in Patch requests.
  4217. ForceSendFields []string `json:"-"`
  4218. }
  4219. func (s *LiveStreamSnippet) MarshalJSON() ([]byte, error) {
  4220. type noMethod LiveStreamSnippet
  4221. raw := noMethod(*s)
  4222. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4223. }
  4224. // LiveStreamStatus: Brief description of the live stream status.
  4225. type LiveStreamStatus struct {
  4226. // HealthStatus: The health status of the stream.
  4227. HealthStatus *LiveStreamHealthStatus `json:"healthStatus,omitempty"`
  4228. // Possible values:
  4229. // "active"
  4230. // "created"
  4231. // "error"
  4232. // "inactive"
  4233. // "ready"
  4234. StreamStatus string `json:"streamStatus,omitempty"`
  4235. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  4236. // unconditionally include in API requests. By default, fields with
  4237. // empty values are omitted from API requests. However, any non-pointer,
  4238. // non-interface field appearing in ForceSendFields will be sent to the
  4239. // server regardless of whether the field is empty or not. This may be
  4240. // used to include empty fields in Patch requests.
  4241. ForceSendFields []string `json:"-"`
  4242. }
  4243. func (s *LiveStreamStatus) MarshalJSON() ([]byte, error) {
  4244. type noMethod LiveStreamStatus
  4245. raw := noMethod(*s)
  4246. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4247. }
  4248. type LocalizedProperty struct {
  4249. Default string `json:"default,omitempty"`
  4250. // DefaultLanguage: The language of the default property.
  4251. DefaultLanguage *LanguageTag `json:"defaultLanguage,omitempty"`
  4252. Localized []*LocalizedString `json:"localized,omitempty"`
  4253. // ForceSendFields is a list of field names (e.g. "Default") to
  4254. // unconditionally include in API requests. By default, fields with
  4255. // empty values are omitted from API requests. However, any non-pointer,
  4256. // non-interface field appearing in ForceSendFields will be sent to the
  4257. // server regardless of whether the field is empty or not. This may be
  4258. // used to include empty fields in Patch requests.
  4259. ForceSendFields []string `json:"-"`
  4260. }
  4261. func (s *LocalizedProperty) MarshalJSON() ([]byte, error) {
  4262. type noMethod LocalizedProperty
  4263. raw := noMethod(*s)
  4264. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4265. }
  4266. type LocalizedString struct {
  4267. Language string `json:"language,omitempty"`
  4268. Value string `json:"value,omitempty"`
  4269. // ForceSendFields is a list of field names (e.g. "Language") to
  4270. // unconditionally include in API requests. By default, fields with
  4271. // empty values are omitted from API requests. However, any non-pointer,
  4272. // non-interface field appearing in ForceSendFields will be sent to the
  4273. // server regardless of whether the field is empty or not. This may be
  4274. // used to include empty fields in Patch requests.
  4275. ForceSendFields []string `json:"-"`
  4276. }
  4277. func (s *LocalizedString) MarshalJSON() ([]byte, error) {
  4278. type noMethod LocalizedString
  4279. raw := noMethod(*s)
  4280. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4281. }
  4282. // MonitorStreamInfo: Settings and Info of the monitor stream
  4283. type MonitorStreamInfo struct {
  4284. // BroadcastStreamDelayMs: If you have set the enableMonitorStream
  4285. // property to true, then this property determines the length of the
  4286. // live broadcast delay.
  4287. BroadcastStreamDelayMs int64 `json:"broadcastStreamDelayMs,omitempty"`
  4288. // EmbedHtml: HTML code that embeds a player that plays the monitor
  4289. // stream.
  4290. EmbedHtml string `json:"embedHtml,omitempty"`
  4291. // EnableMonitorStream: This value determines whether the monitor stream
  4292. // is enabled for the broadcast. If the monitor stream is enabled, then
  4293. // YouTube will broadcast the event content on a special stream intended
  4294. // only for the broadcaster's consumption. The broadcaster can use the
  4295. // stream to review the event content and also to identify the optimal
  4296. // times to insert cuepoints.
  4297. //
  4298. // You need to set this value to true if you intend to have a broadcast
  4299. // delay for your event.
  4300. //
  4301. // Note: This property cannot be updated once the broadcast is in the
  4302. // testing or live state.
  4303. EnableMonitorStream bool `json:"enableMonitorStream,omitempty"`
  4304. // ForceSendFields is a list of field names (e.g.
  4305. // "BroadcastStreamDelayMs") to unconditionally include in API requests.
  4306. // By default, fields with empty values are omitted from API requests.
  4307. // However, any non-pointer, non-interface field appearing in
  4308. // ForceSendFields will be sent to the server regardless of whether the
  4309. // field is empty or not. This may be used to include empty fields in
  4310. // Patch requests.
  4311. ForceSendFields []string `json:"-"`
  4312. }
  4313. func (s *MonitorStreamInfo) MarshalJSON() ([]byte, error) {
  4314. type noMethod MonitorStreamInfo
  4315. raw := noMethod(*s)
  4316. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4317. }
  4318. // PageInfo: Paging details for lists of resources, including total
  4319. // number of items available and number of resources returned in a
  4320. // single page.
  4321. type PageInfo struct {
  4322. // ResultsPerPage: The number of results included in the API response.
  4323. ResultsPerPage int64 `json:"resultsPerPage,omitempty"`
  4324. // TotalResults: The total number of results in the result set.
  4325. TotalResults int64 `json:"totalResults,omitempty"`
  4326. // ForceSendFields is a list of field names (e.g. "ResultsPerPage") to
  4327. // unconditionally include in API requests. By default, fields with
  4328. // empty values are omitted from API requests. However, any non-pointer,
  4329. // non-interface field appearing in ForceSendFields will be sent to the
  4330. // server regardless of whether the field is empty or not. This may be
  4331. // used to include empty fields in Patch requests.
  4332. ForceSendFields []string `json:"-"`
  4333. }
  4334. func (s *PageInfo) MarshalJSON() ([]byte, error) {
  4335. type noMethod PageInfo
  4336. raw := noMethod(*s)
  4337. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4338. }
  4339. // Playlist: A playlist resource represents a YouTube playlist. A
  4340. // playlist is a collection of videos that can be viewed sequentially
  4341. // and shared with other users. A playlist can contain up to 200 videos,
  4342. // and YouTube does not limit the number of playlists that each user
  4343. // creates. By default, playlists are publicly visible to other users,
  4344. // but playlists can be public or private.
  4345. //
  4346. // YouTube also uses playlists to identify special collections of videos
  4347. // for a channel, such as:
  4348. // - uploaded videos
  4349. // - favorite videos
  4350. // - positively rated (liked) videos
  4351. // - watch history
  4352. // - watch later To be more specific, these lists are associated with a
  4353. // channel, which is a collection of a person, group, or company's
  4354. // videos, playlists, and other YouTube information. You can retrieve
  4355. // the playlist IDs for each of these lists from the channel resource
  4356. // for a given channel.
  4357. //
  4358. // You can then use the playlistItems.list method to retrieve any of
  4359. // those lists. You can also add or remove items from those lists by
  4360. // calling the playlistItems.insert and playlistItems.delete
  4361. // methods.
  4362. type Playlist struct {
  4363. // ContentDetails: The contentDetails object contains information like
  4364. // video count.
  4365. ContentDetails *PlaylistContentDetails `json:"contentDetails,omitempty"`
  4366. // Etag: Etag of this resource.
  4367. Etag string `json:"etag,omitempty"`
  4368. // Id: The ID that YouTube uses to uniquely identify the playlist.
  4369. Id string `json:"id,omitempty"`
  4370. // Kind: Identifies what kind of resource this is. Value: the fixed
  4371. // string "youtube#playlist".
  4372. Kind string `json:"kind,omitempty"`
  4373. // Localizations: Localizations for different languages
  4374. Localizations map[string]PlaylistLocalization `json:"localizations,omitempty"`
  4375. // Player: The player object contains information that you would use to
  4376. // play the playlist in an embedded player.
  4377. Player *PlaylistPlayer `json:"player,omitempty"`
  4378. // Snippet: The snippet object contains basic details about the
  4379. // playlist, such as its title and description.
  4380. Snippet *PlaylistSnippet `json:"snippet,omitempty"`
  4381. // Status: The status object contains status information for the
  4382. // playlist.
  4383. Status *PlaylistStatus `json:"status,omitempty"`
  4384. // ServerResponse contains the HTTP response code and headers from the
  4385. // server.
  4386. googleapi.ServerResponse `json:"-"`
  4387. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  4388. // unconditionally include in API requests. By default, fields with
  4389. // empty values are omitted from API requests. However, any non-pointer,
  4390. // non-interface field appearing in ForceSendFields will be sent to the
  4391. // server regardless of whether the field is empty or not. This may be
  4392. // used to include empty fields in Patch requests.
  4393. ForceSendFields []string `json:"-"`
  4394. }
  4395. func (s *Playlist) MarshalJSON() ([]byte, error) {
  4396. type noMethod Playlist
  4397. raw := noMethod(*s)
  4398. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4399. }
  4400. type PlaylistContentDetails struct {
  4401. // ItemCount: The number of videos in the playlist.
  4402. ItemCount int64 `json:"itemCount,omitempty"`
  4403. // ForceSendFields is a list of field names (e.g. "ItemCount") to
  4404. // unconditionally include in API requests. By default, fields with
  4405. // empty values are omitted from API requests. However, any non-pointer,
  4406. // non-interface field appearing in ForceSendFields will be sent to the
  4407. // server regardless of whether the field is empty or not. This may be
  4408. // used to include empty fields in Patch requests.
  4409. ForceSendFields []string `json:"-"`
  4410. }
  4411. func (s *PlaylistContentDetails) MarshalJSON() ([]byte, error) {
  4412. type noMethod PlaylistContentDetails
  4413. raw := noMethod(*s)
  4414. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4415. }
  4416. // PlaylistItem: A playlistItem resource identifies another resource,
  4417. // such as a video, that is included in a playlist. In addition, the
  4418. // playlistItem resource contains details about the included resource
  4419. // that pertain specifically to how that resource is used in that
  4420. // playlist.
  4421. //
  4422. // YouTube uses playlists to identify special collections of videos for
  4423. // a channel, such as:
  4424. // - uploaded videos
  4425. // - favorite videos
  4426. // - positively rated (liked) videos
  4427. // - watch history
  4428. // - watch later To be more specific, these lists are associated with a
  4429. // channel, which is a collection of a person, group, or company's
  4430. // videos, playlists, and other YouTube information.
  4431. //
  4432. // You can retrieve the playlist IDs for each of these lists from the
  4433. // channel resource for a given channel. You can then use the
  4434. // playlistItems.list method to retrieve any of those lists. You can
  4435. // also add or remove items from those lists by calling the
  4436. // playlistItems.insert and playlistItems.delete methods. For example,
  4437. // if a user gives a positive rating to a video, you would insert that
  4438. // video into the liked videos playlist for that user's channel.
  4439. type PlaylistItem struct {
  4440. // ContentDetails: The contentDetails object is included in the resource
  4441. // if the included item is a YouTube video. The object contains
  4442. // additional information about the video.
  4443. ContentDetails *PlaylistItemContentDetails `json:"contentDetails,omitempty"`
  4444. // Etag: Etag of this resource.
  4445. Etag string `json:"etag,omitempty"`
  4446. // Id: The ID that YouTube uses to uniquely identify the playlist item.
  4447. Id string `json:"id,omitempty"`
  4448. // Kind: Identifies what kind of resource this is. Value: the fixed
  4449. // string "youtube#playlistItem".
  4450. Kind string `json:"kind,omitempty"`
  4451. // Snippet: The snippet object contains basic details about the playlist
  4452. // item, such as its title and position in the playlist.
  4453. Snippet *PlaylistItemSnippet `json:"snippet,omitempty"`
  4454. // Status: The status object contains information about the playlist
  4455. // item's privacy status.
  4456. Status *PlaylistItemStatus `json:"status,omitempty"`
  4457. // ServerResponse contains the HTTP response code and headers from the
  4458. // server.
  4459. googleapi.ServerResponse `json:"-"`
  4460. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  4461. // unconditionally include in API requests. By default, fields with
  4462. // empty values are omitted from API requests. However, any non-pointer,
  4463. // non-interface field appearing in ForceSendFields will be sent to the
  4464. // server regardless of whether the field is empty or not. This may be
  4465. // used to include empty fields in Patch requests.
  4466. ForceSendFields []string `json:"-"`
  4467. }
  4468. func (s *PlaylistItem) MarshalJSON() ([]byte, error) {
  4469. type noMethod PlaylistItem
  4470. raw := noMethod(*s)
  4471. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4472. }
  4473. type PlaylistItemContentDetails struct {
  4474. // EndAt: The time, measured in seconds from the start of the video,
  4475. // when the video should stop playing. (The playlist owner can specify
  4476. // the times when the video should start and stop playing when the video
  4477. // is played in the context of the playlist.) By default, assume that
  4478. // the video.endTime is the end of the video.
  4479. EndAt string `json:"endAt,omitempty"`
  4480. // Note: A user-generated note for this item.
  4481. Note string `json:"note,omitempty"`
  4482. // StartAt: The time, measured in seconds from the start of the video,
  4483. // when the video should start playing. (The playlist owner can specify
  4484. // the times when the video should start and stop playing when the video
  4485. // is played in the context of the playlist.) The default value is 0.
  4486. StartAt string `json:"startAt,omitempty"`
  4487. // VideoId: The ID that YouTube uses to uniquely identify a video. To
  4488. // retrieve the video resource, set the id query parameter to this value
  4489. // in your API request.
  4490. VideoId string `json:"videoId,omitempty"`
  4491. // ForceSendFields is a list of field names (e.g. "EndAt") to
  4492. // unconditionally include in API requests. By default, fields with
  4493. // empty values are omitted from API requests. However, any non-pointer,
  4494. // non-interface field appearing in ForceSendFields will be sent to the
  4495. // server regardless of whether the field is empty or not. This may be
  4496. // used to include empty fields in Patch requests.
  4497. ForceSendFields []string `json:"-"`
  4498. }
  4499. func (s *PlaylistItemContentDetails) MarshalJSON() ([]byte, error) {
  4500. type noMethod PlaylistItemContentDetails
  4501. raw := noMethod(*s)
  4502. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4503. }
  4504. type PlaylistItemListResponse struct {
  4505. // Etag: Etag of this resource.
  4506. Etag string `json:"etag,omitempty"`
  4507. // EventId: Serialized EventId of the request which produced this
  4508. // response.
  4509. EventId string `json:"eventId,omitempty"`
  4510. // Items: A list of playlist items that match the request criteria.
  4511. Items []*PlaylistItem `json:"items,omitempty"`
  4512. // Kind: Identifies what kind of resource this is. Value: the fixed
  4513. // string "youtube#playlistItemListResponse".
  4514. Kind string `json:"kind,omitempty"`
  4515. // NextPageToken: The token that can be used as the value of the
  4516. // pageToken parameter to retrieve the next page in the result set.
  4517. NextPageToken string `json:"nextPageToken,omitempty"`
  4518. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  4519. // PrevPageToken: The token that can be used as the value of the
  4520. // pageToken parameter to retrieve the previous page in the result set.
  4521. PrevPageToken string `json:"prevPageToken,omitempty"`
  4522. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  4523. // VisitorId: The visitorId identifies the visitor.
  4524. VisitorId string `json:"visitorId,omitempty"`
  4525. // ServerResponse contains the HTTP response code and headers from the
  4526. // server.
  4527. googleapi.ServerResponse `json:"-"`
  4528. // ForceSendFields is a list of field names (e.g. "Etag") to
  4529. // unconditionally include in API requests. By default, fields with
  4530. // empty values are omitted from API requests. However, any non-pointer,
  4531. // non-interface field appearing in ForceSendFields will be sent to the
  4532. // server regardless of whether the field is empty or not. This may be
  4533. // used to include empty fields in Patch requests.
  4534. ForceSendFields []string `json:"-"`
  4535. }
  4536. func (s *PlaylistItemListResponse) MarshalJSON() ([]byte, error) {
  4537. type noMethod PlaylistItemListResponse
  4538. raw := noMethod(*s)
  4539. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4540. }
  4541. // PlaylistItemSnippet: Basic details about a playlist, including title,
  4542. // description and thumbnails.
  4543. type PlaylistItemSnippet struct {
  4544. // ChannelId: The ID that YouTube uses to uniquely identify the user
  4545. // that added the item to the playlist.
  4546. ChannelId string `json:"channelId,omitempty"`
  4547. // ChannelTitle: Channel title for the channel that the playlist item
  4548. // belongs to.
  4549. ChannelTitle string `json:"channelTitle,omitempty"`
  4550. // Description: The item's description.
  4551. Description string `json:"description,omitempty"`
  4552. // PlaylistId: The ID that YouTube uses to uniquely identify the
  4553. // playlist that the playlist item is in.
  4554. PlaylistId string `json:"playlistId,omitempty"`
  4555. // Position: The order in which the item appears in the playlist. The
  4556. // value uses a zero-based index, so the first item has a position of 0,
  4557. // the second item has a position of 1, and so forth.
  4558. Position int64 `json:"position,omitempty"`
  4559. // PublishedAt: The date and time that the item was added to the
  4560. // playlist. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  4561. // format.
  4562. PublishedAt string `json:"publishedAt,omitempty"`
  4563. // ResourceId: The id object contains information that can be used to
  4564. // uniquely identify the resource that is included in the playlist as
  4565. // the playlist item.
  4566. ResourceId *ResourceId `json:"resourceId,omitempty"`
  4567. // Thumbnails: A map of thumbnail images associated with the playlist
  4568. // item. For each object in the map, the key is the name of the
  4569. // thumbnail image, and the value is an object that contains other
  4570. // information about the thumbnail.
  4571. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  4572. // Title: The item's title.
  4573. Title string `json:"title,omitempty"`
  4574. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  4575. // unconditionally include in API requests. By default, fields with
  4576. // empty values are omitted from API requests. However, any non-pointer,
  4577. // non-interface field appearing in ForceSendFields will be sent to the
  4578. // server regardless of whether the field is empty or not. This may be
  4579. // used to include empty fields in Patch requests.
  4580. ForceSendFields []string `json:"-"`
  4581. }
  4582. func (s *PlaylistItemSnippet) MarshalJSON() ([]byte, error) {
  4583. type noMethod PlaylistItemSnippet
  4584. raw := noMethod(*s)
  4585. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4586. }
  4587. // PlaylistItemStatus: Information about the playlist item's privacy
  4588. // status.
  4589. type PlaylistItemStatus struct {
  4590. // PrivacyStatus: This resource's privacy status.
  4591. //
  4592. // Possible values:
  4593. // "private"
  4594. // "public"
  4595. // "unlisted"
  4596. PrivacyStatus string `json:"privacyStatus,omitempty"`
  4597. // ForceSendFields is a list of field names (e.g. "PrivacyStatus") to
  4598. // unconditionally include in API requests. By default, fields with
  4599. // empty values are omitted from API requests. However, any non-pointer,
  4600. // non-interface field appearing in ForceSendFields will be sent to the
  4601. // server regardless of whether the field is empty or not. This may be
  4602. // used to include empty fields in Patch requests.
  4603. ForceSendFields []string `json:"-"`
  4604. }
  4605. func (s *PlaylistItemStatus) MarshalJSON() ([]byte, error) {
  4606. type noMethod PlaylistItemStatus
  4607. raw := noMethod(*s)
  4608. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4609. }
  4610. type PlaylistListResponse struct {
  4611. // Etag: Etag of this resource.
  4612. Etag string `json:"etag,omitempty"`
  4613. // EventId: Serialized EventId of the request which produced this
  4614. // response.
  4615. EventId string `json:"eventId,omitempty"`
  4616. // Items: A list of playlists that match the request criteria.
  4617. Items []*Playlist `json:"items,omitempty"`
  4618. // Kind: Identifies what kind of resource this is. Value: the fixed
  4619. // string "youtube#playlistListResponse".
  4620. Kind string `json:"kind,omitempty"`
  4621. // NextPageToken: The token that can be used as the value of the
  4622. // pageToken parameter to retrieve the next page in the result set.
  4623. NextPageToken string `json:"nextPageToken,omitempty"`
  4624. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  4625. // PrevPageToken: The token that can be used as the value of the
  4626. // pageToken parameter to retrieve the previous page in the result set.
  4627. PrevPageToken string `json:"prevPageToken,omitempty"`
  4628. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  4629. // VisitorId: The visitorId identifies the visitor.
  4630. VisitorId string `json:"visitorId,omitempty"`
  4631. // ServerResponse contains the HTTP response code and headers from the
  4632. // server.
  4633. googleapi.ServerResponse `json:"-"`
  4634. // ForceSendFields is a list of field names (e.g. "Etag") to
  4635. // unconditionally include in API requests. By default, fields with
  4636. // empty values are omitted from API requests. However, any non-pointer,
  4637. // non-interface field appearing in ForceSendFields will be sent to the
  4638. // server regardless of whether the field is empty or not. This may be
  4639. // used to include empty fields in Patch requests.
  4640. ForceSendFields []string `json:"-"`
  4641. }
  4642. func (s *PlaylistListResponse) MarshalJSON() ([]byte, error) {
  4643. type noMethod PlaylistListResponse
  4644. raw := noMethod(*s)
  4645. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4646. }
  4647. // PlaylistLocalization: Playlist localization setting
  4648. type PlaylistLocalization struct {
  4649. // Description: The localized strings for playlist's description.
  4650. Description string `json:"description,omitempty"`
  4651. // Title: The localized strings for playlist's title.
  4652. Title string `json:"title,omitempty"`
  4653. // ForceSendFields is a list of field names (e.g. "Description") to
  4654. // unconditionally include in API requests. By default, fields with
  4655. // empty values are omitted from API requests. However, any non-pointer,
  4656. // non-interface field appearing in ForceSendFields will be sent to the
  4657. // server regardless of whether the field is empty or not. This may be
  4658. // used to include empty fields in Patch requests.
  4659. ForceSendFields []string `json:"-"`
  4660. }
  4661. func (s *PlaylistLocalization) MarshalJSON() ([]byte, error) {
  4662. type noMethod PlaylistLocalization
  4663. raw := noMethod(*s)
  4664. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4665. }
  4666. type PlaylistPlayer struct {
  4667. // EmbedHtml: An <iframe> tag that embeds a player that will play the
  4668. // playlist.
  4669. EmbedHtml string `json:"embedHtml,omitempty"`
  4670. // ForceSendFields is a list of field names (e.g. "EmbedHtml") to
  4671. // unconditionally include in API requests. By default, fields with
  4672. // empty values are omitted from API requests. However, any non-pointer,
  4673. // non-interface field appearing in ForceSendFields will be sent to the
  4674. // server regardless of whether the field is empty or not. This may be
  4675. // used to include empty fields in Patch requests.
  4676. ForceSendFields []string `json:"-"`
  4677. }
  4678. func (s *PlaylistPlayer) MarshalJSON() ([]byte, error) {
  4679. type noMethod PlaylistPlayer
  4680. raw := noMethod(*s)
  4681. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4682. }
  4683. // PlaylistSnippet: Basic details about a playlist, including title,
  4684. // description and thumbnails.
  4685. type PlaylistSnippet struct {
  4686. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  4687. // that published the playlist.
  4688. ChannelId string `json:"channelId,omitempty"`
  4689. // ChannelTitle: The channel title of the channel that the video belongs
  4690. // to.
  4691. ChannelTitle string `json:"channelTitle,omitempty"`
  4692. // DefaultLanguage: The language of the playlist's default title and
  4693. // description.
  4694. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  4695. // Description: The playlist's description.
  4696. Description string `json:"description,omitempty"`
  4697. // Localized: Localized title and description, read-only.
  4698. Localized *PlaylistLocalization `json:"localized,omitempty"`
  4699. // PublishedAt: The date and time that the playlist was created. The
  4700. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  4701. PublishedAt string `json:"publishedAt,omitempty"`
  4702. // Tags: Keyword tags associated with the playlist.
  4703. Tags []string `json:"tags,omitempty"`
  4704. // Thumbnails: A map of thumbnail images associated with the playlist.
  4705. // For each object in the map, the key is the name of the thumbnail
  4706. // image, and the value is an object that contains other information
  4707. // about the thumbnail.
  4708. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  4709. // Title: The playlist's title.
  4710. Title string `json:"title,omitempty"`
  4711. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  4712. // unconditionally include in API requests. By default, fields with
  4713. // empty values are omitted from API requests. However, any non-pointer,
  4714. // non-interface field appearing in ForceSendFields will be sent to the
  4715. // server regardless of whether the field is empty or not. This may be
  4716. // used to include empty fields in Patch requests.
  4717. ForceSendFields []string `json:"-"`
  4718. }
  4719. func (s *PlaylistSnippet) MarshalJSON() ([]byte, error) {
  4720. type noMethod PlaylistSnippet
  4721. raw := noMethod(*s)
  4722. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4723. }
  4724. type PlaylistStatus struct {
  4725. // PrivacyStatus: The playlist's privacy status.
  4726. //
  4727. // Possible values:
  4728. // "private"
  4729. // "public"
  4730. // "unlisted"
  4731. PrivacyStatus string `json:"privacyStatus,omitempty"`
  4732. // ForceSendFields is a list of field names (e.g. "PrivacyStatus") to
  4733. // unconditionally include in API requests. By default, fields with
  4734. // empty values are omitted from API requests. However, any non-pointer,
  4735. // non-interface field appearing in ForceSendFields will be sent to the
  4736. // server regardless of whether the field is empty or not. This may be
  4737. // used to include empty fields in Patch requests.
  4738. ForceSendFields []string `json:"-"`
  4739. }
  4740. func (s *PlaylistStatus) MarshalJSON() ([]byte, error) {
  4741. type noMethod PlaylistStatus
  4742. raw := noMethod(*s)
  4743. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4744. }
  4745. // PromotedItem: Describes a single promoted item.
  4746. type PromotedItem struct {
  4747. // CustomMessage: A custom message to display for this promotion. This
  4748. // field is currently ignored unless the promoted item is a website.
  4749. CustomMessage string `json:"customMessage,omitempty"`
  4750. // Id: Identifies the promoted item.
  4751. Id *PromotedItemId `json:"id,omitempty"`
  4752. // PromotedByContentOwner: If true, the content owner's name will be
  4753. // used when displaying the promotion. This field can only be set when
  4754. // the update is made on behalf of the content owner.
  4755. PromotedByContentOwner bool `json:"promotedByContentOwner,omitempty"`
  4756. // Timing: The temporal position within the video where the promoted
  4757. // item will be displayed. If present, it overrides the default timing.
  4758. Timing *InvideoTiming `json:"timing,omitempty"`
  4759. // ForceSendFields is a list of field names (e.g. "CustomMessage") to
  4760. // unconditionally include in API requests. By default, fields with
  4761. // empty values are omitted from API requests. However, any non-pointer,
  4762. // non-interface field appearing in ForceSendFields will be sent to the
  4763. // server regardless of whether the field is empty or not. This may be
  4764. // used to include empty fields in Patch requests.
  4765. ForceSendFields []string `json:"-"`
  4766. }
  4767. func (s *PromotedItem) MarshalJSON() ([]byte, error) {
  4768. type noMethod PromotedItem
  4769. raw := noMethod(*s)
  4770. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4771. }
  4772. // PromotedItemId: Describes a single promoted item id. It is a union of
  4773. // various possible types.
  4774. type PromotedItemId struct {
  4775. // RecentlyUploadedBy: If type is recentUpload, this field identifies
  4776. // the channel from which to take the recent upload. If missing, the
  4777. // channel is assumed to be the same channel for which the
  4778. // invideoPromotion is set.
  4779. RecentlyUploadedBy string `json:"recentlyUploadedBy,omitempty"`
  4780. // Type: Describes the type of the promoted item.
  4781. //
  4782. // Possible values:
  4783. // "recentUpload"
  4784. // "video"
  4785. // "website"
  4786. Type string `json:"type,omitempty"`
  4787. // VideoId: If the promoted item represents a video, this field
  4788. // represents the unique YouTube ID identifying it. This field will be
  4789. // present only if type has the value video.
  4790. VideoId string `json:"videoId,omitempty"`
  4791. // WebsiteUrl: If the promoted item represents a website, this field
  4792. // represents the url pointing to the website. This field will be
  4793. // present only if type has the value website.
  4794. WebsiteUrl string `json:"websiteUrl,omitempty"`
  4795. // ForceSendFields is a list of field names (e.g. "RecentlyUploadedBy")
  4796. // to unconditionally include in API requests. By default, fields with
  4797. // empty values are omitted from API requests. However, any non-pointer,
  4798. // non-interface field appearing in ForceSendFields will be sent to the
  4799. // server regardless of whether the field is empty or not. This may be
  4800. // used to include empty fields in Patch requests.
  4801. ForceSendFields []string `json:"-"`
  4802. }
  4803. func (s *PromotedItemId) MarshalJSON() ([]byte, error) {
  4804. type noMethod PromotedItemId
  4805. raw := noMethod(*s)
  4806. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4807. }
  4808. // PropertyValue: A pair Property / Value.
  4809. type PropertyValue struct {
  4810. // Property: A property.
  4811. Property string `json:"property,omitempty"`
  4812. // Value: The property's value.
  4813. Value string `json:"value,omitempty"`
  4814. // ForceSendFields is a list of field names (e.g. "Property") to
  4815. // unconditionally include in API requests. By default, fields with
  4816. // empty values are omitted from API requests. However, any non-pointer,
  4817. // non-interface field appearing in ForceSendFields will be sent to the
  4818. // server regardless of whether the field is empty or not. This may be
  4819. // used to include empty fields in Patch requests.
  4820. ForceSendFields []string `json:"-"`
  4821. }
  4822. func (s *PropertyValue) MarshalJSON() ([]byte, error) {
  4823. type noMethod PropertyValue
  4824. raw := noMethod(*s)
  4825. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4826. }
  4827. // ResourceId: A resource id is a generic reference that points to
  4828. // another YouTube resource.
  4829. type ResourceId struct {
  4830. // ChannelId: The ID that YouTube uses to uniquely identify the referred
  4831. // resource, if that resource is a channel. This property is only
  4832. // present if the resourceId.kind value is youtube#channel.
  4833. ChannelId string `json:"channelId,omitempty"`
  4834. // Kind: The type of the API resource.
  4835. Kind string `json:"kind,omitempty"`
  4836. // PlaylistId: The ID that YouTube uses to uniquely identify the
  4837. // referred resource, if that resource is a playlist. This property is
  4838. // only present if the resourceId.kind value is youtube#playlist.
  4839. PlaylistId string `json:"playlistId,omitempty"`
  4840. // VideoId: The ID that YouTube uses to uniquely identify the referred
  4841. // resource, if that resource is a video. This property is only present
  4842. // if the resourceId.kind value is youtube#video.
  4843. VideoId string `json:"videoId,omitempty"`
  4844. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  4845. // unconditionally include in API requests. By default, fields with
  4846. // empty values are omitted from API requests. However, any non-pointer,
  4847. // non-interface field appearing in ForceSendFields will be sent to the
  4848. // server regardless of whether the field is empty or not. This may be
  4849. // used to include empty fields in Patch requests.
  4850. ForceSendFields []string `json:"-"`
  4851. }
  4852. func (s *ResourceId) MarshalJSON() ([]byte, error) {
  4853. type noMethod ResourceId
  4854. raw := noMethod(*s)
  4855. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4856. }
  4857. type SearchListResponse struct {
  4858. // Etag: Etag of this resource.
  4859. Etag string `json:"etag,omitempty"`
  4860. // EventId: Serialized EventId of the request which produced this
  4861. // response.
  4862. EventId string `json:"eventId,omitempty"`
  4863. // Items: A list of results that match the search criteria.
  4864. Items []*SearchResult `json:"items,omitempty"`
  4865. // Kind: Identifies what kind of resource this is. Value: the fixed
  4866. // string "youtube#searchListResponse".
  4867. Kind string `json:"kind,omitempty"`
  4868. // NextPageToken: The token that can be used as the value of the
  4869. // pageToken parameter to retrieve the next page in the result set.
  4870. NextPageToken string `json:"nextPageToken,omitempty"`
  4871. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  4872. // PrevPageToken: The token that can be used as the value of the
  4873. // pageToken parameter to retrieve the previous page in the result set.
  4874. PrevPageToken string `json:"prevPageToken,omitempty"`
  4875. RegionCode string `json:"regionCode,omitempty"`
  4876. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  4877. // VisitorId: The visitorId identifies the visitor.
  4878. VisitorId string `json:"visitorId,omitempty"`
  4879. // ServerResponse contains the HTTP response code and headers from the
  4880. // server.
  4881. googleapi.ServerResponse `json:"-"`
  4882. // ForceSendFields is a list of field names (e.g. "Etag") to
  4883. // unconditionally include in API requests. By default, fields with
  4884. // empty values are omitted from API requests. However, any non-pointer,
  4885. // non-interface field appearing in ForceSendFields will be sent to the
  4886. // server regardless of whether the field is empty or not. This may be
  4887. // used to include empty fields in Patch requests.
  4888. ForceSendFields []string `json:"-"`
  4889. }
  4890. func (s *SearchListResponse) MarshalJSON() ([]byte, error) {
  4891. type noMethod SearchListResponse
  4892. raw := noMethod(*s)
  4893. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4894. }
  4895. // SearchResult: A search result contains information about a YouTube
  4896. // video, channel, or playlist that matches the search parameters
  4897. // specified in an API request. While a search result points to a
  4898. // uniquely identifiable resource, like a video, it does not have its
  4899. // own persistent data.
  4900. type SearchResult struct {
  4901. // Etag: Etag of this resource.
  4902. Etag string `json:"etag,omitempty"`
  4903. // Id: The id object contains information that can be used to uniquely
  4904. // identify the resource that matches the search request.
  4905. Id *ResourceId `json:"id,omitempty"`
  4906. // Kind: Identifies what kind of resource this is. Value: the fixed
  4907. // string "youtube#searchResult".
  4908. Kind string `json:"kind,omitempty"`
  4909. // Snippet: The snippet object contains basic details about a search
  4910. // result, such as its title or description. For example, if the search
  4911. // result is a video, then the title will be the video's title and the
  4912. // description will be the video's description.
  4913. Snippet *SearchResultSnippet `json:"snippet,omitempty"`
  4914. // ForceSendFields is a list of field names (e.g. "Etag") to
  4915. // unconditionally include in API requests. By default, fields with
  4916. // empty values are omitted from API requests. However, any non-pointer,
  4917. // non-interface field appearing in ForceSendFields will be sent to the
  4918. // server regardless of whether the field is empty or not. This may be
  4919. // used to include empty fields in Patch requests.
  4920. ForceSendFields []string `json:"-"`
  4921. }
  4922. func (s *SearchResult) MarshalJSON() ([]byte, error) {
  4923. type noMethod SearchResult
  4924. raw := noMethod(*s)
  4925. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4926. }
  4927. // SearchResultSnippet: Basic details about a search result, including
  4928. // title, description and thumbnails of the item referenced by the
  4929. // search result.
  4930. type SearchResultSnippet struct {
  4931. // ChannelId: The value that YouTube uses to uniquely identify the
  4932. // channel that published the resource that the search result
  4933. // identifies.
  4934. ChannelId string `json:"channelId,omitempty"`
  4935. // ChannelTitle: The title of the channel that published the resource
  4936. // that the search result identifies.
  4937. ChannelTitle string `json:"channelTitle,omitempty"`
  4938. // Description: A description of the search result.
  4939. Description string `json:"description,omitempty"`
  4940. // LiveBroadcastContent: It indicates if the resource (video or channel)
  4941. // has upcoming/active live broadcast content. Or it's "none" if there
  4942. // is not any upcoming/active live broadcasts.
  4943. //
  4944. // Possible values:
  4945. // "live"
  4946. // "none"
  4947. // "upcoming"
  4948. LiveBroadcastContent string `json:"liveBroadcastContent,omitempty"`
  4949. // PublishedAt: The creation date and time of the resource that the
  4950. // search result identifies. The value is specified in ISO 8601
  4951. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  4952. PublishedAt string `json:"publishedAt,omitempty"`
  4953. // Thumbnails: A map of thumbnail images associated with the search
  4954. // result. For each object in the map, the key is the name of the
  4955. // thumbnail image, and the value is an object that contains other
  4956. // information about the thumbnail.
  4957. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  4958. // Title: The title of the search result.
  4959. Title string `json:"title,omitempty"`
  4960. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  4961. // unconditionally include in API requests. By default, fields with
  4962. // empty values are omitted from API requests. However, any non-pointer,
  4963. // non-interface field appearing in ForceSendFields will be sent to the
  4964. // server regardless of whether the field is empty or not. This may be
  4965. // used to include empty fields in Patch requests.
  4966. ForceSendFields []string `json:"-"`
  4967. }
  4968. func (s *SearchResultSnippet) MarshalJSON() ([]byte, error) {
  4969. type noMethod SearchResultSnippet
  4970. raw := noMethod(*s)
  4971. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4972. }
  4973. // Sponsor: A sponsor resource represents a sponsor for a YouTube
  4974. // channel. A sponsor provides recurring monetary support to a creator
  4975. // and receives special benefits.
  4976. type Sponsor struct {
  4977. // Etag: Etag of this resource.
  4978. Etag string `json:"etag,omitempty"`
  4979. // Id: The ID that YouTube assigns to uniquely identify the sponsor.
  4980. Id string `json:"id,omitempty"`
  4981. // Kind: Identifies what kind of resource this is. Value: the fixed
  4982. // string "youtube#sponsor".
  4983. Kind string `json:"kind,omitempty"`
  4984. // Snippet: The snippet object contains basic details about the sponsor.
  4985. Snippet *SponsorSnippet `json:"snippet,omitempty"`
  4986. // ForceSendFields is a list of field names (e.g. "Etag") to
  4987. // unconditionally include in API requests. By default, fields with
  4988. // empty values are omitted from API requests. However, any non-pointer,
  4989. // non-interface field appearing in ForceSendFields will be sent to the
  4990. // server regardless of whether the field is empty or not. This may be
  4991. // used to include empty fields in Patch requests.
  4992. ForceSendFields []string `json:"-"`
  4993. }
  4994. func (s *Sponsor) MarshalJSON() ([]byte, error) {
  4995. type noMethod Sponsor
  4996. raw := noMethod(*s)
  4997. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  4998. }
  4999. type SponsorListResponse struct {
  5000. // Etag: Etag of this resource.
  5001. Etag string `json:"etag,omitempty"`
  5002. // EventId: Serialized EventId of the request which produced this
  5003. // response.
  5004. EventId string `json:"eventId,omitempty"`
  5005. // Items: A list of sponsors that match the request criteria.
  5006. Items []*Sponsor `json:"items,omitempty"`
  5007. // Kind: Identifies what kind of resource this is. Value: the fixed
  5008. // string "youtube#sponsorListResponse".
  5009. Kind string `json:"kind,omitempty"`
  5010. // NextPageToken: The token that can be used as the value of the
  5011. // pageToken parameter to retrieve the next page in the result set.
  5012. NextPageToken string `json:"nextPageToken,omitempty"`
  5013. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5014. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5015. // VisitorId: The visitorId identifies the visitor.
  5016. VisitorId string `json:"visitorId,omitempty"`
  5017. // ServerResponse contains the HTTP response code and headers from the
  5018. // server.
  5019. googleapi.ServerResponse `json:"-"`
  5020. // ForceSendFields is a list of field names (e.g. "Etag") to
  5021. // unconditionally include in API requests. By default, fields with
  5022. // empty values are omitted from API requests. However, any non-pointer,
  5023. // non-interface field appearing in ForceSendFields will be sent to the
  5024. // server regardless of whether the field is empty or not. This may be
  5025. // used to include empty fields in Patch requests.
  5026. ForceSendFields []string `json:"-"`
  5027. }
  5028. func (s *SponsorListResponse) MarshalJSON() ([]byte, error) {
  5029. type noMethod SponsorListResponse
  5030. raw := noMethod(*s)
  5031. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5032. }
  5033. type SponsorSnippet struct {
  5034. // ChannelId: The id of the channel being sponsored.
  5035. ChannelId string `json:"channelId,omitempty"`
  5036. // SponsorDetails: Details about the sponsor.
  5037. SponsorDetails *ChannelProfileDetails `json:"sponsorDetails,omitempty"`
  5038. // SponsorSince: The date and time when the user became a sponsor. The
  5039. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  5040. SponsorSince string `json:"sponsorSince,omitempty"`
  5041. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5042. // unconditionally include in API requests. By default, fields with
  5043. // empty values are omitted from API requests. However, any non-pointer,
  5044. // non-interface field appearing in ForceSendFields will be sent to the
  5045. // server regardless of whether the field is empty or not. This may be
  5046. // used to include empty fields in Patch requests.
  5047. ForceSendFields []string `json:"-"`
  5048. }
  5049. func (s *SponsorSnippet) MarshalJSON() ([]byte, error) {
  5050. type noMethod SponsorSnippet
  5051. raw := noMethod(*s)
  5052. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5053. }
  5054. // Subscription: A subscription resource contains information about a
  5055. // YouTube user subscription. A subscription notifies a user when new
  5056. // videos are added to a channel or when another user takes one of
  5057. // several actions on YouTube, such as uploading a video, rating a
  5058. // video, or commenting on a video.
  5059. type Subscription struct {
  5060. // ContentDetails: The contentDetails object contains basic statistics
  5061. // about the subscription.
  5062. ContentDetails *SubscriptionContentDetails `json:"contentDetails,omitempty"`
  5063. // Etag: Etag of this resource.
  5064. Etag string `json:"etag,omitempty"`
  5065. // Id: The ID that YouTube uses to uniquely identify the subscription.
  5066. Id string `json:"id,omitempty"`
  5067. // Kind: Identifies what kind of resource this is. Value: the fixed
  5068. // string "youtube#subscription".
  5069. Kind string `json:"kind,omitempty"`
  5070. // Snippet: The snippet object contains basic details about the
  5071. // subscription, including its title and the channel that the user
  5072. // subscribed to.
  5073. Snippet *SubscriptionSnippet `json:"snippet,omitempty"`
  5074. // SubscriberSnippet: The subscriberSnippet object contains basic
  5075. // details about the sbuscriber.
  5076. SubscriberSnippet *SubscriptionSubscriberSnippet `json:"subscriberSnippet,omitempty"`
  5077. // ServerResponse contains the HTTP response code and headers from the
  5078. // server.
  5079. googleapi.ServerResponse `json:"-"`
  5080. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  5081. // unconditionally include in API requests. By default, fields with
  5082. // empty values are omitted from API requests. However, any non-pointer,
  5083. // non-interface field appearing in ForceSendFields will be sent to the
  5084. // server regardless of whether the field is empty or not. This may be
  5085. // used to include empty fields in Patch requests.
  5086. ForceSendFields []string `json:"-"`
  5087. }
  5088. func (s *Subscription) MarshalJSON() ([]byte, error) {
  5089. type noMethod Subscription
  5090. raw := noMethod(*s)
  5091. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5092. }
  5093. // SubscriptionContentDetails: Details about the content to witch a
  5094. // subscription refers.
  5095. type SubscriptionContentDetails struct {
  5096. // ActivityType: The type of activity this subscription is for (only
  5097. // uploads, everything).
  5098. //
  5099. // Possible values:
  5100. // "all"
  5101. // "uploads"
  5102. ActivityType string `json:"activityType,omitempty"`
  5103. // NewItemCount: The number of new items in the subscription since its
  5104. // content was last read.
  5105. NewItemCount int64 `json:"newItemCount,omitempty"`
  5106. // TotalItemCount: The approximate number of items that the subscription
  5107. // points to.
  5108. TotalItemCount int64 `json:"totalItemCount,omitempty"`
  5109. // ForceSendFields is a list of field names (e.g. "ActivityType") to
  5110. // unconditionally include in API requests. By default, fields with
  5111. // empty values are omitted from API requests. However, any non-pointer,
  5112. // non-interface field appearing in ForceSendFields will be sent to the
  5113. // server regardless of whether the field is empty or not. This may be
  5114. // used to include empty fields in Patch requests.
  5115. ForceSendFields []string `json:"-"`
  5116. }
  5117. func (s *SubscriptionContentDetails) MarshalJSON() ([]byte, error) {
  5118. type noMethod SubscriptionContentDetails
  5119. raw := noMethod(*s)
  5120. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5121. }
  5122. type SubscriptionListResponse struct {
  5123. // Etag: Etag of this resource.
  5124. Etag string `json:"etag,omitempty"`
  5125. // EventId: Serialized EventId of the request which produced this
  5126. // response.
  5127. EventId string `json:"eventId,omitempty"`
  5128. // Items: A list of subscriptions that match the request criteria.
  5129. Items []*Subscription `json:"items,omitempty"`
  5130. // Kind: Identifies what kind of resource this is. Value: the fixed
  5131. // string "youtube#subscriptionListResponse".
  5132. Kind string `json:"kind,omitempty"`
  5133. // NextPageToken: The token that can be used as the value of the
  5134. // pageToken parameter to retrieve the next page in the result set.
  5135. NextPageToken string `json:"nextPageToken,omitempty"`
  5136. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5137. // PrevPageToken: The token that can be used as the value of the
  5138. // pageToken parameter to retrieve the previous page in the result set.
  5139. PrevPageToken string `json:"prevPageToken,omitempty"`
  5140. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5141. // VisitorId: The visitorId identifies the visitor.
  5142. VisitorId string `json:"visitorId,omitempty"`
  5143. // ServerResponse contains the HTTP response code and headers from the
  5144. // server.
  5145. googleapi.ServerResponse `json:"-"`
  5146. // ForceSendFields is a list of field names (e.g. "Etag") to
  5147. // unconditionally include in API requests. By default, fields with
  5148. // empty values are omitted from API requests. However, any non-pointer,
  5149. // non-interface field appearing in ForceSendFields will be sent to the
  5150. // server regardless of whether the field is empty or not. This may be
  5151. // used to include empty fields in Patch requests.
  5152. ForceSendFields []string `json:"-"`
  5153. }
  5154. func (s *SubscriptionListResponse) MarshalJSON() ([]byte, error) {
  5155. type noMethod SubscriptionListResponse
  5156. raw := noMethod(*s)
  5157. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5158. }
  5159. // SubscriptionSnippet: Basic details about a subscription, including
  5160. // title, description and thumbnails of the subscribed item.
  5161. type SubscriptionSnippet struct {
  5162. // ChannelId: The ID that YouTube uses to uniquely identify the
  5163. // subscriber's channel.
  5164. ChannelId string `json:"channelId,omitempty"`
  5165. // ChannelTitle: Channel title for the channel that the subscription
  5166. // belongs to.
  5167. ChannelTitle string `json:"channelTitle,omitempty"`
  5168. // Description: The subscription's details.
  5169. Description string `json:"description,omitempty"`
  5170. // PublishedAt: The date and time that the subscription was created. The
  5171. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  5172. PublishedAt string `json:"publishedAt,omitempty"`
  5173. // ResourceId: The id object contains information about the channel that
  5174. // the user subscribed to.
  5175. ResourceId *ResourceId `json:"resourceId,omitempty"`
  5176. // Thumbnails: A map of thumbnail images associated with the video. For
  5177. // each object in the map, the key is the name of the thumbnail image,
  5178. // and the value is an object that contains other information about the
  5179. // thumbnail.
  5180. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  5181. // Title: The subscription's title.
  5182. Title string `json:"title,omitempty"`
  5183. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5184. // unconditionally include in API requests. By default, fields with
  5185. // empty values are omitted from API requests. However, any non-pointer,
  5186. // non-interface field appearing in ForceSendFields will be sent to the
  5187. // server regardless of whether the field is empty or not. This may be
  5188. // used to include empty fields in Patch requests.
  5189. ForceSendFields []string `json:"-"`
  5190. }
  5191. func (s *SubscriptionSnippet) MarshalJSON() ([]byte, error) {
  5192. type noMethod SubscriptionSnippet
  5193. raw := noMethod(*s)
  5194. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5195. }
  5196. // SubscriptionSubscriberSnippet: Basic details about a subscription's
  5197. // subscriber including title, description, channel ID and thumbnails.
  5198. type SubscriptionSubscriberSnippet struct {
  5199. // ChannelId: The channel ID of the subscriber.
  5200. ChannelId string `json:"channelId,omitempty"`
  5201. // Description: The description of the subscriber.
  5202. Description string `json:"description,omitempty"`
  5203. // Thumbnails: Thumbnails for this subscriber.
  5204. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  5205. // Title: The title of the subscriber.
  5206. Title string `json:"title,omitempty"`
  5207. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5208. // unconditionally include in API requests. By default, fields with
  5209. // empty values are omitted from API requests. However, any non-pointer,
  5210. // non-interface field appearing in ForceSendFields will be sent to the
  5211. // server regardless of whether the field is empty or not. This may be
  5212. // used to include empty fields in Patch requests.
  5213. ForceSendFields []string `json:"-"`
  5214. }
  5215. func (s *SubscriptionSubscriberSnippet) MarshalJSON() ([]byte, error) {
  5216. type noMethod SubscriptionSubscriberSnippet
  5217. raw := noMethod(*s)
  5218. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5219. }
  5220. // Thumbnail: A thumbnail is an image representing a YouTube resource.
  5221. type Thumbnail struct {
  5222. // Height: (Optional) Height of the thumbnail image.
  5223. Height int64 `json:"height,omitempty"`
  5224. // Url: The thumbnail image's URL.
  5225. Url string `json:"url,omitempty"`
  5226. // Width: (Optional) Width of the thumbnail image.
  5227. Width int64 `json:"width,omitempty"`
  5228. // ForceSendFields is a list of field names (e.g. "Height") to
  5229. // unconditionally include in API requests. By default, fields with
  5230. // empty values are omitted from API requests. However, any non-pointer,
  5231. // non-interface field appearing in ForceSendFields will be sent to the
  5232. // server regardless of whether the field is empty or not. This may be
  5233. // used to include empty fields in Patch requests.
  5234. ForceSendFields []string `json:"-"`
  5235. }
  5236. func (s *Thumbnail) MarshalJSON() ([]byte, error) {
  5237. type noMethod Thumbnail
  5238. raw := noMethod(*s)
  5239. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5240. }
  5241. // ThumbnailDetails: Internal representation of thumbnails for a YouTube
  5242. // resource.
  5243. type ThumbnailDetails struct {
  5244. // Default: The default image for this resource.
  5245. Default *Thumbnail `json:"default,omitempty"`
  5246. // High: The high quality image for this resource.
  5247. High *Thumbnail `json:"high,omitempty"`
  5248. // Maxres: The maximum resolution quality image for this resource.
  5249. Maxres *Thumbnail `json:"maxres,omitempty"`
  5250. // Medium: The medium quality image for this resource.
  5251. Medium *Thumbnail `json:"medium,omitempty"`
  5252. // Standard: The standard quality image for this resource.
  5253. Standard *Thumbnail `json:"standard,omitempty"`
  5254. // ForceSendFields is a list of field names (e.g. "Default") to
  5255. // unconditionally include in API requests. By default, fields with
  5256. // empty values are omitted from API requests. However, any non-pointer,
  5257. // non-interface field appearing in ForceSendFields will be sent to the
  5258. // server regardless of whether the field is empty or not. This may be
  5259. // used to include empty fields in Patch requests.
  5260. ForceSendFields []string `json:"-"`
  5261. }
  5262. func (s *ThumbnailDetails) MarshalJSON() ([]byte, error) {
  5263. type noMethod ThumbnailDetails
  5264. raw := noMethod(*s)
  5265. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5266. }
  5267. type ThumbnailSetResponse struct {
  5268. // Etag: Etag of this resource.
  5269. Etag string `json:"etag,omitempty"`
  5270. // EventId: Serialized EventId of the request which produced this
  5271. // response.
  5272. EventId string `json:"eventId,omitempty"`
  5273. // Items: A list of thumbnails.
  5274. Items []*ThumbnailDetails `json:"items,omitempty"`
  5275. // Kind: Identifies what kind of resource this is. Value: the fixed
  5276. // string "youtube#thumbnailSetResponse".
  5277. Kind string `json:"kind,omitempty"`
  5278. // VisitorId: The visitorId identifies the visitor.
  5279. VisitorId string `json:"visitorId,omitempty"`
  5280. // ServerResponse contains the HTTP response code and headers from the
  5281. // server.
  5282. googleapi.ServerResponse `json:"-"`
  5283. // ForceSendFields is a list of field names (e.g. "Etag") to
  5284. // unconditionally include in API requests. By default, fields with
  5285. // empty values are omitted from API requests. However, any non-pointer,
  5286. // non-interface field appearing in ForceSendFields will be sent to the
  5287. // server regardless of whether the field is empty or not. This may be
  5288. // used to include empty fields in Patch requests.
  5289. ForceSendFields []string `json:"-"`
  5290. }
  5291. func (s *ThumbnailSetResponse) MarshalJSON() ([]byte, error) {
  5292. type noMethod ThumbnailSetResponse
  5293. raw := noMethod(*s)
  5294. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5295. }
  5296. // TokenPagination: Stub token pagination template to suppress results.
  5297. type TokenPagination struct {
  5298. }
  5299. // Video: A video resource represents a YouTube video.
  5300. type Video struct {
  5301. // AgeGating: Age restriction details related to a video. This data can
  5302. // only be retrieved by the video owner.
  5303. AgeGating *VideoAgeGating `json:"ageGating,omitempty"`
  5304. // ContentDetails: The contentDetails object contains information about
  5305. // the video content, including the length of the video and its aspect
  5306. // ratio.
  5307. ContentDetails *VideoContentDetails `json:"contentDetails,omitempty"`
  5308. // Etag: Etag of this resource.
  5309. Etag string `json:"etag,omitempty"`
  5310. // FileDetails: The fileDetails object encapsulates information about
  5311. // the video file that was uploaded to YouTube, including the file's
  5312. // resolution, duration, audio and video codecs, stream bitrates, and
  5313. // more. This data can only be retrieved by the video owner.
  5314. FileDetails *VideoFileDetails `json:"fileDetails,omitempty"`
  5315. // Id: The ID that YouTube uses to uniquely identify the video.
  5316. Id string `json:"id,omitempty"`
  5317. // Kind: Identifies what kind of resource this is. Value: the fixed
  5318. // string "youtube#video".
  5319. Kind string `json:"kind,omitempty"`
  5320. // LiveStreamingDetails: The liveStreamingDetails object contains
  5321. // metadata about a live video broadcast. The object will only be
  5322. // present in a video resource if the video is an upcoming, live, or
  5323. // completed live broadcast.
  5324. LiveStreamingDetails *VideoLiveStreamingDetails `json:"liveStreamingDetails,omitempty"`
  5325. // Localizations: List with all localizations.
  5326. Localizations map[string]VideoLocalization `json:"localizations,omitempty"`
  5327. // MonetizationDetails: The monetizationDetails object encapsulates
  5328. // information about the monetization status of the video.
  5329. MonetizationDetails *VideoMonetizationDetails `json:"monetizationDetails,omitempty"`
  5330. // Player: The player object contains information that you would use to
  5331. // play the video in an embedded player.
  5332. Player *VideoPlayer `json:"player,omitempty"`
  5333. // ProcessingDetails: The processingProgress object encapsulates
  5334. // information about YouTube's progress in processing the uploaded video
  5335. // file. The properties in the object identify the current processing
  5336. // status and an estimate of the time remaining until YouTube finishes
  5337. // processing the video. This part also indicates whether different
  5338. // types of data or content, such as file details or thumbnail images,
  5339. // are available for the video.
  5340. //
  5341. // The processingProgress object is designed to be polled so that the
  5342. // video uploaded can track the progress that YouTube has made in
  5343. // processing the uploaded video file. This data can only be retrieved
  5344. // by the video owner.
  5345. ProcessingDetails *VideoProcessingDetails `json:"processingDetails,omitempty"`
  5346. // ProjectDetails: The projectDetails object contains information about
  5347. // the project specific video metadata.
  5348. ProjectDetails *VideoProjectDetails `json:"projectDetails,omitempty"`
  5349. // RecordingDetails: The recordingDetails object encapsulates
  5350. // information about the location, date and address where the video was
  5351. // recorded.
  5352. RecordingDetails *VideoRecordingDetails `json:"recordingDetails,omitempty"`
  5353. // Snippet: The snippet object contains basic details about the video,
  5354. // such as its title, description, and category.
  5355. Snippet *VideoSnippet `json:"snippet,omitempty"`
  5356. // Statistics: The statistics object contains statistics about the
  5357. // video.
  5358. Statistics *VideoStatistics `json:"statistics,omitempty"`
  5359. // Status: The status object contains information about the video's
  5360. // uploading, processing, and privacy statuses.
  5361. Status *VideoStatus `json:"status,omitempty"`
  5362. // Suggestions: The suggestions object encapsulates suggestions that
  5363. // identify opportunities to improve the video quality or the metadata
  5364. // for the uploaded video. This data can only be retrieved by the video
  5365. // owner.
  5366. Suggestions *VideoSuggestions `json:"suggestions,omitempty"`
  5367. // TopicDetails: The topicDetails object encapsulates information about
  5368. // Freebase topics associated with the video.
  5369. TopicDetails *VideoTopicDetails `json:"topicDetails,omitempty"`
  5370. // ServerResponse contains the HTTP response code and headers from the
  5371. // server.
  5372. googleapi.ServerResponse `json:"-"`
  5373. // ForceSendFields is a list of field names (e.g. "AgeGating") to
  5374. // unconditionally include in API requests. By default, fields with
  5375. // empty values are omitted from API requests. However, any non-pointer,
  5376. // non-interface field appearing in ForceSendFields will be sent to the
  5377. // server regardless of whether the field is empty or not. This may be
  5378. // used to include empty fields in Patch requests.
  5379. ForceSendFields []string `json:"-"`
  5380. }
  5381. func (s *Video) MarshalJSON() ([]byte, error) {
  5382. type noMethod Video
  5383. raw := noMethod(*s)
  5384. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5385. }
  5386. type VideoAbuseReport struct {
  5387. // Comments: Additional comments regarding the abuse report.
  5388. Comments string `json:"comments,omitempty"`
  5389. // Language: The language that the content was viewed in.
  5390. Language string `json:"language,omitempty"`
  5391. // ReasonId: The high-level, or primary, reason that the content is
  5392. // abusive. The value is an abuse report reason ID.
  5393. ReasonId string `json:"reasonId,omitempty"`
  5394. // SecondaryReasonId: The specific, or secondary, reason that this
  5395. // content is abusive (if available). The value is an abuse report
  5396. // reason ID that is a valid secondary reason for the primary reason.
  5397. SecondaryReasonId string `json:"secondaryReasonId,omitempty"`
  5398. // VideoId: The ID that YouTube uses to uniquely identify the video.
  5399. VideoId string `json:"videoId,omitempty"`
  5400. // ForceSendFields is a list of field names (e.g. "Comments") to
  5401. // unconditionally include in API requests. By default, fields with
  5402. // empty values are omitted from API requests. However, any non-pointer,
  5403. // non-interface field appearing in ForceSendFields will be sent to the
  5404. // server regardless of whether the field is empty or not. This may be
  5405. // used to include empty fields in Patch requests.
  5406. ForceSendFields []string `json:"-"`
  5407. }
  5408. func (s *VideoAbuseReport) MarshalJSON() ([]byte, error) {
  5409. type noMethod VideoAbuseReport
  5410. raw := noMethod(*s)
  5411. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5412. }
  5413. // VideoAbuseReportReason: A videoAbuseReportReason resource identifies
  5414. // a reason that a video could be reported as abusive. Video abuse
  5415. // report reasons are used with video.ReportAbuse.
  5416. type VideoAbuseReportReason struct {
  5417. // Etag: Etag of this resource.
  5418. Etag string `json:"etag,omitempty"`
  5419. // Id: The ID of this abuse report reason.
  5420. Id string `json:"id,omitempty"`
  5421. // Kind: Identifies what kind of resource this is. Value: the fixed
  5422. // string "youtube#videoAbuseReportReason".
  5423. Kind string `json:"kind,omitempty"`
  5424. // Snippet: The snippet object contains basic details about the abuse
  5425. // report reason.
  5426. Snippet *VideoAbuseReportReasonSnippet `json:"snippet,omitempty"`
  5427. // ForceSendFields is a list of field names (e.g. "Etag") to
  5428. // unconditionally include in API requests. By default, fields with
  5429. // empty values are omitted from API requests. However, any non-pointer,
  5430. // non-interface field appearing in ForceSendFields will be sent to the
  5431. // server regardless of whether the field is empty or not. This may be
  5432. // used to include empty fields in Patch requests.
  5433. ForceSendFields []string `json:"-"`
  5434. }
  5435. func (s *VideoAbuseReportReason) MarshalJSON() ([]byte, error) {
  5436. type noMethod VideoAbuseReportReason
  5437. raw := noMethod(*s)
  5438. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5439. }
  5440. type VideoAbuseReportReasonListResponse struct {
  5441. // Etag: Etag of this resource.
  5442. Etag string `json:"etag,omitempty"`
  5443. // EventId: Serialized EventId of the request which produced this
  5444. // response.
  5445. EventId string `json:"eventId,omitempty"`
  5446. // Items: A list of valid abuse reasons that are used with
  5447. // video.ReportAbuse.
  5448. Items []*VideoAbuseReportReason `json:"items,omitempty"`
  5449. // Kind: Identifies what kind of resource this is. Value: the fixed
  5450. // string "youtube#videoAbuseReportReasonListResponse".
  5451. Kind string `json:"kind,omitempty"`
  5452. // VisitorId: The visitorId identifies the visitor.
  5453. VisitorId string `json:"visitorId,omitempty"`
  5454. // ServerResponse contains the HTTP response code and headers from the
  5455. // server.
  5456. googleapi.ServerResponse `json:"-"`
  5457. // ForceSendFields is a list of field names (e.g. "Etag") to
  5458. // unconditionally include in API requests. By default, fields with
  5459. // empty values are omitted from API requests. However, any non-pointer,
  5460. // non-interface field appearing in ForceSendFields will be sent to the
  5461. // server regardless of whether the field is empty or not. This may be
  5462. // used to include empty fields in Patch requests.
  5463. ForceSendFields []string `json:"-"`
  5464. }
  5465. func (s *VideoAbuseReportReasonListResponse) MarshalJSON() ([]byte, error) {
  5466. type noMethod VideoAbuseReportReasonListResponse
  5467. raw := noMethod(*s)
  5468. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5469. }
  5470. // VideoAbuseReportReasonSnippet: Basic details about a video category,
  5471. // such as its localized title.
  5472. type VideoAbuseReportReasonSnippet struct {
  5473. // Label: The localized label belonging to this abuse report reason.
  5474. Label string `json:"label,omitempty"`
  5475. // SecondaryReasons: The secondary reasons associated with this reason,
  5476. // if any are available. (There might be 0 or more.)
  5477. SecondaryReasons []*VideoAbuseReportSecondaryReason `json:"secondaryReasons,omitempty"`
  5478. // ForceSendFields is a list of field names (e.g. "Label") to
  5479. // unconditionally include in API requests. By default, fields with
  5480. // empty values are omitted from API requests. However, any non-pointer,
  5481. // non-interface field appearing in ForceSendFields will be sent to the
  5482. // server regardless of whether the field is empty or not. This may be
  5483. // used to include empty fields in Patch requests.
  5484. ForceSendFields []string `json:"-"`
  5485. }
  5486. func (s *VideoAbuseReportReasonSnippet) MarshalJSON() ([]byte, error) {
  5487. type noMethod VideoAbuseReportReasonSnippet
  5488. raw := noMethod(*s)
  5489. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5490. }
  5491. type VideoAbuseReportSecondaryReason struct {
  5492. // Id: The ID of this abuse report secondary reason.
  5493. Id string `json:"id,omitempty"`
  5494. // Label: The localized label for this abuse report secondary reason.
  5495. Label string `json:"label,omitempty"`
  5496. // ForceSendFields is a list of field names (e.g. "Id") to
  5497. // unconditionally include in API requests. By default, fields with
  5498. // empty values are omitted from API requests. However, any non-pointer,
  5499. // non-interface field appearing in ForceSendFields will be sent to the
  5500. // server regardless of whether the field is empty or not. This may be
  5501. // used to include empty fields in Patch requests.
  5502. ForceSendFields []string `json:"-"`
  5503. }
  5504. func (s *VideoAbuseReportSecondaryReason) MarshalJSON() ([]byte, error) {
  5505. type noMethod VideoAbuseReportSecondaryReason
  5506. raw := noMethod(*s)
  5507. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5508. }
  5509. type VideoAgeGating struct {
  5510. // AlcoholContent: Indicates whether or not the video has alcoholic
  5511. // beverage content. Only users of legal purchasing age in a particular
  5512. // country, as identified by ICAP, can view the content.
  5513. AlcoholContent bool `json:"alcoholContent,omitempty"`
  5514. // Restricted: Age-restricted trailers. For redband trailers and
  5515. // adult-rated video-games. Only users aged 18+ can view the content.
  5516. // The the field is true the content is restricted to viewers aged 18+.
  5517. // Otherwise The field won't be present.
  5518. Restricted bool `json:"restricted,omitempty"`
  5519. // VideoGameRating: Video game rating, if any.
  5520. //
  5521. // Possible values:
  5522. // "anyone"
  5523. // "m15Plus"
  5524. // "m16Plus"
  5525. // "m17Plus"
  5526. VideoGameRating string `json:"videoGameRating,omitempty"`
  5527. // ForceSendFields is a list of field names (e.g. "AlcoholContent") to
  5528. // unconditionally include in API requests. By default, fields with
  5529. // empty values are omitted from API requests. However, any non-pointer,
  5530. // non-interface field appearing in ForceSendFields will be sent to the
  5531. // server regardless of whether the field is empty or not. This may be
  5532. // used to include empty fields in Patch requests.
  5533. ForceSendFields []string `json:"-"`
  5534. }
  5535. func (s *VideoAgeGating) MarshalJSON() ([]byte, error) {
  5536. type noMethod VideoAgeGating
  5537. raw := noMethod(*s)
  5538. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5539. }
  5540. // VideoCategory: A videoCategory resource identifies a category that
  5541. // has been or could be associated with uploaded videos.
  5542. type VideoCategory struct {
  5543. // Etag: Etag of this resource.
  5544. Etag string `json:"etag,omitempty"`
  5545. // Id: The ID that YouTube uses to uniquely identify the video category.
  5546. Id string `json:"id,omitempty"`
  5547. // Kind: Identifies what kind of resource this is. Value: the fixed
  5548. // string "youtube#videoCategory".
  5549. Kind string `json:"kind,omitempty"`
  5550. // Snippet: The snippet object contains basic details about the video
  5551. // category, including its title.
  5552. Snippet *VideoCategorySnippet `json:"snippet,omitempty"`
  5553. // ForceSendFields is a list of field names (e.g. "Etag") to
  5554. // unconditionally include in API requests. By default, fields with
  5555. // empty values are omitted from API requests. However, any non-pointer,
  5556. // non-interface field appearing in ForceSendFields will be sent to the
  5557. // server regardless of whether the field is empty or not. This may be
  5558. // used to include empty fields in Patch requests.
  5559. ForceSendFields []string `json:"-"`
  5560. }
  5561. func (s *VideoCategory) MarshalJSON() ([]byte, error) {
  5562. type noMethod VideoCategory
  5563. raw := noMethod(*s)
  5564. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5565. }
  5566. type VideoCategoryListResponse struct {
  5567. // Etag: Etag of this resource.
  5568. Etag string `json:"etag,omitempty"`
  5569. // EventId: Serialized EventId of the request which produced this
  5570. // response.
  5571. EventId string `json:"eventId,omitempty"`
  5572. // Items: A list of video categories that can be associated with YouTube
  5573. // videos. In this map, the video category ID is the map key, and its
  5574. // value is the corresponding videoCategory resource.
  5575. Items []*VideoCategory `json:"items,omitempty"`
  5576. // Kind: Identifies what kind of resource this is. Value: the fixed
  5577. // string "youtube#videoCategoryListResponse".
  5578. Kind string `json:"kind,omitempty"`
  5579. // NextPageToken: The token that can be used as the value of the
  5580. // pageToken parameter to retrieve the next page in the result set.
  5581. NextPageToken string `json:"nextPageToken,omitempty"`
  5582. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5583. // PrevPageToken: The token that can be used as the value of the
  5584. // pageToken parameter to retrieve the previous page in the result set.
  5585. PrevPageToken string `json:"prevPageToken,omitempty"`
  5586. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5587. // VisitorId: The visitorId identifies the visitor.
  5588. VisitorId string `json:"visitorId,omitempty"`
  5589. // ServerResponse contains the HTTP response code and headers from the
  5590. // server.
  5591. googleapi.ServerResponse `json:"-"`
  5592. // ForceSendFields is a list of field names (e.g. "Etag") to
  5593. // unconditionally include in API requests. By default, fields with
  5594. // empty values are omitted from API requests. However, any non-pointer,
  5595. // non-interface field appearing in ForceSendFields will be sent to the
  5596. // server regardless of whether the field is empty or not. This may be
  5597. // used to include empty fields in Patch requests.
  5598. ForceSendFields []string `json:"-"`
  5599. }
  5600. func (s *VideoCategoryListResponse) MarshalJSON() ([]byte, error) {
  5601. type noMethod VideoCategoryListResponse
  5602. raw := noMethod(*s)
  5603. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5604. }
  5605. // VideoCategorySnippet: Basic details about a video category, such as
  5606. // its localized title.
  5607. type VideoCategorySnippet struct {
  5608. Assignable bool `json:"assignable,omitempty"`
  5609. // ChannelId: The YouTube channel that created the video category.
  5610. ChannelId string `json:"channelId,omitempty"`
  5611. // Title: The video category's title.
  5612. Title string `json:"title,omitempty"`
  5613. // ForceSendFields is a list of field names (e.g. "Assignable") to
  5614. // unconditionally include in API requests. By default, fields with
  5615. // empty values are omitted from API requests. However, any non-pointer,
  5616. // non-interface field appearing in ForceSendFields will be sent to the
  5617. // server regardless of whether the field is empty or not. This may be
  5618. // used to include empty fields in Patch requests.
  5619. ForceSendFields []string `json:"-"`
  5620. }
  5621. func (s *VideoCategorySnippet) MarshalJSON() ([]byte, error) {
  5622. type noMethod VideoCategorySnippet
  5623. raw := noMethod(*s)
  5624. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5625. }
  5626. // VideoContentDetails: Details about the content of a YouTube Video.
  5627. type VideoContentDetails struct {
  5628. // Caption: The value of captions indicates whether the video has
  5629. // captions or not.
  5630. //
  5631. // Possible values:
  5632. // "false"
  5633. // "true"
  5634. Caption string `json:"caption,omitempty"`
  5635. // ContentRating: Specifies the ratings that the video received under
  5636. // various rating schemes.
  5637. ContentRating *ContentRating `json:"contentRating,omitempty"`
  5638. // CountryRestriction: The countryRestriction object contains
  5639. // information about the countries where a video is (or is not)
  5640. // viewable.
  5641. CountryRestriction *AccessPolicy `json:"countryRestriction,omitempty"`
  5642. // Definition: The value of definition indicates whether the video is
  5643. // available in high definition or only in standard definition.
  5644. //
  5645. // Possible values:
  5646. // "hd"
  5647. // "sd"
  5648. Definition string `json:"definition,omitempty"`
  5649. // Dimension: The value of dimension indicates whether the video is
  5650. // available in 3D or in 2D.
  5651. Dimension string `json:"dimension,omitempty"`
  5652. // Duration: The length of the video. The tag value is an ISO 8601
  5653. // duration in the format PT#M#S, in which the letters PT indicate that
  5654. // the value specifies a period of time, and the letters M and S refer
  5655. // to length in minutes and seconds, respectively. The # characters
  5656. // preceding the M and S letters are both integers that specify the
  5657. // number of minutes (or seconds) of the video. For example, a value of
  5658. // PT15M51S indicates that the video is 15 minutes and 51 seconds long.
  5659. Duration string `json:"duration,omitempty"`
  5660. // LicensedContent: The value of is_license_content indicates whether
  5661. // the video is licensed content.
  5662. LicensedContent bool `json:"licensedContent,omitempty"`
  5663. // RegionRestriction: The regionRestriction object contains information
  5664. // about the countries where a video is (or is not) viewable. The object
  5665. // will contain either the contentDetails.regionRestriction.allowed
  5666. // property or the contentDetails.regionRestriction.blocked property.
  5667. RegionRestriction *VideoContentDetailsRegionRestriction `json:"regionRestriction,omitempty"`
  5668. // ForceSendFields is a list of field names (e.g. "Caption") to
  5669. // unconditionally include in API requests. By default, fields with
  5670. // empty values are omitted from API requests. However, any non-pointer,
  5671. // non-interface field appearing in ForceSendFields will be sent to the
  5672. // server regardless of whether the field is empty or not. This may be
  5673. // used to include empty fields in Patch requests.
  5674. ForceSendFields []string `json:"-"`
  5675. }
  5676. func (s *VideoContentDetails) MarshalJSON() ([]byte, error) {
  5677. type noMethod VideoContentDetails
  5678. raw := noMethod(*s)
  5679. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5680. }
  5681. // VideoContentDetailsRegionRestriction: DEPRECATED Region restriction
  5682. // of the video.
  5683. type VideoContentDetailsRegionRestriction struct {
  5684. // Allowed: A list of region codes that identify countries where the
  5685. // video is viewable. If this property is present and a country is not
  5686. // listed in its value, then the video is blocked from appearing in that
  5687. // country. If this property is present and contains an empty list, the
  5688. // video is blocked in all countries.
  5689. Allowed []string `json:"allowed,omitempty"`
  5690. // Blocked: A list of region codes that identify countries where the
  5691. // video is blocked. If this property is present and a country is not
  5692. // listed in its value, then the video is viewable in that country. If
  5693. // this property is present and contains an empty list, the video is
  5694. // viewable in all countries.
  5695. Blocked []string `json:"blocked,omitempty"`
  5696. // ForceSendFields is a list of field names (e.g. "Allowed") to
  5697. // unconditionally include in API requests. By default, fields with
  5698. // empty values are omitted from API requests. However, any non-pointer,
  5699. // non-interface field appearing in ForceSendFields will be sent to the
  5700. // server regardless of whether the field is empty or not. This may be
  5701. // used to include empty fields in Patch requests.
  5702. ForceSendFields []string `json:"-"`
  5703. }
  5704. func (s *VideoContentDetailsRegionRestriction) MarshalJSON() ([]byte, error) {
  5705. type noMethod VideoContentDetailsRegionRestriction
  5706. raw := noMethod(*s)
  5707. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5708. }
  5709. // VideoFileDetails: Describes original video file properties, including
  5710. // technical details about audio and video streams, but also metadata
  5711. // information like content length, digitization time, or geotagging
  5712. // information.
  5713. type VideoFileDetails struct {
  5714. // AudioStreams: A list of audio streams contained in the uploaded video
  5715. // file. Each item in the list contains detailed metadata about an audio
  5716. // stream.
  5717. AudioStreams []*VideoFileDetailsAudioStream `json:"audioStreams,omitempty"`
  5718. // BitrateBps: The uploaded video file's combined (video and audio)
  5719. // bitrate in bits per second.
  5720. BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
  5721. // Container: The uploaded video file's container format.
  5722. Container string `json:"container,omitempty"`
  5723. // CreationTime: The date and time when the uploaded video file was
  5724. // created. The value is specified in ISO 8601 format. Currently, the
  5725. // following ISO 8601 formats are supported:
  5726. // - Date only: YYYY-MM-DD
  5727. // - Naive time: YYYY-MM-DDTHH:MM:SS
  5728. // - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM
  5729. CreationTime string `json:"creationTime,omitempty"`
  5730. // DurationMs: The length of the uploaded video in milliseconds.
  5731. DurationMs uint64 `json:"durationMs,omitempty,string"`
  5732. // FileName: The uploaded file's name. This field is present whether a
  5733. // video file or another type of file was uploaded.
  5734. FileName string `json:"fileName,omitempty"`
  5735. // FileSize: The uploaded file's size in bytes. This field is present
  5736. // whether a video file or another type of file was uploaded.
  5737. FileSize uint64 `json:"fileSize,omitempty,string"`
  5738. // FileType: The uploaded file's type as detected by YouTube's video
  5739. // processing engine. Currently, YouTube only processes video files, but
  5740. // this field is present whether a video file or another type of file
  5741. // was uploaded.
  5742. //
  5743. // Possible values:
  5744. // "archive"
  5745. // "audio"
  5746. // "document"
  5747. // "image"
  5748. // "other"
  5749. // "project"
  5750. // "video"
  5751. FileType string `json:"fileType,omitempty"`
  5752. // RecordingLocation: Geographic coordinates that identify the place
  5753. // where the uploaded video was recorded. Coordinates are defined using
  5754. // WGS 84.
  5755. RecordingLocation *GeoPoint `json:"recordingLocation,omitempty"`
  5756. // VideoStreams: A list of video streams contained in the uploaded video
  5757. // file. Each item in the list contains detailed metadata about a video
  5758. // stream.
  5759. VideoStreams []*VideoFileDetailsVideoStream `json:"videoStreams,omitempty"`
  5760. // ForceSendFields is a list of field names (e.g. "AudioStreams") to
  5761. // unconditionally include in API requests. By default, fields with
  5762. // empty values are omitted from API requests. However, any non-pointer,
  5763. // non-interface field appearing in ForceSendFields will be sent to the
  5764. // server regardless of whether the field is empty or not. This may be
  5765. // used to include empty fields in Patch requests.
  5766. ForceSendFields []string `json:"-"`
  5767. }
  5768. func (s *VideoFileDetails) MarshalJSON() ([]byte, error) {
  5769. type noMethod VideoFileDetails
  5770. raw := noMethod(*s)
  5771. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5772. }
  5773. // VideoFileDetailsAudioStream: Information about an audio stream.
  5774. type VideoFileDetailsAudioStream struct {
  5775. // BitrateBps: The audio stream's bitrate, in bits per second.
  5776. BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
  5777. // ChannelCount: The number of audio channels that the stream contains.
  5778. ChannelCount int64 `json:"channelCount,omitempty"`
  5779. // Codec: The audio codec that the stream uses.
  5780. Codec string `json:"codec,omitempty"`
  5781. // Vendor: A value that uniquely identifies a video vendor. Typically,
  5782. // the value is a four-letter vendor code.
  5783. Vendor string `json:"vendor,omitempty"`
  5784. // ForceSendFields is a list of field names (e.g. "BitrateBps") to
  5785. // unconditionally include in API requests. By default, fields with
  5786. // empty values are omitted from API requests. However, any non-pointer,
  5787. // non-interface field appearing in ForceSendFields will be sent to the
  5788. // server regardless of whether the field is empty or not. This may be
  5789. // used to include empty fields in Patch requests.
  5790. ForceSendFields []string `json:"-"`
  5791. }
  5792. func (s *VideoFileDetailsAudioStream) MarshalJSON() ([]byte, error) {
  5793. type noMethod VideoFileDetailsAudioStream
  5794. raw := noMethod(*s)
  5795. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5796. }
  5797. // VideoFileDetailsVideoStream: Information about a video stream.
  5798. type VideoFileDetailsVideoStream struct {
  5799. // AspectRatio: The video content's display aspect ratio, which
  5800. // specifies the aspect ratio in which the video should be displayed.
  5801. AspectRatio float64 `json:"aspectRatio,omitempty"`
  5802. // BitrateBps: The video stream's bitrate, in bits per second.
  5803. BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
  5804. // Codec: The video codec that the stream uses.
  5805. Codec string `json:"codec,omitempty"`
  5806. // FrameRateFps: The video stream's frame rate, in frames per second.
  5807. FrameRateFps float64 `json:"frameRateFps,omitempty"`
  5808. // HeightPixels: The encoded video content's height in pixels.
  5809. HeightPixels int64 `json:"heightPixels,omitempty"`
  5810. // Rotation: The amount that YouTube needs to rotate the original source
  5811. // content to properly display the video.
  5812. //
  5813. // Possible values:
  5814. // "clockwise"
  5815. // "counterClockwise"
  5816. // "none"
  5817. // "other"
  5818. // "upsideDown"
  5819. Rotation string `json:"rotation,omitempty"`
  5820. // Vendor: A value that uniquely identifies a video vendor. Typically,
  5821. // the value is a four-letter vendor code.
  5822. Vendor string `json:"vendor,omitempty"`
  5823. // WidthPixels: The encoded video content's width in pixels. You can
  5824. // calculate the video's encoding aspect ratio as
  5825. // width_pixels / height_pixels.
  5826. WidthPixels int64 `json:"widthPixels,omitempty"`
  5827. // ForceSendFields is a list of field names (e.g. "AspectRatio") to
  5828. // unconditionally include in API requests. By default, fields with
  5829. // empty values are omitted from API requests. However, any non-pointer,
  5830. // non-interface field appearing in ForceSendFields will be sent to the
  5831. // server regardless of whether the field is empty or not. This may be
  5832. // used to include empty fields in Patch requests.
  5833. ForceSendFields []string `json:"-"`
  5834. }
  5835. func (s *VideoFileDetailsVideoStream) MarshalJSON() ([]byte, error) {
  5836. type noMethod VideoFileDetailsVideoStream
  5837. raw := noMethod(*s)
  5838. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5839. }
  5840. type VideoGetRatingResponse struct {
  5841. // Etag: Etag of this resource.
  5842. Etag string `json:"etag,omitempty"`
  5843. // EventId: Serialized EventId of the request which produced this
  5844. // response.
  5845. EventId string `json:"eventId,omitempty"`
  5846. // Items: A list of ratings that match the request criteria.
  5847. Items []*VideoRating `json:"items,omitempty"`
  5848. // Kind: Identifies what kind of resource this is. Value: the fixed
  5849. // string "youtube#videoGetRatingResponse".
  5850. Kind string `json:"kind,omitempty"`
  5851. // VisitorId: The visitorId identifies the visitor.
  5852. VisitorId string `json:"visitorId,omitempty"`
  5853. // ServerResponse contains the HTTP response code and headers from the
  5854. // server.
  5855. googleapi.ServerResponse `json:"-"`
  5856. // ForceSendFields is a list of field names (e.g. "Etag") to
  5857. // unconditionally include in API requests. By default, fields with
  5858. // empty values are omitted from API requests. However, any non-pointer,
  5859. // non-interface field appearing in ForceSendFields will be sent to the
  5860. // server regardless of whether the field is empty or not. This may be
  5861. // used to include empty fields in Patch requests.
  5862. ForceSendFields []string `json:"-"`
  5863. }
  5864. func (s *VideoGetRatingResponse) MarshalJSON() ([]byte, error) {
  5865. type noMethod VideoGetRatingResponse
  5866. raw := noMethod(*s)
  5867. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5868. }
  5869. type VideoListResponse struct {
  5870. // Etag: Etag of this resource.
  5871. Etag string `json:"etag,omitempty"`
  5872. // EventId: Serialized EventId of the request which produced this
  5873. // response.
  5874. EventId string `json:"eventId,omitempty"`
  5875. // Items: A list of videos that match the request criteria.
  5876. Items []*Video `json:"items,omitempty"`
  5877. // Kind: Identifies what kind of resource this is. Value: the fixed
  5878. // string "youtube#videoListResponse".
  5879. Kind string `json:"kind,omitempty"`
  5880. // NextPageToken: The token that can be used as the value of the
  5881. // pageToken parameter to retrieve the next page in the result set.
  5882. NextPageToken string `json:"nextPageToken,omitempty"`
  5883. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5884. // PrevPageToken: The token that can be used as the value of the
  5885. // pageToken parameter to retrieve the previous page in the result set.
  5886. PrevPageToken string `json:"prevPageToken,omitempty"`
  5887. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5888. // VisitorId: The visitorId identifies the visitor.
  5889. VisitorId string `json:"visitorId,omitempty"`
  5890. // ServerResponse contains the HTTP response code and headers from the
  5891. // server.
  5892. googleapi.ServerResponse `json:"-"`
  5893. // ForceSendFields is a list of field names (e.g. "Etag") to
  5894. // unconditionally include in API requests. By default, fields with
  5895. // empty values are omitted from API requests. However, any non-pointer,
  5896. // non-interface field appearing in ForceSendFields will be sent to the
  5897. // server regardless of whether the field is empty or not. This may be
  5898. // used to include empty fields in Patch requests.
  5899. ForceSendFields []string `json:"-"`
  5900. }
  5901. func (s *VideoListResponse) MarshalJSON() ([]byte, error) {
  5902. type noMethod VideoListResponse
  5903. raw := noMethod(*s)
  5904. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5905. }
  5906. // VideoLiveStreamingDetails: Details about the live streaming metadata.
  5907. type VideoLiveStreamingDetails struct {
  5908. // ActiveLiveChatId: The ID of the currently active live chat attached
  5909. // to this video. This field is filled only if the video is a currently
  5910. // live broadcast that has live chat. Once the broadcast transitions to
  5911. // complete this field will be removed and the live chat closed down.
  5912. // For persistent broadcasts that live chat id will no longer be tied to
  5913. // this video but rather to the new video being displayed at the
  5914. // persistent page.
  5915. ActiveLiveChatId string `json:"activeLiveChatId,omitempty"`
  5916. // ActualEndTime: The time that the broadcast actually ended. The value
  5917. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value
  5918. // will not be available until the broadcast is over.
  5919. ActualEndTime string `json:"actualEndTime,omitempty"`
  5920. // ActualStartTime: The time that the broadcast actually started. The
  5921. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This
  5922. // value will not be available until the broadcast begins.
  5923. ActualStartTime string `json:"actualStartTime,omitempty"`
  5924. // ConcurrentViewers: The number of viewers currently watching the
  5925. // broadcast. The property and its value will be present if the
  5926. // broadcast has current viewers and the broadcast owner has not hidden
  5927. // the viewcount for the video. Note that YouTube stops tracking the
  5928. // number of concurrent viewers for a broadcast when the broadcast ends.
  5929. // So, this property would not identify the number of viewers watching
  5930. // an archived video of a live broadcast that already ended.
  5931. ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"`
  5932. // ScheduledEndTime: The time that the broadcast is scheduled to end.
  5933. // The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  5934. // If the value is empty or the property is not present, then the
  5935. // broadcast is scheduled to continue indefinitely.
  5936. ScheduledEndTime string `json:"scheduledEndTime,omitempty"`
  5937. // ScheduledStartTime: The time that the broadcast is scheduled to
  5938. // begin. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  5939. // format.
  5940. ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
  5941. // ForceSendFields is a list of field names (e.g. "ActiveLiveChatId") to
  5942. // unconditionally include in API requests. By default, fields with
  5943. // empty values are omitted from API requests. However, any non-pointer,
  5944. // non-interface field appearing in ForceSendFields will be sent to the
  5945. // server regardless of whether the field is empty or not. This may be
  5946. // used to include empty fields in Patch requests.
  5947. ForceSendFields []string `json:"-"`
  5948. }
  5949. func (s *VideoLiveStreamingDetails) MarshalJSON() ([]byte, error) {
  5950. type noMethod VideoLiveStreamingDetails
  5951. raw := noMethod(*s)
  5952. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5953. }
  5954. // VideoLocalization: Localized versions of certain video properties
  5955. // (e.g. title).
  5956. type VideoLocalization struct {
  5957. // Description: Localized version of the video's description.
  5958. Description string `json:"description,omitempty"`
  5959. // Title: Localized version of the video's title.
  5960. Title string `json:"title,omitempty"`
  5961. // ForceSendFields is a list of field names (e.g. "Description") to
  5962. // unconditionally include in API requests. By default, fields with
  5963. // empty values are omitted from API requests. However, any non-pointer,
  5964. // non-interface field appearing in ForceSendFields will be sent to the
  5965. // server regardless of whether the field is empty or not. This may be
  5966. // used to include empty fields in Patch requests.
  5967. ForceSendFields []string `json:"-"`
  5968. }
  5969. func (s *VideoLocalization) MarshalJSON() ([]byte, error) {
  5970. type noMethod VideoLocalization
  5971. raw := noMethod(*s)
  5972. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5973. }
  5974. // VideoMonetizationDetails: Details about monetization of a YouTube
  5975. // Video.
  5976. type VideoMonetizationDetails struct {
  5977. // Access: The value of access indicates whether the video can be
  5978. // monetized or not.
  5979. Access *AccessPolicy `json:"access,omitempty"`
  5980. // ForceSendFields is a list of field names (e.g. "Access") to
  5981. // unconditionally include in API requests. By default, fields with
  5982. // empty values are omitted from API requests. However, any non-pointer,
  5983. // non-interface field appearing in ForceSendFields will be sent to the
  5984. // server regardless of whether the field is empty or not. This may be
  5985. // used to include empty fields in Patch requests.
  5986. ForceSendFields []string `json:"-"`
  5987. }
  5988. func (s *VideoMonetizationDetails) MarshalJSON() ([]byte, error) {
  5989. type noMethod VideoMonetizationDetails
  5990. raw := noMethod(*s)
  5991. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  5992. }
  5993. // VideoPlayer: Player to be used for a video playback.
  5994. type VideoPlayer struct {
  5995. // EmbedHtml: An <iframe> tag that embeds a player that will play the
  5996. // video.
  5997. EmbedHtml string `json:"embedHtml,omitempty"`
  5998. // ForceSendFields is a list of field names (e.g. "EmbedHtml") to
  5999. // unconditionally include in API requests. By default, fields with
  6000. // empty values are omitted from API requests. However, any non-pointer,
  6001. // non-interface field appearing in ForceSendFields will be sent to the
  6002. // server regardless of whether the field is empty or not. This may be
  6003. // used to include empty fields in Patch requests.
  6004. ForceSendFields []string `json:"-"`
  6005. }
  6006. func (s *VideoPlayer) MarshalJSON() ([]byte, error) {
  6007. type noMethod VideoPlayer
  6008. raw := noMethod(*s)
  6009. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6010. }
  6011. // VideoProcessingDetails: Describes processing status and progress and
  6012. // availability of some other Video resource parts.
  6013. type VideoProcessingDetails struct {
  6014. // EditorSuggestionsAvailability: This value indicates whether video
  6015. // editing suggestions, which might improve video quality or the
  6016. // playback experience, are available for the video. You can retrieve
  6017. // these suggestions by requesting the suggestions part in your
  6018. // videos.list() request.
  6019. EditorSuggestionsAvailability string `json:"editorSuggestionsAvailability,omitempty"`
  6020. // FileDetailsAvailability: This value indicates whether file details
  6021. // are available for the uploaded video. You can retrieve a video's file
  6022. // details by requesting the fileDetails part in your videos.list()
  6023. // request.
  6024. FileDetailsAvailability string `json:"fileDetailsAvailability,omitempty"`
  6025. // ProcessingFailureReason: The reason that YouTube failed to process
  6026. // the video. This property will only have a value if the
  6027. // processingStatus property's value is failed.
  6028. //
  6029. // Possible values:
  6030. // "other"
  6031. // "streamingFailed"
  6032. // "transcodeFailed"
  6033. // "uploadFailed"
  6034. ProcessingFailureReason string `json:"processingFailureReason,omitempty"`
  6035. // ProcessingIssuesAvailability: This value indicates whether the video
  6036. // processing engine has generated suggestions that might improve
  6037. // YouTube's ability to process the the video, warnings that explain
  6038. // video processing problems, or errors that cause video processing
  6039. // problems. You can retrieve these suggestions by requesting the
  6040. // suggestions part in your videos.list() request.
  6041. ProcessingIssuesAvailability string `json:"processingIssuesAvailability,omitempty"`
  6042. // ProcessingProgress: The processingProgress object contains
  6043. // information about the progress YouTube has made in processing the
  6044. // video. The values are really only relevant if the video's processing
  6045. // status is processing.
  6046. ProcessingProgress *VideoProcessingDetailsProcessingProgress `json:"processingProgress,omitempty"`
  6047. // ProcessingStatus: The video's processing status. This value indicates
  6048. // whether YouTube was able to process the video or if the video is
  6049. // still being processed.
  6050. //
  6051. // Possible values:
  6052. // "failed"
  6053. // "processing"
  6054. // "succeeded"
  6055. // "terminated"
  6056. ProcessingStatus string `json:"processingStatus,omitempty"`
  6057. // TagSuggestionsAvailability: This value indicates whether keyword
  6058. // (tag) suggestions are available for the video. Tags can be added to a
  6059. // video's metadata to make it easier for other users to find the video.
  6060. // You can retrieve these suggestions by requesting the suggestions part
  6061. // in your videos.list() request.
  6062. TagSuggestionsAvailability string `json:"tagSuggestionsAvailability,omitempty"`
  6063. // ThumbnailsAvailability: This value indicates whether thumbnail images
  6064. // have been generated for the video.
  6065. ThumbnailsAvailability string `json:"thumbnailsAvailability,omitempty"`
  6066. // ForceSendFields is a list of field names (e.g.
  6067. // "EditorSuggestionsAvailability") to unconditionally include in API
  6068. // requests. By default, fields with empty values are omitted from API
  6069. // requests. However, any non-pointer, non-interface field appearing in
  6070. // ForceSendFields will be sent to the server regardless of whether the
  6071. // field is empty or not. This may be used to include empty fields in
  6072. // Patch requests.
  6073. ForceSendFields []string `json:"-"`
  6074. }
  6075. func (s *VideoProcessingDetails) MarshalJSON() ([]byte, error) {
  6076. type noMethod VideoProcessingDetails
  6077. raw := noMethod(*s)
  6078. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6079. }
  6080. // VideoProcessingDetailsProcessingProgress: Video processing progress
  6081. // and completion time estimate.
  6082. type VideoProcessingDetailsProcessingProgress struct {
  6083. // PartsProcessed: The number of parts of the video that YouTube has
  6084. // already processed. You can estimate the percentage of the video that
  6085. // YouTube has already processed by calculating:
  6086. // 100 * parts_processed / parts_total
  6087. //
  6088. // Note that since the estimated number of parts could increase without
  6089. // a corresponding increase in the number of parts that have already
  6090. // been processed, it is possible that the calculated progress could
  6091. // periodically decrease while YouTube processes a video.
  6092. PartsProcessed uint64 `json:"partsProcessed,omitempty,string"`
  6093. // PartsTotal: An estimate of the total number of parts that need to be
  6094. // processed for the video. The number may be updated with more precise
  6095. // estimates while YouTube processes the video.
  6096. PartsTotal uint64 `json:"partsTotal,omitempty,string"`
  6097. // TimeLeftMs: An estimate of the amount of time, in millseconds, that
  6098. // YouTube needs to finish processing the video.
  6099. TimeLeftMs uint64 `json:"timeLeftMs,omitempty,string"`
  6100. // ForceSendFields is a list of field names (e.g. "PartsProcessed") to
  6101. // unconditionally include in API requests. By default, fields with
  6102. // empty values are omitted from API requests. However, any non-pointer,
  6103. // non-interface field appearing in ForceSendFields will be sent to the
  6104. // server regardless of whether the field is empty or not. This may be
  6105. // used to include empty fields in Patch requests.
  6106. ForceSendFields []string `json:"-"`
  6107. }
  6108. func (s *VideoProcessingDetailsProcessingProgress) MarshalJSON() ([]byte, error) {
  6109. type noMethod VideoProcessingDetailsProcessingProgress
  6110. raw := noMethod(*s)
  6111. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6112. }
  6113. // VideoProjectDetails: Project specific details about the content of a
  6114. // YouTube Video.
  6115. type VideoProjectDetails struct {
  6116. // Tags: A list of project tags associated with the video during the
  6117. // upload.
  6118. Tags []string `json:"tags,omitempty"`
  6119. // ForceSendFields is a list of field names (e.g. "Tags") to
  6120. // unconditionally include in API requests. By default, fields with
  6121. // empty values are omitted from API requests. However, any non-pointer,
  6122. // non-interface field appearing in ForceSendFields will be sent to the
  6123. // server regardless of whether the field is empty or not. This may be
  6124. // used to include empty fields in Patch requests.
  6125. ForceSendFields []string `json:"-"`
  6126. }
  6127. func (s *VideoProjectDetails) MarshalJSON() ([]byte, error) {
  6128. type noMethod VideoProjectDetails
  6129. raw := noMethod(*s)
  6130. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6131. }
  6132. type VideoRating struct {
  6133. // Possible values:
  6134. // "dislike"
  6135. // "like"
  6136. // "none"
  6137. // "unspecified"
  6138. Rating string `json:"rating,omitempty"`
  6139. VideoId string `json:"videoId,omitempty"`
  6140. // ForceSendFields is a list of field names (e.g. "Rating") to
  6141. // unconditionally include in API requests. By default, fields with
  6142. // empty values are omitted from API requests. However, any non-pointer,
  6143. // non-interface field appearing in ForceSendFields will be sent to the
  6144. // server regardless of whether the field is empty or not. This may be
  6145. // used to include empty fields in Patch requests.
  6146. ForceSendFields []string `json:"-"`
  6147. }
  6148. func (s *VideoRating) MarshalJSON() ([]byte, error) {
  6149. type noMethod VideoRating
  6150. raw := noMethod(*s)
  6151. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6152. }
  6153. // VideoRecordingDetails: Recording information associated with the
  6154. // video.
  6155. type VideoRecordingDetails struct {
  6156. // Location: The geolocation information associated with the video.
  6157. Location *GeoPoint `json:"location,omitempty"`
  6158. // LocationDescription: The text description of the location where the
  6159. // video was recorded.
  6160. LocationDescription string `json:"locationDescription,omitempty"`
  6161. // RecordingDate: The date and time when the video was recorded. The
  6162. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format.
  6163. RecordingDate string `json:"recordingDate,omitempty"`
  6164. // ForceSendFields is a list of field names (e.g. "Location") to
  6165. // unconditionally include in API requests. By default, fields with
  6166. // empty values are omitted from API requests. However, any non-pointer,
  6167. // non-interface field appearing in ForceSendFields will be sent to the
  6168. // server regardless of whether the field is empty or not. This may be
  6169. // used to include empty fields in Patch requests.
  6170. ForceSendFields []string `json:"-"`
  6171. }
  6172. func (s *VideoRecordingDetails) MarshalJSON() ([]byte, error) {
  6173. type noMethod VideoRecordingDetails
  6174. raw := noMethod(*s)
  6175. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6176. }
  6177. // VideoSnippet: Basic details about a video, including title,
  6178. // description, uploader, thumbnails and category.
  6179. type VideoSnippet struct {
  6180. // CategoryId: The YouTube video category associated with the video.
  6181. CategoryId string `json:"categoryId,omitempty"`
  6182. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  6183. // that the video was uploaded to.
  6184. ChannelId string `json:"channelId,omitempty"`
  6185. // ChannelTitle: Channel title for the channel that the video belongs
  6186. // to.
  6187. ChannelTitle string `json:"channelTitle,omitempty"`
  6188. // DefaultAudioLanguage: The default_audio_language property specifies
  6189. // the language spoken in the video's default audio track.
  6190. DefaultAudioLanguage string `json:"defaultAudioLanguage,omitempty"`
  6191. // DefaultLanguage: The language of the videos's default snippet.
  6192. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  6193. // Description: The video's description.
  6194. Description string `json:"description,omitempty"`
  6195. // LiveBroadcastContent: Indicates if the video is an upcoming/active
  6196. // live broadcast. Or it's "none" if the video is not an upcoming/active
  6197. // live broadcast.
  6198. //
  6199. // Possible values:
  6200. // "live"
  6201. // "none"
  6202. // "upcoming"
  6203. LiveBroadcastContent string `json:"liveBroadcastContent,omitempty"`
  6204. // Localized: Localized snippet selected with the hl parameter. If no
  6205. // such localization exists, this field is populated with the default
  6206. // snippet. (Read-only)
  6207. Localized *VideoLocalization `json:"localized,omitempty"`
  6208. // PublishedAt: The date and time that the video was uploaded. The value
  6209. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  6210. PublishedAt string `json:"publishedAt,omitempty"`
  6211. // Tags: A list of keyword tags associated with the video. Tags may
  6212. // contain spaces.
  6213. Tags []string `json:"tags,omitempty"`
  6214. // Thumbnails: A map of thumbnail images associated with the video. For
  6215. // each object in the map, the key is the name of the thumbnail image,
  6216. // and the value is an object that contains other information about the
  6217. // thumbnail.
  6218. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  6219. // Title: The video's title.
  6220. Title string `json:"title,omitempty"`
  6221. // ForceSendFields is a list of field names (e.g. "CategoryId") to
  6222. // unconditionally include in API requests. By default, fields with
  6223. // empty values are omitted from API requests. However, any non-pointer,
  6224. // non-interface field appearing in ForceSendFields will be sent to the
  6225. // server regardless of whether the field is empty or not. This may be
  6226. // used to include empty fields in Patch requests.
  6227. ForceSendFields []string `json:"-"`
  6228. }
  6229. func (s *VideoSnippet) MarshalJSON() ([]byte, error) {
  6230. type noMethod VideoSnippet
  6231. raw := noMethod(*s)
  6232. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6233. }
  6234. // VideoStatistics: Statistics about the video, such as the number of
  6235. // times the video was viewed or liked.
  6236. type VideoStatistics struct {
  6237. // CommentCount: The number of comments for the video.
  6238. CommentCount uint64 `json:"commentCount,omitempty,string"`
  6239. // DislikeCount: The number of users who have indicated that they
  6240. // disliked the video by giving it a negative rating.
  6241. DislikeCount uint64 `json:"dislikeCount,omitempty,string"`
  6242. // FavoriteCount: The number of users who currently have the video
  6243. // marked as a favorite video.
  6244. FavoriteCount uint64 `json:"favoriteCount,omitempty,string"`
  6245. // LikeCount: The number of users who have indicated that they liked the
  6246. // video by giving it a positive rating.
  6247. LikeCount uint64 `json:"likeCount,omitempty,string"`
  6248. // ViewCount: The number of times the video has been viewed.
  6249. ViewCount uint64 `json:"viewCount,omitempty,string"`
  6250. // ForceSendFields is a list of field names (e.g. "CommentCount") to
  6251. // unconditionally include in API requests. By default, fields with
  6252. // empty values are omitted from API requests. However, any non-pointer,
  6253. // non-interface field appearing in ForceSendFields will be sent to the
  6254. // server regardless of whether the field is empty or not. This may be
  6255. // used to include empty fields in Patch requests.
  6256. ForceSendFields []string `json:"-"`
  6257. }
  6258. func (s *VideoStatistics) MarshalJSON() ([]byte, error) {
  6259. type noMethod VideoStatistics
  6260. raw := noMethod(*s)
  6261. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6262. }
  6263. // VideoStatus: Basic details about a video category, such as its
  6264. // localized title.
  6265. type VideoStatus struct {
  6266. // Embeddable: This value indicates if the video can be embedded on
  6267. // another website.
  6268. Embeddable bool `json:"embeddable,omitempty"`
  6269. // FailureReason: This value explains why a video failed to upload. This
  6270. // property is only present if the uploadStatus property indicates that
  6271. // the upload failed.
  6272. //
  6273. // Possible values:
  6274. // "codec"
  6275. // "conversion"
  6276. // "emptyFile"
  6277. // "invalidFile"
  6278. // "tooSmall"
  6279. // "uploadAborted"
  6280. FailureReason string `json:"failureReason,omitempty"`
  6281. // License: The video's license.
  6282. //
  6283. // Possible values:
  6284. // "creativeCommon"
  6285. // "youtube"
  6286. License string `json:"license,omitempty"`
  6287. // PrivacyStatus: The video's privacy status.
  6288. //
  6289. // Possible values:
  6290. // "private"
  6291. // "public"
  6292. // "unlisted"
  6293. PrivacyStatus string `json:"privacyStatus,omitempty"`
  6294. // PublicStatsViewable: This value indicates if the extended video
  6295. // statistics on the watch page can be viewed by everyone. Note that the
  6296. // view count, likes, etc will still be visible if this is disabled.
  6297. PublicStatsViewable bool `json:"publicStatsViewable,omitempty"`
  6298. // PublishAt: The date and time when the video is scheduled to publish.
  6299. // It can be set only if the privacy status of the video is private. The
  6300. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  6301. PublishAt string `json:"publishAt,omitempty"`
  6302. // RejectionReason: This value explains why YouTube rejected an uploaded
  6303. // video. This property is only present if the uploadStatus property
  6304. // indicates that the upload was rejected.
  6305. //
  6306. // Possible values:
  6307. // "claim"
  6308. // "copyright"
  6309. // "duplicate"
  6310. // "inappropriate"
  6311. // "length"
  6312. // "termsOfUse"
  6313. // "trademark"
  6314. // "uploaderAccountClosed"
  6315. // "uploaderAccountSuspended"
  6316. RejectionReason string `json:"rejectionReason,omitempty"`
  6317. // UploadStatus: The status of the uploaded video.
  6318. //
  6319. // Possible values:
  6320. // "deleted"
  6321. // "failed"
  6322. // "processed"
  6323. // "rejected"
  6324. // "uploaded"
  6325. UploadStatus string `json:"uploadStatus,omitempty"`
  6326. // ForceSendFields is a list of field names (e.g. "Embeddable") to
  6327. // unconditionally include in API requests. By default, fields with
  6328. // empty values are omitted from API requests. However, any non-pointer,
  6329. // non-interface field appearing in ForceSendFields will be sent to the
  6330. // server regardless of whether the field is empty or not. This may be
  6331. // used to include empty fields in Patch requests.
  6332. ForceSendFields []string `json:"-"`
  6333. }
  6334. func (s *VideoStatus) MarshalJSON() ([]byte, error) {
  6335. type noMethod VideoStatus
  6336. raw := noMethod(*s)
  6337. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6338. }
  6339. // VideoSuggestions: Specifies suggestions on how to improve video
  6340. // content, including encoding hints, tag suggestions, and editor
  6341. // suggestions.
  6342. type VideoSuggestions struct {
  6343. // EditorSuggestions: A list of video editing operations that might
  6344. // improve the video quality or playback experience of the uploaded
  6345. // video.
  6346. //
  6347. // Possible values:
  6348. // "audioQuietAudioSwap"
  6349. // "videoAutoLevels"
  6350. // "videoCrop"
  6351. // "videoStabilize"
  6352. EditorSuggestions []string `json:"editorSuggestions,omitempty"`
  6353. // ProcessingErrors: A list of errors that will prevent YouTube from
  6354. // successfully processing the uploaded video video. These errors
  6355. // indicate that, regardless of the video's current processing status,
  6356. // eventually, that status will almost certainly be failed.
  6357. //
  6358. // Possible values:
  6359. // "archiveFile"
  6360. // "audioFile"
  6361. // "docFile"
  6362. // "imageFile"
  6363. // "notAVideoFile"
  6364. // "projectFile"
  6365. ProcessingErrors []string `json:"processingErrors,omitempty"`
  6366. // ProcessingHints: A list of suggestions that may improve YouTube's
  6367. // ability to process the video.
  6368. //
  6369. // Possible values:
  6370. // "nonStreamableMov"
  6371. // "sendBestQualityVideo"
  6372. ProcessingHints []string `json:"processingHints,omitempty"`
  6373. // ProcessingWarnings: A list of reasons why YouTube may have difficulty
  6374. // transcoding the uploaded video or that might result in an erroneous
  6375. // transcoding. These warnings are generated before YouTube actually
  6376. // processes the uploaded video file. In addition, they identify issues
  6377. // that are unlikely to cause the video processing to fail but that
  6378. // might cause problems such as sync issues, video artifacts, or a
  6379. // missing audio track.
  6380. //
  6381. // Possible values:
  6382. // "hasEditlist"
  6383. // "inconsistentResolution"
  6384. // "problematicAudioCodec"
  6385. // "problematicVideoCodec"
  6386. // "unknownAudioCodec"
  6387. // "unknownContainer"
  6388. // "unknownVideoCodec"
  6389. ProcessingWarnings []string `json:"processingWarnings,omitempty"`
  6390. // TagSuggestions: A list of keyword tags that could be added to the
  6391. // video's metadata to increase the likelihood that users will locate
  6392. // your video when searching or browsing on YouTube.
  6393. TagSuggestions []*VideoSuggestionsTagSuggestion `json:"tagSuggestions,omitempty"`
  6394. // ForceSendFields is a list of field names (e.g. "EditorSuggestions")
  6395. // to unconditionally include in API requests. By default, fields with
  6396. // empty values are omitted from API requests. However, any non-pointer,
  6397. // non-interface field appearing in ForceSendFields will be sent to the
  6398. // server regardless of whether the field is empty or not. This may be
  6399. // used to include empty fields in Patch requests.
  6400. ForceSendFields []string `json:"-"`
  6401. }
  6402. func (s *VideoSuggestions) MarshalJSON() ([]byte, error) {
  6403. type noMethod VideoSuggestions
  6404. raw := noMethod(*s)
  6405. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6406. }
  6407. // VideoSuggestionsTagSuggestion: A single tag suggestion with it's
  6408. // relevance information.
  6409. type VideoSuggestionsTagSuggestion struct {
  6410. // CategoryRestricts: A set of video categories for which the tag is
  6411. // relevant. You can use this information to display appropriate tag
  6412. // suggestions based on the video category that the video uploader
  6413. // associates with the video. By default, tag suggestions are relevant
  6414. // for all categories if there are no restricts defined for the keyword.
  6415. CategoryRestricts []string `json:"categoryRestricts,omitempty"`
  6416. // Tag: The keyword tag suggested for the video.
  6417. Tag string `json:"tag,omitempty"`
  6418. // ForceSendFields is a list of field names (e.g. "CategoryRestricts")
  6419. // to unconditionally include in API requests. By default, fields with
  6420. // empty values are omitted from API requests. However, any non-pointer,
  6421. // non-interface field appearing in ForceSendFields will be sent to the
  6422. // server regardless of whether the field is empty or not. This may be
  6423. // used to include empty fields in Patch requests.
  6424. ForceSendFields []string `json:"-"`
  6425. }
  6426. func (s *VideoSuggestionsTagSuggestion) MarshalJSON() ([]byte, error) {
  6427. type noMethod VideoSuggestionsTagSuggestion
  6428. raw := noMethod(*s)
  6429. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6430. }
  6431. // VideoTopicDetails: Freebase topic information related to the video.
  6432. type VideoTopicDetails struct {
  6433. // RelevantTopicIds: Similar to topic_id, except that these topics are
  6434. // merely relevant to the video. These are topics that may be mentioned
  6435. // in, or appear in the video. You can retrieve information about each
  6436. // topic using Freebase Topic API.
  6437. RelevantTopicIds []string `json:"relevantTopicIds,omitempty"`
  6438. // TopicIds: A list of Freebase topic IDs that are centrally associated
  6439. // with the video. These are topics that are centrally featured in the
  6440. // video, and it can be said that the video is mainly about each of
  6441. // these. You can retrieve information about each topic using the
  6442. // Freebase Topic API.
  6443. TopicIds []string `json:"topicIds,omitempty"`
  6444. // ForceSendFields is a list of field names (e.g. "RelevantTopicIds") to
  6445. // unconditionally include in API requests. By default, fields with
  6446. // empty values are omitted from API requests. However, any non-pointer,
  6447. // non-interface field appearing in ForceSendFields will be sent to the
  6448. // server regardless of whether the field is empty or not. This may be
  6449. // used to include empty fields in Patch requests.
  6450. ForceSendFields []string `json:"-"`
  6451. }
  6452. func (s *VideoTopicDetails) MarshalJSON() ([]byte, error) {
  6453. type noMethod VideoTopicDetails
  6454. raw := noMethod(*s)
  6455. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6456. }
  6457. // WatchSettings: Branding properties for the watch.
  6458. type WatchSettings struct {
  6459. // BackgroundColor: The text color for the video watch page's branded
  6460. // area.
  6461. BackgroundColor string `json:"backgroundColor,omitempty"`
  6462. // FeaturedPlaylistId: An ID that uniquely identifies a playlist that
  6463. // displays next to the video player.
  6464. FeaturedPlaylistId string `json:"featuredPlaylistId,omitempty"`
  6465. // TextColor: The background color for the video watch page's branded
  6466. // area.
  6467. TextColor string `json:"textColor,omitempty"`
  6468. // ForceSendFields is a list of field names (e.g. "BackgroundColor") to
  6469. // unconditionally include in API requests. By default, fields with
  6470. // empty values are omitted from API requests. However, any non-pointer,
  6471. // non-interface field appearing in ForceSendFields will be sent to the
  6472. // server regardless of whether the field is empty or not. This may be
  6473. // used to include empty fields in Patch requests.
  6474. ForceSendFields []string `json:"-"`
  6475. }
  6476. func (s *WatchSettings) MarshalJSON() ([]byte, error) {
  6477. type noMethod WatchSettings
  6478. raw := noMethod(*s)
  6479. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  6480. }
  6481. // method id "youtube.activities.insert":
  6482. type ActivitiesInsertCall struct {
  6483. s *Service
  6484. activity *Activity
  6485. urlParams_ gensupport.URLParams
  6486. ctx_ context.Context
  6487. }
  6488. // Insert: Posts a bulletin for a specific channel. (The user submitting
  6489. // the request must be authorized to act on the channel's
  6490. // behalf.)
  6491. //
  6492. // Note: Even though an activity resource can contain information about
  6493. // actions like a user rating a video or marking a video as a favorite,
  6494. // you need to use other API methods to generate those activity
  6495. // resources. For example, you would use the API's videos.rate() method
  6496. // to rate a video and the playlistItems.insert() method to mark a video
  6497. // as a favorite.
  6498. func (r *ActivitiesService) Insert(part string, activity *Activity) *ActivitiesInsertCall {
  6499. c := &ActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6500. c.urlParams_.Set("part", part)
  6501. c.activity = activity
  6502. return c
  6503. }
  6504. // Fields allows partial responses to be retrieved. See
  6505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6506. // for more information.
  6507. func (c *ActivitiesInsertCall) Fields(s ...googleapi.Field) *ActivitiesInsertCall {
  6508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6509. return c
  6510. }
  6511. // Context sets the context to be used in this call's Do method. Any
  6512. // pending HTTP request will be aborted if the provided context is
  6513. // canceled.
  6514. func (c *ActivitiesInsertCall) Context(ctx context.Context) *ActivitiesInsertCall {
  6515. c.ctx_ = ctx
  6516. return c
  6517. }
  6518. func (c *ActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  6519. var body io.Reader = nil
  6520. body, err := googleapi.WithoutDataWrapper.JSONReader(c.activity)
  6521. if err != nil {
  6522. return nil, err
  6523. }
  6524. ctype := "application/json"
  6525. c.urlParams_.Set("alt", alt)
  6526. urls := googleapi.ResolveRelative(c.s.BasePath, "activities")
  6527. urls += "?" + c.urlParams_.Encode()
  6528. req, _ := http.NewRequest("POST", urls, body)
  6529. googleapi.SetOpaque(req.URL)
  6530. req.Header.Set("Content-Type", ctype)
  6531. req.Header.Set("User-Agent", c.s.userAgent())
  6532. if c.ctx_ != nil {
  6533. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6534. }
  6535. return c.s.client.Do(req)
  6536. }
  6537. // Do executes the "youtube.activities.insert" call.
  6538. // Exactly one of *Activity or error will be non-nil. Any non-2xx status
  6539. // code is an error. Response headers are in either
  6540. // *Activity.ServerResponse.Header or (if a response was returned at
  6541. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6542. // to check whether the returned error was because
  6543. // http.StatusNotModified was returned.
  6544. func (c *ActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*Activity, error) {
  6545. gensupport.SetOptions(c.urlParams_, opts...)
  6546. res, err := c.doRequest("json")
  6547. if res != nil && res.StatusCode == http.StatusNotModified {
  6548. if res.Body != nil {
  6549. res.Body.Close()
  6550. }
  6551. return nil, &googleapi.Error{
  6552. Code: res.StatusCode,
  6553. Header: res.Header,
  6554. }
  6555. }
  6556. if err != nil {
  6557. return nil, err
  6558. }
  6559. defer googleapi.CloseBody(res)
  6560. if err := googleapi.CheckResponse(res); err != nil {
  6561. return nil, err
  6562. }
  6563. ret := &Activity{
  6564. ServerResponse: googleapi.ServerResponse{
  6565. Header: res.Header,
  6566. HTTPStatusCode: res.StatusCode,
  6567. },
  6568. }
  6569. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6570. return nil, err
  6571. }
  6572. return ret, nil
  6573. // {
  6574. // "description": "Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.)\n\nNote: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite.",
  6575. // "httpMethod": "POST",
  6576. // "id": "youtube.activities.insert",
  6577. // "parameterOrder": [
  6578. // "part"
  6579. // ],
  6580. // "parameters": {
  6581. // "part": {
  6582. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.",
  6583. // "location": "query",
  6584. // "required": true,
  6585. // "type": "string"
  6586. // }
  6587. // },
  6588. // "path": "activities",
  6589. // "request": {
  6590. // "$ref": "Activity"
  6591. // },
  6592. // "response": {
  6593. // "$ref": "Activity"
  6594. // },
  6595. // "scopes": [
  6596. // "https://www.googleapis.com/auth/youtube",
  6597. // "https://www.googleapis.com/auth/youtube.force-ssl"
  6598. // ]
  6599. // }
  6600. }
  6601. // method id "youtube.activities.list":
  6602. type ActivitiesListCall struct {
  6603. s *Service
  6604. urlParams_ gensupport.URLParams
  6605. ifNoneMatch_ string
  6606. ctx_ context.Context
  6607. }
  6608. // List: Returns a list of channel activity events that match the
  6609. // request criteria. For example, you can retrieve events associated
  6610. // with a particular channel, events associated with the user's
  6611. // subscriptions and Google+ friends, or the YouTube home page feed,
  6612. // which is customized for each user.
  6613. func (r *ActivitiesService) List(part string) *ActivitiesListCall {
  6614. c := &ActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6615. c.urlParams_.Set("part", part)
  6616. return c
  6617. }
  6618. // ChannelId sets the optional parameter "channelId": The channelId
  6619. // parameter specifies a unique YouTube channel ID. The API will then
  6620. // return a list of that channel's activities.
  6621. func (c *ActivitiesListCall) ChannelId(channelId string) *ActivitiesListCall {
  6622. c.urlParams_.Set("channelId", channelId)
  6623. return c
  6624. }
  6625. // Home sets the optional parameter "home": Set this parameter's value
  6626. // to true to retrieve the activity feed that displays on the YouTube
  6627. // home page for the currently authenticated user.
  6628. func (c *ActivitiesListCall) Home(home bool) *ActivitiesListCall {
  6629. c.urlParams_.Set("home", fmt.Sprint(home))
  6630. return c
  6631. }
  6632. // MaxResults sets the optional parameter "maxResults": The maxResults
  6633. // parameter specifies the maximum number of items that should be
  6634. // returned in the result set.
  6635. func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall {
  6636. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6637. return c
  6638. }
  6639. // Mine sets the optional parameter "mine": Set this parameter's value
  6640. // to true to retrieve a feed of the authenticated user's activities.
  6641. func (c *ActivitiesListCall) Mine(mine bool) *ActivitiesListCall {
  6642. c.urlParams_.Set("mine", fmt.Sprint(mine))
  6643. return c
  6644. }
  6645. // PageToken sets the optional parameter "pageToken": The pageToken
  6646. // parameter identifies a specific page in the result set that should be
  6647. // returned. In an API response, the nextPageToken and prevPageToken
  6648. // properties identify other pages that could be retrieved.
  6649. func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall {
  6650. c.urlParams_.Set("pageToken", pageToken)
  6651. return c
  6652. }
  6653. // PublishedAfter sets the optional parameter "publishedAfter": The
  6654. // publishedAfter parameter specifies the earliest date and time that an
  6655. // activity could have occurred for that activity to be included in the
  6656. // API response. If the parameter value specifies a day, but not a time,
  6657. // then any activities that occurred that day will be included in the
  6658. // result set. The value is specified in ISO 8601
  6659. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  6660. func (c *ActivitiesListCall) PublishedAfter(publishedAfter string) *ActivitiesListCall {
  6661. c.urlParams_.Set("publishedAfter", publishedAfter)
  6662. return c
  6663. }
  6664. // PublishedBefore sets the optional parameter "publishedBefore": The
  6665. // publishedBefore parameter specifies the date and time before which an
  6666. // activity must have occurred for that activity to be included in the
  6667. // API response. If the parameter value specifies a day, but not a time,
  6668. // then any activities that occurred that day will be excluded from the
  6669. // result set. The value is specified in ISO 8601
  6670. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  6671. func (c *ActivitiesListCall) PublishedBefore(publishedBefore string) *ActivitiesListCall {
  6672. c.urlParams_.Set("publishedBefore", publishedBefore)
  6673. return c
  6674. }
  6675. // RegionCode sets the optional parameter "regionCode": The regionCode
  6676. // parameter instructs the API to return results for the specified
  6677. // country. The parameter value is an ISO 3166-1 alpha-2 country code.
  6678. // YouTube uses this value when the authorized user's previous activity
  6679. // on YouTube does not provide enough information to generate the
  6680. // activity feed.
  6681. func (c *ActivitiesListCall) RegionCode(regionCode string) *ActivitiesListCall {
  6682. c.urlParams_.Set("regionCode", regionCode)
  6683. return c
  6684. }
  6685. // Fields allows partial responses to be retrieved. See
  6686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6687. // for more information.
  6688. func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall {
  6689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6690. return c
  6691. }
  6692. // IfNoneMatch sets the optional parameter which makes the operation
  6693. // fail if the object's ETag matches the given value. This is useful for
  6694. // getting updates only after the object has changed since the last
  6695. // request. Use googleapi.IsNotModified to check whether the response
  6696. // error from Do is the result of In-None-Match.
  6697. func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall {
  6698. c.ifNoneMatch_ = entityTag
  6699. return c
  6700. }
  6701. // Context sets the context to be used in this call's Do method. Any
  6702. // pending HTTP request will be aborted if the provided context is
  6703. // canceled.
  6704. func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall {
  6705. c.ctx_ = ctx
  6706. return c
  6707. }
  6708. func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  6709. var body io.Reader = nil
  6710. c.urlParams_.Set("alt", alt)
  6711. urls := googleapi.ResolveRelative(c.s.BasePath, "activities")
  6712. urls += "?" + c.urlParams_.Encode()
  6713. req, _ := http.NewRequest("GET", urls, body)
  6714. googleapi.SetOpaque(req.URL)
  6715. req.Header.Set("User-Agent", c.s.userAgent())
  6716. if c.ifNoneMatch_ != "" {
  6717. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6718. }
  6719. if c.ctx_ != nil {
  6720. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6721. }
  6722. return c.s.client.Do(req)
  6723. }
  6724. // Do executes the "youtube.activities.list" call.
  6725. // Exactly one of *ActivityListResponse or error will be non-nil. Any
  6726. // non-2xx status code is an error. Response headers are in either
  6727. // *ActivityListResponse.ServerResponse.Header or (if a response was
  6728. // returned at all) in error.(*googleapi.Error).Header. Use
  6729. // googleapi.IsNotModified to check whether the returned error was
  6730. // because http.StatusNotModified was returned.
  6731. func (c *ActivitiesListCall) Do(opts ...googleapi.CallOption) (*ActivityListResponse, error) {
  6732. gensupport.SetOptions(c.urlParams_, opts...)
  6733. res, err := c.doRequest("json")
  6734. if res != nil && res.StatusCode == http.StatusNotModified {
  6735. if res.Body != nil {
  6736. res.Body.Close()
  6737. }
  6738. return nil, &googleapi.Error{
  6739. Code: res.StatusCode,
  6740. Header: res.Header,
  6741. }
  6742. }
  6743. if err != nil {
  6744. return nil, err
  6745. }
  6746. defer googleapi.CloseBody(res)
  6747. if err := googleapi.CheckResponse(res); err != nil {
  6748. return nil, err
  6749. }
  6750. ret := &ActivityListResponse{
  6751. ServerResponse: googleapi.ServerResponse{
  6752. Header: res.Header,
  6753. HTTPStatusCode: res.StatusCode,
  6754. },
  6755. }
  6756. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6757. return nil, err
  6758. }
  6759. return ret, nil
  6760. // {
  6761. // "description": "Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user.",
  6762. // "httpMethod": "GET",
  6763. // "id": "youtube.activities.list",
  6764. // "parameterOrder": [
  6765. // "part"
  6766. // ],
  6767. // "parameters": {
  6768. // "channelId": {
  6769. // "description": "The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities.",
  6770. // "location": "query",
  6771. // "type": "string"
  6772. // },
  6773. // "home": {
  6774. // "description": "Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user.",
  6775. // "location": "query",
  6776. // "type": "boolean"
  6777. // },
  6778. // "maxResults": {
  6779. // "default": "5",
  6780. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  6781. // "format": "uint32",
  6782. // "location": "query",
  6783. // "maximum": "50",
  6784. // "minimum": "0",
  6785. // "type": "integer"
  6786. // },
  6787. // "mine": {
  6788. // "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's activities.",
  6789. // "location": "query",
  6790. // "type": "boolean"
  6791. // },
  6792. // "pageToken": {
  6793. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  6794. // "location": "query",
  6795. // "type": "string"
  6796. // },
  6797. // "part": {
  6798. // "description": "The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.",
  6799. // "location": "query",
  6800. // "required": true,
  6801. // "type": "string"
  6802. // },
  6803. // "publishedAfter": {
  6804. // "description": "The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.",
  6805. // "format": "date-time",
  6806. // "location": "query",
  6807. // "type": "string"
  6808. // },
  6809. // "publishedBefore": {
  6810. // "description": "The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.",
  6811. // "format": "date-time",
  6812. // "location": "query",
  6813. // "type": "string"
  6814. // },
  6815. // "regionCode": {
  6816. // "description": "The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube uses this value when the authorized user's previous activity on YouTube does not provide enough information to generate the activity feed.",
  6817. // "location": "query",
  6818. // "type": "string"
  6819. // }
  6820. // },
  6821. // "path": "activities",
  6822. // "response": {
  6823. // "$ref": "ActivityListResponse"
  6824. // },
  6825. // "scopes": [
  6826. // "https://www.googleapis.com/auth/youtube",
  6827. // "https://www.googleapis.com/auth/youtube.force-ssl",
  6828. // "https://www.googleapis.com/auth/youtube.readonly"
  6829. // ]
  6830. // }
  6831. }
  6832. // Pages invokes f for each page of results.
  6833. // A non-nil error returned from f will halt the iteration.
  6834. // The provided context supersedes any context provided to the Context method.
  6835. func (c *ActivitiesListCall) Pages(ctx context.Context, f func(*ActivityListResponse) error) error {
  6836. c.ctx_ = ctx
  6837. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6838. for {
  6839. x, err := c.Do()
  6840. if err != nil {
  6841. return err
  6842. }
  6843. if err := f(x); err != nil {
  6844. return err
  6845. }
  6846. if x.NextPageToken == "" {
  6847. return nil
  6848. }
  6849. c.PageToken(x.NextPageToken)
  6850. }
  6851. }
  6852. // method id "youtube.captions.delete":
  6853. type CaptionsDeleteCall struct {
  6854. s *Service
  6855. urlParams_ gensupport.URLParams
  6856. ctx_ context.Context
  6857. }
  6858. // Delete: Deletes a specified caption track.
  6859. func (r *CaptionsService) Delete(id string) *CaptionsDeleteCall {
  6860. c := &CaptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6861. c.urlParams_.Set("id", id)
  6862. return c
  6863. }
  6864. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  6865. // Google+ Page for the channel that the request is be on behalf of
  6866. func (c *CaptionsDeleteCall) OnBehalfOf(onBehalfOf string) *CaptionsDeleteCall {
  6867. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  6868. return c
  6869. }
  6870. // OnBehalfOfContentOwner sets the optional parameter
  6871. // "onBehalfOfContentOwner": Note: This parameter is intended
  6872. // exclusively for YouTube content partners.
  6873. //
  6874. // The onBehalfOfContentOwner parameter indicates that the request's
  6875. // authorization credentials identify a YouTube CMS user who is acting
  6876. // on behalf of the content owner specified in the parameter value. This
  6877. // parameter is intended for YouTube content partners that own and
  6878. // manage many different YouTube channels. It allows content owners to
  6879. // authenticate once and get access to all their video and channel data,
  6880. // without having to provide authentication credentials for each
  6881. // individual channel. The actual CMS account that the user
  6882. // authenticates with must be linked to the specified YouTube content
  6883. // owner.
  6884. func (c *CaptionsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsDeleteCall {
  6885. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  6886. return c
  6887. }
  6888. // Fields allows partial responses to be retrieved. See
  6889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6890. // for more information.
  6891. func (c *CaptionsDeleteCall) Fields(s ...googleapi.Field) *CaptionsDeleteCall {
  6892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6893. return c
  6894. }
  6895. // Context sets the context to be used in this call's Do method. Any
  6896. // pending HTTP request will be aborted if the provided context is
  6897. // canceled.
  6898. func (c *CaptionsDeleteCall) Context(ctx context.Context) *CaptionsDeleteCall {
  6899. c.ctx_ = ctx
  6900. return c
  6901. }
  6902. func (c *CaptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6903. var body io.Reader = nil
  6904. c.urlParams_.Set("alt", alt)
  6905. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  6906. urls += "?" + c.urlParams_.Encode()
  6907. req, _ := http.NewRequest("DELETE", urls, body)
  6908. googleapi.SetOpaque(req.URL)
  6909. req.Header.Set("User-Agent", c.s.userAgent())
  6910. if c.ctx_ != nil {
  6911. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6912. }
  6913. return c.s.client.Do(req)
  6914. }
  6915. // Do executes the "youtube.captions.delete" call.
  6916. func (c *CaptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  6917. gensupport.SetOptions(c.urlParams_, opts...)
  6918. res, err := c.doRequest("json")
  6919. if err != nil {
  6920. return err
  6921. }
  6922. defer googleapi.CloseBody(res)
  6923. if err := googleapi.CheckResponse(res); err != nil {
  6924. return err
  6925. }
  6926. return nil
  6927. // {
  6928. // "description": "Deletes a specified caption track.",
  6929. // "httpMethod": "DELETE",
  6930. // "id": "youtube.captions.delete",
  6931. // "parameterOrder": [
  6932. // "id"
  6933. // ],
  6934. // "parameters": {
  6935. // "id": {
  6936. // "description": "The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource.",
  6937. // "location": "query",
  6938. // "required": true,
  6939. // "type": "string"
  6940. // },
  6941. // "onBehalfOf": {
  6942. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  6943. // "location": "query",
  6944. // "type": "string"
  6945. // },
  6946. // "onBehalfOfContentOwner": {
  6947. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  6948. // "location": "query",
  6949. // "type": "string"
  6950. // }
  6951. // },
  6952. // "path": "captions",
  6953. // "scopes": [
  6954. // "https://www.googleapis.com/auth/youtube.force-ssl",
  6955. // "https://www.googleapis.com/auth/youtubepartner"
  6956. // ]
  6957. // }
  6958. }
  6959. // method id "youtube.captions.download":
  6960. type CaptionsDownloadCall struct {
  6961. s *Service
  6962. id string
  6963. urlParams_ gensupport.URLParams
  6964. ifNoneMatch_ string
  6965. ctx_ context.Context
  6966. }
  6967. // Download: Downloads a caption track. The caption track is returned in
  6968. // its original format unless the request specifies a value for the tfmt
  6969. // parameter and in its original language unless the request specifies a
  6970. // value for the tlang parameter.
  6971. func (r *CaptionsService) Download(id string) *CaptionsDownloadCall {
  6972. c := &CaptionsDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6973. c.id = id
  6974. return c
  6975. }
  6976. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  6977. // Google+ Page for the channel that the request is be on behalf of
  6978. func (c *CaptionsDownloadCall) OnBehalfOf(onBehalfOf string) *CaptionsDownloadCall {
  6979. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  6980. return c
  6981. }
  6982. // OnBehalfOfContentOwner sets the optional parameter
  6983. // "onBehalfOfContentOwner": Note: This parameter is intended
  6984. // exclusively for YouTube content partners.
  6985. //
  6986. // The onBehalfOfContentOwner parameter indicates that the request's
  6987. // authorization credentials identify a YouTube CMS user who is acting
  6988. // on behalf of the content owner specified in the parameter value. This
  6989. // parameter is intended for YouTube content partners that own and
  6990. // manage many different YouTube channels. It allows content owners to
  6991. // authenticate once and get access to all their video and channel data,
  6992. // without having to provide authentication credentials for each
  6993. // individual channel. The actual CMS account that the user
  6994. // authenticates with must be linked to the specified YouTube content
  6995. // owner.
  6996. func (c *CaptionsDownloadCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsDownloadCall {
  6997. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  6998. return c
  6999. }
  7000. // Tfmt sets the optional parameter "tfmt": The tfmt parameter specifies
  7001. // that the caption track should be returned in a specific format. If
  7002. // the parameter is not included in the request, the track is returned
  7003. // in its original format.
  7004. //
  7005. // Possible values:
  7006. // "sbv" - SubViewer subtitle.
  7007. // "scc" - Scenarist Closed Caption format.
  7008. // "srt" - SubRip subtitle.
  7009. // "ttml" - Timed Text Markup Language caption.
  7010. // "vtt" - Web Video Text Tracks caption.
  7011. func (c *CaptionsDownloadCall) Tfmt(tfmt string) *CaptionsDownloadCall {
  7012. c.urlParams_.Set("tfmt", tfmt)
  7013. return c
  7014. }
  7015. // Tlang sets the optional parameter "tlang": The tlang parameter
  7016. // specifies that the API response should return a translation of the
  7017. // specified caption track. The parameter value is an ISO 639-1
  7018. // two-letter language code that identifies the desired caption
  7019. // language. The translation is generated by using machine translation,
  7020. // such as Google Translate.
  7021. func (c *CaptionsDownloadCall) Tlang(tlang string) *CaptionsDownloadCall {
  7022. c.urlParams_.Set("tlang", tlang)
  7023. return c
  7024. }
  7025. // Fields allows partial responses to be retrieved. See
  7026. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7027. // for more information.
  7028. func (c *CaptionsDownloadCall) Fields(s ...googleapi.Field) *CaptionsDownloadCall {
  7029. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7030. return c
  7031. }
  7032. // IfNoneMatch sets the optional parameter which makes the operation
  7033. // fail if the object's ETag matches the given value. This is useful for
  7034. // getting updates only after the object has changed since the last
  7035. // request. Use googleapi.IsNotModified to check whether the response
  7036. // error from Do is the result of In-None-Match.
  7037. func (c *CaptionsDownloadCall) IfNoneMatch(entityTag string) *CaptionsDownloadCall {
  7038. c.ifNoneMatch_ = entityTag
  7039. return c
  7040. }
  7041. // Context sets the context to be used in this call's Do and Download
  7042. // methods. Any pending HTTP request will be aborted if the provided
  7043. // context is canceled.
  7044. func (c *CaptionsDownloadCall) Context(ctx context.Context) *CaptionsDownloadCall {
  7045. c.ctx_ = ctx
  7046. return c
  7047. }
  7048. func (c *CaptionsDownloadCall) doRequest(alt string) (*http.Response, error) {
  7049. var body io.Reader = nil
  7050. c.urlParams_.Set("alt", alt)
  7051. urls := googleapi.ResolveRelative(c.s.BasePath, "captions/{id}")
  7052. urls += "?" + c.urlParams_.Encode()
  7053. req, _ := http.NewRequest("GET", urls, body)
  7054. googleapi.Expand(req.URL, map[string]string{
  7055. "id": c.id,
  7056. })
  7057. req.Header.Set("User-Agent", c.s.userAgent())
  7058. if c.ifNoneMatch_ != "" {
  7059. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7060. }
  7061. if c.ctx_ != nil {
  7062. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7063. }
  7064. return c.s.client.Do(req)
  7065. }
  7066. // Download fetches the API endpoint's "media" value, instead of the normal
  7067. // API response value. If the returned error is nil, the Response is guaranteed to
  7068. // have a 2xx status code. Callers must close the Response.Body as usual.
  7069. func (c *CaptionsDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  7070. gensupport.SetOptions(c.urlParams_, opts...)
  7071. res, err := c.doRequest("media")
  7072. if err != nil {
  7073. return nil, err
  7074. }
  7075. if err := googleapi.CheckMediaResponse(res); err != nil {
  7076. res.Body.Close()
  7077. return nil, err
  7078. }
  7079. return res, nil
  7080. }
  7081. // Do executes the "youtube.captions.download" call.
  7082. func (c *CaptionsDownloadCall) Do(opts ...googleapi.CallOption) error {
  7083. gensupport.SetOptions(c.urlParams_, opts...)
  7084. res, err := c.doRequest("json")
  7085. if err != nil {
  7086. return err
  7087. }
  7088. defer googleapi.CloseBody(res)
  7089. if err := googleapi.CheckResponse(res); err != nil {
  7090. return err
  7091. }
  7092. return nil
  7093. // {
  7094. // "description": "Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter.",
  7095. // "httpMethod": "GET",
  7096. // "id": "youtube.captions.download",
  7097. // "parameterOrder": [
  7098. // "id"
  7099. // ],
  7100. // "parameters": {
  7101. // "id": {
  7102. // "description": "The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource.",
  7103. // "location": "path",
  7104. // "required": true,
  7105. // "type": "string"
  7106. // },
  7107. // "onBehalfOf": {
  7108. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  7109. // "location": "query",
  7110. // "type": "string"
  7111. // },
  7112. // "onBehalfOfContentOwner": {
  7113. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  7114. // "location": "query",
  7115. // "type": "string"
  7116. // },
  7117. // "tfmt": {
  7118. // "description": "The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format.",
  7119. // "enum": [
  7120. // "sbv",
  7121. // "scc",
  7122. // "srt",
  7123. // "ttml",
  7124. // "vtt"
  7125. // ],
  7126. // "enumDescriptions": [
  7127. // "SubViewer subtitle.",
  7128. // "Scenarist Closed Caption format.",
  7129. // "SubRip subtitle.",
  7130. // "Timed Text Markup Language caption.",
  7131. // "Web Video Text Tracks caption."
  7132. // ],
  7133. // "location": "query",
  7134. // "type": "string"
  7135. // },
  7136. // "tlang": {
  7137. // "description": "The tlang parameter specifies that the API response should return a translation of the specified caption track. The parameter value is an ISO 639-1 two-letter language code that identifies the desired caption language. The translation is generated by using machine translation, such as Google Translate.",
  7138. // "location": "query",
  7139. // "type": "string"
  7140. // }
  7141. // },
  7142. // "path": "captions/{id}",
  7143. // "scopes": [
  7144. // "https://www.googleapis.com/auth/youtube.force-ssl",
  7145. // "https://www.googleapis.com/auth/youtubepartner"
  7146. // ],
  7147. // "supportsMediaDownload": true
  7148. // }
  7149. }
  7150. // method id "youtube.captions.insert":
  7151. type CaptionsInsertCall struct {
  7152. s *Service
  7153. caption *Caption
  7154. urlParams_ gensupport.URLParams
  7155. media_ io.Reader
  7156. resumableBuffer_ *gensupport.ResumableBuffer
  7157. mediaType_ string
  7158. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  7159. progressUpdater_ googleapi.ProgressUpdater
  7160. ctx_ context.Context
  7161. }
  7162. // Insert: Uploads a caption track.
  7163. func (r *CaptionsService) Insert(part string, caption *Caption) *CaptionsInsertCall {
  7164. c := &CaptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7165. c.urlParams_.Set("part", part)
  7166. c.caption = caption
  7167. return c
  7168. }
  7169. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  7170. // Google+ Page for the channel that the request is be on behalf of
  7171. func (c *CaptionsInsertCall) OnBehalfOf(onBehalfOf string) *CaptionsInsertCall {
  7172. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  7173. return c
  7174. }
  7175. // OnBehalfOfContentOwner sets the optional parameter
  7176. // "onBehalfOfContentOwner": Note: This parameter is intended
  7177. // exclusively for YouTube content partners.
  7178. //
  7179. // The onBehalfOfContentOwner parameter indicates that the request's
  7180. // authorization credentials identify a YouTube CMS user who is acting
  7181. // on behalf of the content owner specified in the parameter value. This
  7182. // parameter is intended for YouTube content partners that own and
  7183. // manage many different YouTube channels. It allows content owners to
  7184. // authenticate once and get access to all their video and channel data,
  7185. // without having to provide authentication credentials for each
  7186. // individual channel. The actual CMS account that the user
  7187. // authenticates with must be linked to the specified YouTube content
  7188. // owner.
  7189. func (c *CaptionsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsInsertCall {
  7190. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  7191. return c
  7192. }
  7193. // Sync sets the optional parameter "sync": The sync parameter indicates
  7194. // whether YouTube should automatically synchronize the caption file
  7195. // with the audio track of the video. If you set the value to true,
  7196. // YouTube will disregard any time codes that are in the uploaded
  7197. // caption file and generate new time codes for the captions.
  7198. //
  7199. // You should set the sync parameter to true if you are uploading a
  7200. // transcript, which has no time codes, or if you suspect the time codes
  7201. // in your file are incorrect and want YouTube to try to fix them.
  7202. func (c *CaptionsInsertCall) Sync(sync bool) *CaptionsInsertCall {
  7203. c.urlParams_.Set("sync", fmt.Sprint(sync))
  7204. return c
  7205. }
  7206. // Media specifies the media to upload in one or more chunks. The chunk
  7207. // size may be controlled by supplying a MediaOption generated by
  7208. // googleapi.ChunkSize. The chunk size defaults to
  7209. // googleapi.DefaultUploadChunkSize.
  7210. // At most one of Media and ResumableMedia may be set.
  7211. func (c *CaptionsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CaptionsInsertCall {
  7212. opts := googleapi.ProcessMediaOptions(options)
  7213. chunkSize := opts.ChunkSize
  7214. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  7215. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  7216. return c
  7217. }
  7218. // ResumableMedia specifies the media to upload in chunks and can be
  7219. // canceled with ctx.
  7220. //
  7221. // Deprecated: use Media instead.
  7222. //
  7223. // At most one of Media and ResumableMedia may be set. mediaType
  7224. // identifies the MIME media type of the upload, such as "image/png". If
  7225. // mediaType is "", it will be auto-detected. The provided ctx will
  7226. // supersede any context previously provided to the Context method.
  7227. func (c *CaptionsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CaptionsInsertCall {
  7228. c.ctx_ = ctx
  7229. rdr := gensupport.ReaderAtToReader(r, size)
  7230. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  7231. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  7232. c.media_ = nil
  7233. c.mediaSize_ = size
  7234. return c
  7235. }
  7236. // ProgressUpdater provides a callback function that will be called
  7237. // after every chunk. It should be a low-latency function in order to
  7238. // not slow down the upload operation. This should only be called when
  7239. // using ResumableMedia (as opposed to Media).
  7240. func (c *CaptionsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CaptionsInsertCall {
  7241. c.progressUpdater_ = pu
  7242. return c
  7243. }
  7244. // Fields allows partial responses to be retrieved. See
  7245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7246. // for more information.
  7247. func (c *CaptionsInsertCall) Fields(s ...googleapi.Field) *CaptionsInsertCall {
  7248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7249. return c
  7250. }
  7251. // Context sets the context to be used in this call's Do method. Any
  7252. // pending HTTP request will be aborted if the provided context is
  7253. // canceled.
  7254. // This context will supersede any context previously provided to the
  7255. // ResumableMedia method.
  7256. func (c *CaptionsInsertCall) Context(ctx context.Context) *CaptionsInsertCall {
  7257. c.ctx_ = ctx
  7258. return c
  7259. }
  7260. func (c *CaptionsInsertCall) doRequest(alt string) (*http.Response, error) {
  7261. var body io.Reader = nil
  7262. body, err := googleapi.WithoutDataWrapper.JSONReader(c.caption)
  7263. if err != nil {
  7264. return nil, err
  7265. }
  7266. ctype := "application/json"
  7267. c.urlParams_.Set("alt", alt)
  7268. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  7269. if c.media_ != nil || c.resumableBuffer_ != nil {
  7270. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  7271. protocol := "multipart"
  7272. if c.resumableBuffer_ != nil {
  7273. protocol = "resumable"
  7274. }
  7275. c.urlParams_.Set("uploadType", protocol)
  7276. }
  7277. urls += "?" + c.urlParams_.Encode()
  7278. if c.media_ != nil {
  7279. var combined io.ReadCloser
  7280. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  7281. defer combined.Close()
  7282. body = combined
  7283. }
  7284. req, _ := http.NewRequest("POST", urls, body)
  7285. googleapi.SetOpaque(req.URL)
  7286. if c.resumableBuffer_ != nil {
  7287. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  7288. }
  7289. req.Header.Set("Content-Type", ctype)
  7290. req.Header.Set("User-Agent", c.s.userAgent())
  7291. if c.ctx_ != nil {
  7292. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7293. }
  7294. return c.s.client.Do(req)
  7295. }
  7296. // Do executes the "youtube.captions.insert" call.
  7297. // Exactly one of *Caption or error will be non-nil. Any non-2xx status
  7298. // code is an error. Response headers are in either
  7299. // *Caption.ServerResponse.Header or (if a response was returned at all)
  7300. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7301. // check whether the returned error was because http.StatusNotModified
  7302. // was returned.
  7303. func (c *CaptionsInsertCall) Do(opts ...googleapi.CallOption) (*Caption, error) {
  7304. gensupport.SetOptions(c.urlParams_, opts...)
  7305. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  7306. return c.doRequest("json")
  7307. }, gensupport.DefaultBackoffStrategy())
  7308. if res != nil && res.StatusCode == http.StatusNotModified {
  7309. if res.Body != nil {
  7310. res.Body.Close()
  7311. }
  7312. return nil, &googleapi.Error{
  7313. Code: res.StatusCode,
  7314. Header: res.Header,
  7315. }
  7316. }
  7317. if err != nil {
  7318. return nil, err
  7319. }
  7320. defer googleapi.CloseBody(res)
  7321. if err := googleapi.CheckResponse(res); err != nil {
  7322. return nil, err
  7323. }
  7324. if c.resumableBuffer_ != nil {
  7325. loc := res.Header.Get("Location")
  7326. rx := &gensupport.ResumableUpload{
  7327. Client: c.s.client,
  7328. UserAgent: c.s.userAgent(),
  7329. URI: loc,
  7330. Media: c.resumableBuffer_,
  7331. MediaType: c.mediaType_,
  7332. Callback: func(curr int64) {
  7333. if c.progressUpdater_ != nil {
  7334. c.progressUpdater_(curr, c.mediaSize_)
  7335. }
  7336. },
  7337. }
  7338. ctx := c.ctx_
  7339. if ctx == nil {
  7340. ctx = context.TODO()
  7341. }
  7342. res, err = rx.Upload(ctx)
  7343. if err != nil {
  7344. return nil, err
  7345. }
  7346. defer res.Body.Close()
  7347. if err := googleapi.CheckResponse(res); err != nil {
  7348. return nil, err
  7349. }
  7350. }
  7351. ret := &Caption{
  7352. ServerResponse: googleapi.ServerResponse{
  7353. Header: res.Header,
  7354. HTTPStatusCode: res.StatusCode,
  7355. },
  7356. }
  7357. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7358. return nil, err
  7359. }
  7360. return ret, nil
  7361. // {
  7362. // "description": "Uploads a caption track.",
  7363. // "httpMethod": "POST",
  7364. // "id": "youtube.captions.insert",
  7365. // "mediaUpload": {
  7366. // "accept": [
  7367. // "*/*",
  7368. // "application/octet-stream",
  7369. // "text/xml"
  7370. // ],
  7371. // "maxSize": "100MB",
  7372. // "protocols": {
  7373. // "resumable": {
  7374. // "multipart": true,
  7375. // "path": "/resumable/upload/youtube/v3/captions"
  7376. // },
  7377. // "simple": {
  7378. // "multipart": true,
  7379. // "path": "/upload/youtube/v3/captions"
  7380. // }
  7381. // }
  7382. // },
  7383. // "parameterOrder": [
  7384. // "part"
  7385. // ],
  7386. // "parameters": {
  7387. // "onBehalfOf": {
  7388. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  7389. // "location": "query",
  7390. // "type": "string"
  7391. // },
  7392. // "onBehalfOfContentOwner": {
  7393. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  7394. // "location": "query",
  7395. // "type": "string"
  7396. // },
  7397. // "part": {
  7398. // "description": "The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.",
  7399. // "location": "query",
  7400. // "required": true,
  7401. // "type": "string"
  7402. // },
  7403. // "sync": {
  7404. // "description": "The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will disregard any time codes that are in the uploaded caption file and generate new time codes for the captions.\n\nYou should set the sync parameter to true if you are uploading a transcript, which has no time codes, or if you suspect the time codes in your file are incorrect and want YouTube to try to fix them.",
  7405. // "location": "query",
  7406. // "type": "boolean"
  7407. // }
  7408. // },
  7409. // "path": "captions",
  7410. // "request": {
  7411. // "$ref": "Caption"
  7412. // },
  7413. // "response": {
  7414. // "$ref": "Caption"
  7415. // },
  7416. // "scopes": [
  7417. // "https://www.googleapis.com/auth/youtube.force-ssl",
  7418. // "https://www.googleapis.com/auth/youtubepartner"
  7419. // ],
  7420. // "supportsMediaUpload": true
  7421. // }
  7422. }
  7423. // method id "youtube.captions.list":
  7424. type CaptionsListCall struct {
  7425. s *Service
  7426. urlParams_ gensupport.URLParams
  7427. ifNoneMatch_ string
  7428. ctx_ context.Context
  7429. }
  7430. // List: Returns a list of caption tracks that are associated with a
  7431. // specified video. Note that the API response does not contain the
  7432. // actual captions and that the captions.download method provides the
  7433. // ability to retrieve a caption track.
  7434. func (r *CaptionsService) List(part string, videoId string) *CaptionsListCall {
  7435. c := &CaptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7436. c.urlParams_.Set("part", part)
  7437. c.urlParams_.Set("videoId", videoId)
  7438. return c
  7439. }
  7440. // Id sets the optional parameter "id": The id parameter specifies a
  7441. // comma-separated list of IDs that identify the caption resources that
  7442. // should be retrieved. Each ID must identify a caption track associated
  7443. // with the specified video.
  7444. func (c *CaptionsListCall) Id(id string) *CaptionsListCall {
  7445. c.urlParams_.Set("id", id)
  7446. return c
  7447. }
  7448. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  7449. // Google+ Page for the channel that the request is on behalf of.
  7450. func (c *CaptionsListCall) OnBehalfOf(onBehalfOf string) *CaptionsListCall {
  7451. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  7452. return c
  7453. }
  7454. // OnBehalfOfContentOwner sets the optional parameter
  7455. // "onBehalfOfContentOwner": Note: This parameter is intended
  7456. // exclusively for YouTube content partners.
  7457. //
  7458. // The onBehalfOfContentOwner parameter indicates that the request's
  7459. // authorization credentials identify a YouTube CMS user who is acting
  7460. // on behalf of the content owner specified in the parameter value. This
  7461. // parameter is intended for YouTube content partners that own and
  7462. // manage many different YouTube channels. It allows content owners to
  7463. // authenticate once and get access to all their video and channel data,
  7464. // without having to provide authentication credentials for each
  7465. // individual channel. The actual CMS account that the user
  7466. // authenticates with must be linked to the specified YouTube content
  7467. // owner.
  7468. func (c *CaptionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsListCall {
  7469. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  7470. return c
  7471. }
  7472. // Fields allows partial responses to be retrieved. See
  7473. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7474. // for more information.
  7475. func (c *CaptionsListCall) Fields(s ...googleapi.Field) *CaptionsListCall {
  7476. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7477. return c
  7478. }
  7479. // IfNoneMatch sets the optional parameter which makes the operation
  7480. // fail if the object's ETag matches the given value. This is useful for
  7481. // getting updates only after the object has changed since the last
  7482. // request. Use googleapi.IsNotModified to check whether the response
  7483. // error from Do is the result of In-None-Match.
  7484. func (c *CaptionsListCall) IfNoneMatch(entityTag string) *CaptionsListCall {
  7485. c.ifNoneMatch_ = entityTag
  7486. return c
  7487. }
  7488. // Context sets the context to be used in this call's Do method. Any
  7489. // pending HTTP request will be aborted if the provided context is
  7490. // canceled.
  7491. func (c *CaptionsListCall) Context(ctx context.Context) *CaptionsListCall {
  7492. c.ctx_ = ctx
  7493. return c
  7494. }
  7495. func (c *CaptionsListCall) doRequest(alt string) (*http.Response, error) {
  7496. var body io.Reader = nil
  7497. c.urlParams_.Set("alt", alt)
  7498. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  7499. urls += "?" + c.urlParams_.Encode()
  7500. req, _ := http.NewRequest("GET", urls, body)
  7501. googleapi.SetOpaque(req.URL)
  7502. req.Header.Set("User-Agent", c.s.userAgent())
  7503. if c.ifNoneMatch_ != "" {
  7504. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7505. }
  7506. if c.ctx_ != nil {
  7507. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7508. }
  7509. return c.s.client.Do(req)
  7510. }
  7511. // Do executes the "youtube.captions.list" call.
  7512. // Exactly one of *CaptionListResponse or error will be non-nil. Any
  7513. // non-2xx status code is an error. Response headers are in either
  7514. // *CaptionListResponse.ServerResponse.Header or (if a response was
  7515. // returned at all) in error.(*googleapi.Error).Header. Use
  7516. // googleapi.IsNotModified to check whether the returned error was
  7517. // because http.StatusNotModified was returned.
  7518. func (c *CaptionsListCall) Do(opts ...googleapi.CallOption) (*CaptionListResponse, error) {
  7519. gensupport.SetOptions(c.urlParams_, opts...)
  7520. res, err := c.doRequest("json")
  7521. if res != nil && res.StatusCode == http.StatusNotModified {
  7522. if res.Body != nil {
  7523. res.Body.Close()
  7524. }
  7525. return nil, &googleapi.Error{
  7526. Code: res.StatusCode,
  7527. Header: res.Header,
  7528. }
  7529. }
  7530. if err != nil {
  7531. return nil, err
  7532. }
  7533. defer googleapi.CloseBody(res)
  7534. if err := googleapi.CheckResponse(res); err != nil {
  7535. return nil, err
  7536. }
  7537. ret := &CaptionListResponse{
  7538. ServerResponse: googleapi.ServerResponse{
  7539. Header: res.Header,
  7540. HTTPStatusCode: res.StatusCode,
  7541. },
  7542. }
  7543. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7544. return nil, err
  7545. }
  7546. return ret, nil
  7547. // {
  7548. // "description": "Returns a list of caption tracks that are associated with a specified video. Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track.",
  7549. // "httpMethod": "GET",
  7550. // "id": "youtube.captions.list",
  7551. // "parameterOrder": [
  7552. // "part",
  7553. // "videoId"
  7554. // ],
  7555. // "parameters": {
  7556. // "id": {
  7557. // "description": "The id parameter specifies a comma-separated list of IDs that identify the caption resources that should be retrieved. Each ID must identify a caption track associated with the specified video.",
  7558. // "location": "query",
  7559. // "type": "string"
  7560. // },
  7561. // "onBehalfOf": {
  7562. // "description": "ID of the Google+ Page for the channel that the request is on behalf of.",
  7563. // "location": "query",
  7564. // "type": "string"
  7565. // },
  7566. // "onBehalfOfContentOwner": {
  7567. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  7568. // "location": "query",
  7569. // "type": "string"
  7570. // },
  7571. // "part": {
  7572. // "description": "The part parameter specifies a comma-separated list of one or more caption resource parts that the API response will include. The part names that you can include in the parameter value are id and snippet.",
  7573. // "location": "query",
  7574. // "required": true,
  7575. // "type": "string"
  7576. // },
  7577. // "videoId": {
  7578. // "description": "The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks.",
  7579. // "location": "query",
  7580. // "required": true,
  7581. // "type": "string"
  7582. // }
  7583. // },
  7584. // "path": "captions",
  7585. // "response": {
  7586. // "$ref": "CaptionListResponse"
  7587. // },
  7588. // "scopes": [
  7589. // "https://www.googleapis.com/auth/youtube.force-ssl",
  7590. // "https://www.googleapis.com/auth/youtubepartner"
  7591. // ]
  7592. // }
  7593. }
  7594. // method id "youtube.captions.update":
  7595. type CaptionsUpdateCall struct {
  7596. s *Service
  7597. caption *Caption
  7598. urlParams_ gensupport.URLParams
  7599. media_ io.Reader
  7600. resumableBuffer_ *gensupport.ResumableBuffer
  7601. mediaType_ string
  7602. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  7603. progressUpdater_ googleapi.ProgressUpdater
  7604. ctx_ context.Context
  7605. }
  7606. // Update: Updates a caption track. When updating a caption track, you
  7607. // can change the track's draft status, upload a new caption file for
  7608. // the track, or both.
  7609. func (r *CaptionsService) Update(part string, caption *Caption) *CaptionsUpdateCall {
  7610. c := &CaptionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7611. c.urlParams_.Set("part", part)
  7612. c.caption = caption
  7613. return c
  7614. }
  7615. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  7616. // Google+ Page for the channel that the request is be on behalf of
  7617. func (c *CaptionsUpdateCall) OnBehalfOf(onBehalfOf string) *CaptionsUpdateCall {
  7618. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  7619. return c
  7620. }
  7621. // OnBehalfOfContentOwner sets the optional parameter
  7622. // "onBehalfOfContentOwner": Note: This parameter is intended
  7623. // exclusively for YouTube content partners.
  7624. //
  7625. // The onBehalfOfContentOwner parameter indicates that the request's
  7626. // authorization credentials identify a YouTube CMS user who is acting
  7627. // on behalf of the content owner specified in the parameter value. This
  7628. // parameter is intended for YouTube content partners that own and
  7629. // manage many different YouTube channels. It allows content owners to
  7630. // authenticate once and get access to all their video and channel data,
  7631. // without having to provide authentication credentials for each
  7632. // individual channel. The actual CMS account that the user
  7633. // authenticates with must be linked to the specified YouTube content
  7634. // owner.
  7635. func (c *CaptionsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsUpdateCall {
  7636. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  7637. return c
  7638. }
  7639. // Sync sets the optional parameter "sync": Note: The API server only
  7640. // processes the parameter value if the request contains an updated
  7641. // caption file.
  7642. //
  7643. // The sync parameter indicates whether YouTube should automatically
  7644. // synchronize the caption file with the audio track of the video. If
  7645. // you set the value to true, YouTube will automatically synchronize the
  7646. // caption track with the audio track.
  7647. func (c *CaptionsUpdateCall) Sync(sync bool) *CaptionsUpdateCall {
  7648. c.urlParams_.Set("sync", fmt.Sprint(sync))
  7649. return c
  7650. }
  7651. // Media specifies the media to upload in one or more chunks. The chunk
  7652. // size may be controlled by supplying a MediaOption generated by
  7653. // googleapi.ChunkSize. The chunk size defaults to
  7654. // googleapi.DefaultUploadChunkSize.
  7655. // At most one of Media and ResumableMedia may be set.
  7656. func (c *CaptionsUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *CaptionsUpdateCall {
  7657. opts := googleapi.ProcessMediaOptions(options)
  7658. chunkSize := opts.ChunkSize
  7659. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  7660. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  7661. return c
  7662. }
  7663. // ResumableMedia specifies the media to upload in chunks and can be
  7664. // canceled with ctx.
  7665. //
  7666. // Deprecated: use Media instead.
  7667. //
  7668. // At most one of Media and ResumableMedia may be set. mediaType
  7669. // identifies the MIME media type of the upload, such as "image/png". If
  7670. // mediaType is "", it will be auto-detected. The provided ctx will
  7671. // supersede any context previously provided to the Context method.
  7672. func (c *CaptionsUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CaptionsUpdateCall {
  7673. c.ctx_ = ctx
  7674. rdr := gensupport.ReaderAtToReader(r, size)
  7675. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  7676. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  7677. c.media_ = nil
  7678. c.mediaSize_ = size
  7679. return c
  7680. }
  7681. // ProgressUpdater provides a callback function that will be called
  7682. // after every chunk. It should be a low-latency function in order to
  7683. // not slow down the upload operation. This should only be called when
  7684. // using ResumableMedia (as opposed to Media).
  7685. func (c *CaptionsUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CaptionsUpdateCall {
  7686. c.progressUpdater_ = pu
  7687. return c
  7688. }
  7689. // Fields allows partial responses to be retrieved. See
  7690. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7691. // for more information.
  7692. func (c *CaptionsUpdateCall) Fields(s ...googleapi.Field) *CaptionsUpdateCall {
  7693. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7694. return c
  7695. }
  7696. // Context sets the context to be used in this call's Do method. Any
  7697. // pending HTTP request will be aborted if the provided context is
  7698. // canceled.
  7699. // This context will supersede any context previously provided to the
  7700. // ResumableMedia method.
  7701. func (c *CaptionsUpdateCall) Context(ctx context.Context) *CaptionsUpdateCall {
  7702. c.ctx_ = ctx
  7703. return c
  7704. }
  7705. func (c *CaptionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7706. var body io.Reader = nil
  7707. body, err := googleapi.WithoutDataWrapper.JSONReader(c.caption)
  7708. if err != nil {
  7709. return nil, err
  7710. }
  7711. ctype := "application/json"
  7712. c.urlParams_.Set("alt", alt)
  7713. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  7714. if c.media_ != nil || c.resumableBuffer_ != nil {
  7715. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  7716. protocol := "multipart"
  7717. if c.resumableBuffer_ != nil {
  7718. protocol = "resumable"
  7719. }
  7720. c.urlParams_.Set("uploadType", protocol)
  7721. }
  7722. urls += "?" + c.urlParams_.Encode()
  7723. if c.media_ != nil {
  7724. var combined io.ReadCloser
  7725. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  7726. defer combined.Close()
  7727. body = combined
  7728. }
  7729. req, _ := http.NewRequest("PUT", urls, body)
  7730. googleapi.SetOpaque(req.URL)
  7731. if c.resumableBuffer_ != nil {
  7732. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  7733. }
  7734. req.Header.Set("Content-Type", ctype)
  7735. req.Header.Set("User-Agent", c.s.userAgent())
  7736. if c.ctx_ != nil {
  7737. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7738. }
  7739. return c.s.client.Do(req)
  7740. }
  7741. // Do executes the "youtube.captions.update" call.
  7742. // Exactly one of *Caption or error will be non-nil. Any non-2xx status
  7743. // code is an error. Response headers are in either
  7744. // *Caption.ServerResponse.Header or (if a response was returned at all)
  7745. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7746. // check whether the returned error was because http.StatusNotModified
  7747. // was returned.
  7748. func (c *CaptionsUpdateCall) Do(opts ...googleapi.CallOption) (*Caption, error) {
  7749. gensupport.SetOptions(c.urlParams_, opts...)
  7750. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  7751. return c.doRequest("json")
  7752. }, gensupport.DefaultBackoffStrategy())
  7753. if res != nil && res.StatusCode == http.StatusNotModified {
  7754. if res.Body != nil {
  7755. res.Body.Close()
  7756. }
  7757. return nil, &googleapi.Error{
  7758. Code: res.StatusCode,
  7759. Header: res.Header,
  7760. }
  7761. }
  7762. if err != nil {
  7763. return nil, err
  7764. }
  7765. defer googleapi.CloseBody(res)
  7766. if err := googleapi.CheckResponse(res); err != nil {
  7767. return nil, err
  7768. }
  7769. if c.resumableBuffer_ != nil {
  7770. loc := res.Header.Get("Location")
  7771. rx := &gensupport.ResumableUpload{
  7772. Client: c.s.client,
  7773. UserAgent: c.s.userAgent(),
  7774. URI: loc,
  7775. Media: c.resumableBuffer_,
  7776. MediaType: c.mediaType_,
  7777. Callback: func(curr int64) {
  7778. if c.progressUpdater_ != nil {
  7779. c.progressUpdater_(curr, c.mediaSize_)
  7780. }
  7781. },
  7782. }
  7783. ctx := c.ctx_
  7784. if ctx == nil {
  7785. ctx = context.TODO()
  7786. }
  7787. res, err = rx.Upload(ctx)
  7788. if err != nil {
  7789. return nil, err
  7790. }
  7791. defer res.Body.Close()
  7792. if err := googleapi.CheckResponse(res); err != nil {
  7793. return nil, err
  7794. }
  7795. }
  7796. ret := &Caption{
  7797. ServerResponse: googleapi.ServerResponse{
  7798. Header: res.Header,
  7799. HTTPStatusCode: res.StatusCode,
  7800. },
  7801. }
  7802. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7803. return nil, err
  7804. }
  7805. return ret, nil
  7806. // {
  7807. // "description": "Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both.",
  7808. // "httpMethod": "PUT",
  7809. // "id": "youtube.captions.update",
  7810. // "mediaUpload": {
  7811. // "accept": [
  7812. // "*/*",
  7813. // "application/octet-stream",
  7814. // "text/xml"
  7815. // ],
  7816. // "maxSize": "100MB",
  7817. // "protocols": {
  7818. // "resumable": {
  7819. // "multipart": true,
  7820. // "path": "/resumable/upload/youtube/v3/captions"
  7821. // },
  7822. // "simple": {
  7823. // "multipart": true,
  7824. // "path": "/upload/youtube/v3/captions"
  7825. // }
  7826. // }
  7827. // },
  7828. // "parameterOrder": [
  7829. // "part"
  7830. // ],
  7831. // "parameters": {
  7832. // "onBehalfOf": {
  7833. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  7834. // "location": "query",
  7835. // "type": "string"
  7836. // },
  7837. // "onBehalfOfContentOwner": {
  7838. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  7839. // "location": "query",
  7840. // "type": "string"
  7841. // },
  7842. // "part": {
  7843. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id.",
  7844. // "location": "query",
  7845. // "required": true,
  7846. // "type": "string"
  7847. // },
  7848. // "sync": {
  7849. // "description": "Note: The API server only processes the parameter value if the request contains an updated caption file.\n\nThe sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will automatically synchronize the caption track with the audio track.",
  7850. // "location": "query",
  7851. // "type": "boolean"
  7852. // }
  7853. // },
  7854. // "path": "captions",
  7855. // "request": {
  7856. // "$ref": "Caption"
  7857. // },
  7858. // "response": {
  7859. // "$ref": "Caption"
  7860. // },
  7861. // "scopes": [
  7862. // "https://www.googleapis.com/auth/youtube.force-ssl",
  7863. // "https://www.googleapis.com/auth/youtubepartner"
  7864. // ],
  7865. // "supportsMediaUpload": true
  7866. // }
  7867. }
  7868. // method id "youtube.channelBanners.insert":
  7869. type ChannelBannersInsertCall struct {
  7870. s *Service
  7871. channelbannerresource *ChannelBannerResource
  7872. urlParams_ gensupport.URLParams
  7873. media_ io.Reader
  7874. resumableBuffer_ *gensupport.ResumableBuffer
  7875. mediaType_ string
  7876. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  7877. progressUpdater_ googleapi.ProgressUpdater
  7878. ctx_ context.Context
  7879. }
  7880. // Insert: Uploads a channel banner image to YouTube. This method
  7881. // represents the first two steps in a three-step process to update the
  7882. // banner image for a channel:
  7883. //
  7884. // - Call the channelBanners.insert method to upload the binary image
  7885. // data to YouTube. The image must have a 16:9 aspect ratio and be at
  7886. // least 2120x1192 pixels.
  7887. // - Extract the url property's value from the response that the API
  7888. // returns for step 1.
  7889. // - Call the channels.update method to update the channel's branding
  7890. // settings. Set the brandingSettings.image.bannerExternalUrl property's
  7891. // value to the URL obtained in step 2.
  7892. func (r *ChannelBannersService) Insert(channelbannerresource *ChannelBannerResource) *ChannelBannersInsertCall {
  7893. c := &ChannelBannersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7894. c.channelbannerresource = channelbannerresource
  7895. return c
  7896. }
  7897. // OnBehalfOfContentOwner sets the optional parameter
  7898. // "onBehalfOfContentOwner": Note: This parameter is intended
  7899. // exclusively for YouTube content partners.
  7900. //
  7901. // The onBehalfOfContentOwner parameter indicates that the request's
  7902. // authorization credentials identify a YouTube CMS user who is acting
  7903. // on behalf of the content owner specified in the parameter value. This
  7904. // parameter is intended for YouTube content partners that own and
  7905. // manage many different YouTube channels. It allows content owners to
  7906. // authenticate once and get access to all their video and channel data,
  7907. // without having to provide authentication credentials for each
  7908. // individual channel. The CMS account that the user authenticates with
  7909. // must be linked to the specified YouTube content owner.
  7910. func (c *ChannelBannersInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelBannersInsertCall {
  7911. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  7912. return c
  7913. }
  7914. // Media specifies the media to upload in one or more chunks. The chunk
  7915. // size may be controlled by supplying a MediaOption generated by
  7916. // googleapi.ChunkSize. The chunk size defaults to
  7917. // googleapi.DefaultUploadChunkSize.
  7918. // At most one of Media and ResumableMedia may be set.
  7919. func (c *ChannelBannersInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ChannelBannersInsertCall {
  7920. opts := googleapi.ProcessMediaOptions(options)
  7921. chunkSize := opts.ChunkSize
  7922. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  7923. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  7924. return c
  7925. }
  7926. // ResumableMedia specifies the media to upload in chunks and can be
  7927. // canceled with ctx.
  7928. //
  7929. // Deprecated: use Media instead.
  7930. //
  7931. // At most one of Media and ResumableMedia may be set. mediaType
  7932. // identifies the MIME media type of the upload, such as "image/png". If
  7933. // mediaType is "", it will be auto-detected. The provided ctx will
  7934. // supersede any context previously provided to the Context method.
  7935. func (c *ChannelBannersInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ChannelBannersInsertCall {
  7936. c.ctx_ = ctx
  7937. rdr := gensupport.ReaderAtToReader(r, size)
  7938. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  7939. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  7940. c.media_ = nil
  7941. c.mediaSize_ = size
  7942. return c
  7943. }
  7944. // ProgressUpdater provides a callback function that will be called
  7945. // after every chunk. It should be a low-latency function in order to
  7946. // not slow down the upload operation. This should only be called when
  7947. // using ResumableMedia (as opposed to Media).
  7948. func (c *ChannelBannersInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ChannelBannersInsertCall {
  7949. c.progressUpdater_ = pu
  7950. return c
  7951. }
  7952. // Fields allows partial responses to be retrieved. See
  7953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7954. // for more information.
  7955. func (c *ChannelBannersInsertCall) Fields(s ...googleapi.Field) *ChannelBannersInsertCall {
  7956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7957. return c
  7958. }
  7959. // Context sets the context to be used in this call's Do method. Any
  7960. // pending HTTP request will be aborted if the provided context is
  7961. // canceled.
  7962. // This context will supersede any context previously provided to the
  7963. // ResumableMedia method.
  7964. func (c *ChannelBannersInsertCall) Context(ctx context.Context) *ChannelBannersInsertCall {
  7965. c.ctx_ = ctx
  7966. return c
  7967. }
  7968. func (c *ChannelBannersInsertCall) doRequest(alt string) (*http.Response, error) {
  7969. var body io.Reader = nil
  7970. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelbannerresource)
  7971. if err != nil {
  7972. return nil, err
  7973. }
  7974. ctype := "application/json"
  7975. c.urlParams_.Set("alt", alt)
  7976. urls := googleapi.ResolveRelative(c.s.BasePath, "channelBanners/insert")
  7977. if c.media_ != nil || c.resumableBuffer_ != nil {
  7978. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  7979. protocol := "multipart"
  7980. if c.resumableBuffer_ != nil {
  7981. protocol = "resumable"
  7982. }
  7983. c.urlParams_.Set("uploadType", protocol)
  7984. }
  7985. urls += "?" + c.urlParams_.Encode()
  7986. if c.media_ != nil {
  7987. var combined io.ReadCloser
  7988. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  7989. defer combined.Close()
  7990. body = combined
  7991. }
  7992. req, _ := http.NewRequest("POST", urls, body)
  7993. googleapi.SetOpaque(req.URL)
  7994. if c.resumableBuffer_ != nil {
  7995. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  7996. }
  7997. req.Header.Set("Content-Type", ctype)
  7998. req.Header.Set("User-Agent", c.s.userAgent())
  7999. if c.ctx_ != nil {
  8000. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8001. }
  8002. return c.s.client.Do(req)
  8003. }
  8004. // Do executes the "youtube.channelBanners.insert" call.
  8005. // Exactly one of *ChannelBannerResource or error will be non-nil. Any
  8006. // non-2xx status code is an error. Response headers are in either
  8007. // *ChannelBannerResource.ServerResponse.Header or (if a response was
  8008. // returned at all) in error.(*googleapi.Error).Header. Use
  8009. // googleapi.IsNotModified to check whether the returned error was
  8010. // because http.StatusNotModified was returned.
  8011. func (c *ChannelBannersInsertCall) Do(opts ...googleapi.CallOption) (*ChannelBannerResource, error) {
  8012. gensupport.SetOptions(c.urlParams_, opts...)
  8013. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  8014. return c.doRequest("json")
  8015. }, gensupport.DefaultBackoffStrategy())
  8016. if res != nil && res.StatusCode == http.StatusNotModified {
  8017. if res.Body != nil {
  8018. res.Body.Close()
  8019. }
  8020. return nil, &googleapi.Error{
  8021. Code: res.StatusCode,
  8022. Header: res.Header,
  8023. }
  8024. }
  8025. if err != nil {
  8026. return nil, err
  8027. }
  8028. defer googleapi.CloseBody(res)
  8029. if err := googleapi.CheckResponse(res); err != nil {
  8030. return nil, err
  8031. }
  8032. if c.resumableBuffer_ != nil {
  8033. loc := res.Header.Get("Location")
  8034. rx := &gensupport.ResumableUpload{
  8035. Client: c.s.client,
  8036. UserAgent: c.s.userAgent(),
  8037. URI: loc,
  8038. Media: c.resumableBuffer_,
  8039. MediaType: c.mediaType_,
  8040. Callback: func(curr int64) {
  8041. if c.progressUpdater_ != nil {
  8042. c.progressUpdater_(curr, c.mediaSize_)
  8043. }
  8044. },
  8045. }
  8046. ctx := c.ctx_
  8047. if ctx == nil {
  8048. ctx = context.TODO()
  8049. }
  8050. res, err = rx.Upload(ctx)
  8051. if err != nil {
  8052. return nil, err
  8053. }
  8054. defer res.Body.Close()
  8055. if err := googleapi.CheckResponse(res); err != nil {
  8056. return nil, err
  8057. }
  8058. }
  8059. ret := &ChannelBannerResource{
  8060. ServerResponse: googleapi.ServerResponse{
  8061. Header: res.Header,
  8062. HTTPStatusCode: res.StatusCode,
  8063. },
  8064. }
  8065. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8066. return nil, err
  8067. }
  8068. return ret, nil
  8069. // {
  8070. // "description": "Uploads a channel banner image to YouTube. This method represents the first two steps in a three-step process to update the banner image for a channel:\n\n- Call the channelBanners.insert method to upload the binary image data to YouTube. The image must have a 16:9 aspect ratio and be at least 2120x1192 pixels.\n- Extract the url property's value from the response that the API returns for step 1.\n- Call the channels.update method to update the channel's branding settings. Set the brandingSettings.image.bannerExternalUrl property's value to the URL obtained in step 2.",
  8071. // "httpMethod": "POST",
  8072. // "id": "youtube.channelBanners.insert",
  8073. // "mediaUpload": {
  8074. // "accept": [
  8075. // "application/octet-stream",
  8076. // "image/jpeg",
  8077. // "image/png"
  8078. // ],
  8079. // "maxSize": "6MB",
  8080. // "protocols": {
  8081. // "resumable": {
  8082. // "multipart": true,
  8083. // "path": "/resumable/upload/youtube/v3/channelBanners/insert"
  8084. // },
  8085. // "simple": {
  8086. // "multipart": true,
  8087. // "path": "/upload/youtube/v3/channelBanners/insert"
  8088. // }
  8089. // }
  8090. // },
  8091. // "parameters": {
  8092. // "onBehalfOfContentOwner": {
  8093. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  8094. // "location": "query",
  8095. // "type": "string"
  8096. // }
  8097. // },
  8098. // "path": "channelBanners/insert",
  8099. // "request": {
  8100. // "$ref": "ChannelBannerResource"
  8101. // },
  8102. // "response": {
  8103. // "$ref": "ChannelBannerResource"
  8104. // },
  8105. // "scopes": [
  8106. // "https://www.googleapis.com/auth/youtube",
  8107. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8108. // "https://www.googleapis.com/auth/youtube.upload"
  8109. // ],
  8110. // "supportsMediaUpload": true
  8111. // }
  8112. }
  8113. // method id "youtube.channelSections.delete":
  8114. type ChannelSectionsDeleteCall struct {
  8115. s *Service
  8116. urlParams_ gensupport.URLParams
  8117. ctx_ context.Context
  8118. }
  8119. // Delete: Deletes a channelSection.
  8120. func (r *ChannelSectionsService) Delete(id string) *ChannelSectionsDeleteCall {
  8121. c := &ChannelSectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8122. c.urlParams_.Set("id", id)
  8123. return c
  8124. }
  8125. // OnBehalfOfContentOwner sets the optional parameter
  8126. // "onBehalfOfContentOwner": Note: This parameter is intended
  8127. // exclusively for YouTube content partners.
  8128. //
  8129. // The onBehalfOfContentOwner parameter indicates that the request's
  8130. // authorization credentials identify a YouTube CMS user who is acting
  8131. // on behalf of the content owner specified in the parameter value. This
  8132. // parameter is intended for YouTube content partners that own and
  8133. // manage many different YouTube channels. It allows content owners to
  8134. // authenticate once and get access to all their video and channel data,
  8135. // without having to provide authentication credentials for each
  8136. // individual channel. The CMS account that the user authenticates with
  8137. // must be linked to the specified YouTube content owner.
  8138. func (c *ChannelSectionsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsDeleteCall {
  8139. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8140. return c
  8141. }
  8142. // Fields allows partial responses to be retrieved. See
  8143. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8144. // for more information.
  8145. func (c *ChannelSectionsDeleteCall) Fields(s ...googleapi.Field) *ChannelSectionsDeleteCall {
  8146. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8147. return c
  8148. }
  8149. // Context sets the context to be used in this call's Do method. Any
  8150. // pending HTTP request will be aborted if the provided context is
  8151. // canceled.
  8152. func (c *ChannelSectionsDeleteCall) Context(ctx context.Context) *ChannelSectionsDeleteCall {
  8153. c.ctx_ = ctx
  8154. return c
  8155. }
  8156. func (c *ChannelSectionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8157. var body io.Reader = nil
  8158. c.urlParams_.Set("alt", alt)
  8159. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  8160. urls += "?" + c.urlParams_.Encode()
  8161. req, _ := http.NewRequest("DELETE", urls, body)
  8162. googleapi.SetOpaque(req.URL)
  8163. req.Header.Set("User-Agent", c.s.userAgent())
  8164. if c.ctx_ != nil {
  8165. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8166. }
  8167. return c.s.client.Do(req)
  8168. }
  8169. // Do executes the "youtube.channelSections.delete" call.
  8170. func (c *ChannelSectionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8171. gensupport.SetOptions(c.urlParams_, opts...)
  8172. res, err := c.doRequest("json")
  8173. if err != nil {
  8174. return err
  8175. }
  8176. defer googleapi.CloseBody(res)
  8177. if err := googleapi.CheckResponse(res); err != nil {
  8178. return err
  8179. }
  8180. return nil
  8181. // {
  8182. // "description": "Deletes a channelSection.",
  8183. // "httpMethod": "DELETE",
  8184. // "id": "youtube.channelSections.delete",
  8185. // "parameterOrder": [
  8186. // "id"
  8187. // ],
  8188. // "parameters": {
  8189. // "id": {
  8190. // "description": "The id parameter specifies the YouTube channelSection ID for the resource that is being deleted. In a channelSection resource, the id property specifies the YouTube channelSection ID.",
  8191. // "location": "query",
  8192. // "required": true,
  8193. // "type": "string"
  8194. // },
  8195. // "onBehalfOfContentOwner": {
  8196. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  8197. // "location": "query",
  8198. // "type": "string"
  8199. // }
  8200. // },
  8201. // "path": "channelSections",
  8202. // "scopes": [
  8203. // "https://www.googleapis.com/auth/youtube",
  8204. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8205. // "https://www.googleapis.com/auth/youtubepartner"
  8206. // ]
  8207. // }
  8208. }
  8209. // method id "youtube.channelSections.insert":
  8210. type ChannelSectionsInsertCall struct {
  8211. s *Service
  8212. channelsection *ChannelSection
  8213. urlParams_ gensupport.URLParams
  8214. ctx_ context.Context
  8215. }
  8216. // Insert: Adds a channelSection for the authenticated user's channel.
  8217. func (r *ChannelSectionsService) Insert(part string, channelsection *ChannelSection) *ChannelSectionsInsertCall {
  8218. c := &ChannelSectionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8219. c.urlParams_.Set("part", part)
  8220. c.channelsection = channelsection
  8221. return c
  8222. }
  8223. // OnBehalfOfContentOwner sets the optional parameter
  8224. // "onBehalfOfContentOwner": Note: This parameter is intended
  8225. // exclusively for YouTube content partners.
  8226. //
  8227. // The onBehalfOfContentOwner parameter indicates that the request's
  8228. // authorization credentials identify a YouTube CMS user who is acting
  8229. // on behalf of the content owner specified in the parameter value. This
  8230. // parameter is intended for YouTube content partners that own and
  8231. // manage many different YouTube channels. It allows content owners to
  8232. // authenticate once and get access to all their video and channel data,
  8233. // without having to provide authentication credentials for each
  8234. // individual channel. The CMS account that the user authenticates with
  8235. // must be linked to the specified YouTube content owner.
  8236. func (c *ChannelSectionsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsInsertCall {
  8237. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8238. return c
  8239. }
  8240. // OnBehalfOfContentOwnerChannel sets the optional parameter
  8241. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  8242. // properly authorized request. Note: This parameter is intended
  8243. // exclusively for YouTube content partners.
  8244. //
  8245. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  8246. // channel ID of the channel to which a video is being added. This
  8247. // parameter is required when a request specifies a value for the
  8248. // onBehalfOfContentOwner parameter, and it can only be used in
  8249. // conjunction with that parameter. In addition, the request must be
  8250. // authorized using a CMS account that is linked to the content owner
  8251. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  8252. // channel that the onBehalfOfContentOwnerChannel parameter value
  8253. // specifies must be linked to the content owner that the
  8254. // onBehalfOfContentOwner parameter specifies.
  8255. //
  8256. // This parameter is intended for YouTube content partners that own and
  8257. // manage many different YouTube channels. It allows content owners to
  8258. // authenticate once and perform actions on behalf of the channel
  8259. // specified in the parameter value, without having to provide
  8260. // authentication credentials for each separate channel.
  8261. func (c *ChannelSectionsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *ChannelSectionsInsertCall {
  8262. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  8263. return c
  8264. }
  8265. // Fields allows partial responses to be retrieved. See
  8266. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8267. // for more information.
  8268. func (c *ChannelSectionsInsertCall) Fields(s ...googleapi.Field) *ChannelSectionsInsertCall {
  8269. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8270. return c
  8271. }
  8272. // Context sets the context to be used in this call's Do method. Any
  8273. // pending HTTP request will be aborted if the provided context is
  8274. // canceled.
  8275. func (c *ChannelSectionsInsertCall) Context(ctx context.Context) *ChannelSectionsInsertCall {
  8276. c.ctx_ = ctx
  8277. return c
  8278. }
  8279. func (c *ChannelSectionsInsertCall) doRequest(alt string) (*http.Response, error) {
  8280. var body io.Reader = nil
  8281. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelsection)
  8282. if err != nil {
  8283. return nil, err
  8284. }
  8285. ctype := "application/json"
  8286. c.urlParams_.Set("alt", alt)
  8287. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  8288. urls += "?" + c.urlParams_.Encode()
  8289. req, _ := http.NewRequest("POST", urls, body)
  8290. googleapi.SetOpaque(req.URL)
  8291. req.Header.Set("Content-Type", ctype)
  8292. req.Header.Set("User-Agent", c.s.userAgent())
  8293. if c.ctx_ != nil {
  8294. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8295. }
  8296. return c.s.client.Do(req)
  8297. }
  8298. // Do executes the "youtube.channelSections.insert" call.
  8299. // Exactly one of *ChannelSection or error will be non-nil. Any non-2xx
  8300. // status code is an error. Response headers are in either
  8301. // *ChannelSection.ServerResponse.Header or (if a response was returned
  8302. // at all) in error.(*googleapi.Error).Header. Use
  8303. // googleapi.IsNotModified to check whether the returned error was
  8304. // because http.StatusNotModified was returned.
  8305. func (c *ChannelSectionsInsertCall) Do(opts ...googleapi.CallOption) (*ChannelSection, error) {
  8306. gensupport.SetOptions(c.urlParams_, opts...)
  8307. res, err := c.doRequest("json")
  8308. if res != nil && res.StatusCode == http.StatusNotModified {
  8309. if res.Body != nil {
  8310. res.Body.Close()
  8311. }
  8312. return nil, &googleapi.Error{
  8313. Code: res.StatusCode,
  8314. Header: res.Header,
  8315. }
  8316. }
  8317. if err != nil {
  8318. return nil, err
  8319. }
  8320. defer googleapi.CloseBody(res)
  8321. if err := googleapi.CheckResponse(res); err != nil {
  8322. return nil, err
  8323. }
  8324. ret := &ChannelSection{
  8325. ServerResponse: googleapi.ServerResponse{
  8326. Header: res.Header,
  8327. HTTPStatusCode: res.StatusCode,
  8328. },
  8329. }
  8330. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8331. return nil, err
  8332. }
  8333. return ret, nil
  8334. // {
  8335. // "description": "Adds a channelSection for the authenticated user's channel.",
  8336. // "httpMethod": "POST",
  8337. // "id": "youtube.channelSections.insert",
  8338. // "parameterOrder": [
  8339. // "part"
  8340. // ],
  8341. // "parameters": {
  8342. // "onBehalfOfContentOwner": {
  8343. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  8344. // "location": "query",
  8345. // "type": "string"
  8346. // },
  8347. // "onBehalfOfContentOwnerChannel": {
  8348. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  8349. // "location": "query",
  8350. // "type": "string"
  8351. // },
  8352. // "part": {
  8353. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.",
  8354. // "location": "query",
  8355. // "required": true,
  8356. // "type": "string"
  8357. // }
  8358. // },
  8359. // "path": "channelSections",
  8360. // "request": {
  8361. // "$ref": "ChannelSection"
  8362. // },
  8363. // "response": {
  8364. // "$ref": "ChannelSection"
  8365. // },
  8366. // "scopes": [
  8367. // "https://www.googleapis.com/auth/youtube",
  8368. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8369. // "https://www.googleapis.com/auth/youtubepartner"
  8370. // ]
  8371. // }
  8372. }
  8373. // method id "youtube.channelSections.list":
  8374. type ChannelSectionsListCall struct {
  8375. s *Service
  8376. urlParams_ gensupport.URLParams
  8377. ifNoneMatch_ string
  8378. ctx_ context.Context
  8379. }
  8380. // List: Returns channelSection resources that match the API request
  8381. // criteria.
  8382. func (r *ChannelSectionsService) List(part string) *ChannelSectionsListCall {
  8383. c := &ChannelSectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8384. c.urlParams_.Set("part", part)
  8385. return c
  8386. }
  8387. // ChannelId sets the optional parameter "channelId": The channelId
  8388. // parameter specifies a YouTube channel ID. The API will only return
  8389. // that channel's channelSections.
  8390. func (c *ChannelSectionsListCall) ChannelId(channelId string) *ChannelSectionsListCall {
  8391. c.urlParams_.Set("channelId", channelId)
  8392. return c
  8393. }
  8394. // Hl sets the optional parameter "hl": The hl parameter indicates that
  8395. // the snippet.localized property values in the returned channelSection
  8396. // resources should be in the specified language if localized values for
  8397. // that language are available. For example, if the API request
  8398. // specifies hl=de, the snippet.localized properties in the API response
  8399. // will contain German titles if German titles are available. Channel
  8400. // owners can provide localized channel section titles using either the
  8401. // channelSections.insert or channelSections.update method.
  8402. func (c *ChannelSectionsListCall) Hl(hl string) *ChannelSectionsListCall {
  8403. c.urlParams_.Set("hl", hl)
  8404. return c
  8405. }
  8406. // Id sets the optional parameter "id": The id parameter specifies a
  8407. // comma-separated list of the YouTube channelSection ID(s) for the
  8408. // resource(s) that are being retrieved. In a channelSection resource,
  8409. // the id property specifies the YouTube channelSection ID.
  8410. func (c *ChannelSectionsListCall) Id(id string) *ChannelSectionsListCall {
  8411. c.urlParams_.Set("id", id)
  8412. return c
  8413. }
  8414. // Mine sets the optional parameter "mine": Set this parameter's value
  8415. // to true to retrieve a feed of the authenticated user's
  8416. // channelSections.
  8417. func (c *ChannelSectionsListCall) Mine(mine bool) *ChannelSectionsListCall {
  8418. c.urlParams_.Set("mine", fmt.Sprint(mine))
  8419. return c
  8420. }
  8421. // OnBehalfOfContentOwner sets the optional parameter
  8422. // "onBehalfOfContentOwner": Note: This parameter is intended
  8423. // exclusively for YouTube content partners.
  8424. //
  8425. // The onBehalfOfContentOwner parameter indicates that the request's
  8426. // authorization credentials identify a YouTube CMS user who is acting
  8427. // on behalf of the content owner specified in the parameter value. This
  8428. // parameter is intended for YouTube content partners that own and
  8429. // manage many different YouTube channels. It allows content owners to
  8430. // authenticate once and get access to all their video and channel data,
  8431. // without having to provide authentication credentials for each
  8432. // individual channel. The CMS account that the user authenticates with
  8433. // must be linked to the specified YouTube content owner.
  8434. func (c *ChannelSectionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsListCall {
  8435. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8436. return c
  8437. }
  8438. // Fields allows partial responses to be retrieved. See
  8439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8440. // for more information.
  8441. func (c *ChannelSectionsListCall) Fields(s ...googleapi.Field) *ChannelSectionsListCall {
  8442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8443. return c
  8444. }
  8445. // IfNoneMatch sets the optional parameter which makes the operation
  8446. // fail if the object's ETag matches the given value. This is useful for
  8447. // getting updates only after the object has changed since the last
  8448. // request. Use googleapi.IsNotModified to check whether the response
  8449. // error from Do is the result of In-None-Match.
  8450. func (c *ChannelSectionsListCall) IfNoneMatch(entityTag string) *ChannelSectionsListCall {
  8451. c.ifNoneMatch_ = entityTag
  8452. return c
  8453. }
  8454. // Context sets the context to be used in this call's Do method. Any
  8455. // pending HTTP request will be aborted if the provided context is
  8456. // canceled.
  8457. func (c *ChannelSectionsListCall) Context(ctx context.Context) *ChannelSectionsListCall {
  8458. c.ctx_ = ctx
  8459. return c
  8460. }
  8461. func (c *ChannelSectionsListCall) doRequest(alt string) (*http.Response, error) {
  8462. var body io.Reader = nil
  8463. c.urlParams_.Set("alt", alt)
  8464. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  8465. urls += "?" + c.urlParams_.Encode()
  8466. req, _ := http.NewRequest("GET", urls, body)
  8467. googleapi.SetOpaque(req.URL)
  8468. req.Header.Set("User-Agent", c.s.userAgent())
  8469. if c.ifNoneMatch_ != "" {
  8470. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8471. }
  8472. if c.ctx_ != nil {
  8473. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8474. }
  8475. return c.s.client.Do(req)
  8476. }
  8477. // Do executes the "youtube.channelSections.list" call.
  8478. // Exactly one of *ChannelSectionListResponse or error will be non-nil.
  8479. // Any non-2xx status code is an error. Response headers are in either
  8480. // *ChannelSectionListResponse.ServerResponse.Header or (if a response
  8481. // was returned at all) in error.(*googleapi.Error).Header. Use
  8482. // googleapi.IsNotModified to check whether the returned error was
  8483. // because http.StatusNotModified was returned.
  8484. func (c *ChannelSectionsListCall) Do(opts ...googleapi.CallOption) (*ChannelSectionListResponse, error) {
  8485. gensupport.SetOptions(c.urlParams_, opts...)
  8486. res, err := c.doRequest("json")
  8487. if res != nil && res.StatusCode == http.StatusNotModified {
  8488. if res.Body != nil {
  8489. res.Body.Close()
  8490. }
  8491. return nil, &googleapi.Error{
  8492. Code: res.StatusCode,
  8493. Header: res.Header,
  8494. }
  8495. }
  8496. if err != nil {
  8497. return nil, err
  8498. }
  8499. defer googleapi.CloseBody(res)
  8500. if err := googleapi.CheckResponse(res); err != nil {
  8501. return nil, err
  8502. }
  8503. ret := &ChannelSectionListResponse{
  8504. ServerResponse: googleapi.ServerResponse{
  8505. Header: res.Header,
  8506. HTTPStatusCode: res.StatusCode,
  8507. },
  8508. }
  8509. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8510. return nil, err
  8511. }
  8512. return ret, nil
  8513. // {
  8514. // "description": "Returns channelSection resources that match the API request criteria.",
  8515. // "httpMethod": "GET",
  8516. // "id": "youtube.channelSections.list",
  8517. // "parameterOrder": [
  8518. // "part"
  8519. // ],
  8520. // "parameters": {
  8521. // "channelId": {
  8522. // "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's channelSections.",
  8523. // "location": "query",
  8524. // "type": "string"
  8525. // },
  8526. // "hl": {
  8527. // "description": "The hl parameter indicates that the snippet.localized property values in the returned channelSection resources should be in the specified language if localized values for that language are available. For example, if the API request specifies hl=de, the snippet.localized properties in the API response will contain German titles if German titles are available. Channel owners can provide localized channel section titles using either the channelSections.insert or channelSections.update method.",
  8528. // "location": "query",
  8529. // "type": "string"
  8530. // },
  8531. // "id": {
  8532. // "description": "The id parameter specifies a comma-separated list of the YouTube channelSection ID(s) for the resource(s) that are being retrieved. In a channelSection resource, the id property specifies the YouTube channelSection ID.",
  8533. // "location": "query",
  8534. // "type": "string"
  8535. // },
  8536. // "mine": {
  8537. // "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's channelSections.",
  8538. // "location": "query",
  8539. // "type": "boolean"
  8540. // },
  8541. // "onBehalfOfContentOwner": {
  8542. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  8543. // "location": "query",
  8544. // "type": "string"
  8545. // },
  8546. // "part": {
  8547. // "description": "The part parameter specifies a comma-separated list of one or more channelSection resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channelSection resource, the snippet property contains other properties, such as a display title for the channelSection. If you set part=snippet, the API response will also contain all of those nested properties.",
  8548. // "location": "query",
  8549. // "required": true,
  8550. // "type": "string"
  8551. // }
  8552. // },
  8553. // "path": "channelSections",
  8554. // "response": {
  8555. // "$ref": "ChannelSectionListResponse"
  8556. // },
  8557. // "scopes": [
  8558. // "https://www.googleapis.com/auth/youtube",
  8559. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8560. // "https://www.googleapis.com/auth/youtube.readonly",
  8561. // "https://www.googleapis.com/auth/youtubepartner"
  8562. // ]
  8563. // }
  8564. }
  8565. // method id "youtube.channelSections.update":
  8566. type ChannelSectionsUpdateCall struct {
  8567. s *Service
  8568. channelsection *ChannelSection
  8569. urlParams_ gensupport.URLParams
  8570. ctx_ context.Context
  8571. }
  8572. // Update: Update a channelSection.
  8573. func (r *ChannelSectionsService) Update(part string, channelsection *ChannelSection) *ChannelSectionsUpdateCall {
  8574. c := &ChannelSectionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8575. c.urlParams_.Set("part", part)
  8576. c.channelsection = channelsection
  8577. return c
  8578. }
  8579. // OnBehalfOfContentOwner sets the optional parameter
  8580. // "onBehalfOfContentOwner": Note: This parameter is intended
  8581. // exclusively for YouTube content partners.
  8582. //
  8583. // The onBehalfOfContentOwner parameter indicates that the request's
  8584. // authorization credentials identify a YouTube CMS user who is acting
  8585. // on behalf of the content owner specified in the parameter value. This
  8586. // parameter is intended for YouTube content partners that own and
  8587. // manage many different YouTube channels. It allows content owners to
  8588. // authenticate once and get access to all their video and channel data,
  8589. // without having to provide authentication credentials for each
  8590. // individual channel. The CMS account that the user authenticates with
  8591. // must be linked to the specified YouTube content owner.
  8592. func (c *ChannelSectionsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsUpdateCall {
  8593. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8594. return c
  8595. }
  8596. // Fields allows partial responses to be retrieved. See
  8597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8598. // for more information.
  8599. func (c *ChannelSectionsUpdateCall) Fields(s ...googleapi.Field) *ChannelSectionsUpdateCall {
  8600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8601. return c
  8602. }
  8603. // Context sets the context to be used in this call's Do method. Any
  8604. // pending HTTP request will be aborted if the provided context is
  8605. // canceled.
  8606. func (c *ChannelSectionsUpdateCall) Context(ctx context.Context) *ChannelSectionsUpdateCall {
  8607. c.ctx_ = ctx
  8608. return c
  8609. }
  8610. func (c *ChannelSectionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8611. var body io.Reader = nil
  8612. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelsection)
  8613. if err != nil {
  8614. return nil, err
  8615. }
  8616. ctype := "application/json"
  8617. c.urlParams_.Set("alt", alt)
  8618. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  8619. urls += "?" + c.urlParams_.Encode()
  8620. req, _ := http.NewRequest("PUT", urls, body)
  8621. googleapi.SetOpaque(req.URL)
  8622. req.Header.Set("Content-Type", ctype)
  8623. req.Header.Set("User-Agent", c.s.userAgent())
  8624. if c.ctx_ != nil {
  8625. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8626. }
  8627. return c.s.client.Do(req)
  8628. }
  8629. // Do executes the "youtube.channelSections.update" call.
  8630. // Exactly one of *ChannelSection or error will be non-nil. Any non-2xx
  8631. // status code is an error. Response headers are in either
  8632. // *ChannelSection.ServerResponse.Header or (if a response was returned
  8633. // at all) in error.(*googleapi.Error).Header. Use
  8634. // googleapi.IsNotModified to check whether the returned error was
  8635. // because http.StatusNotModified was returned.
  8636. func (c *ChannelSectionsUpdateCall) Do(opts ...googleapi.CallOption) (*ChannelSection, error) {
  8637. gensupport.SetOptions(c.urlParams_, opts...)
  8638. res, err := c.doRequest("json")
  8639. if res != nil && res.StatusCode == http.StatusNotModified {
  8640. if res.Body != nil {
  8641. res.Body.Close()
  8642. }
  8643. return nil, &googleapi.Error{
  8644. Code: res.StatusCode,
  8645. Header: res.Header,
  8646. }
  8647. }
  8648. if err != nil {
  8649. return nil, err
  8650. }
  8651. defer googleapi.CloseBody(res)
  8652. if err := googleapi.CheckResponse(res); err != nil {
  8653. return nil, err
  8654. }
  8655. ret := &ChannelSection{
  8656. ServerResponse: googleapi.ServerResponse{
  8657. Header: res.Header,
  8658. HTTPStatusCode: res.StatusCode,
  8659. },
  8660. }
  8661. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8662. return nil, err
  8663. }
  8664. return ret, nil
  8665. // {
  8666. // "description": "Update a channelSection.",
  8667. // "httpMethod": "PUT",
  8668. // "id": "youtube.channelSections.update",
  8669. // "parameterOrder": [
  8670. // "part"
  8671. // ],
  8672. // "parameters": {
  8673. // "onBehalfOfContentOwner": {
  8674. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  8675. // "location": "query",
  8676. // "type": "string"
  8677. // },
  8678. // "part": {
  8679. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.",
  8680. // "location": "query",
  8681. // "required": true,
  8682. // "type": "string"
  8683. // }
  8684. // },
  8685. // "path": "channelSections",
  8686. // "request": {
  8687. // "$ref": "ChannelSection"
  8688. // },
  8689. // "response": {
  8690. // "$ref": "ChannelSection"
  8691. // },
  8692. // "scopes": [
  8693. // "https://www.googleapis.com/auth/youtube",
  8694. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8695. // "https://www.googleapis.com/auth/youtubepartner"
  8696. // ]
  8697. // }
  8698. }
  8699. // method id "youtube.channels.list":
  8700. type ChannelsListCall struct {
  8701. s *Service
  8702. urlParams_ gensupport.URLParams
  8703. ifNoneMatch_ string
  8704. ctx_ context.Context
  8705. }
  8706. // List: Returns a collection of zero or more channel resources that
  8707. // match the request criteria.
  8708. func (r *ChannelsService) List(part string) *ChannelsListCall {
  8709. c := &ChannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8710. c.urlParams_.Set("part", part)
  8711. return c
  8712. }
  8713. // CategoryId sets the optional parameter "categoryId": The categoryId
  8714. // parameter specifies a YouTube guide category, thereby requesting
  8715. // YouTube channels associated with that category.
  8716. func (c *ChannelsListCall) CategoryId(categoryId string) *ChannelsListCall {
  8717. c.urlParams_.Set("categoryId", categoryId)
  8718. return c
  8719. }
  8720. // ForUsername sets the optional parameter "forUsername": The
  8721. // forUsername parameter specifies a YouTube username, thereby
  8722. // requesting the channel associated with that username.
  8723. func (c *ChannelsListCall) ForUsername(forUsername string) *ChannelsListCall {
  8724. c.urlParams_.Set("forUsername", forUsername)
  8725. return c
  8726. }
  8727. // Hl sets the optional parameter "hl": The hl parameter should be used
  8728. // for filter out the properties that are not in the given language.
  8729. // Used for the brandingSettings part.
  8730. func (c *ChannelsListCall) Hl(hl string) *ChannelsListCall {
  8731. c.urlParams_.Set("hl", hl)
  8732. return c
  8733. }
  8734. // Id sets the optional parameter "id": The id parameter specifies a
  8735. // comma-separated list of the YouTube channel ID(s) for the resource(s)
  8736. // that are being retrieved. In a channel resource, the id property
  8737. // specifies the channel's YouTube channel ID.
  8738. func (c *ChannelsListCall) Id(id string) *ChannelsListCall {
  8739. c.urlParams_.Set("id", id)
  8740. return c
  8741. }
  8742. // ManagedByMe sets the optional parameter "managedByMe": Note: This
  8743. // parameter is intended exclusively for YouTube content partners.
  8744. //
  8745. // Set this parameter's value to true to instruct the API to only return
  8746. // channels managed by the content owner that the onBehalfOfContentOwner
  8747. // parameter specifies. The user must be authenticated as a CMS account
  8748. // linked to the specified content owner and onBehalfOfContentOwner must
  8749. // be provided.
  8750. func (c *ChannelsListCall) ManagedByMe(managedByMe bool) *ChannelsListCall {
  8751. c.urlParams_.Set("managedByMe", fmt.Sprint(managedByMe))
  8752. return c
  8753. }
  8754. // MaxResults sets the optional parameter "maxResults": The maxResults
  8755. // parameter specifies the maximum number of items that should be
  8756. // returned in the result set.
  8757. func (c *ChannelsListCall) MaxResults(maxResults int64) *ChannelsListCall {
  8758. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8759. return c
  8760. }
  8761. // Mine sets the optional parameter "mine": Set this parameter's value
  8762. // to true to instruct the API to only return channels owned by the
  8763. // authenticated user.
  8764. func (c *ChannelsListCall) Mine(mine bool) *ChannelsListCall {
  8765. c.urlParams_.Set("mine", fmt.Sprint(mine))
  8766. return c
  8767. }
  8768. // MySubscribers sets the optional parameter "mySubscribers": Use the
  8769. // subscriptions.list method and its mySubscribers parameter to retrieve
  8770. // a list of subscribers to the authenticated user's channel.
  8771. func (c *ChannelsListCall) MySubscribers(mySubscribers bool) *ChannelsListCall {
  8772. c.urlParams_.Set("mySubscribers", fmt.Sprint(mySubscribers))
  8773. return c
  8774. }
  8775. // OnBehalfOfContentOwner sets the optional parameter
  8776. // "onBehalfOfContentOwner": Note: This parameter is intended
  8777. // exclusively for YouTube content partners.
  8778. //
  8779. // The onBehalfOfContentOwner parameter indicates that the request's
  8780. // authorization credentials identify a YouTube CMS user who is acting
  8781. // on behalf of the content owner specified in the parameter value. This
  8782. // parameter is intended for YouTube content partners that own and
  8783. // manage many different YouTube channels. It allows content owners to
  8784. // authenticate once and get access to all their video and channel data,
  8785. // without having to provide authentication credentials for each
  8786. // individual channel. The CMS account that the user authenticates with
  8787. // must be linked to the specified YouTube content owner.
  8788. func (c *ChannelsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelsListCall {
  8789. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8790. return c
  8791. }
  8792. // PageToken sets the optional parameter "pageToken": The pageToken
  8793. // parameter identifies a specific page in the result set that should be
  8794. // returned. In an API response, the nextPageToken and prevPageToken
  8795. // properties identify other pages that could be retrieved.
  8796. func (c *ChannelsListCall) PageToken(pageToken string) *ChannelsListCall {
  8797. c.urlParams_.Set("pageToken", pageToken)
  8798. return c
  8799. }
  8800. // Fields allows partial responses to be retrieved. See
  8801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8802. // for more information.
  8803. func (c *ChannelsListCall) Fields(s ...googleapi.Field) *ChannelsListCall {
  8804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8805. return c
  8806. }
  8807. // IfNoneMatch sets the optional parameter which makes the operation
  8808. // fail if the object's ETag matches the given value. This is useful for
  8809. // getting updates only after the object has changed since the last
  8810. // request. Use googleapi.IsNotModified to check whether the response
  8811. // error from Do is the result of In-None-Match.
  8812. func (c *ChannelsListCall) IfNoneMatch(entityTag string) *ChannelsListCall {
  8813. c.ifNoneMatch_ = entityTag
  8814. return c
  8815. }
  8816. // Context sets the context to be used in this call's Do method. Any
  8817. // pending HTTP request will be aborted if the provided context is
  8818. // canceled.
  8819. func (c *ChannelsListCall) Context(ctx context.Context) *ChannelsListCall {
  8820. c.ctx_ = ctx
  8821. return c
  8822. }
  8823. func (c *ChannelsListCall) doRequest(alt string) (*http.Response, error) {
  8824. var body io.Reader = nil
  8825. c.urlParams_.Set("alt", alt)
  8826. urls := googleapi.ResolveRelative(c.s.BasePath, "channels")
  8827. urls += "?" + c.urlParams_.Encode()
  8828. req, _ := http.NewRequest("GET", urls, body)
  8829. googleapi.SetOpaque(req.URL)
  8830. req.Header.Set("User-Agent", c.s.userAgent())
  8831. if c.ifNoneMatch_ != "" {
  8832. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8833. }
  8834. if c.ctx_ != nil {
  8835. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8836. }
  8837. return c.s.client.Do(req)
  8838. }
  8839. // Do executes the "youtube.channels.list" call.
  8840. // Exactly one of *ChannelListResponse or error will be non-nil. Any
  8841. // non-2xx status code is an error. Response headers are in either
  8842. // *ChannelListResponse.ServerResponse.Header or (if a response was
  8843. // returned at all) in error.(*googleapi.Error).Header. Use
  8844. // googleapi.IsNotModified to check whether the returned error was
  8845. // because http.StatusNotModified was returned.
  8846. func (c *ChannelsListCall) Do(opts ...googleapi.CallOption) (*ChannelListResponse, error) {
  8847. gensupport.SetOptions(c.urlParams_, opts...)
  8848. res, err := c.doRequest("json")
  8849. if res != nil && res.StatusCode == http.StatusNotModified {
  8850. if res.Body != nil {
  8851. res.Body.Close()
  8852. }
  8853. return nil, &googleapi.Error{
  8854. Code: res.StatusCode,
  8855. Header: res.Header,
  8856. }
  8857. }
  8858. if err != nil {
  8859. return nil, err
  8860. }
  8861. defer googleapi.CloseBody(res)
  8862. if err := googleapi.CheckResponse(res); err != nil {
  8863. return nil, err
  8864. }
  8865. ret := &ChannelListResponse{
  8866. ServerResponse: googleapi.ServerResponse{
  8867. Header: res.Header,
  8868. HTTPStatusCode: res.StatusCode,
  8869. },
  8870. }
  8871. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8872. return nil, err
  8873. }
  8874. return ret, nil
  8875. // {
  8876. // "description": "Returns a collection of zero or more channel resources that match the request criteria.",
  8877. // "httpMethod": "GET",
  8878. // "id": "youtube.channels.list",
  8879. // "parameterOrder": [
  8880. // "part"
  8881. // ],
  8882. // "parameters": {
  8883. // "categoryId": {
  8884. // "description": "The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category.",
  8885. // "location": "query",
  8886. // "type": "string"
  8887. // },
  8888. // "forUsername": {
  8889. // "description": "The forUsername parameter specifies a YouTube username, thereby requesting the channel associated with that username.",
  8890. // "location": "query",
  8891. // "type": "string"
  8892. // },
  8893. // "hl": {
  8894. // "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the brandingSettings part.",
  8895. // "location": "query",
  8896. // "type": "string"
  8897. // },
  8898. // "id": {
  8899. // "description": "The id parameter specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the id property specifies the channel's YouTube channel ID.",
  8900. // "location": "query",
  8901. // "type": "string"
  8902. // },
  8903. // "managedByMe": {
  8904. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nSet this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.",
  8905. // "location": "query",
  8906. // "type": "boolean"
  8907. // },
  8908. // "maxResults": {
  8909. // "default": "5",
  8910. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  8911. // "format": "uint32",
  8912. // "location": "query",
  8913. // "maximum": "50",
  8914. // "minimum": "0",
  8915. // "type": "integer"
  8916. // },
  8917. // "mine": {
  8918. // "description": "Set this parameter's value to true to instruct the API to only return channels owned by the authenticated user.",
  8919. // "location": "query",
  8920. // "type": "boolean"
  8921. // },
  8922. // "mySubscribers": {
  8923. // "description": "Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel.",
  8924. // "location": "query",
  8925. // "type": "boolean"
  8926. // },
  8927. // "onBehalfOfContentOwner": {
  8928. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  8929. // "location": "query",
  8930. // "type": "string"
  8931. // },
  8932. // "pageToken": {
  8933. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  8934. // "location": "query",
  8935. // "type": "string"
  8936. // },
  8937. // "part": {
  8938. // "description": "The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties.",
  8939. // "location": "query",
  8940. // "required": true,
  8941. // "type": "string"
  8942. // }
  8943. // },
  8944. // "path": "channels",
  8945. // "response": {
  8946. // "$ref": "ChannelListResponse"
  8947. // },
  8948. // "scopes": [
  8949. // "https://www.googleapis.com/auth/youtube",
  8950. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8951. // "https://www.googleapis.com/auth/youtube.readonly",
  8952. // "https://www.googleapis.com/auth/youtubepartner",
  8953. // "https://www.googleapis.com/auth/youtubepartner-channel-audit"
  8954. // ]
  8955. // }
  8956. }
  8957. // Pages invokes f for each page of results.
  8958. // A non-nil error returned from f will halt the iteration.
  8959. // The provided context supersedes any context provided to the Context method.
  8960. func (c *ChannelsListCall) Pages(ctx context.Context, f func(*ChannelListResponse) error) error {
  8961. c.ctx_ = ctx
  8962. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8963. for {
  8964. x, err := c.Do()
  8965. if err != nil {
  8966. return err
  8967. }
  8968. if err := f(x); err != nil {
  8969. return err
  8970. }
  8971. if x.NextPageToken == "" {
  8972. return nil
  8973. }
  8974. c.PageToken(x.NextPageToken)
  8975. }
  8976. }
  8977. // method id "youtube.channels.update":
  8978. type ChannelsUpdateCall struct {
  8979. s *Service
  8980. channel *Channel
  8981. urlParams_ gensupport.URLParams
  8982. ctx_ context.Context
  8983. }
  8984. // Update: Updates a channel's metadata. Note that this method currently
  8985. // only supports updates to the channel resource's brandingSettings and
  8986. // invideoPromotion objects and their child properties.
  8987. func (r *ChannelsService) Update(part string, channel *Channel) *ChannelsUpdateCall {
  8988. c := &ChannelsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8989. c.urlParams_.Set("part", part)
  8990. c.channel = channel
  8991. return c
  8992. }
  8993. // OnBehalfOfContentOwner sets the optional parameter
  8994. // "onBehalfOfContentOwner": The onBehalfOfContentOwner parameter
  8995. // indicates that the authenticated user is acting on behalf of the
  8996. // content owner specified in the parameter value. This parameter is
  8997. // intended for YouTube content partners that own and manage many
  8998. // different YouTube channels. It allows content owners to authenticate
  8999. // once and get access to all their video and channel data, without
  9000. // having to provide authentication credentials for each individual
  9001. // channel. The actual CMS account that the user authenticates with
  9002. // needs to be linked to the specified YouTube content owner.
  9003. func (c *ChannelsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelsUpdateCall {
  9004. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9005. return c
  9006. }
  9007. // Fields allows partial responses to be retrieved. See
  9008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9009. // for more information.
  9010. func (c *ChannelsUpdateCall) Fields(s ...googleapi.Field) *ChannelsUpdateCall {
  9011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9012. return c
  9013. }
  9014. // Context sets the context to be used in this call's Do method. Any
  9015. // pending HTTP request will be aborted if the provided context is
  9016. // canceled.
  9017. func (c *ChannelsUpdateCall) Context(ctx context.Context) *ChannelsUpdateCall {
  9018. c.ctx_ = ctx
  9019. return c
  9020. }
  9021. func (c *ChannelsUpdateCall) doRequest(alt string) (*http.Response, error) {
  9022. var body io.Reader = nil
  9023. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  9024. if err != nil {
  9025. return nil, err
  9026. }
  9027. ctype := "application/json"
  9028. c.urlParams_.Set("alt", alt)
  9029. urls := googleapi.ResolveRelative(c.s.BasePath, "channels")
  9030. urls += "?" + c.urlParams_.Encode()
  9031. req, _ := http.NewRequest("PUT", urls, body)
  9032. googleapi.SetOpaque(req.URL)
  9033. req.Header.Set("Content-Type", ctype)
  9034. req.Header.Set("User-Agent", c.s.userAgent())
  9035. if c.ctx_ != nil {
  9036. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9037. }
  9038. return c.s.client.Do(req)
  9039. }
  9040. // Do executes the "youtube.channels.update" call.
  9041. // Exactly one of *Channel or error will be non-nil. Any non-2xx status
  9042. // code is an error. Response headers are in either
  9043. // *Channel.ServerResponse.Header or (if a response was returned at all)
  9044. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9045. // check whether the returned error was because http.StatusNotModified
  9046. // was returned.
  9047. func (c *ChannelsUpdateCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  9048. gensupport.SetOptions(c.urlParams_, opts...)
  9049. res, err := c.doRequest("json")
  9050. if res != nil && res.StatusCode == http.StatusNotModified {
  9051. if res.Body != nil {
  9052. res.Body.Close()
  9053. }
  9054. return nil, &googleapi.Error{
  9055. Code: res.StatusCode,
  9056. Header: res.Header,
  9057. }
  9058. }
  9059. if err != nil {
  9060. return nil, err
  9061. }
  9062. defer googleapi.CloseBody(res)
  9063. if err := googleapi.CheckResponse(res); err != nil {
  9064. return nil, err
  9065. }
  9066. ret := &Channel{
  9067. ServerResponse: googleapi.ServerResponse{
  9068. Header: res.Header,
  9069. HTTPStatusCode: res.StatusCode,
  9070. },
  9071. }
  9072. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9073. return nil, err
  9074. }
  9075. return ret, nil
  9076. // {
  9077. // "description": "Updates a channel's metadata. Note that this method currently only supports updates to the channel resource's brandingSettings and invideoPromotion objects and their child properties.",
  9078. // "httpMethod": "PUT",
  9079. // "id": "youtube.channels.update",
  9080. // "parameterOrder": [
  9081. // "part"
  9082. // ],
  9083. // "parameters": {
  9084. // "onBehalfOfContentOwner": {
  9085. // "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.",
  9086. // "location": "query",
  9087. // "type": "string"
  9088. // },
  9089. // "part": {
  9090. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.)\n\nNote that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies.",
  9091. // "location": "query",
  9092. // "required": true,
  9093. // "type": "string"
  9094. // }
  9095. // },
  9096. // "path": "channels",
  9097. // "request": {
  9098. // "$ref": "Channel"
  9099. // },
  9100. // "response": {
  9101. // "$ref": "Channel"
  9102. // },
  9103. // "scopes": [
  9104. // "https://www.googleapis.com/auth/youtube",
  9105. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9106. // "https://www.googleapis.com/auth/youtubepartner"
  9107. // ]
  9108. // }
  9109. }
  9110. // method id "youtube.commentThreads.insert":
  9111. type CommentThreadsInsertCall struct {
  9112. s *Service
  9113. commentthread *CommentThread
  9114. urlParams_ gensupport.URLParams
  9115. ctx_ context.Context
  9116. }
  9117. // Insert: Creates a new top-level comment. To add a reply to an
  9118. // existing comment, use the comments.insert method instead.
  9119. func (r *CommentThreadsService) Insert(part string, commentthread *CommentThread) *CommentThreadsInsertCall {
  9120. c := &CommentThreadsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9121. c.urlParams_.Set("part", part)
  9122. c.commentthread = commentthread
  9123. return c
  9124. }
  9125. // Fields allows partial responses to be retrieved. See
  9126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9127. // for more information.
  9128. func (c *CommentThreadsInsertCall) Fields(s ...googleapi.Field) *CommentThreadsInsertCall {
  9129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9130. return c
  9131. }
  9132. // Context sets the context to be used in this call's Do method. Any
  9133. // pending HTTP request will be aborted if the provided context is
  9134. // canceled.
  9135. func (c *CommentThreadsInsertCall) Context(ctx context.Context) *CommentThreadsInsertCall {
  9136. c.ctx_ = ctx
  9137. return c
  9138. }
  9139. func (c *CommentThreadsInsertCall) doRequest(alt string) (*http.Response, error) {
  9140. var body io.Reader = nil
  9141. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentthread)
  9142. if err != nil {
  9143. return nil, err
  9144. }
  9145. ctype := "application/json"
  9146. c.urlParams_.Set("alt", alt)
  9147. urls := googleapi.ResolveRelative(c.s.BasePath, "commentThreads")
  9148. urls += "?" + c.urlParams_.Encode()
  9149. req, _ := http.NewRequest("POST", urls, body)
  9150. googleapi.SetOpaque(req.URL)
  9151. req.Header.Set("Content-Type", ctype)
  9152. req.Header.Set("User-Agent", c.s.userAgent())
  9153. if c.ctx_ != nil {
  9154. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9155. }
  9156. return c.s.client.Do(req)
  9157. }
  9158. // Do executes the "youtube.commentThreads.insert" call.
  9159. // Exactly one of *CommentThread or error will be non-nil. Any non-2xx
  9160. // status code is an error. Response headers are in either
  9161. // *CommentThread.ServerResponse.Header or (if a response was returned
  9162. // at all) in error.(*googleapi.Error).Header. Use
  9163. // googleapi.IsNotModified to check whether the returned error was
  9164. // because http.StatusNotModified was returned.
  9165. func (c *CommentThreadsInsertCall) Do(opts ...googleapi.CallOption) (*CommentThread, error) {
  9166. gensupport.SetOptions(c.urlParams_, opts...)
  9167. res, err := c.doRequest("json")
  9168. if res != nil && res.StatusCode == http.StatusNotModified {
  9169. if res.Body != nil {
  9170. res.Body.Close()
  9171. }
  9172. return nil, &googleapi.Error{
  9173. Code: res.StatusCode,
  9174. Header: res.Header,
  9175. }
  9176. }
  9177. if err != nil {
  9178. return nil, err
  9179. }
  9180. defer googleapi.CloseBody(res)
  9181. if err := googleapi.CheckResponse(res); err != nil {
  9182. return nil, err
  9183. }
  9184. ret := &CommentThread{
  9185. ServerResponse: googleapi.ServerResponse{
  9186. Header: res.Header,
  9187. HTTPStatusCode: res.StatusCode,
  9188. },
  9189. }
  9190. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9191. return nil, err
  9192. }
  9193. return ret, nil
  9194. // {
  9195. // "description": "Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead.",
  9196. // "httpMethod": "POST",
  9197. // "id": "youtube.commentThreads.insert",
  9198. // "parameterOrder": [
  9199. // "part"
  9200. // ],
  9201. // "parameters": {
  9202. // "part": {
  9203. // "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.",
  9204. // "location": "query",
  9205. // "required": true,
  9206. // "type": "string"
  9207. // }
  9208. // },
  9209. // "path": "commentThreads",
  9210. // "request": {
  9211. // "$ref": "CommentThread"
  9212. // },
  9213. // "response": {
  9214. // "$ref": "CommentThread"
  9215. // },
  9216. // "scopes": [
  9217. // "https://www.googleapis.com/auth/youtube.force-ssl"
  9218. // ]
  9219. // }
  9220. }
  9221. // method id "youtube.commentThreads.list":
  9222. type CommentThreadsListCall struct {
  9223. s *Service
  9224. urlParams_ gensupport.URLParams
  9225. ifNoneMatch_ string
  9226. ctx_ context.Context
  9227. }
  9228. // List: Returns a list of comment threads that match the API request
  9229. // parameters.
  9230. func (r *CommentThreadsService) List(part string) *CommentThreadsListCall {
  9231. c := &CommentThreadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9232. c.urlParams_.Set("part", part)
  9233. return c
  9234. }
  9235. // AllThreadsRelatedToChannelId sets the optional parameter
  9236. // "allThreadsRelatedToChannelId": The allThreadsRelatedToChannelId
  9237. // parameter instructs the API to return all comment threads associated
  9238. // with the specified channel. The response can include comments about
  9239. // the channel or about the channel's videos.
  9240. func (c *CommentThreadsListCall) AllThreadsRelatedToChannelId(allThreadsRelatedToChannelId string) *CommentThreadsListCall {
  9241. c.urlParams_.Set("allThreadsRelatedToChannelId", allThreadsRelatedToChannelId)
  9242. return c
  9243. }
  9244. // ChannelId sets the optional parameter "channelId": The channelId
  9245. // parameter instructs the API to return comment threads containing
  9246. // comments about the specified channel. (The response will not include
  9247. // comments left on videos that the channel uploaded.)
  9248. func (c *CommentThreadsListCall) ChannelId(channelId string) *CommentThreadsListCall {
  9249. c.urlParams_.Set("channelId", channelId)
  9250. return c
  9251. }
  9252. // Id sets the optional parameter "id": The id parameter specifies a
  9253. // comma-separated list of comment thread IDs for the resources that
  9254. // should be retrieved.
  9255. func (c *CommentThreadsListCall) Id(id string) *CommentThreadsListCall {
  9256. c.urlParams_.Set("id", id)
  9257. return c
  9258. }
  9259. // MaxResults sets the optional parameter "maxResults": The maxResults
  9260. // parameter specifies the maximum number of items that should be
  9261. // returned in the result set.
  9262. //
  9263. // Note: This parameter is not supported for use in conjunction with the
  9264. // id parameter.
  9265. func (c *CommentThreadsListCall) MaxResults(maxResults int64) *CommentThreadsListCall {
  9266. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9267. return c
  9268. }
  9269. // ModerationStatus sets the optional parameter "moderationStatus": Set
  9270. // this parameter to limit the returned comment threads to a particular
  9271. // moderation state.
  9272. //
  9273. // Note: This parameter is not supported for use in conjunction with the
  9274. // id parameter.
  9275. //
  9276. // Possible values:
  9277. // "heldForReview" - Retrieve comment threads that are awaiting review
  9278. // by a moderator. A comment thread can be included in the response if
  9279. // the top-level comment or at least one of the replies to that comment
  9280. // are awaiting review.
  9281. // "likelySpam" - Retrieve comment threads classified as likely to be
  9282. // spam. A comment thread can be included in the response if the
  9283. // top-level comment or at least one of the replies to that comment is
  9284. // considered likely to be spam.
  9285. // "published" - Retrieve threads of published comments. This is the
  9286. // default value. A comment thread can be included in the response if
  9287. // its top-level comment has been published.
  9288. func (c *CommentThreadsListCall) ModerationStatus(moderationStatus string) *CommentThreadsListCall {
  9289. c.urlParams_.Set("moderationStatus", moderationStatus)
  9290. return c
  9291. }
  9292. // Order sets the optional parameter "order": The order parameter
  9293. // specifies the order in which the API response should list comment
  9294. // threads. Valid values are:
  9295. // - time - Comment threads are ordered by time. This is the default
  9296. // behavior.
  9297. // - relevance - Comment threads are ordered by relevance.Note: This
  9298. // parameter is not supported for use in conjunction with the id
  9299. // parameter.
  9300. //
  9301. // Possible values:
  9302. // "relevance" - Order by relevance.
  9303. // "time" - Order by time.
  9304. func (c *CommentThreadsListCall) Order(order string) *CommentThreadsListCall {
  9305. c.urlParams_.Set("order", order)
  9306. return c
  9307. }
  9308. // PageToken sets the optional parameter "pageToken": The pageToken
  9309. // parameter identifies a specific page in the result set that should be
  9310. // returned. In an API response, the nextPageToken property identifies
  9311. // the next page of the result that can be retrieved.
  9312. //
  9313. // Note: This parameter is not supported for use in conjunction with the
  9314. // id parameter.
  9315. func (c *CommentThreadsListCall) PageToken(pageToken string) *CommentThreadsListCall {
  9316. c.urlParams_.Set("pageToken", pageToken)
  9317. return c
  9318. }
  9319. // SearchTerms sets the optional parameter "searchTerms": The
  9320. // searchTerms parameter instructs the API to limit the API response to
  9321. // only contain comments that contain the specified search terms.
  9322. //
  9323. // Note: This parameter is not supported for use in conjunction with the
  9324. // id parameter.
  9325. func (c *CommentThreadsListCall) SearchTerms(searchTerms string) *CommentThreadsListCall {
  9326. c.urlParams_.Set("searchTerms", searchTerms)
  9327. return c
  9328. }
  9329. // TextFormat sets the optional parameter "textFormat": Set this
  9330. // parameter's value to html or plainText to instruct the API to return
  9331. // the comments left by users in html formatted or in plain text.
  9332. //
  9333. // Possible values:
  9334. // "html" - Returns the comments in HTML format. This is the default
  9335. // value.
  9336. // "plainText" - Returns the comments in plain text format.
  9337. func (c *CommentThreadsListCall) TextFormat(textFormat string) *CommentThreadsListCall {
  9338. c.urlParams_.Set("textFormat", textFormat)
  9339. return c
  9340. }
  9341. // VideoId sets the optional parameter "videoId": The videoId parameter
  9342. // instructs the API to return comment threads associated with the
  9343. // specified video ID.
  9344. func (c *CommentThreadsListCall) VideoId(videoId string) *CommentThreadsListCall {
  9345. c.urlParams_.Set("videoId", videoId)
  9346. return c
  9347. }
  9348. // Fields allows partial responses to be retrieved. See
  9349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9350. // for more information.
  9351. func (c *CommentThreadsListCall) Fields(s ...googleapi.Field) *CommentThreadsListCall {
  9352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9353. return c
  9354. }
  9355. // IfNoneMatch sets the optional parameter which makes the operation
  9356. // fail if the object's ETag matches the given value. This is useful for
  9357. // getting updates only after the object has changed since the last
  9358. // request. Use googleapi.IsNotModified to check whether the response
  9359. // error from Do is the result of In-None-Match.
  9360. func (c *CommentThreadsListCall) IfNoneMatch(entityTag string) *CommentThreadsListCall {
  9361. c.ifNoneMatch_ = entityTag
  9362. return c
  9363. }
  9364. // Context sets the context to be used in this call's Do method. Any
  9365. // pending HTTP request will be aborted if the provided context is
  9366. // canceled.
  9367. func (c *CommentThreadsListCall) Context(ctx context.Context) *CommentThreadsListCall {
  9368. c.ctx_ = ctx
  9369. return c
  9370. }
  9371. func (c *CommentThreadsListCall) doRequest(alt string) (*http.Response, error) {
  9372. var body io.Reader = nil
  9373. c.urlParams_.Set("alt", alt)
  9374. urls := googleapi.ResolveRelative(c.s.BasePath, "commentThreads")
  9375. urls += "?" + c.urlParams_.Encode()
  9376. req, _ := http.NewRequest("GET", urls, body)
  9377. googleapi.SetOpaque(req.URL)
  9378. req.Header.Set("User-Agent", c.s.userAgent())
  9379. if c.ifNoneMatch_ != "" {
  9380. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9381. }
  9382. if c.ctx_ != nil {
  9383. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9384. }
  9385. return c.s.client.Do(req)
  9386. }
  9387. // Do executes the "youtube.commentThreads.list" call.
  9388. // Exactly one of *CommentThreadListResponse or error will be non-nil.
  9389. // Any non-2xx status code is an error. Response headers are in either
  9390. // *CommentThreadListResponse.ServerResponse.Header or (if a response
  9391. // was returned at all) in error.(*googleapi.Error).Header. Use
  9392. // googleapi.IsNotModified to check whether the returned error was
  9393. // because http.StatusNotModified was returned.
  9394. func (c *CommentThreadsListCall) Do(opts ...googleapi.CallOption) (*CommentThreadListResponse, error) {
  9395. gensupport.SetOptions(c.urlParams_, opts...)
  9396. res, err := c.doRequest("json")
  9397. if res != nil && res.StatusCode == http.StatusNotModified {
  9398. if res.Body != nil {
  9399. res.Body.Close()
  9400. }
  9401. return nil, &googleapi.Error{
  9402. Code: res.StatusCode,
  9403. Header: res.Header,
  9404. }
  9405. }
  9406. if err != nil {
  9407. return nil, err
  9408. }
  9409. defer googleapi.CloseBody(res)
  9410. if err := googleapi.CheckResponse(res); err != nil {
  9411. return nil, err
  9412. }
  9413. ret := &CommentThreadListResponse{
  9414. ServerResponse: googleapi.ServerResponse{
  9415. Header: res.Header,
  9416. HTTPStatusCode: res.StatusCode,
  9417. },
  9418. }
  9419. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9420. return nil, err
  9421. }
  9422. return ret, nil
  9423. // {
  9424. // "description": "Returns a list of comment threads that match the API request parameters.",
  9425. // "httpMethod": "GET",
  9426. // "id": "youtube.commentThreads.list",
  9427. // "parameterOrder": [
  9428. // "part"
  9429. // ],
  9430. // "parameters": {
  9431. // "allThreadsRelatedToChannelId": {
  9432. // "description": "The allThreadsRelatedToChannelId parameter instructs the API to return all comment threads associated with the specified channel. The response can include comments about the channel or about the channel's videos.",
  9433. // "location": "query",
  9434. // "type": "string"
  9435. // },
  9436. // "channelId": {
  9437. // "description": "The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.)",
  9438. // "location": "query",
  9439. // "type": "string"
  9440. // },
  9441. // "id": {
  9442. // "description": "The id parameter specifies a comma-separated list of comment thread IDs for the resources that should be retrieved.",
  9443. // "location": "query",
  9444. // "type": "string"
  9445. // },
  9446. // "maxResults": {
  9447. // "default": "20",
  9448. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  9449. // "format": "uint32",
  9450. // "location": "query",
  9451. // "maximum": "100",
  9452. // "minimum": "1",
  9453. // "type": "integer"
  9454. // },
  9455. // "moderationStatus": {
  9456. // "default": "MODERATION_STATUS_PUBLISHED",
  9457. // "description": "Set this parameter to limit the returned comment threads to a particular moderation state.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  9458. // "enum": [
  9459. // "heldForReview",
  9460. // "likelySpam",
  9461. // "published"
  9462. // ],
  9463. // "enumDescriptions": [
  9464. // "Retrieve comment threads that are awaiting review by a moderator. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment are awaiting review.",
  9465. // "Retrieve comment threads classified as likely to be spam. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment is considered likely to be spam.",
  9466. // "Retrieve threads of published comments. This is the default value. A comment thread can be included in the response if its top-level comment has been published."
  9467. // ],
  9468. // "location": "query",
  9469. // "type": "string"
  9470. // },
  9471. // "order": {
  9472. // "default": "true",
  9473. // "description": "The order parameter specifies the order in which the API response should list comment threads. Valid values are: \n- time - Comment threads are ordered by time. This is the default behavior.\n- relevance - Comment threads are ordered by relevance.Note: This parameter is not supported for use in conjunction with the id parameter.",
  9474. // "enum": [
  9475. // "relevance",
  9476. // "time"
  9477. // ],
  9478. // "enumDescriptions": [
  9479. // "Order by relevance.",
  9480. // "Order by time."
  9481. // ],
  9482. // "location": "query",
  9483. // "type": "string"
  9484. // },
  9485. // "pageToken": {
  9486. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  9487. // "location": "query",
  9488. // "type": "string"
  9489. // },
  9490. // "part": {
  9491. // "description": "The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include.",
  9492. // "location": "query",
  9493. // "required": true,
  9494. // "type": "string"
  9495. // },
  9496. // "searchTerms": {
  9497. // "description": "The searchTerms parameter instructs the API to limit the API response to only contain comments that contain the specified search terms.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  9498. // "location": "query",
  9499. // "type": "string"
  9500. // },
  9501. // "textFormat": {
  9502. // "default": "FORMAT_HTML",
  9503. // "description": "Set this parameter's value to html or plainText to instruct the API to return the comments left by users in html formatted or in plain text.",
  9504. // "enum": [
  9505. // "html",
  9506. // "plainText"
  9507. // ],
  9508. // "enumDescriptions": [
  9509. // "Returns the comments in HTML format. This is the default value.",
  9510. // "Returns the comments in plain text format."
  9511. // ],
  9512. // "location": "query",
  9513. // "type": "string"
  9514. // },
  9515. // "videoId": {
  9516. // "description": "The videoId parameter instructs the API to return comment threads associated with the specified video ID.",
  9517. // "location": "query",
  9518. // "type": "string"
  9519. // }
  9520. // },
  9521. // "path": "commentThreads",
  9522. // "response": {
  9523. // "$ref": "CommentThreadListResponse"
  9524. // },
  9525. // "scopes": [
  9526. // "https://www.googleapis.com/auth/youtube.force-ssl"
  9527. // ]
  9528. // }
  9529. }
  9530. // Pages invokes f for each page of results.
  9531. // A non-nil error returned from f will halt the iteration.
  9532. // The provided context supersedes any context provided to the Context method.
  9533. func (c *CommentThreadsListCall) Pages(ctx context.Context, f func(*CommentThreadListResponse) error) error {
  9534. c.ctx_ = ctx
  9535. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9536. for {
  9537. x, err := c.Do()
  9538. if err != nil {
  9539. return err
  9540. }
  9541. if err := f(x); err != nil {
  9542. return err
  9543. }
  9544. if x.NextPageToken == "" {
  9545. return nil
  9546. }
  9547. c.PageToken(x.NextPageToken)
  9548. }
  9549. }
  9550. // method id "youtube.commentThreads.update":
  9551. type CommentThreadsUpdateCall struct {
  9552. s *Service
  9553. commentthread *CommentThread
  9554. urlParams_ gensupport.URLParams
  9555. ctx_ context.Context
  9556. }
  9557. // Update: Modifies the top-level comment in a comment thread.
  9558. func (r *CommentThreadsService) Update(part string, commentthread *CommentThread) *CommentThreadsUpdateCall {
  9559. c := &CommentThreadsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9560. c.urlParams_.Set("part", part)
  9561. c.commentthread = commentthread
  9562. return c
  9563. }
  9564. // Fields allows partial responses to be retrieved. See
  9565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9566. // for more information.
  9567. func (c *CommentThreadsUpdateCall) Fields(s ...googleapi.Field) *CommentThreadsUpdateCall {
  9568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9569. return c
  9570. }
  9571. // Context sets the context to be used in this call's Do method. Any
  9572. // pending HTTP request will be aborted if the provided context is
  9573. // canceled.
  9574. func (c *CommentThreadsUpdateCall) Context(ctx context.Context) *CommentThreadsUpdateCall {
  9575. c.ctx_ = ctx
  9576. return c
  9577. }
  9578. func (c *CommentThreadsUpdateCall) doRequest(alt string) (*http.Response, error) {
  9579. var body io.Reader = nil
  9580. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentthread)
  9581. if err != nil {
  9582. return nil, err
  9583. }
  9584. ctype := "application/json"
  9585. c.urlParams_.Set("alt", alt)
  9586. urls := googleapi.ResolveRelative(c.s.BasePath, "commentThreads")
  9587. urls += "?" + c.urlParams_.Encode()
  9588. req, _ := http.NewRequest("PUT", urls, body)
  9589. googleapi.SetOpaque(req.URL)
  9590. req.Header.Set("Content-Type", ctype)
  9591. req.Header.Set("User-Agent", c.s.userAgent())
  9592. if c.ctx_ != nil {
  9593. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9594. }
  9595. return c.s.client.Do(req)
  9596. }
  9597. // Do executes the "youtube.commentThreads.update" call.
  9598. // Exactly one of *CommentThread or error will be non-nil. Any non-2xx
  9599. // status code is an error. Response headers are in either
  9600. // *CommentThread.ServerResponse.Header or (if a response was returned
  9601. // at all) in error.(*googleapi.Error).Header. Use
  9602. // googleapi.IsNotModified to check whether the returned error was
  9603. // because http.StatusNotModified was returned.
  9604. func (c *CommentThreadsUpdateCall) Do(opts ...googleapi.CallOption) (*CommentThread, error) {
  9605. gensupport.SetOptions(c.urlParams_, opts...)
  9606. res, err := c.doRequest("json")
  9607. if res != nil && res.StatusCode == http.StatusNotModified {
  9608. if res.Body != nil {
  9609. res.Body.Close()
  9610. }
  9611. return nil, &googleapi.Error{
  9612. Code: res.StatusCode,
  9613. Header: res.Header,
  9614. }
  9615. }
  9616. if err != nil {
  9617. return nil, err
  9618. }
  9619. defer googleapi.CloseBody(res)
  9620. if err := googleapi.CheckResponse(res); err != nil {
  9621. return nil, err
  9622. }
  9623. ret := &CommentThread{
  9624. ServerResponse: googleapi.ServerResponse{
  9625. Header: res.Header,
  9626. HTTPStatusCode: res.StatusCode,
  9627. },
  9628. }
  9629. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9630. return nil, err
  9631. }
  9632. return ret, nil
  9633. // {
  9634. // "description": "Modifies the top-level comment in a comment thread.",
  9635. // "httpMethod": "PUT",
  9636. // "id": "youtube.commentThreads.update",
  9637. // "parameterOrder": [
  9638. // "part"
  9639. // ],
  9640. // "parameters": {
  9641. // "part": {
  9642. // "description": "The part parameter specifies a comma-separated list of commentThread resource properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.",
  9643. // "location": "query",
  9644. // "required": true,
  9645. // "type": "string"
  9646. // }
  9647. // },
  9648. // "path": "commentThreads",
  9649. // "request": {
  9650. // "$ref": "CommentThread"
  9651. // },
  9652. // "response": {
  9653. // "$ref": "CommentThread"
  9654. // },
  9655. // "scopes": [
  9656. // "https://www.googleapis.com/auth/youtube.force-ssl"
  9657. // ]
  9658. // }
  9659. }
  9660. // method id "youtube.comments.delete":
  9661. type CommentsDeleteCall struct {
  9662. s *Service
  9663. urlParams_ gensupport.URLParams
  9664. ctx_ context.Context
  9665. }
  9666. // Delete: Deletes a comment.
  9667. func (r *CommentsService) Delete(id string) *CommentsDeleteCall {
  9668. c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9669. c.urlParams_.Set("id", id)
  9670. return c
  9671. }
  9672. // Fields allows partial responses to be retrieved. See
  9673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9674. // for more information.
  9675. func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
  9676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9677. return c
  9678. }
  9679. // Context sets the context to be used in this call's Do method. Any
  9680. // pending HTTP request will be aborted if the provided context is
  9681. // canceled.
  9682. func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall {
  9683. c.ctx_ = ctx
  9684. return c
  9685. }
  9686. func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9687. var body io.Reader = nil
  9688. c.urlParams_.Set("alt", alt)
  9689. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  9690. urls += "?" + c.urlParams_.Encode()
  9691. req, _ := http.NewRequest("DELETE", urls, body)
  9692. googleapi.SetOpaque(req.URL)
  9693. req.Header.Set("User-Agent", c.s.userAgent())
  9694. if c.ctx_ != nil {
  9695. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9696. }
  9697. return c.s.client.Do(req)
  9698. }
  9699. // Do executes the "youtube.comments.delete" call.
  9700. func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  9701. gensupport.SetOptions(c.urlParams_, opts...)
  9702. res, err := c.doRequest("json")
  9703. if err != nil {
  9704. return err
  9705. }
  9706. defer googleapi.CloseBody(res)
  9707. if err := googleapi.CheckResponse(res); err != nil {
  9708. return err
  9709. }
  9710. return nil
  9711. // {
  9712. // "description": "Deletes a comment.",
  9713. // "httpMethod": "DELETE",
  9714. // "id": "youtube.comments.delete",
  9715. // "parameterOrder": [
  9716. // "id"
  9717. // ],
  9718. // "parameters": {
  9719. // "id": {
  9720. // "description": "The id parameter specifies the comment ID for the resource that is being deleted.",
  9721. // "location": "query",
  9722. // "required": true,
  9723. // "type": "string"
  9724. // }
  9725. // },
  9726. // "path": "comments",
  9727. // "scopes": [
  9728. // "https://www.googleapis.com/auth/youtube.force-ssl"
  9729. // ]
  9730. // }
  9731. }
  9732. // method id "youtube.comments.insert":
  9733. type CommentsInsertCall struct {
  9734. s *Service
  9735. comment *Comment
  9736. urlParams_ gensupport.URLParams
  9737. ctx_ context.Context
  9738. }
  9739. // Insert: Creates a reply to an existing comment. Note: To create a
  9740. // top-level comment, use the commentThreads.insert method.
  9741. func (r *CommentsService) Insert(part string, comment *Comment) *CommentsInsertCall {
  9742. c := &CommentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9743. c.urlParams_.Set("part", part)
  9744. c.comment = comment
  9745. return c
  9746. }
  9747. // Fields allows partial responses to be retrieved. See
  9748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9749. // for more information.
  9750. func (c *CommentsInsertCall) Fields(s ...googleapi.Field) *CommentsInsertCall {
  9751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9752. return c
  9753. }
  9754. // Context sets the context to be used in this call's Do method. Any
  9755. // pending HTTP request will be aborted if the provided context is
  9756. // canceled.
  9757. func (c *CommentsInsertCall) Context(ctx context.Context) *CommentsInsertCall {
  9758. c.ctx_ = ctx
  9759. return c
  9760. }
  9761. func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, error) {
  9762. var body io.Reader = nil
  9763. body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
  9764. if err != nil {
  9765. return nil, err
  9766. }
  9767. ctype := "application/json"
  9768. c.urlParams_.Set("alt", alt)
  9769. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  9770. urls += "?" + c.urlParams_.Encode()
  9771. req, _ := http.NewRequest("POST", urls, body)
  9772. googleapi.SetOpaque(req.URL)
  9773. req.Header.Set("Content-Type", ctype)
  9774. req.Header.Set("User-Agent", c.s.userAgent())
  9775. if c.ctx_ != nil {
  9776. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9777. }
  9778. return c.s.client.Do(req)
  9779. }
  9780. // Do executes the "youtube.comments.insert" call.
  9781. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  9782. // code is an error. Response headers are in either
  9783. // *Comment.ServerResponse.Header or (if a response was returned at all)
  9784. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9785. // check whether the returned error was because http.StatusNotModified
  9786. // was returned.
  9787. func (c *CommentsInsertCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  9788. gensupport.SetOptions(c.urlParams_, opts...)
  9789. res, err := c.doRequest("json")
  9790. if res != nil && res.StatusCode == http.StatusNotModified {
  9791. if res.Body != nil {
  9792. res.Body.Close()
  9793. }
  9794. return nil, &googleapi.Error{
  9795. Code: res.StatusCode,
  9796. Header: res.Header,
  9797. }
  9798. }
  9799. if err != nil {
  9800. return nil, err
  9801. }
  9802. defer googleapi.CloseBody(res)
  9803. if err := googleapi.CheckResponse(res); err != nil {
  9804. return nil, err
  9805. }
  9806. ret := &Comment{
  9807. ServerResponse: googleapi.ServerResponse{
  9808. Header: res.Header,
  9809. HTTPStatusCode: res.StatusCode,
  9810. },
  9811. }
  9812. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9813. return nil, err
  9814. }
  9815. return ret, nil
  9816. // {
  9817. // "description": "Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method.",
  9818. // "httpMethod": "POST",
  9819. // "id": "youtube.comments.insert",
  9820. // "parameterOrder": [
  9821. // "part"
  9822. // ],
  9823. // "parameters": {
  9824. // "part": {
  9825. // "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.",
  9826. // "location": "query",
  9827. // "required": true,
  9828. // "type": "string"
  9829. // }
  9830. // },
  9831. // "path": "comments",
  9832. // "request": {
  9833. // "$ref": "Comment"
  9834. // },
  9835. // "response": {
  9836. // "$ref": "Comment"
  9837. // },
  9838. // "scopes": [
  9839. // "https://www.googleapis.com/auth/youtube.force-ssl"
  9840. // ]
  9841. // }
  9842. }
  9843. // method id "youtube.comments.list":
  9844. type CommentsListCall struct {
  9845. s *Service
  9846. urlParams_ gensupport.URLParams
  9847. ifNoneMatch_ string
  9848. ctx_ context.Context
  9849. }
  9850. // List: Returns a list of comments that match the API request
  9851. // parameters.
  9852. func (r *CommentsService) List(part string) *CommentsListCall {
  9853. c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9854. c.urlParams_.Set("part", part)
  9855. return c
  9856. }
  9857. // Id sets the optional parameter "id": The id parameter specifies a
  9858. // comma-separated list of comment IDs for the resources that are being
  9859. // retrieved. In a comment resource, the id property specifies the
  9860. // comment's ID.
  9861. func (c *CommentsListCall) Id(id string) *CommentsListCall {
  9862. c.urlParams_.Set("id", id)
  9863. return c
  9864. }
  9865. // MaxResults sets the optional parameter "maxResults": The maxResults
  9866. // parameter specifies the maximum number of items that should be
  9867. // returned in the result set.
  9868. //
  9869. // Note: This parameter is not supported for use in conjunction with the
  9870. // id parameter.
  9871. func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
  9872. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9873. return c
  9874. }
  9875. // PageToken sets the optional parameter "pageToken": The pageToken
  9876. // parameter identifies a specific page in the result set that should be
  9877. // returned. In an API response, the nextPageToken property identifies
  9878. // the next page of the result that can be retrieved.
  9879. //
  9880. // Note: This parameter is not supported for use in conjunction with the
  9881. // id parameter.
  9882. func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
  9883. c.urlParams_.Set("pageToken", pageToken)
  9884. return c
  9885. }
  9886. // ParentId sets the optional parameter "parentId": The parentId
  9887. // parameter specifies the ID of the comment for which replies should be
  9888. // retrieved.
  9889. //
  9890. // Note: YouTube currently supports replies only for top-level comments.
  9891. // However, replies to replies may be supported in the future.
  9892. func (c *CommentsListCall) ParentId(parentId string) *CommentsListCall {
  9893. c.urlParams_.Set("parentId", parentId)
  9894. return c
  9895. }
  9896. // TextFormat sets the optional parameter "textFormat": This parameter
  9897. // indicates whether the API should return comments formatted as HTML or
  9898. // as plain text.
  9899. //
  9900. // Possible values:
  9901. // "html" - Returns the comments in HTML format. This is the default
  9902. // value.
  9903. // "plainText" - Returns the comments in plain text format.
  9904. func (c *CommentsListCall) TextFormat(textFormat string) *CommentsListCall {
  9905. c.urlParams_.Set("textFormat", textFormat)
  9906. return c
  9907. }
  9908. // Fields allows partial responses to be retrieved. See
  9909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9910. // for more information.
  9911. func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
  9912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9913. return c
  9914. }
  9915. // IfNoneMatch sets the optional parameter which makes the operation
  9916. // fail if the object's ETag matches the given value. This is useful for
  9917. // getting updates only after the object has changed since the last
  9918. // request. Use googleapi.IsNotModified to check whether the response
  9919. // error from Do is the result of In-None-Match.
  9920. func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
  9921. c.ifNoneMatch_ = entityTag
  9922. return c
  9923. }
  9924. // Context sets the context to be used in this call's Do method. Any
  9925. // pending HTTP request will be aborted if the provided context is
  9926. // canceled.
  9927. func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
  9928. c.ctx_ = ctx
  9929. return c
  9930. }
  9931. func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
  9932. var body io.Reader = nil
  9933. c.urlParams_.Set("alt", alt)
  9934. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  9935. urls += "?" + c.urlParams_.Encode()
  9936. req, _ := http.NewRequest("GET", urls, body)
  9937. googleapi.SetOpaque(req.URL)
  9938. req.Header.Set("User-Agent", c.s.userAgent())
  9939. if c.ifNoneMatch_ != "" {
  9940. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9941. }
  9942. if c.ctx_ != nil {
  9943. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9944. }
  9945. return c.s.client.Do(req)
  9946. }
  9947. // Do executes the "youtube.comments.list" call.
  9948. // Exactly one of *CommentListResponse or error will be non-nil. Any
  9949. // non-2xx status code is an error. Response headers are in either
  9950. // *CommentListResponse.ServerResponse.Header or (if a response was
  9951. // returned at all) in error.(*googleapi.Error).Header. Use
  9952. // googleapi.IsNotModified to check whether the returned error was
  9953. // because http.StatusNotModified was returned.
  9954. func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentListResponse, error) {
  9955. gensupport.SetOptions(c.urlParams_, opts...)
  9956. res, err := c.doRequest("json")
  9957. if res != nil && res.StatusCode == http.StatusNotModified {
  9958. if res.Body != nil {
  9959. res.Body.Close()
  9960. }
  9961. return nil, &googleapi.Error{
  9962. Code: res.StatusCode,
  9963. Header: res.Header,
  9964. }
  9965. }
  9966. if err != nil {
  9967. return nil, err
  9968. }
  9969. defer googleapi.CloseBody(res)
  9970. if err := googleapi.CheckResponse(res); err != nil {
  9971. return nil, err
  9972. }
  9973. ret := &CommentListResponse{
  9974. ServerResponse: googleapi.ServerResponse{
  9975. Header: res.Header,
  9976. HTTPStatusCode: res.StatusCode,
  9977. },
  9978. }
  9979. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9980. return nil, err
  9981. }
  9982. return ret, nil
  9983. // {
  9984. // "description": "Returns a list of comments that match the API request parameters.",
  9985. // "httpMethod": "GET",
  9986. // "id": "youtube.comments.list",
  9987. // "parameterOrder": [
  9988. // "part"
  9989. // ],
  9990. // "parameters": {
  9991. // "id": {
  9992. // "description": "The id parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a comment resource, the id property specifies the comment's ID.",
  9993. // "location": "query",
  9994. // "type": "string"
  9995. // },
  9996. // "maxResults": {
  9997. // "default": "20",
  9998. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  9999. // "format": "uint32",
  10000. // "location": "query",
  10001. // "maximum": "100",
  10002. // "minimum": "1",
  10003. // "type": "integer"
  10004. // },
  10005. // "pageToken": {
  10006. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  10007. // "location": "query",
  10008. // "type": "string"
  10009. // },
  10010. // "parentId": {
  10011. // "description": "The parentId parameter specifies the ID of the comment for which replies should be retrieved.\n\nNote: YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future.",
  10012. // "location": "query",
  10013. // "type": "string"
  10014. // },
  10015. // "part": {
  10016. // "description": "The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include.",
  10017. // "location": "query",
  10018. // "required": true,
  10019. // "type": "string"
  10020. // },
  10021. // "textFormat": {
  10022. // "default": "FORMAT_HTML",
  10023. // "description": "This parameter indicates whether the API should return comments formatted as HTML or as plain text.",
  10024. // "enum": [
  10025. // "html",
  10026. // "plainText"
  10027. // ],
  10028. // "enumDescriptions": [
  10029. // "Returns the comments in HTML format. This is the default value.",
  10030. // "Returns the comments in plain text format."
  10031. // ],
  10032. // "location": "query",
  10033. // "type": "string"
  10034. // }
  10035. // },
  10036. // "path": "comments",
  10037. // "response": {
  10038. // "$ref": "CommentListResponse"
  10039. // },
  10040. // "scopes": [
  10041. // "https://www.googleapis.com/auth/youtube.force-ssl"
  10042. // ]
  10043. // }
  10044. }
  10045. // Pages invokes f for each page of results.
  10046. // A non-nil error returned from f will halt the iteration.
  10047. // The provided context supersedes any context provided to the Context method.
  10048. func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentListResponse) error) error {
  10049. c.ctx_ = ctx
  10050. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10051. for {
  10052. x, err := c.Do()
  10053. if err != nil {
  10054. return err
  10055. }
  10056. if err := f(x); err != nil {
  10057. return err
  10058. }
  10059. if x.NextPageToken == "" {
  10060. return nil
  10061. }
  10062. c.PageToken(x.NextPageToken)
  10063. }
  10064. }
  10065. // method id "youtube.comments.markAsSpam":
  10066. type CommentsMarkAsSpamCall struct {
  10067. s *Service
  10068. urlParams_ gensupport.URLParams
  10069. ctx_ context.Context
  10070. }
  10071. // MarkAsSpam: Expresses the caller's opinion that one or more comments
  10072. // should be flagged as spam.
  10073. func (r *CommentsService) MarkAsSpam(id string) *CommentsMarkAsSpamCall {
  10074. c := &CommentsMarkAsSpamCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10075. c.urlParams_.Set("id", id)
  10076. return c
  10077. }
  10078. // Fields allows partial responses to be retrieved. See
  10079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10080. // for more information.
  10081. func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall {
  10082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10083. return c
  10084. }
  10085. // Context sets the context to be used in this call's Do method. Any
  10086. // pending HTTP request will be aborted if the provided context is
  10087. // canceled.
  10088. func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall {
  10089. c.ctx_ = ctx
  10090. return c
  10091. }
  10092. func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) {
  10093. var body io.Reader = nil
  10094. c.urlParams_.Set("alt", alt)
  10095. urls := googleapi.ResolveRelative(c.s.BasePath, "comments/markAsSpam")
  10096. urls += "?" + c.urlParams_.Encode()
  10097. req, _ := http.NewRequest("POST", urls, body)
  10098. googleapi.SetOpaque(req.URL)
  10099. req.Header.Set("User-Agent", c.s.userAgent())
  10100. if c.ctx_ != nil {
  10101. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10102. }
  10103. return c.s.client.Do(req)
  10104. }
  10105. // Do executes the "youtube.comments.markAsSpam" call.
  10106. func (c *CommentsMarkAsSpamCall) Do(opts ...googleapi.CallOption) error {
  10107. gensupport.SetOptions(c.urlParams_, opts...)
  10108. res, err := c.doRequest("json")
  10109. if err != nil {
  10110. return err
  10111. }
  10112. defer googleapi.CloseBody(res)
  10113. if err := googleapi.CheckResponse(res); err != nil {
  10114. return err
  10115. }
  10116. return nil
  10117. // {
  10118. // "description": "Expresses the caller's opinion that one or more comments should be flagged as spam.",
  10119. // "httpMethod": "POST",
  10120. // "id": "youtube.comments.markAsSpam",
  10121. // "parameterOrder": [
  10122. // "id"
  10123. // ],
  10124. // "parameters": {
  10125. // "id": {
  10126. // "description": "The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam.",
  10127. // "location": "query",
  10128. // "required": true,
  10129. // "type": "string"
  10130. // }
  10131. // },
  10132. // "path": "comments/markAsSpam",
  10133. // "scopes": [
  10134. // "https://www.googleapis.com/auth/youtube.force-ssl"
  10135. // ]
  10136. // }
  10137. }
  10138. // method id "youtube.comments.setModerationStatus":
  10139. type CommentsSetModerationStatusCall struct {
  10140. s *Service
  10141. urlParams_ gensupport.URLParams
  10142. ctx_ context.Context
  10143. }
  10144. // SetModerationStatus: Sets the moderation status of one or more
  10145. // comments. The API request must be authorized by the owner of the
  10146. // channel or video associated with the comments.
  10147. func (r *CommentsService) SetModerationStatus(id string, moderationStatus string) *CommentsSetModerationStatusCall {
  10148. c := &CommentsSetModerationStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10149. c.urlParams_.Set("id", id)
  10150. c.urlParams_.Set("moderationStatus", moderationStatus)
  10151. return c
  10152. }
  10153. // BanAuthor sets the optional parameter "banAuthor": The banAuthor
  10154. // parameter lets you indicate that you want to automatically reject any
  10155. // additional comments written by the comment's author. Set the
  10156. // parameter value to true to ban the author.
  10157. //
  10158. // Note: This parameter is only valid if the moderationStatus parameter
  10159. // is also set to rejected.
  10160. func (c *CommentsSetModerationStatusCall) BanAuthor(banAuthor bool) *CommentsSetModerationStatusCall {
  10161. c.urlParams_.Set("banAuthor", fmt.Sprint(banAuthor))
  10162. return c
  10163. }
  10164. // Fields allows partial responses to be retrieved. See
  10165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10166. // for more information.
  10167. func (c *CommentsSetModerationStatusCall) Fields(s ...googleapi.Field) *CommentsSetModerationStatusCall {
  10168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10169. return c
  10170. }
  10171. // Context sets the context to be used in this call's Do method. Any
  10172. // pending HTTP request will be aborted if the provided context is
  10173. // canceled.
  10174. func (c *CommentsSetModerationStatusCall) Context(ctx context.Context) *CommentsSetModerationStatusCall {
  10175. c.ctx_ = ctx
  10176. return c
  10177. }
  10178. func (c *CommentsSetModerationStatusCall) doRequest(alt string) (*http.Response, error) {
  10179. var body io.Reader = nil
  10180. c.urlParams_.Set("alt", alt)
  10181. urls := googleapi.ResolveRelative(c.s.BasePath, "comments/setModerationStatus")
  10182. urls += "?" + c.urlParams_.Encode()
  10183. req, _ := http.NewRequest("POST", urls, body)
  10184. googleapi.SetOpaque(req.URL)
  10185. req.Header.Set("User-Agent", c.s.userAgent())
  10186. if c.ctx_ != nil {
  10187. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10188. }
  10189. return c.s.client.Do(req)
  10190. }
  10191. // Do executes the "youtube.comments.setModerationStatus" call.
  10192. func (c *CommentsSetModerationStatusCall) Do(opts ...googleapi.CallOption) error {
  10193. gensupport.SetOptions(c.urlParams_, opts...)
  10194. res, err := c.doRequest("json")
  10195. if err != nil {
  10196. return err
  10197. }
  10198. defer googleapi.CloseBody(res)
  10199. if err := googleapi.CheckResponse(res); err != nil {
  10200. return err
  10201. }
  10202. return nil
  10203. // {
  10204. // "description": "Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments.",
  10205. // "httpMethod": "POST",
  10206. // "id": "youtube.comments.setModerationStatus",
  10207. // "parameterOrder": [
  10208. // "id",
  10209. // "moderationStatus"
  10210. // ],
  10211. // "parameters": {
  10212. // "banAuthor": {
  10213. // "default": "false",
  10214. // "description": "The banAuthor parameter lets you indicate that you want to automatically reject any additional comments written by the comment's author. Set the parameter value to true to ban the author.\n\nNote: This parameter is only valid if the moderationStatus parameter is also set to rejected.",
  10215. // "location": "query",
  10216. // "type": "boolean"
  10217. // },
  10218. // "id": {
  10219. // "description": "The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status.",
  10220. // "location": "query",
  10221. // "required": true,
  10222. // "type": "string"
  10223. // },
  10224. // "moderationStatus": {
  10225. // "description": "Identifies the new moderation status of the specified comments.",
  10226. // "enum": [
  10227. // "heldForReview",
  10228. // "published",
  10229. // "rejected"
  10230. // ],
  10231. // "enumDescriptions": [
  10232. // "Marks a comment as awaiting review by a moderator.",
  10233. // "Clears a comment for public display.",
  10234. // "Rejects a comment as being unfit for display. This action also effectively hides all replies to the rejected comment.\n\nNote: The API does not currently provide a way to list or otherwise discover rejected comments. However, you can change the moderation status of a rejected comment if you still know its ID. If you were to change the moderation status of a rejected comment, the comment replies would subsequently be discoverable again as well."
  10235. // ],
  10236. // "location": "query",
  10237. // "required": true,
  10238. // "type": "string"
  10239. // }
  10240. // },
  10241. // "path": "comments/setModerationStatus",
  10242. // "scopes": [
  10243. // "https://www.googleapis.com/auth/youtube.force-ssl"
  10244. // ]
  10245. // }
  10246. }
  10247. // method id "youtube.comments.update":
  10248. type CommentsUpdateCall struct {
  10249. s *Service
  10250. comment *Comment
  10251. urlParams_ gensupport.URLParams
  10252. ctx_ context.Context
  10253. }
  10254. // Update: Modifies a comment.
  10255. func (r *CommentsService) Update(part string, comment *Comment) *CommentsUpdateCall {
  10256. c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10257. c.urlParams_.Set("part", part)
  10258. c.comment = comment
  10259. return c
  10260. }
  10261. // Fields allows partial responses to be retrieved. See
  10262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10263. // for more information.
  10264. func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall {
  10265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10266. return c
  10267. }
  10268. // Context sets the context to be used in this call's Do method. Any
  10269. // pending HTTP request will be aborted if the provided context is
  10270. // canceled.
  10271. func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall {
  10272. c.ctx_ = ctx
  10273. return c
  10274. }
  10275. func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10276. var body io.Reader = nil
  10277. body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
  10278. if err != nil {
  10279. return nil, err
  10280. }
  10281. ctype := "application/json"
  10282. c.urlParams_.Set("alt", alt)
  10283. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  10284. urls += "?" + c.urlParams_.Encode()
  10285. req, _ := http.NewRequest("PUT", urls, body)
  10286. googleapi.SetOpaque(req.URL)
  10287. req.Header.Set("Content-Type", ctype)
  10288. req.Header.Set("User-Agent", c.s.userAgent())
  10289. if c.ctx_ != nil {
  10290. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10291. }
  10292. return c.s.client.Do(req)
  10293. }
  10294. // Do executes the "youtube.comments.update" call.
  10295. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  10296. // code is an error. Response headers are in either
  10297. // *Comment.ServerResponse.Header or (if a response was returned at all)
  10298. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10299. // check whether the returned error was because http.StatusNotModified
  10300. // was returned.
  10301. func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  10302. gensupport.SetOptions(c.urlParams_, opts...)
  10303. res, err := c.doRequest("json")
  10304. if res != nil && res.StatusCode == http.StatusNotModified {
  10305. if res.Body != nil {
  10306. res.Body.Close()
  10307. }
  10308. return nil, &googleapi.Error{
  10309. Code: res.StatusCode,
  10310. Header: res.Header,
  10311. }
  10312. }
  10313. if err != nil {
  10314. return nil, err
  10315. }
  10316. defer googleapi.CloseBody(res)
  10317. if err := googleapi.CheckResponse(res); err != nil {
  10318. return nil, err
  10319. }
  10320. ret := &Comment{
  10321. ServerResponse: googleapi.ServerResponse{
  10322. Header: res.Header,
  10323. HTTPStatusCode: res.StatusCode,
  10324. },
  10325. }
  10326. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10327. return nil, err
  10328. }
  10329. return ret, nil
  10330. // {
  10331. // "description": "Modifies a comment.",
  10332. // "httpMethod": "PUT",
  10333. // "id": "youtube.comments.update",
  10334. // "parameterOrder": [
  10335. // "part"
  10336. // ],
  10337. // "parameters": {
  10338. // "part": {
  10339. // "description": "The part parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.",
  10340. // "location": "query",
  10341. // "required": true,
  10342. // "type": "string"
  10343. // }
  10344. // },
  10345. // "path": "comments",
  10346. // "request": {
  10347. // "$ref": "Comment"
  10348. // },
  10349. // "response": {
  10350. // "$ref": "Comment"
  10351. // },
  10352. // "scopes": [
  10353. // "https://www.googleapis.com/auth/youtube.force-ssl"
  10354. // ]
  10355. // }
  10356. }
  10357. // method id "youtube.fanFundingEvents.list":
  10358. type FanFundingEventsListCall struct {
  10359. s *Service
  10360. urlParams_ gensupport.URLParams
  10361. ifNoneMatch_ string
  10362. ctx_ context.Context
  10363. }
  10364. // List: Lists fan funding events for a channel.
  10365. func (r *FanFundingEventsService) List(part string) *FanFundingEventsListCall {
  10366. c := &FanFundingEventsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10367. c.urlParams_.Set("part", part)
  10368. return c
  10369. }
  10370. // Hl sets the optional parameter "hl": The hl parameter instructs the
  10371. // API to retrieve localized resource metadata for a specific
  10372. // application language that the YouTube website supports. The parameter
  10373. // value must be a language code included in the list returned by the
  10374. // i18nLanguages.list method.
  10375. //
  10376. // If localized resource details are available in that language, the
  10377. // resource's snippet.localized object will contain the localized
  10378. // values. However, if localized details are not available, the
  10379. // snippet.localized object will contain resource details in the
  10380. // resource's default language.
  10381. func (c *FanFundingEventsListCall) Hl(hl string) *FanFundingEventsListCall {
  10382. c.urlParams_.Set("hl", hl)
  10383. return c
  10384. }
  10385. // MaxResults sets the optional parameter "maxResults": The maxResults
  10386. // parameter specifies the maximum number of items that should be
  10387. // returned in the result set.
  10388. func (c *FanFundingEventsListCall) MaxResults(maxResults int64) *FanFundingEventsListCall {
  10389. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10390. return c
  10391. }
  10392. // PageToken sets the optional parameter "pageToken": The pageToken
  10393. // parameter identifies a specific page in the result set that should be
  10394. // returned. In an API response, the nextPageToken and prevPageToken
  10395. // properties identify other pages that could be retrieved.
  10396. func (c *FanFundingEventsListCall) PageToken(pageToken string) *FanFundingEventsListCall {
  10397. c.urlParams_.Set("pageToken", pageToken)
  10398. return c
  10399. }
  10400. // Fields allows partial responses to be retrieved. See
  10401. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10402. // for more information.
  10403. func (c *FanFundingEventsListCall) Fields(s ...googleapi.Field) *FanFundingEventsListCall {
  10404. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10405. return c
  10406. }
  10407. // IfNoneMatch sets the optional parameter which makes the operation
  10408. // fail if the object's ETag matches the given value. This is useful for
  10409. // getting updates only after the object has changed since the last
  10410. // request. Use googleapi.IsNotModified to check whether the response
  10411. // error from Do is the result of In-None-Match.
  10412. func (c *FanFundingEventsListCall) IfNoneMatch(entityTag string) *FanFundingEventsListCall {
  10413. c.ifNoneMatch_ = entityTag
  10414. return c
  10415. }
  10416. // Context sets the context to be used in this call's Do method. Any
  10417. // pending HTTP request will be aborted if the provided context is
  10418. // canceled.
  10419. func (c *FanFundingEventsListCall) Context(ctx context.Context) *FanFundingEventsListCall {
  10420. c.ctx_ = ctx
  10421. return c
  10422. }
  10423. func (c *FanFundingEventsListCall) doRequest(alt string) (*http.Response, error) {
  10424. var body io.Reader = nil
  10425. c.urlParams_.Set("alt", alt)
  10426. urls := googleapi.ResolveRelative(c.s.BasePath, "fanFundingEvents")
  10427. urls += "?" + c.urlParams_.Encode()
  10428. req, _ := http.NewRequest("GET", urls, body)
  10429. googleapi.SetOpaque(req.URL)
  10430. req.Header.Set("User-Agent", c.s.userAgent())
  10431. if c.ifNoneMatch_ != "" {
  10432. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10433. }
  10434. if c.ctx_ != nil {
  10435. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10436. }
  10437. return c.s.client.Do(req)
  10438. }
  10439. // Do executes the "youtube.fanFundingEvents.list" call.
  10440. // Exactly one of *FanFundingEventListResponse or error will be non-nil.
  10441. // Any non-2xx status code is an error. Response headers are in either
  10442. // *FanFundingEventListResponse.ServerResponse.Header or (if a response
  10443. // was returned at all) in error.(*googleapi.Error).Header. Use
  10444. // googleapi.IsNotModified to check whether the returned error was
  10445. // because http.StatusNotModified was returned.
  10446. func (c *FanFundingEventsListCall) Do(opts ...googleapi.CallOption) (*FanFundingEventListResponse, error) {
  10447. gensupport.SetOptions(c.urlParams_, opts...)
  10448. res, err := c.doRequest("json")
  10449. if res != nil && res.StatusCode == http.StatusNotModified {
  10450. if res.Body != nil {
  10451. res.Body.Close()
  10452. }
  10453. return nil, &googleapi.Error{
  10454. Code: res.StatusCode,
  10455. Header: res.Header,
  10456. }
  10457. }
  10458. if err != nil {
  10459. return nil, err
  10460. }
  10461. defer googleapi.CloseBody(res)
  10462. if err := googleapi.CheckResponse(res); err != nil {
  10463. return nil, err
  10464. }
  10465. ret := &FanFundingEventListResponse{
  10466. ServerResponse: googleapi.ServerResponse{
  10467. Header: res.Header,
  10468. HTTPStatusCode: res.StatusCode,
  10469. },
  10470. }
  10471. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10472. return nil, err
  10473. }
  10474. return ret, nil
  10475. // {
  10476. // "description": "Lists fan funding events for a channel.",
  10477. // "httpMethod": "GET",
  10478. // "id": "youtube.fanFundingEvents.list",
  10479. // "parameterOrder": [
  10480. // "part"
  10481. // ],
  10482. // "parameters": {
  10483. // "hl": {
  10484. // "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.",
  10485. // "location": "query",
  10486. // "type": "string"
  10487. // },
  10488. // "maxResults": {
  10489. // "default": "5",
  10490. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  10491. // "format": "uint32",
  10492. // "location": "query",
  10493. // "maximum": "50",
  10494. // "minimum": "0",
  10495. // "type": "integer"
  10496. // },
  10497. // "pageToken": {
  10498. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  10499. // "location": "query",
  10500. // "type": "string"
  10501. // },
  10502. // "part": {
  10503. // "description": "The part parameter specifies the fanFundingEvent resource parts that the API response will include. Supported values are id and snippet.",
  10504. // "location": "query",
  10505. // "required": true,
  10506. // "type": "string"
  10507. // }
  10508. // },
  10509. // "path": "fanFundingEvents",
  10510. // "response": {
  10511. // "$ref": "FanFundingEventListResponse"
  10512. // },
  10513. // "scopes": [
  10514. // "https://www.googleapis.com/auth/youtube",
  10515. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10516. // "https://www.googleapis.com/auth/youtube.readonly"
  10517. // ]
  10518. // }
  10519. }
  10520. // Pages invokes f for each page of results.
  10521. // A non-nil error returned from f will halt the iteration.
  10522. // The provided context supersedes any context provided to the Context method.
  10523. func (c *FanFundingEventsListCall) Pages(ctx context.Context, f func(*FanFundingEventListResponse) error) error {
  10524. c.ctx_ = ctx
  10525. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10526. for {
  10527. x, err := c.Do()
  10528. if err != nil {
  10529. return err
  10530. }
  10531. if err := f(x); err != nil {
  10532. return err
  10533. }
  10534. if x.NextPageToken == "" {
  10535. return nil
  10536. }
  10537. c.PageToken(x.NextPageToken)
  10538. }
  10539. }
  10540. // method id "youtube.guideCategories.list":
  10541. type GuideCategoriesListCall struct {
  10542. s *Service
  10543. urlParams_ gensupport.URLParams
  10544. ifNoneMatch_ string
  10545. ctx_ context.Context
  10546. }
  10547. // List: Returns a list of categories that can be associated with
  10548. // YouTube channels.
  10549. func (r *GuideCategoriesService) List(part string) *GuideCategoriesListCall {
  10550. c := &GuideCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10551. c.urlParams_.Set("part", part)
  10552. return c
  10553. }
  10554. // Hl sets the optional parameter "hl": The hl parameter specifies the
  10555. // language that will be used for text values in the API response.
  10556. func (c *GuideCategoriesListCall) Hl(hl string) *GuideCategoriesListCall {
  10557. c.urlParams_.Set("hl", hl)
  10558. return c
  10559. }
  10560. // Id sets the optional parameter "id": The id parameter specifies a
  10561. // comma-separated list of the YouTube channel category ID(s) for the
  10562. // resource(s) that are being retrieved. In a guideCategory resource,
  10563. // the id property specifies the YouTube channel category ID.
  10564. func (c *GuideCategoriesListCall) Id(id string) *GuideCategoriesListCall {
  10565. c.urlParams_.Set("id", id)
  10566. return c
  10567. }
  10568. // RegionCode sets the optional parameter "regionCode": The regionCode
  10569. // parameter instructs the API to return the list of guide categories
  10570. // available in the specified country. The parameter value is an ISO
  10571. // 3166-1 alpha-2 country code.
  10572. func (c *GuideCategoriesListCall) RegionCode(regionCode string) *GuideCategoriesListCall {
  10573. c.urlParams_.Set("regionCode", regionCode)
  10574. return c
  10575. }
  10576. // Fields allows partial responses to be retrieved. See
  10577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10578. // for more information.
  10579. func (c *GuideCategoriesListCall) Fields(s ...googleapi.Field) *GuideCategoriesListCall {
  10580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10581. return c
  10582. }
  10583. // IfNoneMatch sets the optional parameter which makes the operation
  10584. // fail if the object's ETag matches the given value. This is useful for
  10585. // getting updates only after the object has changed since the last
  10586. // request. Use googleapi.IsNotModified to check whether the response
  10587. // error from Do is the result of In-None-Match.
  10588. func (c *GuideCategoriesListCall) IfNoneMatch(entityTag string) *GuideCategoriesListCall {
  10589. c.ifNoneMatch_ = entityTag
  10590. return c
  10591. }
  10592. // Context sets the context to be used in this call's Do method. Any
  10593. // pending HTTP request will be aborted if the provided context is
  10594. // canceled.
  10595. func (c *GuideCategoriesListCall) Context(ctx context.Context) *GuideCategoriesListCall {
  10596. c.ctx_ = ctx
  10597. return c
  10598. }
  10599. func (c *GuideCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  10600. var body io.Reader = nil
  10601. c.urlParams_.Set("alt", alt)
  10602. urls := googleapi.ResolveRelative(c.s.BasePath, "guideCategories")
  10603. urls += "?" + c.urlParams_.Encode()
  10604. req, _ := http.NewRequest("GET", urls, body)
  10605. googleapi.SetOpaque(req.URL)
  10606. req.Header.Set("User-Agent", c.s.userAgent())
  10607. if c.ifNoneMatch_ != "" {
  10608. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10609. }
  10610. if c.ctx_ != nil {
  10611. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10612. }
  10613. return c.s.client.Do(req)
  10614. }
  10615. // Do executes the "youtube.guideCategories.list" call.
  10616. // Exactly one of *GuideCategoryListResponse or error will be non-nil.
  10617. // Any non-2xx status code is an error. Response headers are in either
  10618. // *GuideCategoryListResponse.ServerResponse.Header or (if a response
  10619. // was returned at all) in error.(*googleapi.Error).Header. Use
  10620. // googleapi.IsNotModified to check whether the returned error was
  10621. // because http.StatusNotModified was returned.
  10622. func (c *GuideCategoriesListCall) Do(opts ...googleapi.CallOption) (*GuideCategoryListResponse, error) {
  10623. gensupport.SetOptions(c.urlParams_, opts...)
  10624. res, err := c.doRequest("json")
  10625. if res != nil && res.StatusCode == http.StatusNotModified {
  10626. if res.Body != nil {
  10627. res.Body.Close()
  10628. }
  10629. return nil, &googleapi.Error{
  10630. Code: res.StatusCode,
  10631. Header: res.Header,
  10632. }
  10633. }
  10634. if err != nil {
  10635. return nil, err
  10636. }
  10637. defer googleapi.CloseBody(res)
  10638. if err := googleapi.CheckResponse(res); err != nil {
  10639. return nil, err
  10640. }
  10641. ret := &GuideCategoryListResponse{
  10642. ServerResponse: googleapi.ServerResponse{
  10643. Header: res.Header,
  10644. HTTPStatusCode: res.StatusCode,
  10645. },
  10646. }
  10647. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10648. return nil, err
  10649. }
  10650. return ret, nil
  10651. // {
  10652. // "description": "Returns a list of categories that can be associated with YouTube channels.",
  10653. // "httpMethod": "GET",
  10654. // "id": "youtube.guideCategories.list",
  10655. // "parameterOrder": [
  10656. // "part"
  10657. // ],
  10658. // "parameters": {
  10659. // "hl": {
  10660. // "default": "en-US",
  10661. // "description": "The hl parameter specifies the language that will be used for text values in the API response.",
  10662. // "location": "query",
  10663. // "type": "string"
  10664. // },
  10665. // "id": {
  10666. // "description": "The id parameter specifies a comma-separated list of the YouTube channel category ID(s) for the resource(s) that are being retrieved. In a guideCategory resource, the id property specifies the YouTube channel category ID.",
  10667. // "location": "query",
  10668. // "type": "string"
  10669. // },
  10670. // "part": {
  10671. // "description": "The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet.",
  10672. // "location": "query",
  10673. // "required": true,
  10674. // "type": "string"
  10675. // },
  10676. // "regionCode": {
  10677. // "description": "The regionCode parameter instructs the API to return the list of guide categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.",
  10678. // "location": "query",
  10679. // "type": "string"
  10680. // }
  10681. // },
  10682. // "path": "guideCategories",
  10683. // "response": {
  10684. // "$ref": "GuideCategoryListResponse"
  10685. // },
  10686. // "scopes": [
  10687. // "https://www.googleapis.com/auth/youtube",
  10688. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10689. // "https://www.googleapis.com/auth/youtube.readonly",
  10690. // "https://www.googleapis.com/auth/youtubepartner"
  10691. // ]
  10692. // }
  10693. }
  10694. // method id "youtube.i18nLanguages.list":
  10695. type I18nLanguagesListCall struct {
  10696. s *Service
  10697. urlParams_ gensupport.URLParams
  10698. ifNoneMatch_ string
  10699. ctx_ context.Context
  10700. }
  10701. // List: Returns a list of application languages that the YouTube
  10702. // website supports.
  10703. func (r *I18nLanguagesService) List(part string) *I18nLanguagesListCall {
  10704. c := &I18nLanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10705. c.urlParams_.Set("part", part)
  10706. return c
  10707. }
  10708. // Hl sets the optional parameter "hl": The hl parameter specifies the
  10709. // language that should be used for text values in the API response.
  10710. func (c *I18nLanguagesListCall) Hl(hl string) *I18nLanguagesListCall {
  10711. c.urlParams_.Set("hl", hl)
  10712. return c
  10713. }
  10714. // Fields allows partial responses to be retrieved. See
  10715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10716. // for more information.
  10717. func (c *I18nLanguagesListCall) Fields(s ...googleapi.Field) *I18nLanguagesListCall {
  10718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10719. return c
  10720. }
  10721. // IfNoneMatch sets the optional parameter which makes the operation
  10722. // fail if the object's ETag matches the given value. This is useful for
  10723. // getting updates only after the object has changed since the last
  10724. // request. Use googleapi.IsNotModified to check whether the response
  10725. // error from Do is the result of In-None-Match.
  10726. func (c *I18nLanguagesListCall) IfNoneMatch(entityTag string) *I18nLanguagesListCall {
  10727. c.ifNoneMatch_ = entityTag
  10728. return c
  10729. }
  10730. // Context sets the context to be used in this call's Do method. Any
  10731. // pending HTTP request will be aborted if the provided context is
  10732. // canceled.
  10733. func (c *I18nLanguagesListCall) Context(ctx context.Context) *I18nLanguagesListCall {
  10734. c.ctx_ = ctx
  10735. return c
  10736. }
  10737. func (c *I18nLanguagesListCall) doRequest(alt string) (*http.Response, error) {
  10738. var body io.Reader = nil
  10739. c.urlParams_.Set("alt", alt)
  10740. urls := googleapi.ResolveRelative(c.s.BasePath, "i18nLanguages")
  10741. urls += "?" + c.urlParams_.Encode()
  10742. req, _ := http.NewRequest("GET", urls, body)
  10743. googleapi.SetOpaque(req.URL)
  10744. req.Header.Set("User-Agent", c.s.userAgent())
  10745. if c.ifNoneMatch_ != "" {
  10746. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10747. }
  10748. if c.ctx_ != nil {
  10749. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10750. }
  10751. return c.s.client.Do(req)
  10752. }
  10753. // Do executes the "youtube.i18nLanguages.list" call.
  10754. // Exactly one of *I18nLanguageListResponse or error will be non-nil.
  10755. // Any non-2xx status code is an error. Response headers are in either
  10756. // *I18nLanguageListResponse.ServerResponse.Header or (if a response was
  10757. // returned at all) in error.(*googleapi.Error).Header. Use
  10758. // googleapi.IsNotModified to check whether the returned error was
  10759. // because http.StatusNotModified was returned.
  10760. func (c *I18nLanguagesListCall) Do(opts ...googleapi.CallOption) (*I18nLanguageListResponse, error) {
  10761. gensupport.SetOptions(c.urlParams_, opts...)
  10762. res, err := c.doRequest("json")
  10763. if res != nil && res.StatusCode == http.StatusNotModified {
  10764. if res.Body != nil {
  10765. res.Body.Close()
  10766. }
  10767. return nil, &googleapi.Error{
  10768. Code: res.StatusCode,
  10769. Header: res.Header,
  10770. }
  10771. }
  10772. if err != nil {
  10773. return nil, err
  10774. }
  10775. defer googleapi.CloseBody(res)
  10776. if err := googleapi.CheckResponse(res); err != nil {
  10777. return nil, err
  10778. }
  10779. ret := &I18nLanguageListResponse{
  10780. ServerResponse: googleapi.ServerResponse{
  10781. Header: res.Header,
  10782. HTTPStatusCode: res.StatusCode,
  10783. },
  10784. }
  10785. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10786. return nil, err
  10787. }
  10788. return ret, nil
  10789. // {
  10790. // "description": "Returns a list of application languages that the YouTube website supports.",
  10791. // "httpMethod": "GET",
  10792. // "id": "youtube.i18nLanguages.list",
  10793. // "parameterOrder": [
  10794. // "part"
  10795. // ],
  10796. // "parameters": {
  10797. // "hl": {
  10798. // "default": "en_US",
  10799. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  10800. // "location": "query",
  10801. // "type": "string"
  10802. // },
  10803. // "part": {
  10804. // "description": "The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet.",
  10805. // "location": "query",
  10806. // "required": true,
  10807. // "type": "string"
  10808. // }
  10809. // },
  10810. // "path": "i18nLanguages",
  10811. // "response": {
  10812. // "$ref": "I18nLanguageListResponse"
  10813. // },
  10814. // "scopes": [
  10815. // "https://www.googleapis.com/auth/youtube",
  10816. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10817. // "https://www.googleapis.com/auth/youtube.readonly",
  10818. // "https://www.googleapis.com/auth/youtubepartner"
  10819. // ]
  10820. // }
  10821. }
  10822. // method id "youtube.i18nRegions.list":
  10823. type I18nRegionsListCall struct {
  10824. s *Service
  10825. urlParams_ gensupport.URLParams
  10826. ifNoneMatch_ string
  10827. ctx_ context.Context
  10828. }
  10829. // List: Returns a list of content regions that the YouTube website
  10830. // supports.
  10831. func (r *I18nRegionsService) List(part string) *I18nRegionsListCall {
  10832. c := &I18nRegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10833. c.urlParams_.Set("part", part)
  10834. return c
  10835. }
  10836. // Hl sets the optional parameter "hl": The hl parameter specifies the
  10837. // language that should be used for text values in the API response.
  10838. func (c *I18nRegionsListCall) Hl(hl string) *I18nRegionsListCall {
  10839. c.urlParams_.Set("hl", hl)
  10840. return c
  10841. }
  10842. // Fields allows partial responses to be retrieved. See
  10843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10844. // for more information.
  10845. func (c *I18nRegionsListCall) Fields(s ...googleapi.Field) *I18nRegionsListCall {
  10846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10847. return c
  10848. }
  10849. // IfNoneMatch sets the optional parameter which makes the operation
  10850. // fail if the object's ETag matches the given value. This is useful for
  10851. // getting updates only after the object has changed since the last
  10852. // request. Use googleapi.IsNotModified to check whether the response
  10853. // error from Do is the result of In-None-Match.
  10854. func (c *I18nRegionsListCall) IfNoneMatch(entityTag string) *I18nRegionsListCall {
  10855. c.ifNoneMatch_ = entityTag
  10856. return c
  10857. }
  10858. // Context sets the context to be used in this call's Do method. Any
  10859. // pending HTTP request will be aborted if the provided context is
  10860. // canceled.
  10861. func (c *I18nRegionsListCall) Context(ctx context.Context) *I18nRegionsListCall {
  10862. c.ctx_ = ctx
  10863. return c
  10864. }
  10865. func (c *I18nRegionsListCall) doRequest(alt string) (*http.Response, error) {
  10866. var body io.Reader = nil
  10867. c.urlParams_.Set("alt", alt)
  10868. urls := googleapi.ResolveRelative(c.s.BasePath, "i18nRegions")
  10869. urls += "?" + c.urlParams_.Encode()
  10870. req, _ := http.NewRequest("GET", urls, body)
  10871. googleapi.SetOpaque(req.URL)
  10872. req.Header.Set("User-Agent", c.s.userAgent())
  10873. if c.ifNoneMatch_ != "" {
  10874. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10875. }
  10876. if c.ctx_ != nil {
  10877. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10878. }
  10879. return c.s.client.Do(req)
  10880. }
  10881. // Do executes the "youtube.i18nRegions.list" call.
  10882. // Exactly one of *I18nRegionListResponse or error will be non-nil. Any
  10883. // non-2xx status code is an error. Response headers are in either
  10884. // *I18nRegionListResponse.ServerResponse.Header or (if a response was
  10885. // returned at all) in error.(*googleapi.Error).Header. Use
  10886. // googleapi.IsNotModified to check whether the returned error was
  10887. // because http.StatusNotModified was returned.
  10888. func (c *I18nRegionsListCall) Do(opts ...googleapi.CallOption) (*I18nRegionListResponse, error) {
  10889. gensupport.SetOptions(c.urlParams_, opts...)
  10890. res, err := c.doRequest("json")
  10891. if res != nil && res.StatusCode == http.StatusNotModified {
  10892. if res.Body != nil {
  10893. res.Body.Close()
  10894. }
  10895. return nil, &googleapi.Error{
  10896. Code: res.StatusCode,
  10897. Header: res.Header,
  10898. }
  10899. }
  10900. if err != nil {
  10901. return nil, err
  10902. }
  10903. defer googleapi.CloseBody(res)
  10904. if err := googleapi.CheckResponse(res); err != nil {
  10905. return nil, err
  10906. }
  10907. ret := &I18nRegionListResponse{
  10908. ServerResponse: googleapi.ServerResponse{
  10909. Header: res.Header,
  10910. HTTPStatusCode: res.StatusCode,
  10911. },
  10912. }
  10913. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10914. return nil, err
  10915. }
  10916. return ret, nil
  10917. // {
  10918. // "description": "Returns a list of content regions that the YouTube website supports.",
  10919. // "httpMethod": "GET",
  10920. // "id": "youtube.i18nRegions.list",
  10921. // "parameterOrder": [
  10922. // "part"
  10923. // ],
  10924. // "parameters": {
  10925. // "hl": {
  10926. // "default": "en_US",
  10927. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  10928. // "location": "query",
  10929. // "type": "string"
  10930. // },
  10931. // "part": {
  10932. // "description": "The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet.",
  10933. // "location": "query",
  10934. // "required": true,
  10935. // "type": "string"
  10936. // }
  10937. // },
  10938. // "path": "i18nRegions",
  10939. // "response": {
  10940. // "$ref": "I18nRegionListResponse"
  10941. // },
  10942. // "scopes": [
  10943. // "https://www.googleapis.com/auth/youtube",
  10944. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10945. // "https://www.googleapis.com/auth/youtube.readonly",
  10946. // "https://www.googleapis.com/auth/youtubepartner"
  10947. // ]
  10948. // }
  10949. }
  10950. // method id "youtube.liveBroadcasts.bind":
  10951. type LiveBroadcastsBindCall struct {
  10952. s *Service
  10953. urlParams_ gensupport.URLParams
  10954. ctx_ context.Context
  10955. }
  10956. // Bind: Binds a YouTube broadcast to a stream or removes an existing
  10957. // binding between a broadcast and a stream. A broadcast can only be
  10958. // bound to one video stream, though a video stream may be bound to more
  10959. // than one broadcast.
  10960. func (r *LiveBroadcastsService) Bind(id string, part string) *LiveBroadcastsBindCall {
  10961. c := &LiveBroadcastsBindCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10962. c.urlParams_.Set("id", id)
  10963. c.urlParams_.Set("part", part)
  10964. return c
  10965. }
  10966. // OnBehalfOfContentOwner sets the optional parameter
  10967. // "onBehalfOfContentOwner": Note: This parameter is intended
  10968. // exclusively for YouTube content partners.
  10969. //
  10970. // The onBehalfOfContentOwner parameter indicates that the request's
  10971. // authorization credentials identify a YouTube CMS user who is acting
  10972. // on behalf of the content owner specified in the parameter value. This
  10973. // parameter is intended for YouTube content partners that own and
  10974. // manage many different YouTube channels. It allows content owners to
  10975. // authenticate once and get access to all their video and channel data,
  10976. // without having to provide authentication credentials for each
  10977. // individual channel. The CMS account that the user authenticates with
  10978. // must be linked to the specified YouTube content owner.
  10979. func (c *LiveBroadcastsBindCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsBindCall {
  10980. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10981. return c
  10982. }
  10983. // OnBehalfOfContentOwnerChannel sets the optional parameter
  10984. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  10985. // properly authorized request. Note: This parameter is intended
  10986. // exclusively for YouTube content partners.
  10987. //
  10988. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  10989. // channel ID of the channel to which a video is being added. This
  10990. // parameter is required when a request specifies a value for the
  10991. // onBehalfOfContentOwner parameter, and it can only be used in
  10992. // conjunction with that parameter. In addition, the request must be
  10993. // authorized using a CMS account that is linked to the content owner
  10994. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  10995. // channel that the onBehalfOfContentOwnerChannel parameter value
  10996. // specifies must be linked to the content owner that the
  10997. // onBehalfOfContentOwner parameter specifies.
  10998. //
  10999. // This parameter is intended for YouTube content partners that own and
  11000. // manage many different YouTube channels. It allows content owners to
  11001. // authenticate once and perform actions on behalf of the channel
  11002. // specified in the parameter value, without having to provide
  11003. // authentication credentials for each separate channel.
  11004. func (c *LiveBroadcastsBindCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsBindCall {
  11005. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  11006. return c
  11007. }
  11008. // StreamId sets the optional parameter "streamId": The streamId
  11009. // parameter specifies the unique ID of the video stream that is being
  11010. // bound to a broadcast. If this parameter is omitted, the API will
  11011. // remove any existing binding between the broadcast and a video stream.
  11012. func (c *LiveBroadcastsBindCall) StreamId(streamId string) *LiveBroadcastsBindCall {
  11013. c.urlParams_.Set("streamId", streamId)
  11014. return c
  11015. }
  11016. // Fields allows partial responses to be retrieved. See
  11017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11018. // for more information.
  11019. func (c *LiveBroadcastsBindCall) Fields(s ...googleapi.Field) *LiveBroadcastsBindCall {
  11020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11021. return c
  11022. }
  11023. // Context sets the context to be used in this call's Do method. Any
  11024. // pending HTTP request will be aborted if the provided context is
  11025. // canceled.
  11026. func (c *LiveBroadcastsBindCall) Context(ctx context.Context) *LiveBroadcastsBindCall {
  11027. c.ctx_ = ctx
  11028. return c
  11029. }
  11030. func (c *LiveBroadcastsBindCall) doRequest(alt string) (*http.Response, error) {
  11031. var body io.Reader = nil
  11032. c.urlParams_.Set("alt", alt)
  11033. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts/bind")
  11034. urls += "?" + c.urlParams_.Encode()
  11035. req, _ := http.NewRequest("POST", urls, body)
  11036. googleapi.SetOpaque(req.URL)
  11037. req.Header.Set("User-Agent", c.s.userAgent())
  11038. if c.ctx_ != nil {
  11039. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11040. }
  11041. return c.s.client.Do(req)
  11042. }
  11043. // Do executes the "youtube.liveBroadcasts.bind" call.
  11044. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  11045. // status code is an error. Response headers are in either
  11046. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  11047. // at all) in error.(*googleapi.Error).Header. Use
  11048. // googleapi.IsNotModified to check whether the returned error was
  11049. // because http.StatusNotModified was returned.
  11050. func (c *LiveBroadcastsBindCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  11051. gensupport.SetOptions(c.urlParams_, opts...)
  11052. res, err := c.doRequest("json")
  11053. if res != nil && res.StatusCode == http.StatusNotModified {
  11054. if res.Body != nil {
  11055. res.Body.Close()
  11056. }
  11057. return nil, &googleapi.Error{
  11058. Code: res.StatusCode,
  11059. Header: res.Header,
  11060. }
  11061. }
  11062. if err != nil {
  11063. return nil, err
  11064. }
  11065. defer googleapi.CloseBody(res)
  11066. if err := googleapi.CheckResponse(res); err != nil {
  11067. return nil, err
  11068. }
  11069. ret := &LiveBroadcast{
  11070. ServerResponse: googleapi.ServerResponse{
  11071. Header: res.Header,
  11072. HTTPStatusCode: res.StatusCode,
  11073. },
  11074. }
  11075. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11076. return nil, err
  11077. }
  11078. return ret, nil
  11079. // {
  11080. // "description": "Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast.",
  11081. // "httpMethod": "POST",
  11082. // "id": "youtube.liveBroadcasts.bind",
  11083. // "parameterOrder": [
  11084. // "id",
  11085. // "part"
  11086. // ],
  11087. // "parameters": {
  11088. // "id": {
  11089. // "description": "The id parameter specifies the unique ID of the broadcast that is being bound to a video stream.",
  11090. // "location": "query",
  11091. // "required": true,
  11092. // "type": "string"
  11093. // },
  11094. // "onBehalfOfContentOwner": {
  11095. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  11096. // "location": "query",
  11097. // "type": "string"
  11098. // },
  11099. // "onBehalfOfContentOwnerChannel": {
  11100. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  11101. // "location": "query",
  11102. // "type": "string"
  11103. // },
  11104. // "part": {
  11105. // "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.",
  11106. // "location": "query",
  11107. // "required": true,
  11108. // "type": "string"
  11109. // },
  11110. // "streamId": {
  11111. // "description": "The streamId parameter specifies the unique ID of the video stream that is being bound to a broadcast. If this parameter is omitted, the API will remove any existing binding between the broadcast and a video stream.",
  11112. // "location": "query",
  11113. // "type": "string"
  11114. // }
  11115. // },
  11116. // "path": "liveBroadcasts/bind",
  11117. // "response": {
  11118. // "$ref": "LiveBroadcast"
  11119. // },
  11120. // "scopes": [
  11121. // "https://www.googleapis.com/auth/youtube",
  11122. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11123. // ]
  11124. // }
  11125. }
  11126. // method id "youtube.liveBroadcasts.control":
  11127. type LiveBroadcastsControlCall struct {
  11128. s *Service
  11129. urlParams_ gensupport.URLParams
  11130. ctx_ context.Context
  11131. }
  11132. // Control: Controls the settings for a slate that can be displayed in
  11133. // the broadcast stream.
  11134. func (r *LiveBroadcastsService) Control(id string, part string) *LiveBroadcastsControlCall {
  11135. c := &LiveBroadcastsControlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11136. c.urlParams_.Set("id", id)
  11137. c.urlParams_.Set("part", part)
  11138. return c
  11139. }
  11140. // DisplaySlate sets the optional parameter "displaySlate": The
  11141. // displaySlate parameter specifies whether the slate is being enabled
  11142. // or disabled.
  11143. func (c *LiveBroadcastsControlCall) DisplaySlate(displaySlate bool) *LiveBroadcastsControlCall {
  11144. c.urlParams_.Set("displaySlate", fmt.Sprint(displaySlate))
  11145. return c
  11146. }
  11147. // OffsetTimeMs sets the optional parameter "offsetTimeMs": The
  11148. // offsetTimeMs parameter specifies a positive time offset when the
  11149. // specified slate change will occur. The value is measured in
  11150. // milliseconds from the beginning of the broadcast's monitor stream,
  11151. // which is the time that the testing phase for the broadcast began.
  11152. // Even though it is specified in milliseconds, the value is actually an
  11153. // approximation, and YouTube completes the requested action as closely
  11154. // as possible to that time.
  11155. //
  11156. // If you do not specify a value for this parameter, then YouTube
  11157. // performs the action as soon as possible. See the Getting started
  11158. // guide for more details.
  11159. //
  11160. // Important: You should only specify a value for this parameter if your
  11161. // broadcast stream is delayed.
  11162. func (c *LiveBroadcastsControlCall) OffsetTimeMs(offsetTimeMs uint64) *LiveBroadcastsControlCall {
  11163. c.urlParams_.Set("offsetTimeMs", fmt.Sprint(offsetTimeMs))
  11164. return c
  11165. }
  11166. // OnBehalfOfContentOwner sets the optional parameter
  11167. // "onBehalfOfContentOwner": Note: This parameter is intended
  11168. // exclusively for YouTube content partners.
  11169. //
  11170. // The onBehalfOfContentOwner parameter indicates that the request's
  11171. // authorization credentials identify a YouTube CMS user who is acting
  11172. // on behalf of the content owner specified in the parameter value. This
  11173. // parameter is intended for YouTube content partners that own and
  11174. // manage many different YouTube channels. It allows content owners to
  11175. // authenticate once and get access to all their video and channel data,
  11176. // without having to provide authentication credentials for each
  11177. // individual channel. The CMS account that the user authenticates with
  11178. // must be linked to the specified YouTube content owner.
  11179. func (c *LiveBroadcastsControlCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsControlCall {
  11180. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  11181. return c
  11182. }
  11183. // OnBehalfOfContentOwnerChannel sets the optional parameter
  11184. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  11185. // properly authorized request. Note: This parameter is intended
  11186. // exclusively for YouTube content partners.
  11187. //
  11188. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  11189. // channel ID of the channel to which a video is being added. This
  11190. // parameter is required when a request specifies a value for the
  11191. // onBehalfOfContentOwner parameter, and it can only be used in
  11192. // conjunction with that parameter. In addition, the request must be
  11193. // authorized using a CMS account that is linked to the content owner
  11194. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  11195. // channel that the onBehalfOfContentOwnerChannel parameter value
  11196. // specifies must be linked to the content owner that the
  11197. // onBehalfOfContentOwner parameter specifies.
  11198. //
  11199. // This parameter is intended for YouTube content partners that own and
  11200. // manage many different YouTube channels. It allows content owners to
  11201. // authenticate once and perform actions on behalf of the channel
  11202. // specified in the parameter value, without having to provide
  11203. // authentication credentials for each separate channel.
  11204. func (c *LiveBroadcastsControlCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsControlCall {
  11205. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  11206. return c
  11207. }
  11208. // Walltime sets the optional parameter "walltime": The walltime
  11209. // parameter specifies the wall clock time at which the specified slate
  11210. // change will occur. The value is specified in ISO 8601
  11211. // (YYYY-MM-DDThh:mm:ss.sssZ) format.
  11212. func (c *LiveBroadcastsControlCall) Walltime(walltime string) *LiveBroadcastsControlCall {
  11213. c.urlParams_.Set("walltime", walltime)
  11214. return c
  11215. }
  11216. // Fields allows partial responses to be retrieved. See
  11217. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11218. // for more information.
  11219. func (c *LiveBroadcastsControlCall) Fields(s ...googleapi.Field) *LiveBroadcastsControlCall {
  11220. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11221. return c
  11222. }
  11223. // Context sets the context to be used in this call's Do method. Any
  11224. // pending HTTP request will be aborted if the provided context is
  11225. // canceled.
  11226. func (c *LiveBroadcastsControlCall) Context(ctx context.Context) *LiveBroadcastsControlCall {
  11227. c.ctx_ = ctx
  11228. return c
  11229. }
  11230. func (c *LiveBroadcastsControlCall) doRequest(alt string) (*http.Response, error) {
  11231. var body io.Reader = nil
  11232. c.urlParams_.Set("alt", alt)
  11233. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts/control")
  11234. urls += "?" + c.urlParams_.Encode()
  11235. req, _ := http.NewRequest("POST", urls, body)
  11236. googleapi.SetOpaque(req.URL)
  11237. req.Header.Set("User-Agent", c.s.userAgent())
  11238. if c.ctx_ != nil {
  11239. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11240. }
  11241. return c.s.client.Do(req)
  11242. }
  11243. // Do executes the "youtube.liveBroadcasts.control" call.
  11244. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  11245. // status code is an error. Response headers are in either
  11246. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  11247. // at all) in error.(*googleapi.Error).Header. Use
  11248. // googleapi.IsNotModified to check whether the returned error was
  11249. // because http.StatusNotModified was returned.
  11250. func (c *LiveBroadcastsControlCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  11251. gensupport.SetOptions(c.urlParams_, opts...)
  11252. res, err := c.doRequest("json")
  11253. if res != nil && res.StatusCode == http.StatusNotModified {
  11254. if res.Body != nil {
  11255. res.Body.Close()
  11256. }
  11257. return nil, &googleapi.Error{
  11258. Code: res.StatusCode,
  11259. Header: res.Header,
  11260. }
  11261. }
  11262. if err != nil {
  11263. return nil, err
  11264. }
  11265. defer googleapi.CloseBody(res)
  11266. if err := googleapi.CheckResponse(res); err != nil {
  11267. return nil, err
  11268. }
  11269. ret := &LiveBroadcast{
  11270. ServerResponse: googleapi.ServerResponse{
  11271. Header: res.Header,
  11272. HTTPStatusCode: res.StatusCode,
  11273. },
  11274. }
  11275. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11276. return nil, err
  11277. }
  11278. return ret, nil
  11279. // {
  11280. // "description": "Controls the settings for a slate that can be displayed in the broadcast stream.",
  11281. // "httpMethod": "POST",
  11282. // "id": "youtube.liveBroadcasts.control",
  11283. // "parameterOrder": [
  11284. // "id",
  11285. // "part"
  11286. // ],
  11287. // "parameters": {
  11288. // "displaySlate": {
  11289. // "description": "The displaySlate parameter specifies whether the slate is being enabled or disabled.",
  11290. // "location": "query",
  11291. // "type": "boolean"
  11292. // },
  11293. // "id": {
  11294. // "description": "The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated.",
  11295. // "location": "query",
  11296. // "required": true,
  11297. // "type": "string"
  11298. // },
  11299. // "offsetTimeMs": {
  11300. // "description": "The offsetTimeMs parameter specifies a positive time offset when the specified slate change will occur. The value is measured in milliseconds from the beginning of the broadcast's monitor stream, which is the time that the testing phase for the broadcast began. Even though it is specified in milliseconds, the value is actually an approximation, and YouTube completes the requested action as closely as possible to that time.\n\nIf you do not specify a value for this parameter, then YouTube performs the action as soon as possible. See the Getting started guide for more details.\n\nImportant: You should only specify a value for this parameter if your broadcast stream is delayed.",
  11301. // "format": "uint64",
  11302. // "location": "query",
  11303. // "type": "string"
  11304. // },
  11305. // "onBehalfOfContentOwner": {
  11306. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  11307. // "location": "query",
  11308. // "type": "string"
  11309. // },
  11310. // "onBehalfOfContentOwnerChannel": {
  11311. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  11312. // "location": "query",
  11313. // "type": "string"
  11314. // },
  11315. // "part": {
  11316. // "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.",
  11317. // "location": "query",
  11318. // "required": true,
  11319. // "type": "string"
  11320. // },
  11321. // "walltime": {
  11322. // "description": "The walltime parameter specifies the wall clock time at which the specified slate change will occur. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format.",
  11323. // "format": "date-time",
  11324. // "location": "query",
  11325. // "type": "string"
  11326. // }
  11327. // },
  11328. // "path": "liveBroadcasts/control",
  11329. // "response": {
  11330. // "$ref": "LiveBroadcast"
  11331. // },
  11332. // "scopes": [
  11333. // "https://www.googleapis.com/auth/youtube",
  11334. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11335. // ]
  11336. // }
  11337. }
  11338. // method id "youtube.liveBroadcasts.delete":
  11339. type LiveBroadcastsDeleteCall struct {
  11340. s *Service
  11341. urlParams_ gensupport.URLParams
  11342. ctx_ context.Context
  11343. }
  11344. // Delete: Deletes a broadcast.
  11345. func (r *LiveBroadcastsService) Delete(id string) *LiveBroadcastsDeleteCall {
  11346. c := &LiveBroadcastsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11347. c.urlParams_.Set("id", id)
  11348. return c
  11349. }
  11350. // OnBehalfOfContentOwner sets the optional parameter
  11351. // "onBehalfOfContentOwner": Note: This parameter is intended
  11352. // exclusively for YouTube content partners.
  11353. //
  11354. // The onBehalfOfContentOwner parameter indicates that the request's
  11355. // authorization credentials identify a YouTube CMS user who is acting
  11356. // on behalf of the content owner specified in the parameter value. This
  11357. // parameter is intended for YouTube content partners that own and
  11358. // manage many different YouTube channels. It allows content owners to
  11359. // authenticate once and get access to all their video and channel data,
  11360. // without having to provide authentication credentials for each
  11361. // individual channel. The CMS account that the user authenticates with
  11362. // must be linked to the specified YouTube content owner.
  11363. func (c *LiveBroadcastsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsDeleteCall {
  11364. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  11365. return c
  11366. }
  11367. // OnBehalfOfContentOwnerChannel sets the optional parameter
  11368. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  11369. // properly authorized request. Note: This parameter is intended
  11370. // exclusively for YouTube content partners.
  11371. //
  11372. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  11373. // channel ID of the channel to which a video is being added. This
  11374. // parameter is required when a request specifies a value for the
  11375. // onBehalfOfContentOwner parameter, and it can only be used in
  11376. // conjunction with that parameter. In addition, the request must be
  11377. // authorized using a CMS account that is linked to the content owner
  11378. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  11379. // channel that the onBehalfOfContentOwnerChannel parameter value
  11380. // specifies must be linked to the content owner that the
  11381. // onBehalfOfContentOwner parameter specifies.
  11382. //
  11383. // This parameter is intended for YouTube content partners that own and
  11384. // manage many different YouTube channels. It allows content owners to
  11385. // authenticate once and perform actions on behalf of the channel
  11386. // specified in the parameter value, without having to provide
  11387. // authentication credentials for each separate channel.
  11388. func (c *LiveBroadcastsDeleteCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsDeleteCall {
  11389. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  11390. return c
  11391. }
  11392. // Fields allows partial responses to be retrieved. See
  11393. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11394. // for more information.
  11395. func (c *LiveBroadcastsDeleteCall) Fields(s ...googleapi.Field) *LiveBroadcastsDeleteCall {
  11396. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11397. return c
  11398. }
  11399. // Context sets the context to be used in this call's Do method. Any
  11400. // pending HTTP request will be aborted if the provided context is
  11401. // canceled.
  11402. func (c *LiveBroadcastsDeleteCall) Context(ctx context.Context) *LiveBroadcastsDeleteCall {
  11403. c.ctx_ = ctx
  11404. return c
  11405. }
  11406. func (c *LiveBroadcastsDeleteCall) doRequest(alt string) (*http.Response, error) {
  11407. var body io.Reader = nil
  11408. c.urlParams_.Set("alt", alt)
  11409. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  11410. urls += "?" + c.urlParams_.Encode()
  11411. req, _ := http.NewRequest("DELETE", urls, body)
  11412. googleapi.SetOpaque(req.URL)
  11413. req.Header.Set("User-Agent", c.s.userAgent())
  11414. if c.ctx_ != nil {
  11415. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11416. }
  11417. return c.s.client.Do(req)
  11418. }
  11419. // Do executes the "youtube.liveBroadcasts.delete" call.
  11420. func (c *LiveBroadcastsDeleteCall) Do(opts ...googleapi.CallOption) error {
  11421. gensupport.SetOptions(c.urlParams_, opts...)
  11422. res, err := c.doRequest("json")
  11423. if err != nil {
  11424. return err
  11425. }
  11426. defer googleapi.CloseBody(res)
  11427. if err := googleapi.CheckResponse(res); err != nil {
  11428. return err
  11429. }
  11430. return nil
  11431. // {
  11432. // "description": "Deletes a broadcast.",
  11433. // "httpMethod": "DELETE",
  11434. // "id": "youtube.liveBroadcasts.delete",
  11435. // "parameterOrder": [
  11436. // "id"
  11437. // ],
  11438. // "parameters": {
  11439. // "id": {
  11440. // "description": "The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted.",
  11441. // "location": "query",
  11442. // "required": true,
  11443. // "type": "string"
  11444. // },
  11445. // "onBehalfOfContentOwner": {
  11446. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  11447. // "location": "query",
  11448. // "type": "string"
  11449. // },
  11450. // "onBehalfOfContentOwnerChannel": {
  11451. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  11452. // "location": "query",
  11453. // "type": "string"
  11454. // }
  11455. // },
  11456. // "path": "liveBroadcasts",
  11457. // "scopes": [
  11458. // "https://www.googleapis.com/auth/youtube",
  11459. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11460. // ]
  11461. // }
  11462. }
  11463. // method id "youtube.liveBroadcasts.insert":
  11464. type LiveBroadcastsInsertCall struct {
  11465. s *Service
  11466. livebroadcast *LiveBroadcast
  11467. urlParams_ gensupport.URLParams
  11468. ctx_ context.Context
  11469. }
  11470. // Insert: Creates a broadcast.
  11471. func (r *LiveBroadcastsService) Insert(part string, livebroadcast *LiveBroadcast) *LiveBroadcastsInsertCall {
  11472. c := &LiveBroadcastsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11473. c.urlParams_.Set("part", part)
  11474. c.livebroadcast = livebroadcast
  11475. return c
  11476. }
  11477. // OnBehalfOfContentOwner sets the optional parameter
  11478. // "onBehalfOfContentOwner": Note: This parameter is intended
  11479. // exclusively for YouTube content partners.
  11480. //
  11481. // The onBehalfOfContentOwner parameter indicates that the request's
  11482. // authorization credentials identify a YouTube CMS user who is acting
  11483. // on behalf of the content owner specified in the parameter value. This
  11484. // parameter is intended for YouTube content partners that own and
  11485. // manage many different YouTube channels. It allows content owners to
  11486. // authenticate once and get access to all their video and channel data,
  11487. // without having to provide authentication credentials for each
  11488. // individual channel. The CMS account that the user authenticates with
  11489. // must be linked to the specified YouTube content owner.
  11490. func (c *LiveBroadcastsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsInsertCall {
  11491. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  11492. return c
  11493. }
  11494. // OnBehalfOfContentOwnerChannel sets the optional parameter
  11495. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  11496. // properly authorized request. Note: This parameter is intended
  11497. // exclusively for YouTube content partners.
  11498. //
  11499. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  11500. // channel ID of the channel to which a video is being added. This
  11501. // parameter is required when a request specifies a value for the
  11502. // onBehalfOfContentOwner parameter, and it can only be used in
  11503. // conjunction with that parameter. In addition, the request must be
  11504. // authorized using a CMS account that is linked to the content owner
  11505. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  11506. // channel that the onBehalfOfContentOwnerChannel parameter value
  11507. // specifies must be linked to the content owner that the
  11508. // onBehalfOfContentOwner parameter specifies.
  11509. //
  11510. // This parameter is intended for YouTube content partners that own and
  11511. // manage many different YouTube channels. It allows content owners to
  11512. // authenticate once and perform actions on behalf of the channel
  11513. // specified in the parameter value, without having to provide
  11514. // authentication credentials for each separate channel.
  11515. func (c *LiveBroadcastsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsInsertCall {
  11516. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  11517. return c
  11518. }
  11519. // Fields allows partial responses to be retrieved. See
  11520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11521. // for more information.
  11522. func (c *LiveBroadcastsInsertCall) Fields(s ...googleapi.Field) *LiveBroadcastsInsertCall {
  11523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11524. return c
  11525. }
  11526. // Context sets the context to be used in this call's Do method. Any
  11527. // pending HTTP request will be aborted if the provided context is
  11528. // canceled.
  11529. func (c *LiveBroadcastsInsertCall) Context(ctx context.Context) *LiveBroadcastsInsertCall {
  11530. c.ctx_ = ctx
  11531. return c
  11532. }
  11533. func (c *LiveBroadcastsInsertCall) doRequest(alt string) (*http.Response, error) {
  11534. var body io.Reader = nil
  11535. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livebroadcast)
  11536. if err != nil {
  11537. return nil, err
  11538. }
  11539. ctype := "application/json"
  11540. c.urlParams_.Set("alt", alt)
  11541. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  11542. urls += "?" + c.urlParams_.Encode()
  11543. req, _ := http.NewRequest("POST", urls, body)
  11544. googleapi.SetOpaque(req.URL)
  11545. req.Header.Set("Content-Type", ctype)
  11546. req.Header.Set("User-Agent", c.s.userAgent())
  11547. if c.ctx_ != nil {
  11548. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11549. }
  11550. return c.s.client.Do(req)
  11551. }
  11552. // Do executes the "youtube.liveBroadcasts.insert" call.
  11553. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  11554. // status code is an error. Response headers are in either
  11555. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  11556. // at all) in error.(*googleapi.Error).Header. Use
  11557. // googleapi.IsNotModified to check whether the returned error was
  11558. // because http.StatusNotModified was returned.
  11559. func (c *LiveBroadcastsInsertCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  11560. gensupport.SetOptions(c.urlParams_, opts...)
  11561. res, err := c.doRequest("json")
  11562. if res != nil && res.StatusCode == http.StatusNotModified {
  11563. if res.Body != nil {
  11564. res.Body.Close()
  11565. }
  11566. return nil, &googleapi.Error{
  11567. Code: res.StatusCode,
  11568. Header: res.Header,
  11569. }
  11570. }
  11571. if err != nil {
  11572. return nil, err
  11573. }
  11574. defer googleapi.CloseBody(res)
  11575. if err := googleapi.CheckResponse(res); err != nil {
  11576. return nil, err
  11577. }
  11578. ret := &LiveBroadcast{
  11579. ServerResponse: googleapi.ServerResponse{
  11580. Header: res.Header,
  11581. HTTPStatusCode: res.StatusCode,
  11582. },
  11583. }
  11584. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11585. return nil, err
  11586. }
  11587. return ret, nil
  11588. // {
  11589. // "description": "Creates a broadcast.",
  11590. // "httpMethod": "POST",
  11591. // "id": "youtube.liveBroadcasts.insert",
  11592. // "parameterOrder": [
  11593. // "part"
  11594. // ],
  11595. // "parameters": {
  11596. // "onBehalfOfContentOwner": {
  11597. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  11598. // "location": "query",
  11599. // "type": "string"
  11600. // },
  11601. // "onBehalfOfContentOwnerChannel": {
  11602. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  11603. // "location": "query",
  11604. // "type": "string"
  11605. // },
  11606. // "part": {
  11607. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, contentDetails, and status.",
  11608. // "location": "query",
  11609. // "required": true,
  11610. // "type": "string"
  11611. // }
  11612. // },
  11613. // "path": "liveBroadcasts",
  11614. // "request": {
  11615. // "$ref": "LiveBroadcast"
  11616. // },
  11617. // "response": {
  11618. // "$ref": "LiveBroadcast"
  11619. // },
  11620. // "scopes": [
  11621. // "https://www.googleapis.com/auth/youtube",
  11622. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11623. // ]
  11624. // }
  11625. }
  11626. // method id "youtube.liveBroadcasts.list":
  11627. type LiveBroadcastsListCall struct {
  11628. s *Service
  11629. urlParams_ gensupport.URLParams
  11630. ifNoneMatch_ string
  11631. ctx_ context.Context
  11632. }
  11633. // List: Returns a list of YouTube broadcasts that match the API request
  11634. // parameters.
  11635. func (r *LiveBroadcastsService) List(part string) *LiveBroadcastsListCall {
  11636. c := &LiveBroadcastsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11637. c.urlParams_.Set("part", part)
  11638. return c
  11639. }
  11640. // BroadcastStatus sets the optional parameter "broadcastStatus": The
  11641. // broadcastStatus parameter filters the API response to only include
  11642. // broadcasts with the specified status.
  11643. //
  11644. // Possible values:
  11645. // "active" - Return current live broadcasts.
  11646. // "all" - Return all broadcasts.
  11647. // "completed" - Return broadcasts that have already ended.
  11648. // "upcoming" - Return broadcasts that have not yet started.
  11649. func (c *LiveBroadcastsListCall) BroadcastStatus(broadcastStatus string) *LiveBroadcastsListCall {
  11650. c.urlParams_.Set("broadcastStatus", broadcastStatus)
  11651. return c
  11652. }
  11653. // BroadcastType sets the optional parameter "broadcastType": The
  11654. // broadcastType parameter filters the API response to only include
  11655. // broadcasts with the specified type. This is only compatible with the
  11656. // mine filter for now.
  11657. //
  11658. // Possible values:
  11659. // "all" - Return all broadcasts.
  11660. // "event" - Return only scheduled event broadcasts.
  11661. // "persistent" - Return only persistent broadcasts.
  11662. func (c *LiveBroadcastsListCall) BroadcastType(broadcastType string) *LiveBroadcastsListCall {
  11663. c.urlParams_.Set("broadcastType", broadcastType)
  11664. return c
  11665. }
  11666. // Id sets the optional parameter "id": The id parameter specifies a
  11667. // comma-separated list of YouTube broadcast IDs that identify the
  11668. // broadcasts being retrieved. In a liveBroadcast resource, the id
  11669. // property specifies the broadcast's ID.
  11670. func (c *LiveBroadcastsListCall) Id(id string) *LiveBroadcastsListCall {
  11671. c.urlParams_.Set("id", id)
  11672. return c
  11673. }
  11674. // MaxResults sets the optional parameter "maxResults": The maxResults
  11675. // parameter specifies the maximum number of items that should be
  11676. // returned in the result set.
  11677. func (c *LiveBroadcastsListCall) MaxResults(maxResults int64) *LiveBroadcastsListCall {
  11678. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11679. return c
  11680. }
  11681. // Mine sets the optional parameter "mine": The mine parameter can be
  11682. // used to instruct the API to only return broadcasts owned by the
  11683. // authenticated user. Set the parameter value to true to only retrieve
  11684. // your own broadcasts.
  11685. func (c *LiveBroadcastsListCall) Mine(mine bool) *LiveBroadcastsListCall {
  11686. c.urlParams_.Set("mine", fmt.Sprint(mine))
  11687. return c
  11688. }
  11689. // OnBehalfOfContentOwner sets the optional parameter
  11690. // "onBehalfOfContentOwner": Note: This parameter is intended
  11691. // exclusively for YouTube content partners.
  11692. //
  11693. // The onBehalfOfContentOwner parameter indicates that the request's
  11694. // authorization credentials identify a YouTube CMS user who is acting
  11695. // on behalf of the content owner specified in the parameter value. This
  11696. // parameter is intended for YouTube content partners that own and
  11697. // manage many different YouTube channels. It allows content owners to
  11698. // authenticate once and get access to all their video and channel data,
  11699. // without having to provide authentication credentials for each
  11700. // individual channel. The CMS account that the user authenticates with
  11701. // must be linked to the specified YouTube content owner.
  11702. func (c *LiveBroadcastsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsListCall {
  11703. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  11704. return c
  11705. }
  11706. // OnBehalfOfContentOwnerChannel sets the optional parameter
  11707. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  11708. // properly authorized request. Note: This parameter is intended
  11709. // exclusively for YouTube content partners.
  11710. //
  11711. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  11712. // channel ID of the channel to which a video is being added. This
  11713. // parameter is required when a request specifies a value for the
  11714. // onBehalfOfContentOwner parameter, and it can only be used in
  11715. // conjunction with that parameter. In addition, the request must be
  11716. // authorized using a CMS account that is linked to the content owner
  11717. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  11718. // channel that the onBehalfOfContentOwnerChannel parameter value
  11719. // specifies must be linked to the content owner that the
  11720. // onBehalfOfContentOwner parameter specifies.
  11721. //
  11722. // This parameter is intended for YouTube content partners that own and
  11723. // manage many different YouTube channels. It allows content owners to
  11724. // authenticate once and perform actions on behalf of the channel
  11725. // specified in the parameter value, without having to provide
  11726. // authentication credentials for each separate channel.
  11727. func (c *LiveBroadcastsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsListCall {
  11728. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  11729. return c
  11730. }
  11731. // PageToken sets the optional parameter "pageToken": The pageToken
  11732. // parameter identifies a specific page in the result set that should be
  11733. // returned. In an API response, the nextPageToken and prevPageToken
  11734. // properties identify other pages that could be retrieved.
  11735. func (c *LiveBroadcastsListCall) PageToken(pageToken string) *LiveBroadcastsListCall {
  11736. c.urlParams_.Set("pageToken", pageToken)
  11737. return c
  11738. }
  11739. // Fields allows partial responses to be retrieved. See
  11740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11741. // for more information.
  11742. func (c *LiveBroadcastsListCall) Fields(s ...googleapi.Field) *LiveBroadcastsListCall {
  11743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11744. return c
  11745. }
  11746. // IfNoneMatch sets the optional parameter which makes the operation
  11747. // fail if the object's ETag matches the given value. This is useful for
  11748. // getting updates only after the object has changed since the last
  11749. // request. Use googleapi.IsNotModified to check whether the response
  11750. // error from Do is the result of In-None-Match.
  11751. func (c *LiveBroadcastsListCall) IfNoneMatch(entityTag string) *LiveBroadcastsListCall {
  11752. c.ifNoneMatch_ = entityTag
  11753. return c
  11754. }
  11755. // Context sets the context to be used in this call's Do method. Any
  11756. // pending HTTP request will be aborted if the provided context is
  11757. // canceled.
  11758. func (c *LiveBroadcastsListCall) Context(ctx context.Context) *LiveBroadcastsListCall {
  11759. c.ctx_ = ctx
  11760. return c
  11761. }
  11762. func (c *LiveBroadcastsListCall) doRequest(alt string) (*http.Response, error) {
  11763. var body io.Reader = nil
  11764. c.urlParams_.Set("alt", alt)
  11765. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  11766. urls += "?" + c.urlParams_.Encode()
  11767. req, _ := http.NewRequest("GET", urls, body)
  11768. googleapi.SetOpaque(req.URL)
  11769. req.Header.Set("User-Agent", c.s.userAgent())
  11770. if c.ifNoneMatch_ != "" {
  11771. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11772. }
  11773. if c.ctx_ != nil {
  11774. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11775. }
  11776. return c.s.client.Do(req)
  11777. }
  11778. // Do executes the "youtube.liveBroadcasts.list" call.
  11779. // Exactly one of *LiveBroadcastListResponse or error will be non-nil.
  11780. // Any non-2xx status code is an error. Response headers are in either
  11781. // *LiveBroadcastListResponse.ServerResponse.Header or (if a response
  11782. // was returned at all) in error.(*googleapi.Error).Header. Use
  11783. // googleapi.IsNotModified to check whether the returned error was
  11784. // because http.StatusNotModified was returned.
  11785. func (c *LiveBroadcastsListCall) Do(opts ...googleapi.CallOption) (*LiveBroadcastListResponse, error) {
  11786. gensupport.SetOptions(c.urlParams_, opts...)
  11787. res, err := c.doRequest("json")
  11788. if res != nil && res.StatusCode == http.StatusNotModified {
  11789. if res.Body != nil {
  11790. res.Body.Close()
  11791. }
  11792. return nil, &googleapi.Error{
  11793. Code: res.StatusCode,
  11794. Header: res.Header,
  11795. }
  11796. }
  11797. if err != nil {
  11798. return nil, err
  11799. }
  11800. defer googleapi.CloseBody(res)
  11801. if err := googleapi.CheckResponse(res); err != nil {
  11802. return nil, err
  11803. }
  11804. ret := &LiveBroadcastListResponse{
  11805. ServerResponse: googleapi.ServerResponse{
  11806. Header: res.Header,
  11807. HTTPStatusCode: res.StatusCode,
  11808. },
  11809. }
  11810. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11811. return nil, err
  11812. }
  11813. return ret, nil
  11814. // {
  11815. // "description": "Returns a list of YouTube broadcasts that match the API request parameters.",
  11816. // "httpMethod": "GET",
  11817. // "id": "youtube.liveBroadcasts.list",
  11818. // "parameterOrder": [
  11819. // "part"
  11820. // ],
  11821. // "parameters": {
  11822. // "broadcastStatus": {
  11823. // "description": "The broadcastStatus parameter filters the API response to only include broadcasts with the specified status.",
  11824. // "enum": [
  11825. // "active",
  11826. // "all",
  11827. // "completed",
  11828. // "upcoming"
  11829. // ],
  11830. // "enumDescriptions": [
  11831. // "Return current live broadcasts.",
  11832. // "Return all broadcasts.",
  11833. // "Return broadcasts that have already ended.",
  11834. // "Return broadcasts that have not yet started."
  11835. // ],
  11836. // "location": "query",
  11837. // "type": "string"
  11838. // },
  11839. // "broadcastType": {
  11840. // "default": "BROADCAST_TYPE_FILTER_EVENT",
  11841. // "description": "The broadcastType parameter filters the API response to only include broadcasts with the specified type. This is only compatible with the mine filter for now.",
  11842. // "enum": [
  11843. // "all",
  11844. // "event",
  11845. // "persistent"
  11846. // ],
  11847. // "enumDescriptions": [
  11848. // "Return all broadcasts.",
  11849. // "Return only scheduled event broadcasts.",
  11850. // "Return only persistent broadcasts."
  11851. // ],
  11852. // "location": "query",
  11853. // "type": "string"
  11854. // },
  11855. // "id": {
  11856. // "description": "The id parameter specifies a comma-separated list of YouTube broadcast IDs that identify the broadcasts being retrieved. In a liveBroadcast resource, the id property specifies the broadcast's ID.",
  11857. // "location": "query",
  11858. // "type": "string"
  11859. // },
  11860. // "maxResults": {
  11861. // "default": "5",
  11862. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  11863. // "format": "uint32",
  11864. // "location": "query",
  11865. // "maximum": "50",
  11866. // "minimum": "0",
  11867. // "type": "integer"
  11868. // },
  11869. // "mine": {
  11870. // "description": "The mine parameter can be used to instruct the API to only return broadcasts owned by the authenticated user. Set the parameter value to true to only retrieve your own broadcasts.",
  11871. // "location": "query",
  11872. // "type": "boolean"
  11873. // },
  11874. // "onBehalfOfContentOwner": {
  11875. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  11876. // "location": "query",
  11877. // "type": "string"
  11878. // },
  11879. // "onBehalfOfContentOwnerChannel": {
  11880. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  11881. // "location": "query",
  11882. // "type": "string"
  11883. // },
  11884. // "pageToken": {
  11885. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  11886. // "location": "query",
  11887. // "type": "string"
  11888. // },
  11889. // "part": {
  11890. // "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.",
  11891. // "location": "query",
  11892. // "required": true,
  11893. // "type": "string"
  11894. // }
  11895. // },
  11896. // "path": "liveBroadcasts",
  11897. // "response": {
  11898. // "$ref": "LiveBroadcastListResponse"
  11899. // },
  11900. // "scopes": [
  11901. // "https://www.googleapis.com/auth/youtube",
  11902. // "https://www.googleapis.com/auth/youtube.force-ssl",
  11903. // "https://www.googleapis.com/auth/youtube.readonly"
  11904. // ]
  11905. // }
  11906. }
  11907. // Pages invokes f for each page of results.
  11908. // A non-nil error returned from f will halt the iteration.
  11909. // The provided context supersedes any context provided to the Context method.
  11910. func (c *LiveBroadcastsListCall) Pages(ctx context.Context, f func(*LiveBroadcastListResponse) error) error {
  11911. c.ctx_ = ctx
  11912. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11913. for {
  11914. x, err := c.Do()
  11915. if err != nil {
  11916. return err
  11917. }
  11918. if err := f(x); err != nil {
  11919. return err
  11920. }
  11921. if x.NextPageToken == "" {
  11922. return nil
  11923. }
  11924. c.PageToken(x.NextPageToken)
  11925. }
  11926. }
  11927. // method id "youtube.liveBroadcasts.transition":
  11928. type LiveBroadcastsTransitionCall struct {
  11929. s *Service
  11930. urlParams_ gensupport.URLParams
  11931. ctx_ context.Context
  11932. }
  11933. // Transition: Changes the status of a YouTube live broadcast and
  11934. // initiates any processes associated with the new status. For example,
  11935. // when you transition a broadcast's status to testing, YouTube starts
  11936. // to transmit video to that broadcast's monitor stream. Before calling
  11937. // this method, you should confirm that the value of the
  11938. // status.streamStatus property for the stream bound to your broadcast
  11939. // is active.
  11940. func (r *LiveBroadcastsService) Transition(broadcastStatus string, id string, part string) *LiveBroadcastsTransitionCall {
  11941. c := &LiveBroadcastsTransitionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11942. c.urlParams_.Set("broadcastStatus", broadcastStatus)
  11943. c.urlParams_.Set("id", id)
  11944. c.urlParams_.Set("part", part)
  11945. return c
  11946. }
  11947. // OnBehalfOfContentOwner sets the optional parameter
  11948. // "onBehalfOfContentOwner": Note: This parameter is intended
  11949. // exclusively for YouTube content partners.
  11950. //
  11951. // The onBehalfOfContentOwner parameter indicates that the request's
  11952. // authorization credentials identify a YouTube CMS user who is acting
  11953. // on behalf of the content owner specified in the parameter value. This
  11954. // parameter is intended for YouTube content partners that own and
  11955. // manage many different YouTube channels. It allows content owners to
  11956. // authenticate once and get access to all their video and channel data,
  11957. // without having to provide authentication credentials for each
  11958. // individual channel. The CMS account that the user authenticates with
  11959. // must be linked to the specified YouTube content owner.
  11960. func (c *LiveBroadcastsTransitionCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsTransitionCall {
  11961. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  11962. return c
  11963. }
  11964. // OnBehalfOfContentOwnerChannel sets the optional parameter
  11965. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  11966. // properly authorized request. Note: This parameter is intended
  11967. // exclusively for YouTube content partners.
  11968. //
  11969. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  11970. // channel ID of the channel to which a video is being added. This
  11971. // parameter is required when a request specifies a value for the
  11972. // onBehalfOfContentOwner parameter, and it can only be used in
  11973. // conjunction with that parameter. In addition, the request must be
  11974. // authorized using a CMS account that is linked to the content owner
  11975. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  11976. // channel that the onBehalfOfContentOwnerChannel parameter value
  11977. // specifies must be linked to the content owner that the
  11978. // onBehalfOfContentOwner parameter specifies.
  11979. //
  11980. // This parameter is intended for YouTube content partners that own and
  11981. // manage many different YouTube channels. It allows content owners to
  11982. // authenticate once and perform actions on behalf of the channel
  11983. // specified in the parameter value, without having to provide
  11984. // authentication credentials for each separate channel.
  11985. func (c *LiveBroadcastsTransitionCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsTransitionCall {
  11986. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  11987. return c
  11988. }
  11989. // Fields allows partial responses to be retrieved. See
  11990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11991. // for more information.
  11992. func (c *LiveBroadcastsTransitionCall) Fields(s ...googleapi.Field) *LiveBroadcastsTransitionCall {
  11993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11994. return c
  11995. }
  11996. // Context sets the context to be used in this call's Do method. Any
  11997. // pending HTTP request will be aborted if the provided context is
  11998. // canceled.
  11999. func (c *LiveBroadcastsTransitionCall) Context(ctx context.Context) *LiveBroadcastsTransitionCall {
  12000. c.ctx_ = ctx
  12001. return c
  12002. }
  12003. func (c *LiveBroadcastsTransitionCall) doRequest(alt string) (*http.Response, error) {
  12004. var body io.Reader = nil
  12005. c.urlParams_.Set("alt", alt)
  12006. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts/transition")
  12007. urls += "?" + c.urlParams_.Encode()
  12008. req, _ := http.NewRequest("POST", urls, body)
  12009. googleapi.SetOpaque(req.URL)
  12010. req.Header.Set("User-Agent", c.s.userAgent())
  12011. if c.ctx_ != nil {
  12012. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12013. }
  12014. return c.s.client.Do(req)
  12015. }
  12016. // Do executes the "youtube.liveBroadcasts.transition" call.
  12017. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  12018. // status code is an error. Response headers are in either
  12019. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  12020. // at all) in error.(*googleapi.Error).Header. Use
  12021. // googleapi.IsNotModified to check whether the returned error was
  12022. // because http.StatusNotModified was returned.
  12023. func (c *LiveBroadcastsTransitionCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  12024. gensupport.SetOptions(c.urlParams_, opts...)
  12025. res, err := c.doRequest("json")
  12026. if res != nil && res.StatusCode == http.StatusNotModified {
  12027. if res.Body != nil {
  12028. res.Body.Close()
  12029. }
  12030. return nil, &googleapi.Error{
  12031. Code: res.StatusCode,
  12032. Header: res.Header,
  12033. }
  12034. }
  12035. if err != nil {
  12036. return nil, err
  12037. }
  12038. defer googleapi.CloseBody(res)
  12039. if err := googleapi.CheckResponse(res); err != nil {
  12040. return nil, err
  12041. }
  12042. ret := &LiveBroadcast{
  12043. ServerResponse: googleapi.ServerResponse{
  12044. Header: res.Header,
  12045. HTTPStatusCode: res.StatusCode,
  12046. },
  12047. }
  12048. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12049. return nil, err
  12050. }
  12051. return ret, nil
  12052. // {
  12053. // "description": "Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active.",
  12054. // "httpMethod": "POST",
  12055. // "id": "youtube.liveBroadcasts.transition",
  12056. // "parameterOrder": [
  12057. // "broadcastStatus",
  12058. // "id",
  12059. // "part"
  12060. // ],
  12061. // "parameters": {
  12062. // "broadcastStatus": {
  12063. // "description": "The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to.",
  12064. // "enum": [
  12065. // "complete",
  12066. // "live",
  12067. // "testing"
  12068. // ],
  12069. // "enumDescriptions": [
  12070. // "The broadcast is over. YouTube stops transmitting video.",
  12071. // "The broadcast is visible to its audience. YouTube transmits video to the broadcast's monitor stream and its broadcast stream.",
  12072. // "Start testing the broadcast. YouTube transmits video to the broadcast's monitor stream. Note that you can only transition a broadcast to the testing state if its contentDetails.monitorStream.enableMonitorStream property is set to true."
  12073. // ],
  12074. // "location": "query",
  12075. // "required": true,
  12076. // "type": "string"
  12077. // },
  12078. // "id": {
  12079. // "description": "The id parameter specifies the unique ID of the broadcast that is transitioning to another status.",
  12080. // "location": "query",
  12081. // "required": true,
  12082. // "type": "string"
  12083. // },
  12084. // "onBehalfOfContentOwner": {
  12085. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  12086. // "location": "query",
  12087. // "type": "string"
  12088. // },
  12089. // "onBehalfOfContentOwnerChannel": {
  12090. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  12091. // "location": "query",
  12092. // "type": "string"
  12093. // },
  12094. // "part": {
  12095. // "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.",
  12096. // "location": "query",
  12097. // "required": true,
  12098. // "type": "string"
  12099. // }
  12100. // },
  12101. // "path": "liveBroadcasts/transition",
  12102. // "response": {
  12103. // "$ref": "LiveBroadcast"
  12104. // },
  12105. // "scopes": [
  12106. // "https://www.googleapis.com/auth/youtube",
  12107. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12108. // ]
  12109. // }
  12110. }
  12111. // method id "youtube.liveBroadcasts.update":
  12112. type LiveBroadcastsUpdateCall struct {
  12113. s *Service
  12114. livebroadcast *LiveBroadcast
  12115. urlParams_ gensupport.URLParams
  12116. ctx_ context.Context
  12117. }
  12118. // Update: Updates a broadcast. For example, you could modify the
  12119. // broadcast settings defined in the liveBroadcast resource's
  12120. // contentDetails object.
  12121. func (r *LiveBroadcastsService) Update(part string, livebroadcast *LiveBroadcast) *LiveBroadcastsUpdateCall {
  12122. c := &LiveBroadcastsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12123. c.urlParams_.Set("part", part)
  12124. c.livebroadcast = livebroadcast
  12125. return c
  12126. }
  12127. // OnBehalfOfContentOwner sets the optional parameter
  12128. // "onBehalfOfContentOwner": Note: This parameter is intended
  12129. // exclusively for YouTube content partners.
  12130. //
  12131. // The onBehalfOfContentOwner parameter indicates that the request's
  12132. // authorization credentials identify a YouTube CMS user who is acting
  12133. // on behalf of the content owner specified in the parameter value. This
  12134. // parameter is intended for YouTube content partners that own and
  12135. // manage many different YouTube channels. It allows content owners to
  12136. // authenticate once and get access to all their video and channel data,
  12137. // without having to provide authentication credentials for each
  12138. // individual channel. The CMS account that the user authenticates with
  12139. // must be linked to the specified YouTube content owner.
  12140. func (c *LiveBroadcastsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsUpdateCall {
  12141. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  12142. return c
  12143. }
  12144. // OnBehalfOfContentOwnerChannel sets the optional parameter
  12145. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  12146. // properly authorized request. Note: This parameter is intended
  12147. // exclusively for YouTube content partners.
  12148. //
  12149. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  12150. // channel ID of the channel to which a video is being added. This
  12151. // parameter is required when a request specifies a value for the
  12152. // onBehalfOfContentOwner parameter, and it can only be used in
  12153. // conjunction with that parameter. In addition, the request must be
  12154. // authorized using a CMS account that is linked to the content owner
  12155. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  12156. // channel that the onBehalfOfContentOwnerChannel parameter value
  12157. // specifies must be linked to the content owner that the
  12158. // onBehalfOfContentOwner parameter specifies.
  12159. //
  12160. // This parameter is intended for YouTube content partners that own and
  12161. // manage many different YouTube channels. It allows content owners to
  12162. // authenticate once and perform actions on behalf of the channel
  12163. // specified in the parameter value, without having to provide
  12164. // authentication credentials for each separate channel.
  12165. func (c *LiveBroadcastsUpdateCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsUpdateCall {
  12166. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  12167. return c
  12168. }
  12169. // Fields allows partial responses to be retrieved. See
  12170. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12171. // for more information.
  12172. func (c *LiveBroadcastsUpdateCall) Fields(s ...googleapi.Field) *LiveBroadcastsUpdateCall {
  12173. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12174. return c
  12175. }
  12176. // Context sets the context to be used in this call's Do method. Any
  12177. // pending HTTP request will be aborted if the provided context is
  12178. // canceled.
  12179. func (c *LiveBroadcastsUpdateCall) Context(ctx context.Context) *LiveBroadcastsUpdateCall {
  12180. c.ctx_ = ctx
  12181. return c
  12182. }
  12183. func (c *LiveBroadcastsUpdateCall) doRequest(alt string) (*http.Response, error) {
  12184. var body io.Reader = nil
  12185. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livebroadcast)
  12186. if err != nil {
  12187. return nil, err
  12188. }
  12189. ctype := "application/json"
  12190. c.urlParams_.Set("alt", alt)
  12191. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  12192. urls += "?" + c.urlParams_.Encode()
  12193. req, _ := http.NewRequest("PUT", urls, body)
  12194. googleapi.SetOpaque(req.URL)
  12195. req.Header.Set("Content-Type", ctype)
  12196. req.Header.Set("User-Agent", c.s.userAgent())
  12197. if c.ctx_ != nil {
  12198. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12199. }
  12200. return c.s.client.Do(req)
  12201. }
  12202. // Do executes the "youtube.liveBroadcasts.update" call.
  12203. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  12204. // status code is an error. Response headers are in either
  12205. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  12206. // at all) in error.(*googleapi.Error).Header. Use
  12207. // googleapi.IsNotModified to check whether the returned error was
  12208. // because http.StatusNotModified was returned.
  12209. func (c *LiveBroadcastsUpdateCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  12210. gensupport.SetOptions(c.urlParams_, opts...)
  12211. res, err := c.doRequest("json")
  12212. if res != nil && res.StatusCode == http.StatusNotModified {
  12213. if res.Body != nil {
  12214. res.Body.Close()
  12215. }
  12216. return nil, &googleapi.Error{
  12217. Code: res.StatusCode,
  12218. Header: res.Header,
  12219. }
  12220. }
  12221. if err != nil {
  12222. return nil, err
  12223. }
  12224. defer googleapi.CloseBody(res)
  12225. if err := googleapi.CheckResponse(res); err != nil {
  12226. return nil, err
  12227. }
  12228. ret := &LiveBroadcast{
  12229. ServerResponse: googleapi.ServerResponse{
  12230. Header: res.Header,
  12231. HTTPStatusCode: res.StatusCode,
  12232. },
  12233. }
  12234. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12235. return nil, err
  12236. }
  12237. return ret, nil
  12238. // {
  12239. // "description": "Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object.",
  12240. // "httpMethod": "PUT",
  12241. // "id": "youtube.liveBroadcasts.update",
  12242. // "parameterOrder": [
  12243. // "part"
  12244. // ],
  12245. // "parameters": {
  12246. // "onBehalfOfContentOwner": {
  12247. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  12248. // "location": "query",
  12249. // "type": "string"
  12250. // },
  12251. // "onBehalfOfContentOwnerChannel": {
  12252. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  12253. // "location": "query",
  12254. // "type": "string"
  12255. // },
  12256. // "part": {
  12257. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, contentDetails, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a broadcast's privacy status is defined in the status part. As such, if your request is updating a private or unlisted broadcast, and the request's part parameter value includes the status part, the broadcast's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the broadcast will revert to the default privacy setting.",
  12258. // "location": "query",
  12259. // "required": true,
  12260. // "type": "string"
  12261. // }
  12262. // },
  12263. // "path": "liveBroadcasts",
  12264. // "request": {
  12265. // "$ref": "LiveBroadcast"
  12266. // },
  12267. // "response": {
  12268. // "$ref": "LiveBroadcast"
  12269. // },
  12270. // "scopes": [
  12271. // "https://www.googleapis.com/auth/youtube",
  12272. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12273. // ]
  12274. // }
  12275. }
  12276. // method id "youtube.liveChatBans.delete":
  12277. type LiveChatBansDeleteCall struct {
  12278. s *Service
  12279. urlParams_ gensupport.URLParams
  12280. ctx_ context.Context
  12281. }
  12282. // Delete: Removes a chat ban.
  12283. func (r *LiveChatBansService) Delete(id string) *LiveChatBansDeleteCall {
  12284. c := &LiveChatBansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12285. c.urlParams_.Set("id", id)
  12286. return c
  12287. }
  12288. // Fields allows partial responses to be retrieved. See
  12289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12290. // for more information.
  12291. func (c *LiveChatBansDeleteCall) Fields(s ...googleapi.Field) *LiveChatBansDeleteCall {
  12292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12293. return c
  12294. }
  12295. // Context sets the context to be used in this call's Do method. Any
  12296. // pending HTTP request will be aborted if the provided context is
  12297. // canceled.
  12298. func (c *LiveChatBansDeleteCall) Context(ctx context.Context) *LiveChatBansDeleteCall {
  12299. c.ctx_ = ctx
  12300. return c
  12301. }
  12302. func (c *LiveChatBansDeleteCall) doRequest(alt string) (*http.Response, error) {
  12303. var body io.Reader = nil
  12304. c.urlParams_.Set("alt", alt)
  12305. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/bans")
  12306. urls += "?" + c.urlParams_.Encode()
  12307. req, _ := http.NewRequest("DELETE", urls, body)
  12308. googleapi.SetOpaque(req.URL)
  12309. req.Header.Set("User-Agent", c.s.userAgent())
  12310. if c.ctx_ != nil {
  12311. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12312. }
  12313. return c.s.client.Do(req)
  12314. }
  12315. // Do executes the "youtube.liveChatBans.delete" call.
  12316. func (c *LiveChatBansDeleteCall) Do(opts ...googleapi.CallOption) error {
  12317. gensupport.SetOptions(c.urlParams_, opts...)
  12318. res, err := c.doRequest("json")
  12319. if err != nil {
  12320. return err
  12321. }
  12322. defer googleapi.CloseBody(res)
  12323. if err := googleapi.CheckResponse(res); err != nil {
  12324. return err
  12325. }
  12326. return nil
  12327. // {
  12328. // "description": "Removes a chat ban.",
  12329. // "httpMethod": "DELETE",
  12330. // "id": "youtube.liveChatBans.delete",
  12331. // "parameterOrder": [
  12332. // "id"
  12333. // ],
  12334. // "parameters": {
  12335. // "id": {
  12336. // "description": "The id parameter identifies the chat ban to remove. The value uniquely identifies both the ban and the chat.",
  12337. // "location": "query",
  12338. // "required": true,
  12339. // "type": "string"
  12340. // }
  12341. // },
  12342. // "path": "liveChat/bans",
  12343. // "scopes": [
  12344. // "https://www.googleapis.com/auth/youtube",
  12345. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12346. // ]
  12347. // }
  12348. }
  12349. // method id "youtube.liveChatBans.insert":
  12350. type LiveChatBansInsertCall struct {
  12351. s *Service
  12352. livechatban *LiveChatBan
  12353. urlParams_ gensupport.URLParams
  12354. ctx_ context.Context
  12355. }
  12356. // Insert: Adds a new ban to the chat.
  12357. func (r *LiveChatBansService) Insert(part string, livechatban *LiveChatBan) *LiveChatBansInsertCall {
  12358. c := &LiveChatBansInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12359. c.urlParams_.Set("part", part)
  12360. c.livechatban = livechatban
  12361. return c
  12362. }
  12363. // Fields allows partial responses to be retrieved. See
  12364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12365. // for more information.
  12366. func (c *LiveChatBansInsertCall) Fields(s ...googleapi.Field) *LiveChatBansInsertCall {
  12367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12368. return c
  12369. }
  12370. // Context sets the context to be used in this call's Do method. Any
  12371. // pending HTTP request will be aborted if the provided context is
  12372. // canceled.
  12373. func (c *LiveChatBansInsertCall) Context(ctx context.Context) *LiveChatBansInsertCall {
  12374. c.ctx_ = ctx
  12375. return c
  12376. }
  12377. func (c *LiveChatBansInsertCall) doRequest(alt string) (*http.Response, error) {
  12378. var body io.Reader = nil
  12379. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatban)
  12380. if err != nil {
  12381. return nil, err
  12382. }
  12383. ctype := "application/json"
  12384. c.urlParams_.Set("alt", alt)
  12385. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/bans")
  12386. urls += "?" + c.urlParams_.Encode()
  12387. req, _ := http.NewRequest("POST", urls, body)
  12388. googleapi.SetOpaque(req.URL)
  12389. req.Header.Set("Content-Type", ctype)
  12390. req.Header.Set("User-Agent", c.s.userAgent())
  12391. if c.ctx_ != nil {
  12392. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12393. }
  12394. return c.s.client.Do(req)
  12395. }
  12396. // Do executes the "youtube.liveChatBans.insert" call.
  12397. // Exactly one of *LiveChatBan or error will be non-nil. Any non-2xx
  12398. // status code is an error. Response headers are in either
  12399. // *LiveChatBan.ServerResponse.Header or (if a response was returned at
  12400. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12401. // to check whether the returned error was because
  12402. // http.StatusNotModified was returned.
  12403. func (c *LiveChatBansInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatBan, error) {
  12404. gensupport.SetOptions(c.urlParams_, opts...)
  12405. res, err := c.doRequest("json")
  12406. if res != nil && res.StatusCode == http.StatusNotModified {
  12407. if res.Body != nil {
  12408. res.Body.Close()
  12409. }
  12410. return nil, &googleapi.Error{
  12411. Code: res.StatusCode,
  12412. Header: res.Header,
  12413. }
  12414. }
  12415. if err != nil {
  12416. return nil, err
  12417. }
  12418. defer googleapi.CloseBody(res)
  12419. if err := googleapi.CheckResponse(res); err != nil {
  12420. return nil, err
  12421. }
  12422. ret := &LiveChatBan{
  12423. ServerResponse: googleapi.ServerResponse{
  12424. Header: res.Header,
  12425. HTTPStatusCode: res.StatusCode,
  12426. },
  12427. }
  12428. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12429. return nil, err
  12430. }
  12431. return ret, nil
  12432. // {
  12433. // "description": "Adds a new ban to the chat.",
  12434. // "httpMethod": "POST",
  12435. // "id": "youtube.liveChatBans.insert",
  12436. // "parameterOrder": [
  12437. // "part"
  12438. // ],
  12439. // "parameters": {
  12440. // "part": {
  12441. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet.",
  12442. // "location": "query",
  12443. // "required": true,
  12444. // "type": "string"
  12445. // }
  12446. // },
  12447. // "path": "liveChat/bans",
  12448. // "request": {
  12449. // "$ref": "LiveChatBan"
  12450. // },
  12451. // "response": {
  12452. // "$ref": "LiveChatBan"
  12453. // },
  12454. // "scopes": [
  12455. // "https://www.googleapis.com/auth/youtube",
  12456. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12457. // ]
  12458. // }
  12459. }
  12460. // method id "youtube.liveChatMessages.delete":
  12461. type LiveChatMessagesDeleteCall struct {
  12462. s *Service
  12463. urlParams_ gensupport.URLParams
  12464. ctx_ context.Context
  12465. }
  12466. // Delete: Deletes a chat message.
  12467. func (r *LiveChatMessagesService) Delete(id string) *LiveChatMessagesDeleteCall {
  12468. c := &LiveChatMessagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12469. c.urlParams_.Set("id", id)
  12470. return c
  12471. }
  12472. // Fields allows partial responses to be retrieved. See
  12473. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12474. // for more information.
  12475. func (c *LiveChatMessagesDeleteCall) Fields(s ...googleapi.Field) *LiveChatMessagesDeleteCall {
  12476. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12477. return c
  12478. }
  12479. // Context sets the context to be used in this call's Do method. Any
  12480. // pending HTTP request will be aborted if the provided context is
  12481. // canceled.
  12482. func (c *LiveChatMessagesDeleteCall) Context(ctx context.Context) *LiveChatMessagesDeleteCall {
  12483. c.ctx_ = ctx
  12484. return c
  12485. }
  12486. func (c *LiveChatMessagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  12487. var body io.Reader = nil
  12488. c.urlParams_.Set("alt", alt)
  12489. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/messages")
  12490. urls += "?" + c.urlParams_.Encode()
  12491. req, _ := http.NewRequest("DELETE", urls, body)
  12492. googleapi.SetOpaque(req.URL)
  12493. req.Header.Set("User-Agent", c.s.userAgent())
  12494. if c.ctx_ != nil {
  12495. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12496. }
  12497. return c.s.client.Do(req)
  12498. }
  12499. // Do executes the "youtube.liveChatMessages.delete" call.
  12500. func (c *LiveChatMessagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  12501. gensupport.SetOptions(c.urlParams_, opts...)
  12502. res, err := c.doRequest("json")
  12503. if err != nil {
  12504. return err
  12505. }
  12506. defer googleapi.CloseBody(res)
  12507. if err := googleapi.CheckResponse(res); err != nil {
  12508. return err
  12509. }
  12510. return nil
  12511. // {
  12512. // "description": "Deletes a chat message.",
  12513. // "httpMethod": "DELETE",
  12514. // "id": "youtube.liveChatMessages.delete",
  12515. // "parameterOrder": [
  12516. // "id"
  12517. // ],
  12518. // "parameters": {
  12519. // "id": {
  12520. // "description": "The id parameter specifies the YouTube chat message ID of the resource that is being deleted.",
  12521. // "location": "query",
  12522. // "required": true,
  12523. // "type": "string"
  12524. // }
  12525. // },
  12526. // "path": "liveChat/messages",
  12527. // "scopes": [
  12528. // "https://www.googleapis.com/auth/youtube",
  12529. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12530. // ]
  12531. // }
  12532. }
  12533. // method id "youtube.liveChatMessages.insert":
  12534. type LiveChatMessagesInsertCall struct {
  12535. s *Service
  12536. livechatmessage *LiveChatMessage
  12537. urlParams_ gensupport.URLParams
  12538. ctx_ context.Context
  12539. }
  12540. // Insert: Adds a message to a live chat.
  12541. func (r *LiveChatMessagesService) Insert(part string, livechatmessage *LiveChatMessage) *LiveChatMessagesInsertCall {
  12542. c := &LiveChatMessagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12543. c.urlParams_.Set("part", part)
  12544. c.livechatmessage = livechatmessage
  12545. return c
  12546. }
  12547. // Fields allows partial responses to be retrieved. See
  12548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12549. // for more information.
  12550. func (c *LiveChatMessagesInsertCall) Fields(s ...googleapi.Field) *LiveChatMessagesInsertCall {
  12551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12552. return c
  12553. }
  12554. // Context sets the context to be used in this call's Do method. Any
  12555. // pending HTTP request will be aborted if the provided context is
  12556. // canceled.
  12557. func (c *LiveChatMessagesInsertCall) Context(ctx context.Context) *LiveChatMessagesInsertCall {
  12558. c.ctx_ = ctx
  12559. return c
  12560. }
  12561. func (c *LiveChatMessagesInsertCall) doRequest(alt string) (*http.Response, error) {
  12562. var body io.Reader = nil
  12563. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatmessage)
  12564. if err != nil {
  12565. return nil, err
  12566. }
  12567. ctype := "application/json"
  12568. c.urlParams_.Set("alt", alt)
  12569. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/messages")
  12570. urls += "?" + c.urlParams_.Encode()
  12571. req, _ := http.NewRequest("POST", urls, body)
  12572. googleapi.SetOpaque(req.URL)
  12573. req.Header.Set("Content-Type", ctype)
  12574. req.Header.Set("User-Agent", c.s.userAgent())
  12575. if c.ctx_ != nil {
  12576. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12577. }
  12578. return c.s.client.Do(req)
  12579. }
  12580. // Do executes the "youtube.liveChatMessages.insert" call.
  12581. // Exactly one of *LiveChatMessage or error will be non-nil. Any non-2xx
  12582. // status code is an error. Response headers are in either
  12583. // *LiveChatMessage.ServerResponse.Header or (if a response was returned
  12584. // at all) in error.(*googleapi.Error).Header. Use
  12585. // googleapi.IsNotModified to check whether the returned error was
  12586. // because http.StatusNotModified was returned.
  12587. func (c *LiveChatMessagesInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatMessage, error) {
  12588. gensupport.SetOptions(c.urlParams_, opts...)
  12589. res, err := c.doRequest("json")
  12590. if res != nil && res.StatusCode == http.StatusNotModified {
  12591. if res.Body != nil {
  12592. res.Body.Close()
  12593. }
  12594. return nil, &googleapi.Error{
  12595. Code: res.StatusCode,
  12596. Header: res.Header,
  12597. }
  12598. }
  12599. if err != nil {
  12600. return nil, err
  12601. }
  12602. defer googleapi.CloseBody(res)
  12603. if err := googleapi.CheckResponse(res); err != nil {
  12604. return nil, err
  12605. }
  12606. ret := &LiveChatMessage{
  12607. ServerResponse: googleapi.ServerResponse{
  12608. Header: res.Header,
  12609. HTTPStatusCode: res.StatusCode,
  12610. },
  12611. }
  12612. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12613. return nil, err
  12614. }
  12615. return ret, nil
  12616. // {
  12617. // "description": "Adds a message to a live chat.",
  12618. // "httpMethod": "POST",
  12619. // "id": "youtube.liveChatMessages.insert",
  12620. // "parameterOrder": [
  12621. // "part"
  12622. // ],
  12623. // "parameters": {
  12624. // "part": {
  12625. // "description": "The part parameter serves two purposes. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the parameter value to snippet.",
  12626. // "location": "query",
  12627. // "required": true,
  12628. // "type": "string"
  12629. // }
  12630. // },
  12631. // "path": "liveChat/messages",
  12632. // "request": {
  12633. // "$ref": "LiveChatMessage"
  12634. // },
  12635. // "response": {
  12636. // "$ref": "LiveChatMessage"
  12637. // },
  12638. // "scopes": [
  12639. // "https://www.googleapis.com/auth/youtube",
  12640. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12641. // ]
  12642. // }
  12643. }
  12644. // method id "youtube.liveChatMessages.list":
  12645. type LiveChatMessagesListCall struct {
  12646. s *Service
  12647. urlParams_ gensupport.URLParams
  12648. ifNoneMatch_ string
  12649. ctx_ context.Context
  12650. }
  12651. // List: Lists live chat messages for a specific chat.
  12652. func (r *LiveChatMessagesService) List(liveChatId string, part string) *LiveChatMessagesListCall {
  12653. c := &LiveChatMessagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12654. c.urlParams_.Set("liveChatId", liveChatId)
  12655. c.urlParams_.Set("part", part)
  12656. return c
  12657. }
  12658. // Hl sets the optional parameter "hl": The hl parameter instructs the
  12659. // API to retrieve localized resource metadata for a specific
  12660. // application language that the YouTube website supports. The parameter
  12661. // value must be a language code included in the list returned by the
  12662. // i18nLanguages.list method.
  12663. //
  12664. // If localized resource details are available in that language, the
  12665. // resource's snippet.localized object will contain the localized
  12666. // values. However, if localized details are not available, the
  12667. // snippet.localized object will contain resource details in the
  12668. // resource's default language.
  12669. func (c *LiveChatMessagesListCall) Hl(hl string) *LiveChatMessagesListCall {
  12670. c.urlParams_.Set("hl", hl)
  12671. return c
  12672. }
  12673. // MaxResults sets the optional parameter "maxResults": The maxResults
  12674. // parameter specifies the maximum number of messages that should be
  12675. // returned in the result set.
  12676. func (c *LiveChatMessagesListCall) MaxResults(maxResults int64) *LiveChatMessagesListCall {
  12677. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12678. return c
  12679. }
  12680. // PageToken sets the optional parameter "pageToken": The pageToken
  12681. // parameter identifies a specific page in the result set that should be
  12682. // returned. In an API response, the nextPageToken property identify
  12683. // other pages that could be retrieved.
  12684. func (c *LiveChatMessagesListCall) PageToken(pageToken string) *LiveChatMessagesListCall {
  12685. c.urlParams_.Set("pageToken", pageToken)
  12686. return c
  12687. }
  12688. // ProfileImageSize sets the optional parameter "profileImageSize": The
  12689. // profileImageSize parameter specifies the size of the user profile
  12690. // pictures that should be returned in the result set. Default: 88.
  12691. func (c *LiveChatMessagesListCall) ProfileImageSize(profileImageSize int64) *LiveChatMessagesListCall {
  12692. c.urlParams_.Set("profileImageSize", fmt.Sprint(profileImageSize))
  12693. return c
  12694. }
  12695. // Fields allows partial responses to be retrieved. See
  12696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12697. // for more information.
  12698. func (c *LiveChatMessagesListCall) Fields(s ...googleapi.Field) *LiveChatMessagesListCall {
  12699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12700. return c
  12701. }
  12702. // IfNoneMatch sets the optional parameter which makes the operation
  12703. // fail if the object's ETag matches the given value. This is useful for
  12704. // getting updates only after the object has changed since the last
  12705. // request. Use googleapi.IsNotModified to check whether the response
  12706. // error from Do is the result of In-None-Match.
  12707. func (c *LiveChatMessagesListCall) IfNoneMatch(entityTag string) *LiveChatMessagesListCall {
  12708. c.ifNoneMatch_ = entityTag
  12709. return c
  12710. }
  12711. // Context sets the context to be used in this call's Do method. Any
  12712. // pending HTTP request will be aborted if the provided context is
  12713. // canceled.
  12714. func (c *LiveChatMessagesListCall) Context(ctx context.Context) *LiveChatMessagesListCall {
  12715. c.ctx_ = ctx
  12716. return c
  12717. }
  12718. func (c *LiveChatMessagesListCall) doRequest(alt string) (*http.Response, error) {
  12719. var body io.Reader = nil
  12720. c.urlParams_.Set("alt", alt)
  12721. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/messages")
  12722. urls += "?" + c.urlParams_.Encode()
  12723. req, _ := http.NewRequest("GET", urls, body)
  12724. googleapi.SetOpaque(req.URL)
  12725. req.Header.Set("User-Agent", c.s.userAgent())
  12726. if c.ifNoneMatch_ != "" {
  12727. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12728. }
  12729. if c.ctx_ != nil {
  12730. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12731. }
  12732. return c.s.client.Do(req)
  12733. }
  12734. // Do executes the "youtube.liveChatMessages.list" call.
  12735. // Exactly one of *LiveChatMessageListResponse or error will be non-nil.
  12736. // Any non-2xx status code is an error. Response headers are in either
  12737. // *LiveChatMessageListResponse.ServerResponse.Header or (if a response
  12738. // was returned at all) in error.(*googleapi.Error).Header. Use
  12739. // googleapi.IsNotModified to check whether the returned error was
  12740. // because http.StatusNotModified was returned.
  12741. func (c *LiveChatMessagesListCall) Do(opts ...googleapi.CallOption) (*LiveChatMessageListResponse, error) {
  12742. gensupport.SetOptions(c.urlParams_, opts...)
  12743. res, err := c.doRequest("json")
  12744. if res != nil && res.StatusCode == http.StatusNotModified {
  12745. if res.Body != nil {
  12746. res.Body.Close()
  12747. }
  12748. return nil, &googleapi.Error{
  12749. Code: res.StatusCode,
  12750. Header: res.Header,
  12751. }
  12752. }
  12753. if err != nil {
  12754. return nil, err
  12755. }
  12756. defer googleapi.CloseBody(res)
  12757. if err := googleapi.CheckResponse(res); err != nil {
  12758. return nil, err
  12759. }
  12760. ret := &LiveChatMessageListResponse{
  12761. ServerResponse: googleapi.ServerResponse{
  12762. Header: res.Header,
  12763. HTTPStatusCode: res.StatusCode,
  12764. },
  12765. }
  12766. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12767. return nil, err
  12768. }
  12769. return ret, nil
  12770. // {
  12771. // "description": "Lists live chat messages for a specific chat.",
  12772. // "httpMethod": "GET",
  12773. // "id": "youtube.liveChatMessages.list",
  12774. // "parameterOrder": [
  12775. // "liveChatId",
  12776. // "part"
  12777. // ],
  12778. // "parameters": {
  12779. // "hl": {
  12780. // "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.",
  12781. // "location": "query",
  12782. // "type": "string"
  12783. // },
  12784. // "liveChatId": {
  12785. // "description": "The liveChatId parameter specifies the ID of the chat whose messages will be returned.",
  12786. // "location": "query",
  12787. // "required": true,
  12788. // "type": "string"
  12789. // },
  12790. // "maxResults": {
  12791. // "default": "500",
  12792. // "description": "The maxResults parameter specifies the maximum number of messages that should be returned in the result set.",
  12793. // "format": "uint32",
  12794. // "location": "query",
  12795. // "maximum": "2000",
  12796. // "minimum": "200",
  12797. // "type": "integer"
  12798. // },
  12799. // "pageToken": {
  12800. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identify other pages that could be retrieved.",
  12801. // "location": "query",
  12802. // "type": "string"
  12803. // },
  12804. // "part": {
  12805. // "description": "The part parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id and snippet.",
  12806. // "location": "query",
  12807. // "required": true,
  12808. // "type": "string"
  12809. // },
  12810. // "profileImageSize": {
  12811. // "description": "The profileImageSize parameter specifies the size of the user profile pictures that should be returned in the result set. Default: 88.",
  12812. // "format": "uint32",
  12813. // "location": "query",
  12814. // "maximum": "720",
  12815. // "minimum": "16",
  12816. // "type": "integer"
  12817. // }
  12818. // },
  12819. // "path": "liveChat/messages",
  12820. // "response": {
  12821. // "$ref": "LiveChatMessageListResponse"
  12822. // },
  12823. // "scopes": [
  12824. // "https://www.googleapis.com/auth/youtube",
  12825. // "https://www.googleapis.com/auth/youtube.force-ssl",
  12826. // "https://www.googleapis.com/auth/youtube.readonly"
  12827. // ]
  12828. // }
  12829. }
  12830. // Pages invokes f for each page of results.
  12831. // A non-nil error returned from f will halt the iteration.
  12832. // The provided context supersedes any context provided to the Context method.
  12833. func (c *LiveChatMessagesListCall) Pages(ctx context.Context, f func(*LiveChatMessageListResponse) error) error {
  12834. c.ctx_ = ctx
  12835. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12836. for {
  12837. x, err := c.Do()
  12838. if err != nil {
  12839. return err
  12840. }
  12841. if err := f(x); err != nil {
  12842. return err
  12843. }
  12844. if x.NextPageToken == "" {
  12845. return nil
  12846. }
  12847. c.PageToken(x.NextPageToken)
  12848. }
  12849. }
  12850. // method id "youtube.liveChatModerators.delete":
  12851. type LiveChatModeratorsDeleteCall struct {
  12852. s *Service
  12853. urlParams_ gensupport.URLParams
  12854. ctx_ context.Context
  12855. }
  12856. // Delete: Removes a chat moderator.
  12857. func (r *LiveChatModeratorsService) Delete(id string) *LiveChatModeratorsDeleteCall {
  12858. c := &LiveChatModeratorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12859. c.urlParams_.Set("id", id)
  12860. return c
  12861. }
  12862. // Fields allows partial responses to be retrieved. See
  12863. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12864. // for more information.
  12865. func (c *LiveChatModeratorsDeleteCall) Fields(s ...googleapi.Field) *LiveChatModeratorsDeleteCall {
  12866. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12867. return c
  12868. }
  12869. // Context sets the context to be used in this call's Do method. Any
  12870. // pending HTTP request will be aborted if the provided context is
  12871. // canceled.
  12872. func (c *LiveChatModeratorsDeleteCall) Context(ctx context.Context) *LiveChatModeratorsDeleteCall {
  12873. c.ctx_ = ctx
  12874. return c
  12875. }
  12876. func (c *LiveChatModeratorsDeleteCall) doRequest(alt string) (*http.Response, error) {
  12877. var body io.Reader = nil
  12878. c.urlParams_.Set("alt", alt)
  12879. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/moderators")
  12880. urls += "?" + c.urlParams_.Encode()
  12881. req, _ := http.NewRequest("DELETE", urls, body)
  12882. googleapi.SetOpaque(req.URL)
  12883. req.Header.Set("User-Agent", c.s.userAgent())
  12884. if c.ctx_ != nil {
  12885. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12886. }
  12887. return c.s.client.Do(req)
  12888. }
  12889. // Do executes the "youtube.liveChatModerators.delete" call.
  12890. func (c *LiveChatModeratorsDeleteCall) Do(opts ...googleapi.CallOption) error {
  12891. gensupport.SetOptions(c.urlParams_, opts...)
  12892. res, err := c.doRequest("json")
  12893. if err != nil {
  12894. return err
  12895. }
  12896. defer googleapi.CloseBody(res)
  12897. if err := googleapi.CheckResponse(res); err != nil {
  12898. return err
  12899. }
  12900. return nil
  12901. // {
  12902. // "description": "Removes a chat moderator.",
  12903. // "httpMethod": "DELETE",
  12904. // "id": "youtube.liveChatModerators.delete",
  12905. // "parameterOrder": [
  12906. // "id"
  12907. // ],
  12908. // "parameters": {
  12909. // "id": {
  12910. // "description": "The id parameter identifies the chat moderator to remove. The value uniquely identifies both the moderator and the chat.",
  12911. // "location": "query",
  12912. // "required": true,
  12913. // "type": "string"
  12914. // }
  12915. // },
  12916. // "path": "liveChat/moderators",
  12917. // "scopes": [
  12918. // "https://www.googleapis.com/auth/youtube",
  12919. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12920. // ]
  12921. // }
  12922. }
  12923. // method id "youtube.liveChatModerators.insert":
  12924. type LiveChatModeratorsInsertCall struct {
  12925. s *Service
  12926. livechatmoderator *LiveChatModerator
  12927. urlParams_ gensupport.URLParams
  12928. ctx_ context.Context
  12929. }
  12930. // Insert: Adds a new moderator for the chat.
  12931. func (r *LiveChatModeratorsService) Insert(part string, livechatmoderator *LiveChatModerator) *LiveChatModeratorsInsertCall {
  12932. c := &LiveChatModeratorsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12933. c.urlParams_.Set("part", part)
  12934. c.livechatmoderator = livechatmoderator
  12935. return c
  12936. }
  12937. // Fields allows partial responses to be retrieved. See
  12938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12939. // for more information.
  12940. func (c *LiveChatModeratorsInsertCall) Fields(s ...googleapi.Field) *LiveChatModeratorsInsertCall {
  12941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12942. return c
  12943. }
  12944. // Context sets the context to be used in this call's Do method. Any
  12945. // pending HTTP request will be aborted if the provided context is
  12946. // canceled.
  12947. func (c *LiveChatModeratorsInsertCall) Context(ctx context.Context) *LiveChatModeratorsInsertCall {
  12948. c.ctx_ = ctx
  12949. return c
  12950. }
  12951. func (c *LiveChatModeratorsInsertCall) doRequest(alt string) (*http.Response, error) {
  12952. var body io.Reader = nil
  12953. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatmoderator)
  12954. if err != nil {
  12955. return nil, err
  12956. }
  12957. ctype := "application/json"
  12958. c.urlParams_.Set("alt", alt)
  12959. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/moderators")
  12960. urls += "?" + c.urlParams_.Encode()
  12961. req, _ := http.NewRequest("POST", urls, body)
  12962. googleapi.SetOpaque(req.URL)
  12963. req.Header.Set("Content-Type", ctype)
  12964. req.Header.Set("User-Agent", c.s.userAgent())
  12965. if c.ctx_ != nil {
  12966. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12967. }
  12968. return c.s.client.Do(req)
  12969. }
  12970. // Do executes the "youtube.liveChatModerators.insert" call.
  12971. // Exactly one of *LiveChatModerator or error will be non-nil. Any
  12972. // non-2xx status code is an error. Response headers are in either
  12973. // *LiveChatModerator.ServerResponse.Header or (if a response was
  12974. // returned at all) in error.(*googleapi.Error).Header. Use
  12975. // googleapi.IsNotModified to check whether the returned error was
  12976. // because http.StatusNotModified was returned.
  12977. func (c *LiveChatModeratorsInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatModerator, error) {
  12978. gensupport.SetOptions(c.urlParams_, opts...)
  12979. res, err := c.doRequest("json")
  12980. if res != nil && res.StatusCode == http.StatusNotModified {
  12981. if res.Body != nil {
  12982. res.Body.Close()
  12983. }
  12984. return nil, &googleapi.Error{
  12985. Code: res.StatusCode,
  12986. Header: res.Header,
  12987. }
  12988. }
  12989. if err != nil {
  12990. return nil, err
  12991. }
  12992. defer googleapi.CloseBody(res)
  12993. if err := googleapi.CheckResponse(res); err != nil {
  12994. return nil, err
  12995. }
  12996. ret := &LiveChatModerator{
  12997. ServerResponse: googleapi.ServerResponse{
  12998. Header: res.Header,
  12999. HTTPStatusCode: res.StatusCode,
  13000. },
  13001. }
  13002. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13003. return nil, err
  13004. }
  13005. return ret, nil
  13006. // {
  13007. // "description": "Adds a new moderator for the chat.",
  13008. // "httpMethod": "POST",
  13009. // "id": "youtube.liveChatModerators.insert",
  13010. // "parameterOrder": [
  13011. // "part"
  13012. // ],
  13013. // "parameters": {
  13014. // "part": {
  13015. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet.",
  13016. // "location": "query",
  13017. // "required": true,
  13018. // "type": "string"
  13019. // }
  13020. // },
  13021. // "path": "liveChat/moderators",
  13022. // "request": {
  13023. // "$ref": "LiveChatModerator"
  13024. // },
  13025. // "response": {
  13026. // "$ref": "LiveChatModerator"
  13027. // },
  13028. // "scopes": [
  13029. // "https://www.googleapis.com/auth/youtube",
  13030. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13031. // ]
  13032. // }
  13033. }
  13034. // method id "youtube.liveChatModerators.list":
  13035. type LiveChatModeratorsListCall struct {
  13036. s *Service
  13037. urlParams_ gensupport.URLParams
  13038. ifNoneMatch_ string
  13039. ctx_ context.Context
  13040. }
  13041. // List: Lists moderators for a live chat.
  13042. func (r *LiveChatModeratorsService) List(liveChatId string, part string) *LiveChatModeratorsListCall {
  13043. c := &LiveChatModeratorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13044. c.urlParams_.Set("liveChatId", liveChatId)
  13045. c.urlParams_.Set("part", part)
  13046. return c
  13047. }
  13048. // MaxResults sets the optional parameter "maxResults": The maxResults
  13049. // parameter specifies the maximum number of items that should be
  13050. // returned in the result set.
  13051. func (c *LiveChatModeratorsListCall) MaxResults(maxResults int64) *LiveChatModeratorsListCall {
  13052. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13053. return c
  13054. }
  13055. // PageToken sets the optional parameter "pageToken": The pageToken
  13056. // parameter identifies a specific page in the result set that should be
  13057. // returned. In an API response, the nextPageToken and prevPageToken
  13058. // properties identify other pages that could be retrieved.
  13059. func (c *LiveChatModeratorsListCall) PageToken(pageToken string) *LiveChatModeratorsListCall {
  13060. c.urlParams_.Set("pageToken", pageToken)
  13061. return c
  13062. }
  13063. // Fields allows partial responses to be retrieved. See
  13064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13065. // for more information.
  13066. func (c *LiveChatModeratorsListCall) Fields(s ...googleapi.Field) *LiveChatModeratorsListCall {
  13067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13068. return c
  13069. }
  13070. // IfNoneMatch sets the optional parameter which makes the operation
  13071. // fail if the object's ETag matches the given value. This is useful for
  13072. // getting updates only after the object has changed since the last
  13073. // request. Use googleapi.IsNotModified to check whether the response
  13074. // error from Do is the result of In-None-Match.
  13075. func (c *LiveChatModeratorsListCall) IfNoneMatch(entityTag string) *LiveChatModeratorsListCall {
  13076. c.ifNoneMatch_ = entityTag
  13077. return c
  13078. }
  13079. // Context sets the context to be used in this call's Do method. Any
  13080. // pending HTTP request will be aborted if the provided context is
  13081. // canceled.
  13082. func (c *LiveChatModeratorsListCall) Context(ctx context.Context) *LiveChatModeratorsListCall {
  13083. c.ctx_ = ctx
  13084. return c
  13085. }
  13086. func (c *LiveChatModeratorsListCall) doRequest(alt string) (*http.Response, error) {
  13087. var body io.Reader = nil
  13088. c.urlParams_.Set("alt", alt)
  13089. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/moderators")
  13090. urls += "?" + c.urlParams_.Encode()
  13091. req, _ := http.NewRequest("GET", urls, body)
  13092. googleapi.SetOpaque(req.URL)
  13093. req.Header.Set("User-Agent", c.s.userAgent())
  13094. if c.ifNoneMatch_ != "" {
  13095. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13096. }
  13097. if c.ctx_ != nil {
  13098. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13099. }
  13100. return c.s.client.Do(req)
  13101. }
  13102. // Do executes the "youtube.liveChatModerators.list" call.
  13103. // Exactly one of *LiveChatModeratorListResponse or error will be
  13104. // non-nil. Any non-2xx status code is an error. Response headers are in
  13105. // either *LiveChatModeratorListResponse.ServerResponse.Header or (if a
  13106. // response was returned at all) in error.(*googleapi.Error).Header. Use
  13107. // googleapi.IsNotModified to check whether the returned error was
  13108. // because http.StatusNotModified was returned.
  13109. func (c *LiveChatModeratorsListCall) Do(opts ...googleapi.CallOption) (*LiveChatModeratorListResponse, error) {
  13110. gensupport.SetOptions(c.urlParams_, opts...)
  13111. res, err := c.doRequest("json")
  13112. if res != nil && res.StatusCode == http.StatusNotModified {
  13113. if res.Body != nil {
  13114. res.Body.Close()
  13115. }
  13116. return nil, &googleapi.Error{
  13117. Code: res.StatusCode,
  13118. Header: res.Header,
  13119. }
  13120. }
  13121. if err != nil {
  13122. return nil, err
  13123. }
  13124. defer googleapi.CloseBody(res)
  13125. if err := googleapi.CheckResponse(res); err != nil {
  13126. return nil, err
  13127. }
  13128. ret := &LiveChatModeratorListResponse{
  13129. ServerResponse: googleapi.ServerResponse{
  13130. Header: res.Header,
  13131. HTTPStatusCode: res.StatusCode,
  13132. },
  13133. }
  13134. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13135. return nil, err
  13136. }
  13137. return ret, nil
  13138. // {
  13139. // "description": "Lists moderators for a live chat.",
  13140. // "httpMethod": "GET",
  13141. // "id": "youtube.liveChatModerators.list",
  13142. // "parameterOrder": [
  13143. // "liveChatId",
  13144. // "part"
  13145. // ],
  13146. // "parameters": {
  13147. // "liveChatId": {
  13148. // "description": "The liveChatId parameter specifies the YouTube live chat for which the API should return moderators.",
  13149. // "location": "query",
  13150. // "required": true,
  13151. // "type": "string"
  13152. // },
  13153. // "maxResults": {
  13154. // "default": "5",
  13155. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  13156. // "format": "uint32",
  13157. // "location": "query",
  13158. // "maximum": "50",
  13159. // "minimum": "0",
  13160. // "type": "integer"
  13161. // },
  13162. // "pageToken": {
  13163. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  13164. // "location": "query",
  13165. // "type": "string"
  13166. // },
  13167. // "part": {
  13168. // "description": "The part parameter specifies the liveChatModerator resource parts that the API response will include. Supported values are id and snippet.",
  13169. // "location": "query",
  13170. // "required": true,
  13171. // "type": "string"
  13172. // }
  13173. // },
  13174. // "path": "liveChat/moderators",
  13175. // "response": {
  13176. // "$ref": "LiveChatModeratorListResponse"
  13177. // },
  13178. // "scopes": [
  13179. // "https://www.googleapis.com/auth/youtube",
  13180. // "https://www.googleapis.com/auth/youtube.force-ssl",
  13181. // "https://www.googleapis.com/auth/youtube.readonly"
  13182. // ]
  13183. // }
  13184. }
  13185. // Pages invokes f for each page of results.
  13186. // A non-nil error returned from f will halt the iteration.
  13187. // The provided context supersedes any context provided to the Context method.
  13188. func (c *LiveChatModeratorsListCall) Pages(ctx context.Context, f func(*LiveChatModeratorListResponse) error) error {
  13189. c.ctx_ = ctx
  13190. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13191. for {
  13192. x, err := c.Do()
  13193. if err != nil {
  13194. return err
  13195. }
  13196. if err := f(x); err != nil {
  13197. return err
  13198. }
  13199. if x.NextPageToken == "" {
  13200. return nil
  13201. }
  13202. c.PageToken(x.NextPageToken)
  13203. }
  13204. }
  13205. // method id "youtube.liveStreams.delete":
  13206. type LiveStreamsDeleteCall struct {
  13207. s *Service
  13208. urlParams_ gensupport.URLParams
  13209. ctx_ context.Context
  13210. }
  13211. // Delete: Deletes a video stream.
  13212. func (r *LiveStreamsService) Delete(id string) *LiveStreamsDeleteCall {
  13213. c := &LiveStreamsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13214. c.urlParams_.Set("id", id)
  13215. return c
  13216. }
  13217. // OnBehalfOfContentOwner sets the optional parameter
  13218. // "onBehalfOfContentOwner": Note: This parameter is intended
  13219. // exclusively for YouTube content partners.
  13220. //
  13221. // The onBehalfOfContentOwner parameter indicates that the request's
  13222. // authorization credentials identify a YouTube CMS user who is acting
  13223. // on behalf of the content owner specified in the parameter value. This
  13224. // parameter is intended for YouTube content partners that own and
  13225. // manage many different YouTube channels. It allows content owners to
  13226. // authenticate once and get access to all their video and channel data,
  13227. // without having to provide authentication credentials for each
  13228. // individual channel. The CMS account that the user authenticates with
  13229. // must be linked to the specified YouTube content owner.
  13230. func (c *LiveStreamsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsDeleteCall {
  13231. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13232. return c
  13233. }
  13234. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13235. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13236. // properly authorized request. Note: This parameter is intended
  13237. // exclusively for YouTube content partners.
  13238. //
  13239. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13240. // channel ID of the channel to which a video is being added. This
  13241. // parameter is required when a request specifies a value for the
  13242. // onBehalfOfContentOwner parameter, and it can only be used in
  13243. // conjunction with that parameter. In addition, the request must be
  13244. // authorized using a CMS account that is linked to the content owner
  13245. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13246. // channel that the onBehalfOfContentOwnerChannel parameter value
  13247. // specifies must be linked to the content owner that the
  13248. // onBehalfOfContentOwner parameter specifies.
  13249. //
  13250. // This parameter is intended for YouTube content partners that own and
  13251. // manage many different YouTube channels. It allows content owners to
  13252. // authenticate once and perform actions on behalf of the channel
  13253. // specified in the parameter value, without having to provide
  13254. // authentication credentials for each separate channel.
  13255. func (c *LiveStreamsDeleteCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsDeleteCall {
  13256. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13257. return c
  13258. }
  13259. // Fields allows partial responses to be retrieved. See
  13260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13261. // for more information.
  13262. func (c *LiveStreamsDeleteCall) Fields(s ...googleapi.Field) *LiveStreamsDeleteCall {
  13263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13264. return c
  13265. }
  13266. // Context sets the context to be used in this call's Do method. Any
  13267. // pending HTTP request will be aborted if the provided context is
  13268. // canceled.
  13269. func (c *LiveStreamsDeleteCall) Context(ctx context.Context) *LiveStreamsDeleteCall {
  13270. c.ctx_ = ctx
  13271. return c
  13272. }
  13273. func (c *LiveStreamsDeleteCall) doRequest(alt string) (*http.Response, error) {
  13274. var body io.Reader = nil
  13275. c.urlParams_.Set("alt", alt)
  13276. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  13277. urls += "?" + c.urlParams_.Encode()
  13278. req, _ := http.NewRequest("DELETE", urls, body)
  13279. googleapi.SetOpaque(req.URL)
  13280. req.Header.Set("User-Agent", c.s.userAgent())
  13281. if c.ctx_ != nil {
  13282. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13283. }
  13284. return c.s.client.Do(req)
  13285. }
  13286. // Do executes the "youtube.liveStreams.delete" call.
  13287. func (c *LiveStreamsDeleteCall) Do(opts ...googleapi.CallOption) error {
  13288. gensupport.SetOptions(c.urlParams_, opts...)
  13289. res, err := c.doRequest("json")
  13290. if err != nil {
  13291. return err
  13292. }
  13293. defer googleapi.CloseBody(res)
  13294. if err := googleapi.CheckResponse(res); err != nil {
  13295. return err
  13296. }
  13297. return nil
  13298. // {
  13299. // "description": "Deletes a video stream.",
  13300. // "httpMethod": "DELETE",
  13301. // "id": "youtube.liveStreams.delete",
  13302. // "parameterOrder": [
  13303. // "id"
  13304. // ],
  13305. // "parameters": {
  13306. // "id": {
  13307. // "description": "The id parameter specifies the YouTube live stream ID for the resource that is being deleted.",
  13308. // "location": "query",
  13309. // "required": true,
  13310. // "type": "string"
  13311. // },
  13312. // "onBehalfOfContentOwner": {
  13313. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  13314. // "location": "query",
  13315. // "type": "string"
  13316. // },
  13317. // "onBehalfOfContentOwnerChannel": {
  13318. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  13319. // "location": "query",
  13320. // "type": "string"
  13321. // }
  13322. // },
  13323. // "path": "liveStreams",
  13324. // "scopes": [
  13325. // "https://www.googleapis.com/auth/youtube",
  13326. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13327. // ]
  13328. // }
  13329. }
  13330. // method id "youtube.liveStreams.insert":
  13331. type LiveStreamsInsertCall struct {
  13332. s *Service
  13333. livestream *LiveStream
  13334. urlParams_ gensupport.URLParams
  13335. ctx_ context.Context
  13336. }
  13337. // Insert: Creates a video stream. The stream enables you to send your
  13338. // video to YouTube, which can then broadcast the video to your
  13339. // audience.
  13340. func (r *LiveStreamsService) Insert(part string, livestream *LiveStream) *LiveStreamsInsertCall {
  13341. c := &LiveStreamsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13342. c.urlParams_.Set("part", part)
  13343. c.livestream = livestream
  13344. return c
  13345. }
  13346. // OnBehalfOfContentOwner sets the optional parameter
  13347. // "onBehalfOfContentOwner": Note: This parameter is intended
  13348. // exclusively for YouTube content partners.
  13349. //
  13350. // The onBehalfOfContentOwner parameter indicates that the request's
  13351. // authorization credentials identify a YouTube CMS user who is acting
  13352. // on behalf of the content owner specified in the parameter value. This
  13353. // parameter is intended for YouTube content partners that own and
  13354. // manage many different YouTube channels. It allows content owners to
  13355. // authenticate once and get access to all their video and channel data,
  13356. // without having to provide authentication credentials for each
  13357. // individual channel. The CMS account that the user authenticates with
  13358. // must be linked to the specified YouTube content owner.
  13359. func (c *LiveStreamsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsInsertCall {
  13360. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13361. return c
  13362. }
  13363. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13364. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13365. // properly authorized request. Note: This parameter is intended
  13366. // exclusively for YouTube content partners.
  13367. //
  13368. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13369. // channel ID of the channel to which a video is being added. This
  13370. // parameter is required when a request specifies a value for the
  13371. // onBehalfOfContentOwner parameter, and it can only be used in
  13372. // conjunction with that parameter. In addition, the request must be
  13373. // authorized using a CMS account that is linked to the content owner
  13374. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13375. // channel that the onBehalfOfContentOwnerChannel parameter value
  13376. // specifies must be linked to the content owner that the
  13377. // onBehalfOfContentOwner parameter specifies.
  13378. //
  13379. // This parameter is intended for YouTube content partners that own and
  13380. // manage many different YouTube channels. It allows content owners to
  13381. // authenticate once and perform actions on behalf of the channel
  13382. // specified in the parameter value, without having to provide
  13383. // authentication credentials for each separate channel.
  13384. func (c *LiveStreamsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsInsertCall {
  13385. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13386. return c
  13387. }
  13388. // Fields allows partial responses to be retrieved. See
  13389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13390. // for more information.
  13391. func (c *LiveStreamsInsertCall) Fields(s ...googleapi.Field) *LiveStreamsInsertCall {
  13392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13393. return c
  13394. }
  13395. // Context sets the context to be used in this call's Do method. Any
  13396. // pending HTTP request will be aborted if the provided context is
  13397. // canceled.
  13398. func (c *LiveStreamsInsertCall) Context(ctx context.Context) *LiveStreamsInsertCall {
  13399. c.ctx_ = ctx
  13400. return c
  13401. }
  13402. func (c *LiveStreamsInsertCall) doRequest(alt string) (*http.Response, error) {
  13403. var body io.Reader = nil
  13404. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livestream)
  13405. if err != nil {
  13406. return nil, err
  13407. }
  13408. ctype := "application/json"
  13409. c.urlParams_.Set("alt", alt)
  13410. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  13411. urls += "?" + c.urlParams_.Encode()
  13412. req, _ := http.NewRequest("POST", urls, body)
  13413. googleapi.SetOpaque(req.URL)
  13414. req.Header.Set("Content-Type", ctype)
  13415. req.Header.Set("User-Agent", c.s.userAgent())
  13416. if c.ctx_ != nil {
  13417. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13418. }
  13419. return c.s.client.Do(req)
  13420. }
  13421. // Do executes the "youtube.liveStreams.insert" call.
  13422. // Exactly one of *LiveStream or error will be non-nil. Any non-2xx
  13423. // status code is an error. Response headers are in either
  13424. // *LiveStream.ServerResponse.Header or (if a response was returned at
  13425. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13426. // to check whether the returned error was because
  13427. // http.StatusNotModified was returned.
  13428. func (c *LiveStreamsInsertCall) Do(opts ...googleapi.CallOption) (*LiveStream, error) {
  13429. gensupport.SetOptions(c.urlParams_, opts...)
  13430. res, err := c.doRequest("json")
  13431. if res != nil && res.StatusCode == http.StatusNotModified {
  13432. if res.Body != nil {
  13433. res.Body.Close()
  13434. }
  13435. return nil, &googleapi.Error{
  13436. Code: res.StatusCode,
  13437. Header: res.Header,
  13438. }
  13439. }
  13440. if err != nil {
  13441. return nil, err
  13442. }
  13443. defer googleapi.CloseBody(res)
  13444. if err := googleapi.CheckResponse(res); err != nil {
  13445. return nil, err
  13446. }
  13447. ret := &LiveStream{
  13448. ServerResponse: googleapi.ServerResponse{
  13449. Header: res.Header,
  13450. HTTPStatusCode: res.StatusCode,
  13451. },
  13452. }
  13453. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13454. return nil, err
  13455. }
  13456. return ret, nil
  13457. // {
  13458. // "description": "Creates a video stream. The stream enables you to send your video to YouTube, which can then broadcast the video to your audience.",
  13459. // "httpMethod": "POST",
  13460. // "id": "youtube.liveStreams.insert",
  13461. // "parameterOrder": [
  13462. // "part"
  13463. // ],
  13464. // "parameters": {
  13465. // "onBehalfOfContentOwner": {
  13466. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  13467. // "location": "query",
  13468. // "type": "string"
  13469. // },
  13470. // "onBehalfOfContentOwnerChannel": {
  13471. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  13472. // "location": "query",
  13473. // "type": "string"
  13474. // },
  13475. // "part": {
  13476. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, cdn, and status.",
  13477. // "location": "query",
  13478. // "required": true,
  13479. // "type": "string"
  13480. // }
  13481. // },
  13482. // "path": "liveStreams",
  13483. // "request": {
  13484. // "$ref": "LiveStream"
  13485. // },
  13486. // "response": {
  13487. // "$ref": "LiveStream"
  13488. // },
  13489. // "scopes": [
  13490. // "https://www.googleapis.com/auth/youtube",
  13491. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13492. // ]
  13493. // }
  13494. }
  13495. // method id "youtube.liveStreams.list":
  13496. type LiveStreamsListCall struct {
  13497. s *Service
  13498. urlParams_ gensupport.URLParams
  13499. ifNoneMatch_ string
  13500. ctx_ context.Context
  13501. }
  13502. // List: Returns a list of video streams that match the API request
  13503. // parameters.
  13504. func (r *LiveStreamsService) List(part string) *LiveStreamsListCall {
  13505. c := &LiveStreamsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13506. c.urlParams_.Set("part", part)
  13507. return c
  13508. }
  13509. // Id sets the optional parameter "id": The id parameter specifies a
  13510. // comma-separated list of YouTube stream IDs that identify the streams
  13511. // being retrieved. In a liveStream resource, the id property specifies
  13512. // the stream's ID.
  13513. func (c *LiveStreamsListCall) Id(id string) *LiveStreamsListCall {
  13514. c.urlParams_.Set("id", id)
  13515. return c
  13516. }
  13517. // MaxResults sets the optional parameter "maxResults": The maxResults
  13518. // parameter specifies the maximum number of items that should be
  13519. // returned in the result set.
  13520. func (c *LiveStreamsListCall) MaxResults(maxResults int64) *LiveStreamsListCall {
  13521. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13522. return c
  13523. }
  13524. // Mine sets the optional parameter "mine": The mine parameter can be
  13525. // used to instruct the API to only return streams owned by the
  13526. // authenticated user. Set the parameter value to true to only retrieve
  13527. // your own streams.
  13528. func (c *LiveStreamsListCall) Mine(mine bool) *LiveStreamsListCall {
  13529. c.urlParams_.Set("mine", fmt.Sprint(mine))
  13530. return c
  13531. }
  13532. // OnBehalfOfContentOwner sets the optional parameter
  13533. // "onBehalfOfContentOwner": Note: This parameter is intended
  13534. // exclusively for YouTube content partners.
  13535. //
  13536. // The onBehalfOfContentOwner parameter indicates that the request's
  13537. // authorization credentials identify a YouTube CMS user who is acting
  13538. // on behalf of the content owner specified in the parameter value. This
  13539. // parameter is intended for YouTube content partners that own and
  13540. // manage many different YouTube channels. It allows content owners to
  13541. // authenticate once and get access to all their video and channel data,
  13542. // without having to provide authentication credentials for each
  13543. // individual channel. The CMS account that the user authenticates with
  13544. // must be linked to the specified YouTube content owner.
  13545. func (c *LiveStreamsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsListCall {
  13546. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13547. return c
  13548. }
  13549. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13550. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13551. // properly authorized request. Note: This parameter is intended
  13552. // exclusively for YouTube content partners.
  13553. //
  13554. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13555. // channel ID of the channel to which a video is being added. This
  13556. // parameter is required when a request specifies a value for the
  13557. // onBehalfOfContentOwner parameter, and it can only be used in
  13558. // conjunction with that parameter. In addition, the request must be
  13559. // authorized using a CMS account that is linked to the content owner
  13560. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13561. // channel that the onBehalfOfContentOwnerChannel parameter value
  13562. // specifies must be linked to the content owner that the
  13563. // onBehalfOfContentOwner parameter specifies.
  13564. //
  13565. // This parameter is intended for YouTube content partners that own and
  13566. // manage many different YouTube channels. It allows content owners to
  13567. // authenticate once and perform actions on behalf of the channel
  13568. // specified in the parameter value, without having to provide
  13569. // authentication credentials for each separate channel.
  13570. func (c *LiveStreamsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsListCall {
  13571. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13572. return c
  13573. }
  13574. // PageToken sets the optional parameter "pageToken": The pageToken
  13575. // parameter identifies a specific page in the result set that should be
  13576. // returned. In an API response, the nextPageToken and prevPageToken
  13577. // properties identify other pages that could be retrieved.
  13578. func (c *LiveStreamsListCall) PageToken(pageToken string) *LiveStreamsListCall {
  13579. c.urlParams_.Set("pageToken", pageToken)
  13580. return c
  13581. }
  13582. // Fields allows partial responses to be retrieved. See
  13583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13584. // for more information.
  13585. func (c *LiveStreamsListCall) Fields(s ...googleapi.Field) *LiveStreamsListCall {
  13586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13587. return c
  13588. }
  13589. // IfNoneMatch sets the optional parameter which makes the operation
  13590. // fail if the object's ETag matches the given value. This is useful for
  13591. // getting updates only after the object has changed since the last
  13592. // request. Use googleapi.IsNotModified to check whether the response
  13593. // error from Do is the result of In-None-Match.
  13594. func (c *LiveStreamsListCall) IfNoneMatch(entityTag string) *LiveStreamsListCall {
  13595. c.ifNoneMatch_ = entityTag
  13596. return c
  13597. }
  13598. // Context sets the context to be used in this call's Do method. Any
  13599. // pending HTTP request will be aborted if the provided context is
  13600. // canceled.
  13601. func (c *LiveStreamsListCall) Context(ctx context.Context) *LiveStreamsListCall {
  13602. c.ctx_ = ctx
  13603. return c
  13604. }
  13605. func (c *LiveStreamsListCall) doRequest(alt string) (*http.Response, error) {
  13606. var body io.Reader = nil
  13607. c.urlParams_.Set("alt", alt)
  13608. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  13609. urls += "?" + c.urlParams_.Encode()
  13610. req, _ := http.NewRequest("GET", urls, body)
  13611. googleapi.SetOpaque(req.URL)
  13612. req.Header.Set("User-Agent", c.s.userAgent())
  13613. if c.ifNoneMatch_ != "" {
  13614. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13615. }
  13616. if c.ctx_ != nil {
  13617. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13618. }
  13619. return c.s.client.Do(req)
  13620. }
  13621. // Do executes the "youtube.liveStreams.list" call.
  13622. // Exactly one of *LiveStreamListResponse or error will be non-nil. Any
  13623. // non-2xx status code is an error. Response headers are in either
  13624. // *LiveStreamListResponse.ServerResponse.Header or (if a response was
  13625. // returned at all) in error.(*googleapi.Error).Header. Use
  13626. // googleapi.IsNotModified to check whether the returned error was
  13627. // because http.StatusNotModified was returned.
  13628. func (c *LiveStreamsListCall) Do(opts ...googleapi.CallOption) (*LiveStreamListResponse, error) {
  13629. gensupport.SetOptions(c.urlParams_, opts...)
  13630. res, err := c.doRequest("json")
  13631. if res != nil && res.StatusCode == http.StatusNotModified {
  13632. if res.Body != nil {
  13633. res.Body.Close()
  13634. }
  13635. return nil, &googleapi.Error{
  13636. Code: res.StatusCode,
  13637. Header: res.Header,
  13638. }
  13639. }
  13640. if err != nil {
  13641. return nil, err
  13642. }
  13643. defer googleapi.CloseBody(res)
  13644. if err := googleapi.CheckResponse(res); err != nil {
  13645. return nil, err
  13646. }
  13647. ret := &LiveStreamListResponse{
  13648. ServerResponse: googleapi.ServerResponse{
  13649. Header: res.Header,
  13650. HTTPStatusCode: res.StatusCode,
  13651. },
  13652. }
  13653. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13654. return nil, err
  13655. }
  13656. return ret, nil
  13657. // {
  13658. // "description": "Returns a list of video streams that match the API request parameters.",
  13659. // "httpMethod": "GET",
  13660. // "id": "youtube.liveStreams.list",
  13661. // "parameterOrder": [
  13662. // "part"
  13663. // ],
  13664. // "parameters": {
  13665. // "id": {
  13666. // "description": "The id parameter specifies a comma-separated list of YouTube stream IDs that identify the streams being retrieved. In a liveStream resource, the id property specifies the stream's ID.",
  13667. // "location": "query",
  13668. // "type": "string"
  13669. // },
  13670. // "maxResults": {
  13671. // "default": "5",
  13672. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  13673. // "format": "uint32",
  13674. // "location": "query",
  13675. // "maximum": "50",
  13676. // "minimum": "0",
  13677. // "type": "integer"
  13678. // },
  13679. // "mine": {
  13680. // "description": "The mine parameter can be used to instruct the API to only return streams owned by the authenticated user. Set the parameter value to true to only retrieve your own streams.",
  13681. // "location": "query",
  13682. // "type": "boolean"
  13683. // },
  13684. // "onBehalfOfContentOwner": {
  13685. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  13686. // "location": "query",
  13687. // "type": "string"
  13688. // },
  13689. // "onBehalfOfContentOwnerChannel": {
  13690. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  13691. // "location": "query",
  13692. // "type": "string"
  13693. // },
  13694. // "pageToken": {
  13695. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  13696. // "location": "query",
  13697. // "type": "string"
  13698. // },
  13699. // "part": {
  13700. // "description": "The part parameter specifies a comma-separated list of one or more liveStream resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, cdn, and status.",
  13701. // "location": "query",
  13702. // "required": true,
  13703. // "type": "string"
  13704. // }
  13705. // },
  13706. // "path": "liveStreams",
  13707. // "response": {
  13708. // "$ref": "LiveStreamListResponse"
  13709. // },
  13710. // "scopes": [
  13711. // "https://www.googleapis.com/auth/youtube",
  13712. // "https://www.googleapis.com/auth/youtube.force-ssl",
  13713. // "https://www.googleapis.com/auth/youtube.readonly"
  13714. // ]
  13715. // }
  13716. }
  13717. // Pages invokes f for each page of results.
  13718. // A non-nil error returned from f will halt the iteration.
  13719. // The provided context supersedes any context provided to the Context method.
  13720. func (c *LiveStreamsListCall) Pages(ctx context.Context, f func(*LiveStreamListResponse) error) error {
  13721. c.ctx_ = ctx
  13722. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13723. for {
  13724. x, err := c.Do()
  13725. if err != nil {
  13726. return err
  13727. }
  13728. if err := f(x); err != nil {
  13729. return err
  13730. }
  13731. if x.NextPageToken == "" {
  13732. return nil
  13733. }
  13734. c.PageToken(x.NextPageToken)
  13735. }
  13736. }
  13737. // method id "youtube.liveStreams.update":
  13738. type LiveStreamsUpdateCall struct {
  13739. s *Service
  13740. livestream *LiveStream
  13741. urlParams_ gensupport.URLParams
  13742. ctx_ context.Context
  13743. }
  13744. // Update: Updates a video stream. If the properties that you want to
  13745. // change cannot be updated, then you need to create a new stream with
  13746. // the proper settings.
  13747. func (r *LiveStreamsService) Update(part string, livestream *LiveStream) *LiveStreamsUpdateCall {
  13748. c := &LiveStreamsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13749. c.urlParams_.Set("part", part)
  13750. c.livestream = livestream
  13751. return c
  13752. }
  13753. // OnBehalfOfContentOwner sets the optional parameter
  13754. // "onBehalfOfContentOwner": Note: This parameter is intended
  13755. // exclusively for YouTube content partners.
  13756. //
  13757. // The onBehalfOfContentOwner parameter indicates that the request's
  13758. // authorization credentials identify a YouTube CMS user who is acting
  13759. // on behalf of the content owner specified in the parameter value. This
  13760. // parameter is intended for YouTube content partners that own and
  13761. // manage many different YouTube channels. It allows content owners to
  13762. // authenticate once and get access to all their video and channel data,
  13763. // without having to provide authentication credentials for each
  13764. // individual channel. The CMS account that the user authenticates with
  13765. // must be linked to the specified YouTube content owner.
  13766. func (c *LiveStreamsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsUpdateCall {
  13767. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13768. return c
  13769. }
  13770. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13771. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13772. // properly authorized request. Note: This parameter is intended
  13773. // exclusively for YouTube content partners.
  13774. //
  13775. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13776. // channel ID of the channel to which a video is being added. This
  13777. // parameter is required when a request specifies a value for the
  13778. // onBehalfOfContentOwner parameter, and it can only be used in
  13779. // conjunction with that parameter. In addition, the request must be
  13780. // authorized using a CMS account that is linked to the content owner
  13781. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13782. // channel that the onBehalfOfContentOwnerChannel parameter value
  13783. // specifies must be linked to the content owner that the
  13784. // onBehalfOfContentOwner parameter specifies.
  13785. //
  13786. // This parameter is intended for YouTube content partners that own and
  13787. // manage many different YouTube channels. It allows content owners to
  13788. // authenticate once and perform actions on behalf of the channel
  13789. // specified in the parameter value, without having to provide
  13790. // authentication credentials for each separate channel.
  13791. func (c *LiveStreamsUpdateCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsUpdateCall {
  13792. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13793. return c
  13794. }
  13795. // Fields allows partial responses to be retrieved. See
  13796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13797. // for more information.
  13798. func (c *LiveStreamsUpdateCall) Fields(s ...googleapi.Field) *LiveStreamsUpdateCall {
  13799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13800. return c
  13801. }
  13802. // Context sets the context to be used in this call's Do method. Any
  13803. // pending HTTP request will be aborted if the provided context is
  13804. // canceled.
  13805. func (c *LiveStreamsUpdateCall) Context(ctx context.Context) *LiveStreamsUpdateCall {
  13806. c.ctx_ = ctx
  13807. return c
  13808. }
  13809. func (c *LiveStreamsUpdateCall) doRequest(alt string) (*http.Response, error) {
  13810. var body io.Reader = nil
  13811. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livestream)
  13812. if err != nil {
  13813. return nil, err
  13814. }
  13815. ctype := "application/json"
  13816. c.urlParams_.Set("alt", alt)
  13817. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  13818. urls += "?" + c.urlParams_.Encode()
  13819. req, _ := http.NewRequest("PUT", urls, body)
  13820. googleapi.SetOpaque(req.URL)
  13821. req.Header.Set("Content-Type", ctype)
  13822. req.Header.Set("User-Agent", c.s.userAgent())
  13823. if c.ctx_ != nil {
  13824. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13825. }
  13826. return c.s.client.Do(req)
  13827. }
  13828. // Do executes the "youtube.liveStreams.update" call.
  13829. // Exactly one of *LiveStream or error will be non-nil. Any non-2xx
  13830. // status code is an error. Response headers are in either
  13831. // *LiveStream.ServerResponse.Header or (if a response was returned at
  13832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13833. // to check whether the returned error was because
  13834. // http.StatusNotModified was returned.
  13835. func (c *LiveStreamsUpdateCall) Do(opts ...googleapi.CallOption) (*LiveStream, error) {
  13836. gensupport.SetOptions(c.urlParams_, opts...)
  13837. res, err := c.doRequest("json")
  13838. if res != nil && res.StatusCode == http.StatusNotModified {
  13839. if res.Body != nil {
  13840. res.Body.Close()
  13841. }
  13842. return nil, &googleapi.Error{
  13843. Code: res.StatusCode,
  13844. Header: res.Header,
  13845. }
  13846. }
  13847. if err != nil {
  13848. return nil, err
  13849. }
  13850. defer googleapi.CloseBody(res)
  13851. if err := googleapi.CheckResponse(res); err != nil {
  13852. return nil, err
  13853. }
  13854. ret := &LiveStream{
  13855. ServerResponse: googleapi.ServerResponse{
  13856. Header: res.Header,
  13857. HTTPStatusCode: res.StatusCode,
  13858. },
  13859. }
  13860. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13861. return nil, err
  13862. }
  13863. return ret, nil
  13864. // {
  13865. // "description": "Updates a video stream. If the properties that you want to change cannot be updated, then you need to create a new stream with the proper settings.",
  13866. // "httpMethod": "PUT",
  13867. // "id": "youtube.liveStreams.update",
  13868. // "parameterOrder": [
  13869. // "part"
  13870. // ],
  13871. // "parameters": {
  13872. // "onBehalfOfContentOwner": {
  13873. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  13874. // "location": "query",
  13875. // "type": "string"
  13876. // },
  13877. // "onBehalfOfContentOwnerChannel": {
  13878. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  13879. // "location": "query",
  13880. // "type": "string"
  13881. // },
  13882. // "part": {
  13883. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, cdn, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed.",
  13884. // "location": "query",
  13885. // "required": true,
  13886. // "type": "string"
  13887. // }
  13888. // },
  13889. // "path": "liveStreams",
  13890. // "request": {
  13891. // "$ref": "LiveStream"
  13892. // },
  13893. // "response": {
  13894. // "$ref": "LiveStream"
  13895. // },
  13896. // "scopes": [
  13897. // "https://www.googleapis.com/auth/youtube",
  13898. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13899. // ]
  13900. // }
  13901. }
  13902. // method id "youtube.playlistItems.delete":
  13903. type PlaylistItemsDeleteCall struct {
  13904. s *Service
  13905. urlParams_ gensupport.URLParams
  13906. ctx_ context.Context
  13907. }
  13908. // Delete: Deletes a playlist item.
  13909. func (r *PlaylistItemsService) Delete(id string) *PlaylistItemsDeleteCall {
  13910. c := &PlaylistItemsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13911. c.urlParams_.Set("id", id)
  13912. return c
  13913. }
  13914. // Fields allows partial responses to be retrieved. See
  13915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13916. // for more information.
  13917. func (c *PlaylistItemsDeleteCall) Fields(s ...googleapi.Field) *PlaylistItemsDeleteCall {
  13918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13919. return c
  13920. }
  13921. // Context sets the context to be used in this call's Do method. Any
  13922. // pending HTTP request will be aborted if the provided context is
  13923. // canceled.
  13924. func (c *PlaylistItemsDeleteCall) Context(ctx context.Context) *PlaylistItemsDeleteCall {
  13925. c.ctx_ = ctx
  13926. return c
  13927. }
  13928. func (c *PlaylistItemsDeleteCall) doRequest(alt string) (*http.Response, error) {
  13929. var body io.Reader = nil
  13930. c.urlParams_.Set("alt", alt)
  13931. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  13932. urls += "?" + c.urlParams_.Encode()
  13933. req, _ := http.NewRequest("DELETE", urls, body)
  13934. googleapi.SetOpaque(req.URL)
  13935. req.Header.Set("User-Agent", c.s.userAgent())
  13936. if c.ctx_ != nil {
  13937. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13938. }
  13939. return c.s.client.Do(req)
  13940. }
  13941. // Do executes the "youtube.playlistItems.delete" call.
  13942. func (c *PlaylistItemsDeleteCall) Do(opts ...googleapi.CallOption) error {
  13943. gensupport.SetOptions(c.urlParams_, opts...)
  13944. res, err := c.doRequest("json")
  13945. if err != nil {
  13946. return err
  13947. }
  13948. defer googleapi.CloseBody(res)
  13949. if err := googleapi.CheckResponse(res); err != nil {
  13950. return err
  13951. }
  13952. return nil
  13953. // {
  13954. // "description": "Deletes a playlist item.",
  13955. // "httpMethod": "DELETE",
  13956. // "id": "youtube.playlistItems.delete",
  13957. // "parameterOrder": [
  13958. // "id"
  13959. // ],
  13960. // "parameters": {
  13961. // "id": {
  13962. // "description": "The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item's ID.",
  13963. // "location": "query",
  13964. // "required": true,
  13965. // "type": "string"
  13966. // }
  13967. // },
  13968. // "path": "playlistItems",
  13969. // "scopes": [
  13970. // "https://www.googleapis.com/auth/youtube",
  13971. // "https://www.googleapis.com/auth/youtube.force-ssl",
  13972. // "https://www.googleapis.com/auth/youtubepartner"
  13973. // ]
  13974. // }
  13975. }
  13976. // method id "youtube.playlistItems.insert":
  13977. type PlaylistItemsInsertCall struct {
  13978. s *Service
  13979. playlistitem *PlaylistItem
  13980. urlParams_ gensupport.URLParams
  13981. ctx_ context.Context
  13982. }
  13983. // Insert: Adds a resource to a playlist.
  13984. func (r *PlaylistItemsService) Insert(part string, playlistitem *PlaylistItem) *PlaylistItemsInsertCall {
  13985. c := &PlaylistItemsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13986. c.urlParams_.Set("part", part)
  13987. c.playlistitem = playlistitem
  13988. return c
  13989. }
  13990. // OnBehalfOfContentOwner sets the optional parameter
  13991. // "onBehalfOfContentOwner": Note: This parameter is intended
  13992. // exclusively for YouTube content partners.
  13993. //
  13994. // The onBehalfOfContentOwner parameter indicates that the request's
  13995. // authorization credentials identify a YouTube CMS user who is acting
  13996. // on behalf of the content owner specified in the parameter value. This
  13997. // parameter is intended for YouTube content partners that own and
  13998. // manage many different YouTube channels. It allows content owners to
  13999. // authenticate once and get access to all their video and channel data,
  14000. // without having to provide authentication credentials for each
  14001. // individual channel. The CMS account that the user authenticates with
  14002. // must be linked to the specified YouTube content owner.
  14003. func (c *PlaylistItemsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsInsertCall {
  14004. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  14005. return c
  14006. }
  14007. // Fields allows partial responses to be retrieved. See
  14008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14009. // for more information.
  14010. func (c *PlaylistItemsInsertCall) Fields(s ...googleapi.Field) *PlaylistItemsInsertCall {
  14011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14012. return c
  14013. }
  14014. // Context sets the context to be used in this call's Do method. Any
  14015. // pending HTTP request will be aborted if the provided context is
  14016. // canceled.
  14017. func (c *PlaylistItemsInsertCall) Context(ctx context.Context) *PlaylistItemsInsertCall {
  14018. c.ctx_ = ctx
  14019. return c
  14020. }
  14021. func (c *PlaylistItemsInsertCall) doRequest(alt string) (*http.Response, error) {
  14022. var body io.Reader = nil
  14023. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistitem)
  14024. if err != nil {
  14025. return nil, err
  14026. }
  14027. ctype := "application/json"
  14028. c.urlParams_.Set("alt", alt)
  14029. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  14030. urls += "?" + c.urlParams_.Encode()
  14031. req, _ := http.NewRequest("POST", urls, body)
  14032. googleapi.SetOpaque(req.URL)
  14033. req.Header.Set("Content-Type", ctype)
  14034. req.Header.Set("User-Agent", c.s.userAgent())
  14035. if c.ctx_ != nil {
  14036. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14037. }
  14038. return c.s.client.Do(req)
  14039. }
  14040. // Do executes the "youtube.playlistItems.insert" call.
  14041. // Exactly one of *PlaylistItem or error will be non-nil. Any non-2xx
  14042. // status code is an error. Response headers are in either
  14043. // *PlaylistItem.ServerResponse.Header or (if a response was returned at
  14044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14045. // to check whether the returned error was because
  14046. // http.StatusNotModified was returned.
  14047. func (c *PlaylistItemsInsertCall) Do(opts ...googleapi.CallOption) (*PlaylistItem, error) {
  14048. gensupport.SetOptions(c.urlParams_, opts...)
  14049. res, err := c.doRequest("json")
  14050. if res != nil && res.StatusCode == http.StatusNotModified {
  14051. if res.Body != nil {
  14052. res.Body.Close()
  14053. }
  14054. return nil, &googleapi.Error{
  14055. Code: res.StatusCode,
  14056. Header: res.Header,
  14057. }
  14058. }
  14059. if err != nil {
  14060. return nil, err
  14061. }
  14062. defer googleapi.CloseBody(res)
  14063. if err := googleapi.CheckResponse(res); err != nil {
  14064. return nil, err
  14065. }
  14066. ret := &PlaylistItem{
  14067. ServerResponse: googleapi.ServerResponse{
  14068. Header: res.Header,
  14069. HTTPStatusCode: res.StatusCode,
  14070. },
  14071. }
  14072. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14073. return nil, err
  14074. }
  14075. return ret, nil
  14076. // {
  14077. // "description": "Adds a resource to a playlist.",
  14078. // "httpMethod": "POST",
  14079. // "id": "youtube.playlistItems.insert",
  14080. // "parameterOrder": [
  14081. // "part"
  14082. // ],
  14083. // "parameters": {
  14084. // "onBehalfOfContentOwner": {
  14085. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  14086. // "location": "query",
  14087. // "type": "string"
  14088. // },
  14089. // "part": {
  14090. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.",
  14091. // "location": "query",
  14092. // "required": true,
  14093. // "type": "string"
  14094. // }
  14095. // },
  14096. // "path": "playlistItems",
  14097. // "request": {
  14098. // "$ref": "PlaylistItem"
  14099. // },
  14100. // "response": {
  14101. // "$ref": "PlaylistItem"
  14102. // },
  14103. // "scopes": [
  14104. // "https://www.googleapis.com/auth/youtube",
  14105. // "https://www.googleapis.com/auth/youtube.force-ssl",
  14106. // "https://www.googleapis.com/auth/youtubepartner"
  14107. // ]
  14108. // }
  14109. }
  14110. // method id "youtube.playlistItems.list":
  14111. type PlaylistItemsListCall struct {
  14112. s *Service
  14113. urlParams_ gensupport.URLParams
  14114. ifNoneMatch_ string
  14115. ctx_ context.Context
  14116. }
  14117. // List: Returns a collection of playlist items that match the API
  14118. // request parameters. You can retrieve all of the playlist items in a
  14119. // specified playlist or retrieve one or more playlist items by their
  14120. // unique IDs.
  14121. func (r *PlaylistItemsService) List(part string) *PlaylistItemsListCall {
  14122. c := &PlaylistItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14123. c.urlParams_.Set("part", part)
  14124. return c
  14125. }
  14126. // Id sets the optional parameter "id": The id parameter specifies a
  14127. // comma-separated list of one or more unique playlist item IDs.
  14128. func (c *PlaylistItemsListCall) Id(id string) *PlaylistItemsListCall {
  14129. c.urlParams_.Set("id", id)
  14130. return c
  14131. }
  14132. // MaxResults sets the optional parameter "maxResults": The maxResults
  14133. // parameter specifies the maximum number of items that should be
  14134. // returned in the result set.
  14135. func (c *PlaylistItemsListCall) MaxResults(maxResults int64) *PlaylistItemsListCall {
  14136. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14137. return c
  14138. }
  14139. // OnBehalfOfContentOwner sets the optional parameter
  14140. // "onBehalfOfContentOwner": Note: This parameter is intended
  14141. // exclusively for YouTube content partners.
  14142. //
  14143. // The onBehalfOfContentOwner parameter indicates that the request's
  14144. // authorization credentials identify a YouTube CMS user who is acting
  14145. // on behalf of the content owner specified in the parameter value. This
  14146. // parameter is intended for YouTube content partners that own and
  14147. // manage many different YouTube channels. It allows content owners to
  14148. // authenticate once and get access to all their video and channel data,
  14149. // without having to provide authentication credentials for each
  14150. // individual channel. The CMS account that the user authenticates with
  14151. // must be linked to the specified YouTube content owner.
  14152. func (c *PlaylistItemsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsListCall {
  14153. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  14154. return c
  14155. }
  14156. // PageToken sets the optional parameter "pageToken": The pageToken
  14157. // parameter identifies a specific page in the result set that should be
  14158. // returned. In an API response, the nextPageToken and prevPageToken
  14159. // properties identify other pages that could be retrieved.
  14160. func (c *PlaylistItemsListCall) PageToken(pageToken string) *PlaylistItemsListCall {
  14161. c.urlParams_.Set("pageToken", pageToken)
  14162. return c
  14163. }
  14164. // PlaylistId sets the optional parameter "playlistId": The playlistId
  14165. // parameter specifies the unique ID of the playlist for which you want
  14166. // to retrieve playlist items. Note that even though this is an optional
  14167. // parameter, every request to retrieve playlist items must specify a
  14168. // value for either the id parameter or the playlistId parameter.
  14169. func (c *PlaylistItemsListCall) PlaylistId(playlistId string) *PlaylistItemsListCall {
  14170. c.urlParams_.Set("playlistId", playlistId)
  14171. return c
  14172. }
  14173. // VideoId sets the optional parameter "videoId": The videoId parameter
  14174. // specifies that the request should return only the playlist items that
  14175. // contain the specified video.
  14176. func (c *PlaylistItemsListCall) VideoId(videoId string) *PlaylistItemsListCall {
  14177. c.urlParams_.Set("videoId", videoId)
  14178. return c
  14179. }
  14180. // Fields allows partial responses to be retrieved. See
  14181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14182. // for more information.
  14183. func (c *PlaylistItemsListCall) Fields(s ...googleapi.Field) *PlaylistItemsListCall {
  14184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14185. return c
  14186. }
  14187. // IfNoneMatch sets the optional parameter which makes the operation
  14188. // fail if the object's ETag matches the given value. This is useful for
  14189. // getting updates only after the object has changed since the last
  14190. // request. Use googleapi.IsNotModified to check whether the response
  14191. // error from Do is the result of In-None-Match.
  14192. func (c *PlaylistItemsListCall) IfNoneMatch(entityTag string) *PlaylistItemsListCall {
  14193. c.ifNoneMatch_ = entityTag
  14194. return c
  14195. }
  14196. // Context sets the context to be used in this call's Do method. Any
  14197. // pending HTTP request will be aborted if the provided context is
  14198. // canceled.
  14199. func (c *PlaylistItemsListCall) Context(ctx context.Context) *PlaylistItemsListCall {
  14200. c.ctx_ = ctx
  14201. return c
  14202. }
  14203. func (c *PlaylistItemsListCall) doRequest(alt string) (*http.Response, error) {
  14204. var body io.Reader = nil
  14205. c.urlParams_.Set("alt", alt)
  14206. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  14207. urls += "?" + c.urlParams_.Encode()
  14208. req, _ := http.NewRequest("GET", urls, body)
  14209. googleapi.SetOpaque(req.URL)
  14210. req.Header.Set("User-Agent", c.s.userAgent())
  14211. if c.ifNoneMatch_ != "" {
  14212. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  14213. }
  14214. if c.ctx_ != nil {
  14215. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14216. }
  14217. return c.s.client.Do(req)
  14218. }
  14219. // Do executes the "youtube.playlistItems.list" call.
  14220. // Exactly one of *PlaylistItemListResponse or error will be non-nil.
  14221. // Any non-2xx status code is an error. Response headers are in either
  14222. // *PlaylistItemListResponse.ServerResponse.Header or (if a response was
  14223. // returned at all) in error.(*googleapi.Error).Header. Use
  14224. // googleapi.IsNotModified to check whether the returned error was
  14225. // because http.StatusNotModified was returned.
  14226. func (c *PlaylistItemsListCall) Do(opts ...googleapi.CallOption) (*PlaylistItemListResponse, error) {
  14227. gensupport.SetOptions(c.urlParams_, opts...)
  14228. res, err := c.doRequest("json")
  14229. if res != nil && res.StatusCode == http.StatusNotModified {
  14230. if res.Body != nil {
  14231. res.Body.Close()
  14232. }
  14233. return nil, &googleapi.Error{
  14234. Code: res.StatusCode,
  14235. Header: res.Header,
  14236. }
  14237. }
  14238. if err != nil {
  14239. return nil, err
  14240. }
  14241. defer googleapi.CloseBody(res)
  14242. if err := googleapi.CheckResponse(res); err != nil {
  14243. return nil, err
  14244. }
  14245. ret := &PlaylistItemListResponse{
  14246. ServerResponse: googleapi.ServerResponse{
  14247. Header: res.Header,
  14248. HTTPStatusCode: res.StatusCode,
  14249. },
  14250. }
  14251. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14252. return nil, err
  14253. }
  14254. return ret, nil
  14255. // {
  14256. // "description": "Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs.",
  14257. // "httpMethod": "GET",
  14258. // "id": "youtube.playlistItems.list",
  14259. // "parameterOrder": [
  14260. // "part"
  14261. // ],
  14262. // "parameters": {
  14263. // "id": {
  14264. // "description": "The id parameter specifies a comma-separated list of one or more unique playlist item IDs.",
  14265. // "location": "query",
  14266. // "type": "string"
  14267. // },
  14268. // "maxResults": {
  14269. // "default": "5",
  14270. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  14271. // "format": "uint32",
  14272. // "location": "query",
  14273. // "maximum": "50",
  14274. // "minimum": "0",
  14275. // "type": "integer"
  14276. // },
  14277. // "onBehalfOfContentOwner": {
  14278. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  14279. // "location": "query",
  14280. // "type": "string"
  14281. // },
  14282. // "pageToken": {
  14283. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  14284. // "location": "query",
  14285. // "type": "string"
  14286. // },
  14287. // "part": {
  14288. // "description": "The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties.",
  14289. // "location": "query",
  14290. // "required": true,
  14291. // "type": "string"
  14292. // },
  14293. // "playlistId": {
  14294. // "description": "The playlistId parameter specifies the unique ID of the playlist for which you want to retrieve playlist items. Note that even though this is an optional parameter, every request to retrieve playlist items must specify a value for either the id parameter or the playlistId parameter.",
  14295. // "location": "query",
  14296. // "type": "string"
  14297. // },
  14298. // "videoId": {
  14299. // "description": "The videoId parameter specifies that the request should return only the playlist items that contain the specified video.",
  14300. // "location": "query",
  14301. // "type": "string"
  14302. // }
  14303. // },
  14304. // "path": "playlistItems",
  14305. // "response": {
  14306. // "$ref": "PlaylistItemListResponse"
  14307. // },
  14308. // "scopes": [
  14309. // "https://www.googleapis.com/auth/youtube",
  14310. // "https://www.googleapis.com/auth/youtube.force-ssl",
  14311. // "https://www.googleapis.com/auth/youtube.readonly",
  14312. // "https://www.googleapis.com/auth/youtubepartner"
  14313. // ],
  14314. // "supportsSubscription": true
  14315. // }
  14316. }
  14317. // Pages invokes f for each page of results.
  14318. // A non-nil error returned from f will halt the iteration.
  14319. // The provided context supersedes any context provided to the Context method.
  14320. func (c *PlaylistItemsListCall) Pages(ctx context.Context, f func(*PlaylistItemListResponse) error) error {
  14321. c.ctx_ = ctx
  14322. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14323. for {
  14324. x, err := c.Do()
  14325. if err != nil {
  14326. return err
  14327. }
  14328. if err := f(x); err != nil {
  14329. return err
  14330. }
  14331. if x.NextPageToken == "" {
  14332. return nil
  14333. }
  14334. c.PageToken(x.NextPageToken)
  14335. }
  14336. }
  14337. // method id "youtube.playlistItems.update":
  14338. type PlaylistItemsUpdateCall struct {
  14339. s *Service
  14340. playlistitem *PlaylistItem
  14341. urlParams_ gensupport.URLParams
  14342. ctx_ context.Context
  14343. }
  14344. // Update: Modifies a playlist item. For example, you could update the
  14345. // item's position in the playlist.
  14346. func (r *PlaylistItemsService) Update(part string, playlistitem *PlaylistItem) *PlaylistItemsUpdateCall {
  14347. c := &PlaylistItemsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14348. c.urlParams_.Set("part", part)
  14349. c.playlistitem = playlistitem
  14350. return c
  14351. }
  14352. // Fields allows partial responses to be retrieved. See
  14353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14354. // for more information.
  14355. func (c *PlaylistItemsUpdateCall) Fields(s ...googleapi.Field) *PlaylistItemsUpdateCall {
  14356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14357. return c
  14358. }
  14359. // Context sets the context to be used in this call's Do method. Any
  14360. // pending HTTP request will be aborted if the provided context is
  14361. // canceled.
  14362. func (c *PlaylistItemsUpdateCall) Context(ctx context.Context) *PlaylistItemsUpdateCall {
  14363. c.ctx_ = ctx
  14364. return c
  14365. }
  14366. func (c *PlaylistItemsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14367. var body io.Reader = nil
  14368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistitem)
  14369. if err != nil {
  14370. return nil, err
  14371. }
  14372. ctype := "application/json"
  14373. c.urlParams_.Set("alt", alt)
  14374. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  14375. urls += "?" + c.urlParams_.Encode()
  14376. req, _ := http.NewRequest("PUT", urls, body)
  14377. googleapi.SetOpaque(req.URL)
  14378. req.Header.Set("Content-Type", ctype)
  14379. req.Header.Set("User-Agent", c.s.userAgent())
  14380. if c.ctx_ != nil {
  14381. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14382. }
  14383. return c.s.client.Do(req)
  14384. }
  14385. // Do executes the "youtube.playlistItems.update" call.
  14386. // Exactly one of *PlaylistItem or error will be non-nil. Any non-2xx
  14387. // status code is an error. Response headers are in either
  14388. // *PlaylistItem.ServerResponse.Header or (if a response was returned at
  14389. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14390. // to check whether the returned error was because
  14391. // http.StatusNotModified was returned.
  14392. func (c *PlaylistItemsUpdateCall) Do(opts ...googleapi.CallOption) (*PlaylistItem, error) {
  14393. gensupport.SetOptions(c.urlParams_, opts...)
  14394. res, err := c.doRequest("json")
  14395. if res != nil && res.StatusCode == http.StatusNotModified {
  14396. if res.Body != nil {
  14397. res.Body.Close()
  14398. }
  14399. return nil, &googleapi.Error{
  14400. Code: res.StatusCode,
  14401. Header: res.Header,
  14402. }
  14403. }
  14404. if err != nil {
  14405. return nil, err
  14406. }
  14407. defer googleapi.CloseBody(res)
  14408. if err := googleapi.CheckResponse(res); err != nil {
  14409. return nil, err
  14410. }
  14411. ret := &PlaylistItem{
  14412. ServerResponse: googleapi.ServerResponse{
  14413. Header: res.Header,
  14414. HTTPStatusCode: res.StatusCode,
  14415. },
  14416. }
  14417. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14418. return nil, err
  14419. }
  14420. return ret, nil
  14421. // {
  14422. // "description": "Modifies a playlist item. For example, you could update the item's position in the playlist.",
  14423. // "httpMethod": "PUT",
  14424. // "id": "youtube.playlistItems.update",
  14425. // "parameterOrder": [
  14426. // "part"
  14427. // ],
  14428. // "parameters": {
  14429. // "part": {
  14430. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings.",
  14431. // "location": "query",
  14432. // "required": true,
  14433. // "type": "string"
  14434. // }
  14435. // },
  14436. // "path": "playlistItems",
  14437. // "request": {
  14438. // "$ref": "PlaylistItem"
  14439. // },
  14440. // "response": {
  14441. // "$ref": "PlaylistItem"
  14442. // },
  14443. // "scopes": [
  14444. // "https://www.googleapis.com/auth/youtube",
  14445. // "https://www.googleapis.com/auth/youtube.force-ssl",
  14446. // "https://www.googleapis.com/auth/youtubepartner"
  14447. // ]
  14448. // }
  14449. }
  14450. // method id "youtube.playlists.delete":
  14451. type PlaylistsDeleteCall struct {
  14452. s *Service
  14453. urlParams_ gensupport.URLParams
  14454. ctx_ context.Context
  14455. }
  14456. // Delete: Deletes a playlist.
  14457. func (r *PlaylistsService) Delete(id string) *PlaylistsDeleteCall {
  14458. c := &PlaylistsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14459. c.urlParams_.Set("id", id)
  14460. return c
  14461. }
  14462. // OnBehalfOfContentOwner sets the optional parameter
  14463. // "onBehalfOfContentOwner": Note: This parameter is intended
  14464. // exclusively for YouTube content partners.
  14465. //
  14466. // The onBehalfOfContentOwner parameter indicates that the request's
  14467. // authorization credentials identify a YouTube CMS user who is acting
  14468. // on behalf of the content owner specified in the parameter value. This
  14469. // parameter is intended for YouTube content partners that own and
  14470. // manage many different YouTube channels. It allows content owners to
  14471. // authenticate once and get access to all their video and channel data,
  14472. // without having to provide authentication credentials for each
  14473. // individual channel. The CMS account that the user authenticates with
  14474. // must be linked to the specified YouTube content owner.
  14475. func (c *PlaylistsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsDeleteCall {
  14476. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  14477. return c
  14478. }
  14479. // Fields allows partial responses to be retrieved. See
  14480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14481. // for more information.
  14482. func (c *PlaylistsDeleteCall) Fields(s ...googleapi.Field) *PlaylistsDeleteCall {
  14483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14484. return c
  14485. }
  14486. // Context sets the context to be used in this call's Do method. Any
  14487. // pending HTTP request will be aborted if the provided context is
  14488. // canceled.
  14489. func (c *PlaylistsDeleteCall) Context(ctx context.Context) *PlaylistsDeleteCall {
  14490. c.ctx_ = ctx
  14491. return c
  14492. }
  14493. func (c *PlaylistsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14494. var body io.Reader = nil
  14495. c.urlParams_.Set("alt", alt)
  14496. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  14497. urls += "?" + c.urlParams_.Encode()
  14498. req, _ := http.NewRequest("DELETE", urls, body)
  14499. googleapi.SetOpaque(req.URL)
  14500. req.Header.Set("User-Agent", c.s.userAgent())
  14501. if c.ctx_ != nil {
  14502. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14503. }
  14504. return c.s.client.Do(req)
  14505. }
  14506. // Do executes the "youtube.playlists.delete" call.
  14507. func (c *PlaylistsDeleteCall) Do(opts ...googleapi.CallOption) error {
  14508. gensupport.SetOptions(c.urlParams_, opts...)
  14509. res, err := c.doRequest("json")
  14510. if err != nil {
  14511. return err
  14512. }
  14513. defer googleapi.CloseBody(res)
  14514. if err := googleapi.CheckResponse(res); err != nil {
  14515. return err
  14516. }
  14517. return nil
  14518. // {
  14519. // "description": "Deletes a playlist.",
  14520. // "httpMethod": "DELETE",
  14521. // "id": "youtube.playlists.delete",
  14522. // "parameterOrder": [
  14523. // "id"
  14524. // ],
  14525. // "parameters": {
  14526. // "id": {
  14527. // "description": "The id parameter specifies the YouTube playlist ID for the playlist that is being deleted. In a playlist resource, the id property specifies the playlist's ID.",
  14528. // "location": "query",
  14529. // "required": true,
  14530. // "type": "string"
  14531. // },
  14532. // "onBehalfOfContentOwner": {
  14533. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  14534. // "location": "query",
  14535. // "type": "string"
  14536. // }
  14537. // },
  14538. // "path": "playlists",
  14539. // "scopes": [
  14540. // "https://www.googleapis.com/auth/youtube",
  14541. // "https://www.googleapis.com/auth/youtube.force-ssl",
  14542. // "https://www.googleapis.com/auth/youtubepartner"
  14543. // ]
  14544. // }
  14545. }
  14546. // method id "youtube.playlists.insert":
  14547. type PlaylistsInsertCall struct {
  14548. s *Service
  14549. playlist *Playlist
  14550. urlParams_ gensupport.URLParams
  14551. ctx_ context.Context
  14552. }
  14553. // Insert: Creates a playlist.
  14554. func (r *PlaylistsService) Insert(part string, playlist *Playlist) *PlaylistsInsertCall {
  14555. c := &PlaylistsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14556. c.urlParams_.Set("part", part)
  14557. c.playlist = playlist
  14558. return c
  14559. }
  14560. // OnBehalfOfContentOwner sets the optional parameter
  14561. // "onBehalfOfContentOwner": Note: This parameter is intended
  14562. // exclusively for YouTube content partners.
  14563. //
  14564. // The onBehalfOfContentOwner parameter indicates that the request's
  14565. // authorization credentials identify a YouTube CMS user who is acting
  14566. // on behalf of the content owner specified in the parameter value. This
  14567. // parameter is intended for YouTube content partners that own and
  14568. // manage many different YouTube channels. It allows content owners to
  14569. // authenticate once and get access to all their video and channel data,
  14570. // without having to provide authentication credentials for each
  14571. // individual channel. The CMS account that the user authenticates with
  14572. // must be linked to the specified YouTube content owner.
  14573. func (c *PlaylistsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsInsertCall {
  14574. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  14575. return c
  14576. }
  14577. // OnBehalfOfContentOwnerChannel sets the optional parameter
  14578. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  14579. // properly authorized request. Note: This parameter is intended
  14580. // exclusively for YouTube content partners.
  14581. //
  14582. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  14583. // channel ID of the channel to which a video is being added. This
  14584. // parameter is required when a request specifies a value for the
  14585. // onBehalfOfContentOwner parameter, and it can only be used in
  14586. // conjunction with that parameter. In addition, the request must be
  14587. // authorized using a CMS account that is linked to the content owner
  14588. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  14589. // channel that the onBehalfOfContentOwnerChannel parameter value
  14590. // specifies must be linked to the content owner that the
  14591. // onBehalfOfContentOwner parameter specifies.
  14592. //
  14593. // This parameter is intended for YouTube content partners that own and
  14594. // manage many different YouTube channels. It allows content owners to
  14595. // authenticate once and perform actions on behalf of the channel
  14596. // specified in the parameter value, without having to provide
  14597. // authentication credentials for each separate channel.
  14598. func (c *PlaylistsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistsInsertCall {
  14599. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  14600. return c
  14601. }
  14602. // Fields allows partial responses to be retrieved. See
  14603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14604. // for more information.
  14605. func (c *PlaylistsInsertCall) Fields(s ...googleapi.Field) *PlaylistsInsertCall {
  14606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14607. return c
  14608. }
  14609. // Context sets the context to be used in this call's Do method. Any
  14610. // pending HTTP request will be aborted if the provided context is
  14611. // canceled.
  14612. func (c *PlaylistsInsertCall) Context(ctx context.Context) *PlaylistsInsertCall {
  14613. c.ctx_ = ctx
  14614. return c
  14615. }
  14616. func (c *PlaylistsInsertCall) doRequest(alt string) (*http.Response, error) {
  14617. var body io.Reader = nil
  14618. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlist)
  14619. if err != nil {
  14620. return nil, err
  14621. }
  14622. ctype := "application/json"
  14623. c.urlParams_.Set("alt", alt)
  14624. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  14625. urls += "?" + c.urlParams_.Encode()
  14626. req, _ := http.NewRequest("POST", urls, body)
  14627. googleapi.SetOpaque(req.URL)
  14628. req.Header.Set("Content-Type", ctype)
  14629. req.Header.Set("User-Agent", c.s.userAgent())
  14630. if c.ctx_ != nil {
  14631. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14632. }
  14633. return c.s.client.Do(req)
  14634. }
  14635. // Do executes the "youtube.playlists.insert" call.
  14636. // Exactly one of *Playlist or error will be non-nil. Any non-2xx status
  14637. // code is an error. Response headers are in either
  14638. // *Playlist.ServerResponse.Header or (if a response was returned at
  14639. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14640. // to check whether the returned error was because
  14641. // http.StatusNotModified was returned.
  14642. func (c *PlaylistsInsertCall) Do(opts ...googleapi.CallOption) (*Playlist, error) {
  14643. gensupport.SetOptions(c.urlParams_, opts...)
  14644. res, err := c.doRequest("json")
  14645. if res != nil && res.StatusCode == http.StatusNotModified {
  14646. if res.Body != nil {
  14647. res.Body.Close()
  14648. }
  14649. return nil, &googleapi.Error{
  14650. Code: res.StatusCode,
  14651. Header: res.Header,
  14652. }
  14653. }
  14654. if err != nil {
  14655. return nil, err
  14656. }
  14657. defer googleapi.CloseBody(res)
  14658. if err := googleapi.CheckResponse(res); err != nil {
  14659. return nil, err
  14660. }
  14661. ret := &Playlist{
  14662. ServerResponse: googleapi.ServerResponse{
  14663. Header: res.Header,
  14664. HTTPStatusCode: res.StatusCode,
  14665. },
  14666. }
  14667. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14668. return nil, err
  14669. }
  14670. return ret, nil
  14671. // {
  14672. // "description": "Creates a playlist.",
  14673. // "httpMethod": "POST",
  14674. // "id": "youtube.playlists.insert",
  14675. // "parameterOrder": [
  14676. // "part"
  14677. // ],
  14678. // "parameters": {
  14679. // "onBehalfOfContentOwner": {
  14680. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  14681. // "location": "query",
  14682. // "type": "string"
  14683. // },
  14684. // "onBehalfOfContentOwnerChannel": {
  14685. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  14686. // "location": "query",
  14687. // "type": "string"
  14688. // },
  14689. // "part": {
  14690. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.",
  14691. // "location": "query",
  14692. // "required": true,
  14693. // "type": "string"
  14694. // }
  14695. // },
  14696. // "path": "playlists",
  14697. // "request": {
  14698. // "$ref": "Playlist"
  14699. // },
  14700. // "response": {
  14701. // "$ref": "Playlist"
  14702. // },
  14703. // "scopes": [
  14704. // "https://www.googleapis.com/auth/youtube",
  14705. // "https://www.googleapis.com/auth/youtube.force-ssl",
  14706. // "https://www.googleapis.com/auth/youtubepartner"
  14707. // ]
  14708. // }
  14709. }
  14710. // method id "youtube.playlists.list":
  14711. type PlaylistsListCall struct {
  14712. s *Service
  14713. urlParams_ gensupport.URLParams
  14714. ifNoneMatch_ string
  14715. ctx_ context.Context
  14716. }
  14717. // List: Returns a collection of playlists that match the API request
  14718. // parameters. For example, you can retrieve all playlists that the
  14719. // authenticated user owns, or you can retrieve one or more playlists by
  14720. // their unique IDs.
  14721. func (r *PlaylistsService) List(part string) *PlaylistsListCall {
  14722. c := &PlaylistsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14723. c.urlParams_.Set("part", part)
  14724. return c
  14725. }
  14726. // ChannelId sets the optional parameter "channelId": This value
  14727. // indicates that the API should only return the specified channel's
  14728. // playlists.
  14729. func (c *PlaylistsListCall) ChannelId(channelId string) *PlaylistsListCall {
  14730. c.urlParams_.Set("channelId", channelId)
  14731. return c
  14732. }
  14733. // Hl sets the optional parameter "hl": The hl parameter should be used
  14734. // for filter out the properties that are not in the given language.
  14735. // Used for the snippet part.
  14736. func (c *PlaylistsListCall) Hl(hl string) *PlaylistsListCall {
  14737. c.urlParams_.Set("hl", hl)
  14738. return c
  14739. }
  14740. // Id sets the optional parameter "id": The id parameter specifies a
  14741. // comma-separated list of the YouTube playlist ID(s) for the
  14742. // resource(s) that are being retrieved. In a playlist resource, the id
  14743. // property specifies the playlist's YouTube playlist ID.
  14744. func (c *PlaylistsListCall) Id(id string) *PlaylistsListCall {
  14745. c.urlParams_.Set("id", id)
  14746. return c
  14747. }
  14748. // MaxResults sets the optional parameter "maxResults": The maxResults
  14749. // parameter specifies the maximum number of items that should be
  14750. // returned in the result set.
  14751. func (c *PlaylistsListCall) MaxResults(maxResults int64) *PlaylistsListCall {
  14752. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14753. return c
  14754. }
  14755. // Mine sets the optional parameter "mine": Set this parameter's value
  14756. // to true to instruct the API to only return playlists owned by the
  14757. // authenticated user.
  14758. func (c *PlaylistsListCall) Mine(mine bool) *PlaylistsListCall {
  14759. c.urlParams_.Set("mine", fmt.Sprint(mine))
  14760. return c
  14761. }
  14762. // OnBehalfOfContentOwner sets the optional parameter
  14763. // "onBehalfOfContentOwner": Note: This parameter is intended
  14764. // exclusively for YouTube content partners.
  14765. //
  14766. // The onBehalfOfContentOwner parameter indicates that the request's
  14767. // authorization credentials identify a YouTube CMS user who is acting
  14768. // on behalf of the content owner specified in the parameter value. This
  14769. // parameter is intended for YouTube content partners that own and
  14770. // manage many different YouTube channels. It allows content owners to
  14771. // authenticate once and get access to all their video and channel data,
  14772. // without having to provide authentication credentials for each
  14773. // individual channel. The CMS account that the user authenticates with
  14774. // must be linked to the specified YouTube content owner.
  14775. func (c *PlaylistsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsListCall {
  14776. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  14777. return c
  14778. }
  14779. // OnBehalfOfContentOwnerChannel sets the optional parameter
  14780. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  14781. // properly authorized request. Note: This parameter is intended
  14782. // exclusively for YouTube content partners.
  14783. //
  14784. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  14785. // channel ID of the channel to which a video is being added. This
  14786. // parameter is required when a request specifies a value for the
  14787. // onBehalfOfContentOwner parameter, and it can only be used in
  14788. // conjunction with that parameter. In addition, the request must be
  14789. // authorized using a CMS account that is linked to the content owner
  14790. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  14791. // channel that the onBehalfOfContentOwnerChannel parameter value
  14792. // specifies must be linked to the content owner that the
  14793. // onBehalfOfContentOwner parameter specifies.
  14794. //
  14795. // This parameter is intended for YouTube content partners that own and
  14796. // manage many different YouTube channels. It allows content owners to
  14797. // authenticate once and perform actions on behalf of the channel
  14798. // specified in the parameter value, without having to provide
  14799. // authentication credentials for each separate channel.
  14800. func (c *PlaylistsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistsListCall {
  14801. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  14802. return c
  14803. }
  14804. // PageToken sets the optional parameter "pageToken": The pageToken
  14805. // parameter identifies a specific page in the result set that should be
  14806. // returned. In an API response, the nextPageToken and prevPageToken
  14807. // properties identify other pages that could be retrieved.
  14808. func (c *PlaylistsListCall) PageToken(pageToken string) *PlaylistsListCall {
  14809. c.urlParams_.Set("pageToken", pageToken)
  14810. return c
  14811. }
  14812. // Fields allows partial responses to be retrieved. See
  14813. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14814. // for more information.
  14815. func (c *PlaylistsListCall) Fields(s ...googleapi.Field) *PlaylistsListCall {
  14816. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14817. return c
  14818. }
  14819. // IfNoneMatch sets the optional parameter which makes the operation
  14820. // fail if the object's ETag matches the given value. This is useful for
  14821. // getting updates only after the object has changed since the last
  14822. // request. Use googleapi.IsNotModified to check whether the response
  14823. // error from Do is the result of In-None-Match.
  14824. func (c *PlaylistsListCall) IfNoneMatch(entityTag string) *PlaylistsListCall {
  14825. c.ifNoneMatch_ = entityTag
  14826. return c
  14827. }
  14828. // Context sets the context to be used in this call's Do method. Any
  14829. // pending HTTP request will be aborted if the provided context is
  14830. // canceled.
  14831. func (c *PlaylistsListCall) Context(ctx context.Context) *PlaylistsListCall {
  14832. c.ctx_ = ctx
  14833. return c
  14834. }
  14835. func (c *PlaylistsListCall) doRequest(alt string) (*http.Response, error) {
  14836. var body io.Reader = nil
  14837. c.urlParams_.Set("alt", alt)
  14838. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  14839. urls += "?" + c.urlParams_.Encode()
  14840. req, _ := http.NewRequest("GET", urls, body)
  14841. googleapi.SetOpaque(req.URL)
  14842. req.Header.Set("User-Agent", c.s.userAgent())
  14843. if c.ifNoneMatch_ != "" {
  14844. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  14845. }
  14846. if c.ctx_ != nil {
  14847. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14848. }
  14849. return c.s.client.Do(req)
  14850. }
  14851. // Do executes the "youtube.playlists.list" call.
  14852. // Exactly one of *PlaylistListResponse or error will be non-nil. Any
  14853. // non-2xx status code is an error. Response headers are in either
  14854. // *PlaylistListResponse.ServerResponse.Header or (if a response was
  14855. // returned at all) in error.(*googleapi.Error).Header. Use
  14856. // googleapi.IsNotModified to check whether the returned error was
  14857. // because http.StatusNotModified was returned.
  14858. func (c *PlaylistsListCall) Do(opts ...googleapi.CallOption) (*PlaylistListResponse, error) {
  14859. gensupport.SetOptions(c.urlParams_, opts...)
  14860. res, err := c.doRequest("json")
  14861. if res != nil && res.StatusCode == http.StatusNotModified {
  14862. if res.Body != nil {
  14863. res.Body.Close()
  14864. }
  14865. return nil, &googleapi.Error{
  14866. Code: res.StatusCode,
  14867. Header: res.Header,
  14868. }
  14869. }
  14870. if err != nil {
  14871. return nil, err
  14872. }
  14873. defer googleapi.CloseBody(res)
  14874. if err := googleapi.CheckResponse(res); err != nil {
  14875. return nil, err
  14876. }
  14877. ret := &PlaylistListResponse{
  14878. ServerResponse: googleapi.ServerResponse{
  14879. Header: res.Header,
  14880. HTTPStatusCode: res.StatusCode,
  14881. },
  14882. }
  14883. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14884. return nil, err
  14885. }
  14886. return ret, nil
  14887. // {
  14888. // "description": "Returns a collection of playlists that match the API request parameters. For example, you can retrieve all playlists that the authenticated user owns, or you can retrieve one or more playlists by their unique IDs.",
  14889. // "httpMethod": "GET",
  14890. // "id": "youtube.playlists.list",
  14891. // "parameterOrder": [
  14892. // "part"
  14893. // ],
  14894. // "parameters": {
  14895. // "channelId": {
  14896. // "description": "This value indicates that the API should only return the specified channel's playlists.",
  14897. // "location": "query",
  14898. // "type": "string"
  14899. // },
  14900. // "hl": {
  14901. // "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the snippet part.",
  14902. // "location": "query",
  14903. // "type": "string"
  14904. // },
  14905. // "id": {
  14906. // "description": "The id parameter specifies a comma-separated list of the YouTube playlist ID(s) for the resource(s) that are being retrieved. In a playlist resource, the id property specifies the playlist's YouTube playlist ID.",
  14907. // "location": "query",
  14908. // "type": "string"
  14909. // },
  14910. // "maxResults": {
  14911. // "default": "5",
  14912. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  14913. // "format": "uint32",
  14914. // "location": "query",
  14915. // "maximum": "50",
  14916. // "minimum": "0",
  14917. // "type": "integer"
  14918. // },
  14919. // "mine": {
  14920. // "description": "Set this parameter's value to true to instruct the API to only return playlists owned by the authenticated user.",
  14921. // "location": "query",
  14922. // "type": "boolean"
  14923. // },
  14924. // "onBehalfOfContentOwner": {
  14925. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  14926. // "location": "query",
  14927. // "type": "string"
  14928. // },
  14929. // "onBehalfOfContentOwnerChannel": {
  14930. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  14931. // "location": "query",
  14932. // "type": "string"
  14933. // },
  14934. // "pageToken": {
  14935. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  14936. // "location": "query",
  14937. // "type": "string"
  14938. // },
  14939. // "part": {
  14940. // "description": "The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties.",
  14941. // "location": "query",
  14942. // "required": true,
  14943. // "type": "string"
  14944. // }
  14945. // },
  14946. // "path": "playlists",
  14947. // "response": {
  14948. // "$ref": "PlaylistListResponse"
  14949. // },
  14950. // "scopes": [
  14951. // "https://www.googleapis.com/auth/youtube",
  14952. // "https://www.googleapis.com/auth/youtube.force-ssl",
  14953. // "https://www.googleapis.com/auth/youtube.readonly",
  14954. // "https://www.googleapis.com/auth/youtubepartner"
  14955. // ]
  14956. // }
  14957. }
  14958. // Pages invokes f for each page of results.
  14959. // A non-nil error returned from f will halt the iteration.
  14960. // The provided context supersedes any context provided to the Context method.
  14961. func (c *PlaylistsListCall) Pages(ctx context.Context, f func(*PlaylistListResponse) error) error {
  14962. c.ctx_ = ctx
  14963. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14964. for {
  14965. x, err := c.Do()
  14966. if err != nil {
  14967. return err
  14968. }
  14969. if err := f(x); err != nil {
  14970. return err
  14971. }
  14972. if x.NextPageToken == "" {
  14973. return nil
  14974. }
  14975. c.PageToken(x.NextPageToken)
  14976. }
  14977. }
  14978. // method id "youtube.playlists.update":
  14979. type PlaylistsUpdateCall struct {
  14980. s *Service
  14981. playlist *Playlist
  14982. urlParams_ gensupport.URLParams
  14983. ctx_ context.Context
  14984. }
  14985. // Update: Modifies a playlist. For example, you could change a
  14986. // playlist's title, description, or privacy status.
  14987. func (r *PlaylistsService) Update(part string, playlist *Playlist) *PlaylistsUpdateCall {
  14988. c := &PlaylistsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14989. c.urlParams_.Set("part", part)
  14990. c.playlist = playlist
  14991. return c
  14992. }
  14993. // OnBehalfOfContentOwner sets the optional parameter
  14994. // "onBehalfOfContentOwner": Note: This parameter is intended
  14995. // exclusively for YouTube content partners.
  14996. //
  14997. // The onBehalfOfContentOwner parameter indicates that the request's
  14998. // authorization credentials identify a YouTube CMS user who is acting
  14999. // on behalf of the content owner specified in the parameter value. This
  15000. // parameter is intended for YouTube content partners that own and
  15001. // manage many different YouTube channels. It allows content owners to
  15002. // authenticate once and get access to all their video and channel data,
  15003. // without having to provide authentication credentials for each
  15004. // individual channel. The CMS account that the user authenticates with
  15005. // must be linked to the specified YouTube content owner.
  15006. func (c *PlaylistsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsUpdateCall {
  15007. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15008. return c
  15009. }
  15010. // Fields allows partial responses to be retrieved. See
  15011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15012. // for more information.
  15013. func (c *PlaylistsUpdateCall) Fields(s ...googleapi.Field) *PlaylistsUpdateCall {
  15014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15015. return c
  15016. }
  15017. // Context sets the context to be used in this call's Do method. Any
  15018. // pending HTTP request will be aborted if the provided context is
  15019. // canceled.
  15020. func (c *PlaylistsUpdateCall) Context(ctx context.Context) *PlaylistsUpdateCall {
  15021. c.ctx_ = ctx
  15022. return c
  15023. }
  15024. func (c *PlaylistsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15025. var body io.Reader = nil
  15026. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlist)
  15027. if err != nil {
  15028. return nil, err
  15029. }
  15030. ctype := "application/json"
  15031. c.urlParams_.Set("alt", alt)
  15032. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  15033. urls += "?" + c.urlParams_.Encode()
  15034. req, _ := http.NewRequest("PUT", urls, body)
  15035. googleapi.SetOpaque(req.URL)
  15036. req.Header.Set("Content-Type", ctype)
  15037. req.Header.Set("User-Agent", c.s.userAgent())
  15038. if c.ctx_ != nil {
  15039. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15040. }
  15041. return c.s.client.Do(req)
  15042. }
  15043. // Do executes the "youtube.playlists.update" call.
  15044. // Exactly one of *Playlist or error will be non-nil. Any non-2xx status
  15045. // code is an error. Response headers are in either
  15046. // *Playlist.ServerResponse.Header or (if a response was returned at
  15047. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15048. // to check whether the returned error was because
  15049. // http.StatusNotModified was returned.
  15050. func (c *PlaylistsUpdateCall) Do(opts ...googleapi.CallOption) (*Playlist, error) {
  15051. gensupport.SetOptions(c.urlParams_, opts...)
  15052. res, err := c.doRequest("json")
  15053. if res != nil && res.StatusCode == http.StatusNotModified {
  15054. if res.Body != nil {
  15055. res.Body.Close()
  15056. }
  15057. return nil, &googleapi.Error{
  15058. Code: res.StatusCode,
  15059. Header: res.Header,
  15060. }
  15061. }
  15062. if err != nil {
  15063. return nil, err
  15064. }
  15065. defer googleapi.CloseBody(res)
  15066. if err := googleapi.CheckResponse(res); err != nil {
  15067. return nil, err
  15068. }
  15069. ret := &Playlist{
  15070. ServerResponse: googleapi.ServerResponse{
  15071. Header: res.Header,
  15072. HTTPStatusCode: res.StatusCode,
  15073. },
  15074. }
  15075. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15076. return nil, err
  15077. }
  15078. return ret, nil
  15079. // {
  15080. // "description": "Modifies a playlist. For example, you could change a playlist's title, description, or privacy status.",
  15081. // "httpMethod": "PUT",
  15082. // "id": "youtube.playlists.update",
  15083. // "parameterOrder": [
  15084. // "part"
  15085. // ],
  15086. // "parameters": {
  15087. // "onBehalfOfContentOwner": {
  15088. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  15089. // "location": "query",
  15090. // "type": "string"
  15091. // },
  15092. // "part": {
  15093. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for mutable properties that are contained in any parts that the request body specifies. For example, a playlist's description is contained in the snippet part, which must be included in the request body. If the request does not specify a value for the snippet.description property, the playlist's existing description will be deleted.",
  15094. // "location": "query",
  15095. // "required": true,
  15096. // "type": "string"
  15097. // }
  15098. // },
  15099. // "path": "playlists",
  15100. // "request": {
  15101. // "$ref": "Playlist"
  15102. // },
  15103. // "response": {
  15104. // "$ref": "Playlist"
  15105. // },
  15106. // "scopes": [
  15107. // "https://www.googleapis.com/auth/youtube",
  15108. // "https://www.googleapis.com/auth/youtube.force-ssl",
  15109. // "https://www.googleapis.com/auth/youtubepartner"
  15110. // ]
  15111. // }
  15112. }
  15113. // method id "youtube.search.list":
  15114. type SearchListCall struct {
  15115. s *Service
  15116. urlParams_ gensupport.URLParams
  15117. ifNoneMatch_ string
  15118. ctx_ context.Context
  15119. }
  15120. // List: Returns a collection of search results that match the query
  15121. // parameters specified in the API request. By default, a search result
  15122. // set identifies matching video, channel, and playlist resources, but
  15123. // you can also configure queries to only retrieve a specific type of
  15124. // resource.
  15125. func (r *SearchService) List(part string) *SearchListCall {
  15126. c := &SearchListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15127. c.urlParams_.Set("part", part)
  15128. return c
  15129. }
  15130. // ChannelId sets the optional parameter "channelId": The channelId
  15131. // parameter indicates that the API response should only contain
  15132. // resources created by the channel
  15133. func (c *SearchListCall) ChannelId(channelId string) *SearchListCall {
  15134. c.urlParams_.Set("channelId", channelId)
  15135. return c
  15136. }
  15137. // ChannelType sets the optional parameter "channelType": The
  15138. // channelType parameter lets you restrict a search to a particular type
  15139. // of channel.
  15140. //
  15141. // Possible values:
  15142. // "any" - Return all channels.
  15143. // "show" - Only retrieve shows.
  15144. func (c *SearchListCall) ChannelType(channelType string) *SearchListCall {
  15145. c.urlParams_.Set("channelType", channelType)
  15146. return c
  15147. }
  15148. // EventType sets the optional parameter "eventType": The eventType
  15149. // parameter restricts a search to broadcast events. If you specify a
  15150. // value for this parameter, you must also set the type parameter's
  15151. // value to video.
  15152. //
  15153. // Possible values:
  15154. // "completed" - Only include completed broadcasts.
  15155. // "live" - Only include active broadcasts.
  15156. // "upcoming" - Only include upcoming broadcasts.
  15157. func (c *SearchListCall) EventType(eventType string) *SearchListCall {
  15158. c.urlParams_.Set("eventType", eventType)
  15159. return c
  15160. }
  15161. // ForContentOwner sets the optional parameter "forContentOwner": Note:
  15162. // This parameter is intended exclusively for YouTube content
  15163. // partners.
  15164. //
  15165. // The forContentOwner parameter restricts the search to only retrieve
  15166. // resources owned by the content owner specified by the
  15167. // onBehalfOfContentOwner parameter. The user must be authenticated
  15168. // using a CMS account linked to the specified content owner and
  15169. // onBehalfOfContentOwner must be provided.
  15170. func (c *SearchListCall) ForContentOwner(forContentOwner bool) *SearchListCall {
  15171. c.urlParams_.Set("forContentOwner", fmt.Sprint(forContentOwner))
  15172. return c
  15173. }
  15174. // ForDeveloper sets the optional parameter "forDeveloper": The
  15175. // forDeveloper parameter restricts the search to only retrieve videos
  15176. // uploaded via the developer's application or website. The API server
  15177. // uses the request's authorization credentials to identify the
  15178. // developer. Therefore, a developer can restrict results to videos
  15179. // uploaded through the developer's own app or website but not to videos
  15180. // uploaded through other apps or sites.
  15181. func (c *SearchListCall) ForDeveloper(forDeveloper bool) *SearchListCall {
  15182. c.urlParams_.Set("forDeveloper", fmt.Sprint(forDeveloper))
  15183. return c
  15184. }
  15185. // ForMine sets the optional parameter "forMine": The forMine parameter
  15186. // restricts the search to only retrieve videos owned by the
  15187. // authenticated user. If you set this parameter to true, then the type
  15188. // parameter's value must also be set to video.
  15189. func (c *SearchListCall) ForMine(forMine bool) *SearchListCall {
  15190. c.urlParams_.Set("forMine", fmt.Sprint(forMine))
  15191. return c
  15192. }
  15193. // Location sets the optional parameter "location": The location
  15194. // parameter, in conjunction with the locationRadius parameter, defines
  15195. // a circular geographic area and also restricts a search to videos that
  15196. // specify, in their metadata, a geographic location that falls within
  15197. // that area. The parameter value is a string that specifies
  15198. // latitude/longitude coordinates e.g. (37.42307,-122.08427).
  15199. //
  15200. //
  15201. // - The location parameter value identifies the point at the center of
  15202. // the area.
  15203. // - The locationRadius parameter specifies the maximum distance that
  15204. // the location associated with a video can be from that point for the
  15205. // video to still be included in the search results.The API returns an
  15206. // error if your request specifies a value for the location parameter
  15207. // but does not also specify a value for the locationRadius parameter.
  15208. func (c *SearchListCall) Location(location string) *SearchListCall {
  15209. c.urlParams_.Set("location", location)
  15210. return c
  15211. }
  15212. // LocationRadius sets the optional parameter "locationRadius": The
  15213. // locationRadius parameter, in conjunction with the location parameter,
  15214. // defines a circular geographic area.
  15215. //
  15216. // The parameter value must be a floating point number followed by a
  15217. // measurement unit. Valid measurement units are m, km, ft, and mi. For
  15218. // example, valid parameter values include 1500m, 5km, 10000ft, and
  15219. // 0.75mi. The API does not support locationRadius parameter values
  15220. // larger than 1000 kilometers.
  15221. //
  15222. // Note: See the definition of the location parameter for more
  15223. // information.
  15224. func (c *SearchListCall) LocationRadius(locationRadius string) *SearchListCall {
  15225. c.urlParams_.Set("locationRadius", locationRadius)
  15226. return c
  15227. }
  15228. // MaxResults sets the optional parameter "maxResults": The maxResults
  15229. // parameter specifies the maximum number of items that should be
  15230. // returned in the result set.
  15231. func (c *SearchListCall) MaxResults(maxResults int64) *SearchListCall {
  15232. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15233. return c
  15234. }
  15235. // OnBehalfOfContentOwner sets the optional parameter
  15236. // "onBehalfOfContentOwner": Note: This parameter is intended
  15237. // exclusively for YouTube content partners.
  15238. //
  15239. // The onBehalfOfContentOwner parameter indicates that the request's
  15240. // authorization credentials identify a YouTube CMS user who is acting
  15241. // on behalf of the content owner specified in the parameter value. This
  15242. // parameter is intended for YouTube content partners that own and
  15243. // manage many different YouTube channels. It allows content owners to
  15244. // authenticate once and get access to all their video and channel data,
  15245. // without having to provide authentication credentials for each
  15246. // individual channel. The CMS account that the user authenticates with
  15247. // must be linked to the specified YouTube content owner.
  15248. func (c *SearchListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *SearchListCall {
  15249. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15250. return c
  15251. }
  15252. // Order sets the optional parameter "order": The order parameter
  15253. // specifies the method that will be used to order resources in the API
  15254. // response.
  15255. //
  15256. // Possible values:
  15257. // "date" - Resources are sorted in reverse chronological order based
  15258. // on the date they were created.
  15259. // "rating" - Resources are sorted from highest to lowest rating.
  15260. // "relevance" - Resources are sorted based on their relevance to the
  15261. // search query. This is the default value for this parameter.
  15262. // "title" - Resources are sorted alphabetically by title.
  15263. // "videoCount" - Channels are sorted in descending order of their
  15264. // number of uploaded videos.
  15265. // "viewCount" - Resources are sorted from highest to lowest number of
  15266. // views.
  15267. func (c *SearchListCall) Order(order string) *SearchListCall {
  15268. c.urlParams_.Set("order", order)
  15269. return c
  15270. }
  15271. // PageToken sets the optional parameter "pageToken": The pageToken
  15272. // parameter identifies a specific page in the result set that should be
  15273. // returned. In an API response, the nextPageToken and prevPageToken
  15274. // properties identify other pages that could be retrieved.
  15275. func (c *SearchListCall) PageToken(pageToken string) *SearchListCall {
  15276. c.urlParams_.Set("pageToken", pageToken)
  15277. return c
  15278. }
  15279. // PublishedAfter sets the optional parameter "publishedAfter": The
  15280. // publishedAfter parameter indicates that the API response should only
  15281. // contain resources created after the specified time. The value is an
  15282. // RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).
  15283. func (c *SearchListCall) PublishedAfter(publishedAfter string) *SearchListCall {
  15284. c.urlParams_.Set("publishedAfter", publishedAfter)
  15285. return c
  15286. }
  15287. // PublishedBefore sets the optional parameter "publishedBefore": The
  15288. // publishedBefore parameter indicates that the API response should only
  15289. // contain resources created before the specified time. The value is an
  15290. // RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).
  15291. func (c *SearchListCall) PublishedBefore(publishedBefore string) *SearchListCall {
  15292. c.urlParams_.Set("publishedBefore", publishedBefore)
  15293. return c
  15294. }
  15295. // Q sets the optional parameter "q": The q parameter specifies the
  15296. // query term to search for.
  15297. //
  15298. // Your request can also use the Boolean NOT (-) and OR (|) operators to
  15299. // exclude videos or to find videos that are associated with one of
  15300. // several search terms. For example, to search for videos matching
  15301. // either "boating" or "sailing", set the q parameter value to
  15302. // boating|sailing. Similarly, to search for videos matching either
  15303. // "boating" or "sailing" but not "fishing", set the q parameter value
  15304. // to boating|sailing -fishing. Note that the pipe character must be
  15305. // URL-escaped when it is sent in your API request. The URL-escaped
  15306. // value for the pipe character is %7C.
  15307. func (c *SearchListCall) Q(q string) *SearchListCall {
  15308. c.urlParams_.Set("q", q)
  15309. return c
  15310. }
  15311. // RegionCode sets the optional parameter "regionCode": The regionCode
  15312. // parameter instructs the API to return search results for the
  15313. // specified country. The parameter value is an ISO 3166-1 alpha-2
  15314. // country code.
  15315. func (c *SearchListCall) RegionCode(regionCode string) *SearchListCall {
  15316. c.urlParams_.Set("regionCode", regionCode)
  15317. return c
  15318. }
  15319. // RelatedToVideoId sets the optional parameter "relatedToVideoId": The
  15320. // relatedToVideoId parameter retrieves a list of videos that are
  15321. // related to the video that the parameter value identifies. The
  15322. // parameter value must be set to a YouTube video ID and, if you are
  15323. // using this parameter, the type parameter must be set to video.
  15324. func (c *SearchListCall) RelatedToVideoId(relatedToVideoId string) *SearchListCall {
  15325. c.urlParams_.Set("relatedToVideoId", relatedToVideoId)
  15326. return c
  15327. }
  15328. // RelevanceLanguage sets the optional parameter "relevanceLanguage":
  15329. // The relevanceLanguage parameter instructs the API to return search
  15330. // results that are most relevant to the specified language. The
  15331. // parameter value is typically an ISO 639-1 two-letter language code.
  15332. // However, you should use the values zh-Hans for simplified Chinese and
  15333. // zh-Hant for traditional Chinese. Please note that results in other
  15334. // languages will still be returned if they are highly relevant to the
  15335. // search query term.
  15336. func (c *SearchListCall) RelevanceLanguage(relevanceLanguage string) *SearchListCall {
  15337. c.urlParams_.Set("relevanceLanguage", relevanceLanguage)
  15338. return c
  15339. }
  15340. // SafeSearch sets the optional parameter "safeSearch": The safeSearch
  15341. // parameter indicates whether the search results should include
  15342. // restricted content as well as standard content.
  15343. //
  15344. // Possible values:
  15345. // "moderate" - YouTube will filter some content from search results
  15346. // and, at the least, will filter content that is restricted in your
  15347. // locale. Based on their content, search results could be removed from
  15348. // search results or demoted in search results. This is the default
  15349. // parameter value.
  15350. // "none" - YouTube will not filter the search result set.
  15351. // "strict" - YouTube will try to exclude all restricted content from
  15352. // the search result set. Based on their content, search results could
  15353. // be removed from search results or demoted in search results.
  15354. func (c *SearchListCall) SafeSearch(safeSearch string) *SearchListCall {
  15355. c.urlParams_.Set("safeSearch", safeSearch)
  15356. return c
  15357. }
  15358. // TopicId sets the optional parameter "topicId": The topicId parameter
  15359. // indicates that the API response should only contain resources
  15360. // associated with the specified topic. The value identifies a Freebase
  15361. // topic ID.
  15362. func (c *SearchListCall) TopicId(topicId string) *SearchListCall {
  15363. c.urlParams_.Set("topicId", topicId)
  15364. return c
  15365. }
  15366. // Type sets the optional parameter "type": The type parameter restricts
  15367. // a search query to only retrieve a particular type of resource. The
  15368. // value is a comma-separated list of resource types.
  15369. func (c *SearchListCall) Type(type_ string) *SearchListCall {
  15370. c.urlParams_.Set("type", type_)
  15371. return c
  15372. }
  15373. // VideoCaption sets the optional parameter "videoCaption": The
  15374. // videoCaption parameter indicates whether the API should filter video
  15375. // search results based on whether they have captions. If you specify a
  15376. // value for this parameter, you must also set the type parameter's
  15377. // value to video.
  15378. //
  15379. // Possible values:
  15380. // "any" - Do not filter results based on caption availability.
  15381. // "closedCaption" - Only include videos that have captions.
  15382. // "none" - Only include videos that do not have captions.
  15383. func (c *SearchListCall) VideoCaption(videoCaption string) *SearchListCall {
  15384. c.urlParams_.Set("videoCaption", videoCaption)
  15385. return c
  15386. }
  15387. // VideoCategoryId sets the optional parameter "videoCategoryId": The
  15388. // videoCategoryId parameter filters video search results based on their
  15389. // category. If you specify a value for this parameter, you must also
  15390. // set the type parameter's value to video.
  15391. func (c *SearchListCall) VideoCategoryId(videoCategoryId string) *SearchListCall {
  15392. c.urlParams_.Set("videoCategoryId", videoCategoryId)
  15393. return c
  15394. }
  15395. // VideoDefinition sets the optional parameter "videoDefinition": The
  15396. // videoDefinition parameter lets you restrict a search to only include
  15397. // either high definition (HD) or standard definition (SD) videos. HD
  15398. // videos are available for playback in at least 720p, though higher
  15399. // resolutions, like 1080p, might also be available. If you specify a
  15400. // value for this parameter, you must also set the type parameter's
  15401. // value to video.
  15402. //
  15403. // Possible values:
  15404. // "any" - Return all videos, regardless of their resolution.
  15405. // "high" - Only retrieve HD videos.
  15406. // "standard" - Only retrieve videos in standard definition.
  15407. func (c *SearchListCall) VideoDefinition(videoDefinition string) *SearchListCall {
  15408. c.urlParams_.Set("videoDefinition", videoDefinition)
  15409. return c
  15410. }
  15411. // VideoDimension sets the optional parameter "videoDimension": The
  15412. // videoDimension parameter lets you restrict a search to only retrieve
  15413. // 2D or 3D videos. If you specify a value for this parameter, you must
  15414. // also set the type parameter's value to video.
  15415. //
  15416. // Possible values:
  15417. // "2d" - Restrict search results to exclude 3D videos.
  15418. // "3d" - Restrict search results to only include 3D videos.
  15419. // "any" - Include both 3D and non-3D videos in returned results. This
  15420. // is the default value.
  15421. func (c *SearchListCall) VideoDimension(videoDimension string) *SearchListCall {
  15422. c.urlParams_.Set("videoDimension", videoDimension)
  15423. return c
  15424. }
  15425. // VideoDuration sets the optional parameter "videoDuration": The
  15426. // videoDuration parameter filters video search results based on their
  15427. // duration. If you specify a value for this parameter, you must also
  15428. // set the type parameter's value to video.
  15429. //
  15430. // Possible values:
  15431. // "any" - Do not filter video search results based on their duration.
  15432. // This is the default value.
  15433. // "long" - Only include videos longer than 20 minutes.
  15434. // "medium" - Only include videos that are between four and 20 minutes
  15435. // long (inclusive).
  15436. // "short" - Only include videos that are less than four minutes long.
  15437. func (c *SearchListCall) VideoDuration(videoDuration string) *SearchListCall {
  15438. c.urlParams_.Set("videoDuration", videoDuration)
  15439. return c
  15440. }
  15441. // VideoEmbeddable sets the optional parameter "videoEmbeddable": The
  15442. // videoEmbeddable parameter lets you to restrict a search to only
  15443. // videos that can be embedded into a webpage. If you specify a value
  15444. // for this parameter, you must also set the type parameter's value to
  15445. // video.
  15446. //
  15447. // Possible values:
  15448. // "any" - Return all videos, embeddable or not.
  15449. // "true" - Only retrieve embeddable videos.
  15450. func (c *SearchListCall) VideoEmbeddable(videoEmbeddable string) *SearchListCall {
  15451. c.urlParams_.Set("videoEmbeddable", videoEmbeddable)
  15452. return c
  15453. }
  15454. // VideoLicense sets the optional parameter "videoLicense": The
  15455. // videoLicense parameter filters search results to only include videos
  15456. // with a particular license. YouTube lets video uploaders choose to
  15457. // attach either the Creative Commons license or the standard YouTube
  15458. // license to each of their videos. If you specify a value for this
  15459. // parameter, you must also set the type parameter's value to video.
  15460. //
  15461. // Possible values:
  15462. // "any" - Return all videos, regardless of which license they have,
  15463. // that match the query parameters.
  15464. // "creativeCommon" - Only return videos that have a Creative Commons
  15465. // license. Users can reuse videos with this license in other videos
  15466. // that they create. Learn more.
  15467. // "youtube" - Only return videos that have the standard YouTube
  15468. // license.
  15469. func (c *SearchListCall) VideoLicense(videoLicense string) *SearchListCall {
  15470. c.urlParams_.Set("videoLicense", videoLicense)
  15471. return c
  15472. }
  15473. // VideoSyndicated sets the optional parameter "videoSyndicated": The
  15474. // videoSyndicated parameter lets you to restrict a search to only
  15475. // videos that can be played outside youtube.com. If you specify a value
  15476. // for this parameter, you must also set the type parameter's value to
  15477. // video.
  15478. //
  15479. // Possible values:
  15480. // "any" - Return all videos, syndicated or not.
  15481. // "true" - Only retrieve syndicated videos.
  15482. func (c *SearchListCall) VideoSyndicated(videoSyndicated string) *SearchListCall {
  15483. c.urlParams_.Set("videoSyndicated", videoSyndicated)
  15484. return c
  15485. }
  15486. // VideoType sets the optional parameter "videoType": The videoType
  15487. // parameter lets you restrict a search to a particular type of videos.
  15488. // If you specify a value for this parameter, you must also set the type
  15489. // parameter's value to video.
  15490. //
  15491. // Possible values:
  15492. // "any" - Return all videos.
  15493. // "episode" - Only retrieve episodes of shows.
  15494. // "movie" - Only retrieve movies.
  15495. func (c *SearchListCall) VideoType(videoType string) *SearchListCall {
  15496. c.urlParams_.Set("videoType", videoType)
  15497. return c
  15498. }
  15499. // Fields allows partial responses to be retrieved. See
  15500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15501. // for more information.
  15502. func (c *SearchListCall) Fields(s ...googleapi.Field) *SearchListCall {
  15503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15504. return c
  15505. }
  15506. // IfNoneMatch sets the optional parameter which makes the operation
  15507. // fail if the object's ETag matches the given value. This is useful for
  15508. // getting updates only after the object has changed since the last
  15509. // request. Use googleapi.IsNotModified to check whether the response
  15510. // error from Do is the result of In-None-Match.
  15511. func (c *SearchListCall) IfNoneMatch(entityTag string) *SearchListCall {
  15512. c.ifNoneMatch_ = entityTag
  15513. return c
  15514. }
  15515. // Context sets the context to be used in this call's Do method. Any
  15516. // pending HTTP request will be aborted if the provided context is
  15517. // canceled.
  15518. func (c *SearchListCall) Context(ctx context.Context) *SearchListCall {
  15519. c.ctx_ = ctx
  15520. return c
  15521. }
  15522. func (c *SearchListCall) doRequest(alt string) (*http.Response, error) {
  15523. var body io.Reader = nil
  15524. c.urlParams_.Set("alt", alt)
  15525. urls := googleapi.ResolveRelative(c.s.BasePath, "search")
  15526. urls += "?" + c.urlParams_.Encode()
  15527. req, _ := http.NewRequest("GET", urls, body)
  15528. googleapi.SetOpaque(req.URL)
  15529. req.Header.Set("User-Agent", c.s.userAgent())
  15530. if c.ifNoneMatch_ != "" {
  15531. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15532. }
  15533. if c.ctx_ != nil {
  15534. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15535. }
  15536. return c.s.client.Do(req)
  15537. }
  15538. // Do executes the "youtube.search.list" call.
  15539. // Exactly one of *SearchListResponse or error will be non-nil. Any
  15540. // non-2xx status code is an error. Response headers are in either
  15541. // *SearchListResponse.ServerResponse.Header or (if a response was
  15542. // returned at all) in error.(*googleapi.Error).Header. Use
  15543. // googleapi.IsNotModified to check whether the returned error was
  15544. // because http.StatusNotModified was returned.
  15545. func (c *SearchListCall) Do(opts ...googleapi.CallOption) (*SearchListResponse, error) {
  15546. gensupport.SetOptions(c.urlParams_, opts...)
  15547. res, err := c.doRequest("json")
  15548. if res != nil && res.StatusCode == http.StatusNotModified {
  15549. if res.Body != nil {
  15550. res.Body.Close()
  15551. }
  15552. return nil, &googleapi.Error{
  15553. Code: res.StatusCode,
  15554. Header: res.Header,
  15555. }
  15556. }
  15557. if err != nil {
  15558. return nil, err
  15559. }
  15560. defer googleapi.CloseBody(res)
  15561. if err := googleapi.CheckResponse(res); err != nil {
  15562. return nil, err
  15563. }
  15564. ret := &SearchListResponse{
  15565. ServerResponse: googleapi.ServerResponse{
  15566. Header: res.Header,
  15567. HTTPStatusCode: res.StatusCode,
  15568. },
  15569. }
  15570. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  15571. return nil, err
  15572. }
  15573. return ret, nil
  15574. // {
  15575. // "description": "Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource.",
  15576. // "httpMethod": "GET",
  15577. // "id": "youtube.search.list",
  15578. // "parameterOrder": [
  15579. // "part"
  15580. // ],
  15581. // "parameters": {
  15582. // "channelId": {
  15583. // "description": "The channelId parameter indicates that the API response should only contain resources created by the channel",
  15584. // "location": "query",
  15585. // "type": "string"
  15586. // },
  15587. // "channelType": {
  15588. // "description": "The channelType parameter lets you restrict a search to a particular type of channel.",
  15589. // "enum": [
  15590. // "any",
  15591. // "show"
  15592. // ],
  15593. // "enumDescriptions": [
  15594. // "Return all channels.",
  15595. // "Only retrieve shows."
  15596. // ],
  15597. // "location": "query",
  15598. // "type": "string"
  15599. // },
  15600. // "eventType": {
  15601. // "description": "The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15602. // "enum": [
  15603. // "completed",
  15604. // "live",
  15605. // "upcoming"
  15606. // ],
  15607. // "enumDescriptions": [
  15608. // "Only include completed broadcasts.",
  15609. // "Only include active broadcasts.",
  15610. // "Only include upcoming broadcasts."
  15611. // ],
  15612. // "location": "query",
  15613. // "type": "string"
  15614. // },
  15615. // "forContentOwner": {
  15616. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe forContentOwner parameter restricts the search to only retrieve resources owned by the content owner specified by the onBehalfOfContentOwner parameter. The user must be authenticated using a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.",
  15617. // "location": "query",
  15618. // "type": "boolean"
  15619. // },
  15620. // "forDeveloper": {
  15621. // "description": "The forDeveloper parameter restricts the search to only retrieve videos uploaded via the developer's application or website. The API server uses the request's authorization credentials to identify the developer. Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites.",
  15622. // "location": "query",
  15623. // "type": "boolean"
  15624. // },
  15625. // "forMine": {
  15626. // "description": "The forMine parameter restricts the search to only retrieve videos owned by the authenticated user. If you set this parameter to true, then the type parameter's value must also be set to video.",
  15627. // "location": "query",
  15628. // "type": "boolean"
  15629. // },
  15630. // "location": {
  15631. // "description": "The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).\n\n\n- The location parameter value identifies the point at the center of the area.\n- The locationRadius parameter specifies the maximum distance that the location associated with a video can be from that point for the video to still be included in the search results.The API returns an error if your request specifies a value for the location parameter but does not also specify a value for the locationRadius parameter.",
  15632. // "location": "query",
  15633. // "type": "string"
  15634. // },
  15635. // "locationRadius": {
  15636. // "description": "The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area.\n\nThe parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers.\n\nNote: See the definition of the location parameter for more information.",
  15637. // "location": "query",
  15638. // "type": "string"
  15639. // },
  15640. // "maxResults": {
  15641. // "default": "5",
  15642. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  15643. // "format": "uint32",
  15644. // "location": "query",
  15645. // "maximum": "50",
  15646. // "minimum": "0",
  15647. // "type": "integer"
  15648. // },
  15649. // "onBehalfOfContentOwner": {
  15650. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  15651. // "location": "query",
  15652. // "type": "string"
  15653. // },
  15654. // "order": {
  15655. // "default": "SEARCH_SORT_RELEVANCE",
  15656. // "description": "The order parameter specifies the method that will be used to order resources in the API response.",
  15657. // "enum": [
  15658. // "date",
  15659. // "rating",
  15660. // "relevance",
  15661. // "title",
  15662. // "videoCount",
  15663. // "viewCount"
  15664. // ],
  15665. // "enumDescriptions": [
  15666. // "Resources are sorted in reverse chronological order based on the date they were created.",
  15667. // "Resources are sorted from highest to lowest rating.",
  15668. // "Resources are sorted based on their relevance to the search query. This is the default value for this parameter.",
  15669. // "Resources are sorted alphabetically by title.",
  15670. // "Channels are sorted in descending order of their number of uploaded videos.",
  15671. // "Resources are sorted from highest to lowest number of views."
  15672. // ],
  15673. // "location": "query",
  15674. // "type": "string"
  15675. // },
  15676. // "pageToken": {
  15677. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  15678. // "location": "query",
  15679. // "type": "string"
  15680. // },
  15681. // "part": {
  15682. // "description": "The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet.",
  15683. // "location": "query",
  15684. // "required": true,
  15685. // "type": "string"
  15686. // },
  15687. // "publishedAfter": {
  15688. // "description": "The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).",
  15689. // "format": "date-time",
  15690. // "location": "query",
  15691. // "type": "string"
  15692. // },
  15693. // "publishedBefore": {
  15694. // "description": "The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).",
  15695. // "format": "date-time",
  15696. // "location": "query",
  15697. // "type": "string"
  15698. // },
  15699. // "q": {
  15700. // "description": "The q parameter specifies the query term to search for.\n\nYour request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either \"boating\" or \"sailing\", set the q parameter value to boating|sailing. Similarly, to search for videos matching either \"boating\" or \"sailing\" but not \"fishing\", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C.",
  15701. // "location": "query",
  15702. // "type": "string"
  15703. // },
  15704. // "regionCode": {
  15705. // "description": "The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.",
  15706. // "location": "query",
  15707. // "type": "string"
  15708. // },
  15709. // "relatedToVideoId": {
  15710. // "description": "The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video.",
  15711. // "location": "query",
  15712. // "type": "string"
  15713. // },
  15714. // "relevanceLanguage": {
  15715. // "description": "The relevanceLanguage parameter instructs the API to return search results that are most relevant to the specified language. The parameter value is typically an ISO 639-1 two-letter language code. However, you should use the values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese. Please note that results in other languages will still be returned if they are highly relevant to the search query term.",
  15716. // "location": "query",
  15717. // "type": "string"
  15718. // },
  15719. // "safeSearch": {
  15720. // "description": "The safeSearch parameter indicates whether the search results should include restricted content as well as standard content.",
  15721. // "enum": [
  15722. // "moderate",
  15723. // "none",
  15724. // "strict"
  15725. // ],
  15726. // "enumDescriptions": [
  15727. // "YouTube will filter some content from search results and, at the least, will filter content that is restricted in your locale. Based on their content, search results could be removed from search results or demoted in search results. This is the default parameter value.",
  15728. // "YouTube will not filter the search result set.",
  15729. // "YouTube will try to exclude all restricted content from the search result set. Based on their content, search results could be removed from search results or demoted in search results."
  15730. // ],
  15731. // "location": "query",
  15732. // "type": "string"
  15733. // },
  15734. // "topicId": {
  15735. // "description": "The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID.",
  15736. // "location": "query",
  15737. // "type": "string"
  15738. // },
  15739. // "type": {
  15740. // "default": "video,channel,playlist",
  15741. // "description": "The type parameter restricts a search query to only retrieve a particular type of resource. The value is a comma-separated list of resource types.",
  15742. // "location": "query",
  15743. // "type": "string"
  15744. // },
  15745. // "videoCaption": {
  15746. // "description": "The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15747. // "enum": [
  15748. // "any",
  15749. // "closedCaption",
  15750. // "none"
  15751. // ],
  15752. // "enumDescriptions": [
  15753. // "Do not filter results based on caption availability.",
  15754. // "Only include videos that have captions.",
  15755. // "Only include videos that do not have captions."
  15756. // ],
  15757. // "location": "query",
  15758. // "type": "string"
  15759. // },
  15760. // "videoCategoryId": {
  15761. // "description": "The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15762. // "location": "query",
  15763. // "type": "string"
  15764. // },
  15765. // "videoDefinition": {
  15766. // "description": "The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15767. // "enum": [
  15768. // "any",
  15769. // "high",
  15770. // "standard"
  15771. // ],
  15772. // "enumDescriptions": [
  15773. // "Return all videos, regardless of their resolution.",
  15774. // "Only retrieve HD videos.",
  15775. // "Only retrieve videos in standard definition."
  15776. // ],
  15777. // "location": "query",
  15778. // "type": "string"
  15779. // },
  15780. // "videoDimension": {
  15781. // "description": "The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15782. // "enum": [
  15783. // "2d",
  15784. // "3d",
  15785. // "any"
  15786. // ],
  15787. // "enumDescriptions": [
  15788. // "Restrict search results to exclude 3D videos.",
  15789. // "Restrict search results to only include 3D videos.",
  15790. // "Include both 3D and non-3D videos in returned results. This is the default value."
  15791. // ],
  15792. // "location": "query",
  15793. // "type": "string"
  15794. // },
  15795. // "videoDuration": {
  15796. // "description": "The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15797. // "enum": [
  15798. // "any",
  15799. // "long",
  15800. // "medium",
  15801. // "short"
  15802. // ],
  15803. // "enumDescriptions": [
  15804. // "Do not filter video search results based on their duration. This is the default value.",
  15805. // "Only include videos longer than 20 minutes.",
  15806. // "Only include videos that are between four and 20 minutes long (inclusive).",
  15807. // "Only include videos that are less than four minutes long."
  15808. // ],
  15809. // "location": "query",
  15810. // "type": "string"
  15811. // },
  15812. // "videoEmbeddable": {
  15813. // "description": "The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15814. // "enum": [
  15815. // "any",
  15816. // "true"
  15817. // ],
  15818. // "enumDescriptions": [
  15819. // "Return all videos, embeddable or not.",
  15820. // "Only retrieve embeddable videos."
  15821. // ],
  15822. // "location": "query",
  15823. // "type": "string"
  15824. // },
  15825. // "videoLicense": {
  15826. // "description": "The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15827. // "enum": [
  15828. // "any",
  15829. // "creativeCommon",
  15830. // "youtube"
  15831. // ],
  15832. // "enumDescriptions": [
  15833. // "Return all videos, regardless of which license they have, that match the query parameters.",
  15834. // "Only return videos that have a Creative Commons license. Users can reuse videos with this license in other videos that they create. Learn more.",
  15835. // "Only return videos that have the standard YouTube license."
  15836. // ],
  15837. // "location": "query",
  15838. // "type": "string"
  15839. // },
  15840. // "videoSyndicated": {
  15841. // "description": "The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15842. // "enum": [
  15843. // "any",
  15844. // "true"
  15845. // ],
  15846. // "enumDescriptions": [
  15847. // "Return all videos, syndicated or not.",
  15848. // "Only retrieve syndicated videos."
  15849. // ],
  15850. // "location": "query",
  15851. // "type": "string"
  15852. // },
  15853. // "videoType": {
  15854. // "description": "The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  15855. // "enum": [
  15856. // "any",
  15857. // "episode",
  15858. // "movie"
  15859. // ],
  15860. // "enumDescriptions": [
  15861. // "Return all videos.",
  15862. // "Only retrieve episodes of shows.",
  15863. // "Only retrieve movies."
  15864. // ],
  15865. // "location": "query",
  15866. // "type": "string"
  15867. // }
  15868. // },
  15869. // "path": "search",
  15870. // "response": {
  15871. // "$ref": "SearchListResponse"
  15872. // },
  15873. // "scopes": [
  15874. // "https://www.googleapis.com/auth/youtube",
  15875. // "https://www.googleapis.com/auth/youtube.force-ssl",
  15876. // "https://www.googleapis.com/auth/youtube.readonly",
  15877. // "https://www.googleapis.com/auth/youtubepartner"
  15878. // ]
  15879. // }
  15880. }
  15881. // Pages invokes f for each page of results.
  15882. // A non-nil error returned from f will halt the iteration.
  15883. // The provided context supersedes any context provided to the Context method.
  15884. func (c *SearchListCall) Pages(ctx context.Context, f func(*SearchListResponse) error) error {
  15885. c.ctx_ = ctx
  15886. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15887. for {
  15888. x, err := c.Do()
  15889. if err != nil {
  15890. return err
  15891. }
  15892. if err := f(x); err != nil {
  15893. return err
  15894. }
  15895. if x.NextPageToken == "" {
  15896. return nil
  15897. }
  15898. c.PageToken(x.NextPageToken)
  15899. }
  15900. }
  15901. // method id "youtube.sponsors.list":
  15902. type SponsorsListCall struct {
  15903. s *Service
  15904. urlParams_ gensupport.URLParams
  15905. ifNoneMatch_ string
  15906. ctx_ context.Context
  15907. }
  15908. // List: Lists sponsors for a channel.
  15909. func (r *SponsorsService) List(part string) *SponsorsListCall {
  15910. c := &SponsorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15911. c.urlParams_.Set("part", part)
  15912. return c
  15913. }
  15914. // Filter sets the optional parameter "filter": The filter parameter
  15915. // specifies which channel sponsors to return.
  15916. //
  15917. // Possible values:
  15918. // "all" - Return all sponsors, from newest to oldest.
  15919. // "newest" - Return the most recent sponsors, from newest to oldest.
  15920. func (c *SponsorsListCall) Filter(filter string) *SponsorsListCall {
  15921. c.urlParams_.Set("filter", filter)
  15922. return c
  15923. }
  15924. // MaxResults sets the optional parameter "maxResults": The maxResults
  15925. // parameter specifies the maximum number of items that should be
  15926. // returned in the result set.
  15927. func (c *SponsorsListCall) MaxResults(maxResults int64) *SponsorsListCall {
  15928. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15929. return c
  15930. }
  15931. // PageToken sets the optional parameter "pageToken": The pageToken
  15932. // parameter identifies a specific page in the result set that should be
  15933. // returned. In an API response, the nextPageToken and prevPageToken
  15934. // properties identify other pages that could be retrieved.
  15935. func (c *SponsorsListCall) PageToken(pageToken string) *SponsorsListCall {
  15936. c.urlParams_.Set("pageToken", pageToken)
  15937. return c
  15938. }
  15939. // Fields allows partial responses to be retrieved. See
  15940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15941. // for more information.
  15942. func (c *SponsorsListCall) Fields(s ...googleapi.Field) *SponsorsListCall {
  15943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15944. return c
  15945. }
  15946. // IfNoneMatch sets the optional parameter which makes the operation
  15947. // fail if the object's ETag matches the given value. This is useful for
  15948. // getting updates only after the object has changed since the last
  15949. // request. Use googleapi.IsNotModified to check whether the response
  15950. // error from Do is the result of In-None-Match.
  15951. func (c *SponsorsListCall) IfNoneMatch(entityTag string) *SponsorsListCall {
  15952. c.ifNoneMatch_ = entityTag
  15953. return c
  15954. }
  15955. // Context sets the context to be used in this call's Do method. Any
  15956. // pending HTTP request will be aborted if the provided context is
  15957. // canceled.
  15958. func (c *SponsorsListCall) Context(ctx context.Context) *SponsorsListCall {
  15959. c.ctx_ = ctx
  15960. return c
  15961. }
  15962. func (c *SponsorsListCall) doRequest(alt string) (*http.Response, error) {
  15963. var body io.Reader = nil
  15964. c.urlParams_.Set("alt", alt)
  15965. urls := googleapi.ResolveRelative(c.s.BasePath, "sponsors")
  15966. urls += "?" + c.urlParams_.Encode()
  15967. req, _ := http.NewRequest("GET", urls, body)
  15968. googleapi.SetOpaque(req.URL)
  15969. req.Header.Set("User-Agent", c.s.userAgent())
  15970. if c.ifNoneMatch_ != "" {
  15971. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  15972. }
  15973. if c.ctx_ != nil {
  15974. return ctxhttp.Do(c.ctx_, c.s.client, req)
  15975. }
  15976. return c.s.client.Do(req)
  15977. }
  15978. // Do executes the "youtube.sponsors.list" call.
  15979. // Exactly one of *SponsorListResponse or error will be non-nil. Any
  15980. // non-2xx status code is an error. Response headers are in either
  15981. // *SponsorListResponse.ServerResponse.Header or (if a response was
  15982. // returned at all) in error.(*googleapi.Error).Header. Use
  15983. // googleapi.IsNotModified to check whether the returned error was
  15984. // because http.StatusNotModified was returned.
  15985. func (c *SponsorsListCall) Do(opts ...googleapi.CallOption) (*SponsorListResponse, error) {
  15986. gensupport.SetOptions(c.urlParams_, opts...)
  15987. res, err := c.doRequest("json")
  15988. if res != nil && res.StatusCode == http.StatusNotModified {
  15989. if res.Body != nil {
  15990. res.Body.Close()
  15991. }
  15992. return nil, &googleapi.Error{
  15993. Code: res.StatusCode,
  15994. Header: res.Header,
  15995. }
  15996. }
  15997. if err != nil {
  15998. return nil, err
  15999. }
  16000. defer googleapi.CloseBody(res)
  16001. if err := googleapi.CheckResponse(res); err != nil {
  16002. return nil, err
  16003. }
  16004. ret := &SponsorListResponse{
  16005. ServerResponse: googleapi.ServerResponse{
  16006. Header: res.Header,
  16007. HTTPStatusCode: res.StatusCode,
  16008. },
  16009. }
  16010. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16011. return nil, err
  16012. }
  16013. return ret, nil
  16014. // {
  16015. // "description": "Lists sponsors for a channel.",
  16016. // "httpMethod": "GET",
  16017. // "id": "youtube.sponsors.list",
  16018. // "parameterOrder": [
  16019. // "part"
  16020. // ],
  16021. // "parameters": {
  16022. // "filter": {
  16023. // "default": "POLL_NEWEST",
  16024. // "description": "The filter parameter specifies which channel sponsors to return.",
  16025. // "enum": [
  16026. // "all",
  16027. // "newest"
  16028. // ],
  16029. // "enumDescriptions": [
  16030. // "Return all sponsors, from newest to oldest.",
  16031. // "Return the most recent sponsors, from newest to oldest."
  16032. // ],
  16033. // "location": "query",
  16034. // "type": "string"
  16035. // },
  16036. // "maxResults": {
  16037. // "default": "5",
  16038. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  16039. // "format": "uint32",
  16040. // "location": "query",
  16041. // "maximum": "50",
  16042. // "minimum": "0",
  16043. // "type": "integer"
  16044. // },
  16045. // "pageToken": {
  16046. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  16047. // "location": "query",
  16048. // "type": "string"
  16049. // },
  16050. // "part": {
  16051. // "description": "The part parameter specifies the sponsor resource parts that the API response will include. Supported values are id and snippet.",
  16052. // "location": "query",
  16053. // "required": true,
  16054. // "type": "string"
  16055. // }
  16056. // },
  16057. // "path": "sponsors",
  16058. // "response": {
  16059. // "$ref": "SponsorListResponse"
  16060. // },
  16061. // "scopes": [
  16062. // "https://www.googleapis.com/auth/youtube",
  16063. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16064. // "https://www.googleapis.com/auth/youtube.readonly"
  16065. // ]
  16066. // }
  16067. }
  16068. // Pages invokes f for each page of results.
  16069. // A non-nil error returned from f will halt the iteration.
  16070. // The provided context supersedes any context provided to the Context method.
  16071. func (c *SponsorsListCall) Pages(ctx context.Context, f func(*SponsorListResponse) error) error {
  16072. c.ctx_ = ctx
  16073. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16074. for {
  16075. x, err := c.Do()
  16076. if err != nil {
  16077. return err
  16078. }
  16079. if err := f(x); err != nil {
  16080. return err
  16081. }
  16082. if x.NextPageToken == "" {
  16083. return nil
  16084. }
  16085. c.PageToken(x.NextPageToken)
  16086. }
  16087. }
  16088. // method id "youtube.subscriptions.delete":
  16089. type SubscriptionsDeleteCall struct {
  16090. s *Service
  16091. urlParams_ gensupport.URLParams
  16092. ctx_ context.Context
  16093. }
  16094. // Delete: Deletes a subscription.
  16095. func (r *SubscriptionsService) Delete(id string) *SubscriptionsDeleteCall {
  16096. c := &SubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16097. c.urlParams_.Set("id", id)
  16098. return c
  16099. }
  16100. // Fields allows partial responses to be retrieved. See
  16101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16102. // for more information.
  16103. func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall {
  16104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16105. return c
  16106. }
  16107. // Context sets the context to be used in this call's Do method. Any
  16108. // pending HTTP request will be aborted if the provided context is
  16109. // canceled.
  16110. func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall {
  16111. c.ctx_ = ctx
  16112. return c
  16113. }
  16114. func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  16115. var body io.Reader = nil
  16116. c.urlParams_.Set("alt", alt)
  16117. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  16118. urls += "?" + c.urlParams_.Encode()
  16119. req, _ := http.NewRequest("DELETE", urls, body)
  16120. googleapi.SetOpaque(req.URL)
  16121. req.Header.Set("User-Agent", c.s.userAgent())
  16122. if c.ctx_ != nil {
  16123. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16124. }
  16125. return c.s.client.Do(req)
  16126. }
  16127. // Do executes the "youtube.subscriptions.delete" call.
  16128. func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  16129. gensupport.SetOptions(c.urlParams_, opts...)
  16130. res, err := c.doRequest("json")
  16131. if err != nil {
  16132. return err
  16133. }
  16134. defer googleapi.CloseBody(res)
  16135. if err := googleapi.CheckResponse(res); err != nil {
  16136. return err
  16137. }
  16138. return nil
  16139. // {
  16140. // "description": "Deletes a subscription.",
  16141. // "httpMethod": "DELETE",
  16142. // "id": "youtube.subscriptions.delete",
  16143. // "parameterOrder": [
  16144. // "id"
  16145. // ],
  16146. // "parameters": {
  16147. // "id": {
  16148. // "description": "The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID.",
  16149. // "location": "query",
  16150. // "required": true,
  16151. // "type": "string"
  16152. // }
  16153. // },
  16154. // "path": "subscriptions",
  16155. // "scopes": [
  16156. // "https://www.googleapis.com/auth/youtube",
  16157. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16158. // "https://www.googleapis.com/auth/youtubepartner"
  16159. // ]
  16160. // }
  16161. }
  16162. // method id "youtube.subscriptions.insert":
  16163. type SubscriptionsInsertCall struct {
  16164. s *Service
  16165. subscription *Subscription
  16166. urlParams_ gensupport.URLParams
  16167. ctx_ context.Context
  16168. }
  16169. // Insert: Adds a subscription for the authenticated user's channel.
  16170. func (r *SubscriptionsService) Insert(part string, subscription *Subscription) *SubscriptionsInsertCall {
  16171. c := &SubscriptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16172. c.urlParams_.Set("part", part)
  16173. c.subscription = subscription
  16174. return c
  16175. }
  16176. // Fields allows partial responses to be retrieved. See
  16177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16178. // for more information.
  16179. func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall {
  16180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16181. return c
  16182. }
  16183. // Context sets the context to be used in this call's Do method. Any
  16184. // pending HTTP request will be aborted if the provided context is
  16185. // canceled.
  16186. func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall {
  16187. c.ctx_ = ctx
  16188. return c
  16189. }
  16190. func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, error) {
  16191. var body io.Reader = nil
  16192. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
  16193. if err != nil {
  16194. return nil, err
  16195. }
  16196. ctype := "application/json"
  16197. c.urlParams_.Set("alt", alt)
  16198. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  16199. urls += "?" + c.urlParams_.Encode()
  16200. req, _ := http.NewRequest("POST", urls, body)
  16201. googleapi.SetOpaque(req.URL)
  16202. req.Header.Set("Content-Type", ctype)
  16203. req.Header.Set("User-Agent", c.s.userAgent())
  16204. if c.ctx_ != nil {
  16205. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16206. }
  16207. return c.s.client.Do(req)
  16208. }
  16209. // Do executes the "youtube.subscriptions.insert" call.
  16210. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  16211. // status code is an error. Response headers are in either
  16212. // *Subscription.ServerResponse.Header or (if a response was returned at
  16213. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16214. // to check whether the returned error was because
  16215. // http.StatusNotModified was returned.
  16216. func (c *SubscriptionsInsertCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  16217. gensupport.SetOptions(c.urlParams_, opts...)
  16218. res, err := c.doRequest("json")
  16219. if res != nil && res.StatusCode == http.StatusNotModified {
  16220. if res.Body != nil {
  16221. res.Body.Close()
  16222. }
  16223. return nil, &googleapi.Error{
  16224. Code: res.StatusCode,
  16225. Header: res.Header,
  16226. }
  16227. }
  16228. if err != nil {
  16229. return nil, err
  16230. }
  16231. defer googleapi.CloseBody(res)
  16232. if err := googleapi.CheckResponse(res); err != nil {
  16233. return nil, err
  16234. }
  16235. ret := &Subscription{
  16236. ServerResponse: googleapi.ServerResponse{
  16237. Header: res.Header,
  16238. HTTPStatusCode: res.StatusCode,
  16239. },
  16240. }
  16241. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16242. return nil, err
  16243. }
  16244. return ret, nil
  16245. // {
  16246. // "description": "Adds a subscription for the authenticated user's channel.",
  16247. // "httpMethod": "POST",
  16248. // "id": "youtube.subscriptions.insert",
  16249. // "parameterOrder": [
  16250. // "part"
  16251. // ],
  16252. // "parameters": {
  16253. // "part": {
  16254. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.",
  16255. // "location": "query",
  16256. // "required": true,
  16257. // "type": "string"
  16258. // }
  16259. // },
  16260. // "path": "subscriptions",
  16261. // "request": {
  16262. // "$ref": "Subscription"
  16263. // },
  16264. // "response": {
  16265. // "$ref": "Subscription"
  16266. // },
  16267. // "scopes": [
  16268. // "https://www.googleapis.com/auth/youtube",
  16269. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16270. // "https://www.googleapis.com/auth/youtubepartner"
  16271. // ]
  16272. // }
  16273. }
  16274. // method id "youtube.subscriptions.list":
  16275. type SubscriptionsListCall struct {
  16276. s *Service
  16277. urlParams_ gensupport.URLParams
  16278. ifNoneMatch_ string
  16279. ctx_ context.Context
  16280. }
  16281. // List: Returns subscription resources that match the API request
  16282. // criteria.
  16283. func (r *SubscriptionsService) List(part string) *SubscriptionsListCall {
  16284. c := &SubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16285. c.urlParams_.Set("part", part)
  16286. return c
  16287. }
  16288. // ChannelId sets the optional parameter "channelId": The channelId
  16289. // parameter specifies a YouTube channel ID. The API will only return
  16290. // that channel's subscriptions.
  16291. func (c *SubscriptionsListCall) ChannelId(channelId string) *SubscriptionsListCall {
  16292. c.urlParams_.Set("channelId", channelId)
  16293. return c
  16294. }
  16295. // ForChannelId sets the optional parameter "forChannelId": The
  16296. // forChannelId parameter specifies a comma-separated list of channel
  16297. // IDs. The API response will then only contain subscriptions matching
  16298. // those channels.
  16299. func (c *SubscriptionsListCall) ForChannelId(forChannelId string) *SubscriptionsListCall {
  16300. c.urlParams_.Set("forChannelId", forChannelId)
  16301. return c
  16302. }
  16303. // Id sets the optional parameter "id": The id parameter specifies a
  16304. // comma-separated list of the YouTube subscription ID(s) for the
  16305. // resource(s) that are being retrieved. In a subscription resource, the
  16306. // id property specifies the YouTube subscription ID.
  16307. func (c *SubscriptionsListCall) Id(id string) *SubscriptionsListCall {
  16308. c.urlParams_.Set("id", id)
  16309. return c
  16310. }
  16311. // MaxResults sets the optional parameter "maxResults": The maxResults
  16312. // parameter specifies the maximum number of items that should be
  16313. // returned in the result set.
  16314. func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall {
  16315. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16316. return c
  16317. }
  16318. // Mine sets the optional parameter "mine": Set this parameter's value
  16319. // to true to retrieve a feed of the authenticated user's subscriptions.
  16320. func (c *SubscriptionsListCall) Mine(mine bool) *SubscriptionsListCall {
  16321. c.urlParams_.Set("mine", fmt.Sprint(mine))
  16322. return c
  16323. }
  16324. // MySubscribers sets the optional parameter "mySubscribers": Set this
  16325. // parameter's value to true to retrieve a feed of the subscribers of
  16326. // the authenticated user.
  16327. func (c *SubscriptionsListCall) MySubscribers(mySubscribers bool) *SubscriptionsListCall {
  16328. c.urlParams_.Set("mySubscribers", fmt.Sprint(mySubscribers))
  16329. return c
  16330. }
  16331. // OnBehalfOfContentOwner sets the optional parameter
  16332. // "onBehalfOfContentOwner": Note: This parameter is intended
  16333. // exclusively for YouTube content partners.
  16334. //
  16335. // The onBehalfOfContentOwner parameter indicates that the request's
  16336. // authorization credentials identify a YouTube CMS user who is acting
  16337. // on behalf of the content owner specified in the parameter value. This
  16338. // parameter is intended for YouTube content partners that own and
  16339. // manage many different YouTube channels. It allows content owners to
  16340. // authenticate once and get access to all their video and channel data,
  16341. // without having to provide authentication credentials for each
  16342. // individual channel. The CMS account that the user authenticates with
  16343. // must be linked to the specified YouTube content owner.
  16344. func (c *SubscriptionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *SubscriptionsListCall {
  16345. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16346. return c
  16347. }
  16348. // OnBehalfOfContentOwnerChannel sets the optional parameter
  16349. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  16350. // properly authorized request. Note: This parameter is intended
  16351. // exclusively for YouTube content partners.
  16352. //
  16353. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  16354. // channel ID of the channel to which a video is being added. This
  16355. // parameter is required when a request specifies a value for the
  16356. // onBehalfOfContentOwner parameter, and it can only be used in
  16357. // conjunction with that parameter. In addition, the request must be
  16358. // authorized using a CMS account that is linked to the content owner
  16359. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  16360. // channel that the onBehalfOfContentOwnerChannel parameter value
  16361. // specifies must be linked to the content owner that the
  16362. // onBehalfOfContentOwner parameter specifies.
  16363. //
  16364. // This parameter is intended for YouTube content partners that own and
  16365. // manage many different YouTube channels. It allows content owners to
  16366. // authenticate once and perform actions on behalf of the channel
  16367. // specified in the parameter value, without having to provide
  16368. // authentication credentials for each separate channel.
  16369. func (c *SubscriptionsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *SubscriptionsListCall {
  16370. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  16371. return c
  16372. }
  16373. // Order sets the optional parameter "order": The order parameter
  16374. // specifies the method that will be used to sort resources in the API
  16375. // response.
  16376. //
  16377. // Possible values:
  16378. // "alphabetical" - Sort alphabetically.
  16379. // "relevance" - Sort by relevance.
  16380. // "unread" - Sort by order of activity.
  16381. func (c *SubscriptionsListCall) Order(order string) *SubscriptionsListCall {
  16382. c.urlParams_.Set("order", order)
  16383. return c
  16384. }
  16385. // PageToken sets the optional parameter "pageToken": The pageToken
  16386. // parameter identifies a specific page in the result set that should be
  16387. // returned. In an API response, the nextPageToken and prevPageToken
  16388. // properties identify other pages that could be retrieved.
  16389. func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall {
  16390. c.urlParams_.Set("pageToken", pageToken)
  16391. return c
  16392. }
  16393. // Fields allows partial responses to be retrieved. See
  16394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16395. // for more information.
  16396. func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall {
  16397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16398. return c
  16399. }
  16400. // IfNoneMatch sets the optional parameter which makes the operation
  16401. // fail if the object's ETag matches the given value. This is useful for
  16402. // getting updates only after the object has changed since the last
  16403. // request. Use googleapi.IsNotModified to check whether the response
  16404. // error from Do is the result of In-None-Match.
  16405. func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall {
  16406. c.ifNoneMatch_ = entityTag
  16407. return c
  16408. }
  16409. // Context sets the context to be used in this call's Do method. Any
  16410. // pending HTTP request will be aborted if the provided context is
  16411. // canceled.
  16412. func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall {
  16413. c.ctx_ = ctx
  16414. return c
  16415. }
  16416. func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
  16417. var body io.Reader = nil
  16418. c.urlParams_.Set("alt", alt)
  16419. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  16420. urls += "?" + c.urlParams_.Encode()
  16421. req, _ := http.NewRequest("GET", urls, body)
  16422. googleapi.SetOpaque(req.URL)
  16423. req.Header.Set("User-Agent", c.s.userAgent())
  16424. if c.ifNoneMatch_ != "" {
  16425. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  16426. }
  16427. if c.ctx_ != nil {
  16428. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16429. }
  16430. return c.s.client.Do(req)
  16431. }
  16432. // Do executes the "youtube.subscriptions.list" call.
  16433. // Exactly one of *SubscriptionListResponse or error will be non-nil.
  16434. // Any non-2xx status code is an error. Response headers are in either
  16435. // *SubscriptionListResponse.ServerResponse.Header or (if a response was
  16436. // returned at all) in error.(*googleapi.Error).Header. Use
  16437. // googleapi.IsNotModified to check whether the returned error was
  16438. // because http.StatusNotModified was returned.
  16439. func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*SubscriptionListResponse, error) {
  16440. gensupport.SetOptions(c.urlParams_, opts...)
  16441. res, err := c.doRequest("json")
  16442. if res != nil && res.StatusCode == http.StatusNotModified {
  16443. if res.Body != nil {
  16444. res.Body.Close()
  16445. }
  16446. return nil, &googleapi.Error{
  16447. Code: res.StatusCode,
  16448. Header: res.Header,
  16449. }
  16450. }
  16451. if err != nil {
  16452. return nil, err
  16453. }
  16454. defer googleapi.CloseBody(res)
  16455. if err := googleapi.CheckResponse(res); err != nil {
  16456. return nil, err
  16457. }
  16458. ret := &SubscriptionListResponse{
  16459. ServerResponse: googleapi.ServerResponse{
  16460. Header: res.Header,
  16461. HTTPStatusCode: res.StatusCode,
  16462. },
  16463. }
  16464. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16465. return nil, err
  16466. }
  16467. return ret, nil
  16468. // {
  16469. // "description": "Returns subscription resources that match the API request criteria.",
  16470. // "httpMethod": "GET",
  16471. // "id": "youtube.subscriptions.list",
  16472. // "parameterOrder": [
  16473. // "part"
  16474. // ],
  16475. // "parameters": {
  16476. // "channelId": {
  16477. // "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions.",
  16478. // "location": "query",
  16479. // "type": "string"
  16480. // },
  16481. // "forChannelId": {
  16482. // "description": "The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.",
  16483. // "location": "query",
  16484. // "type": "string"
  16485. // },
  16486. // "id": {
  16487. // "description": "The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID.",
  16488. // "location": "query",
  16489. // "type": "string"
  16490. // },
  16491. // "maxResults": {
  16492. // "default": "5",
  16493. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  16494. // "format": "uint32",
  16495. // "location": "query",
  16496. // "maximum": "50",
  16497. // "minimum": "0",
  16498. // "type": "integer"
  16499. // },
  16500. // "mine": {
  16501. // "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions.",
  16502. // "location": "query",
  16503. // "type": "boolean"
  16504. // },
  16505. // "mySubscribers": {
  16506. // "description": "Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user.",
  16507. // "location": "query",
  16508. // "type": "boolean"
  16509. // },
  16510. // "onBehalfOfContentOwner": {
  16511. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  16512. // "location": "query",
  16513. // "type": "string"
  16514. // },
  16515. // "onBehalfOfContentOwnerChannel": {
  16516. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  16517. // "location": "query",
  16518. // "type": "string"
  16519. // },
  16520. // "order": {
  16521. // "default": "SUBSCRIPTION_ORDER_RELEVANCE",
  16522. // "description": "The order parameter specifies the method that will be used to sort resources in the API response.",
  16523. // "enum": [
  16524. // "alphabetical",
  16525. // "relevance",
  16526. // "unread"
  16527. // ],
  16528. // "enumDescriptions": [
  16529. // "Sort alphabetically.",
  16530. // "Sort by relevance.",
  16531. // "Sort by order of activity."
  16532. // ],
  16533. // "location": "query",
  16534. // "type": "string"
  16535. // },
  16536. // "pageToken": {
  16537. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  16538. // "location": "query",
  16539. // "type": "string"
  16540. // },
  16541. // "part": {
  16542. // "description": "The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties.",
  16543. // "location": "query",
  16544. // "required": true,
  16545. // "type": "string"
  16546. // }
  16547. // },
  16548. // "path": "subscriptions",
  16549. // "response": {
  16550. // "$ref": "SubscriptionListResponse"
  16551. // },
  16552. // "scopes": [
  16553. // "https://www.googleapis.com/auth/youtube",
  16554. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16555. // "https://www.googleapis.com/auth/youtube.readonly",
  16556. // "https://www.googleapis.com/auth/youtubepartner"
  16557. // ]
  16558. // }
  16559. }
  16560. // Pages invokes f for each page of results.
  16561. // A non-nil error returned from f will halt the iteration.
  16562. // The provided context supersedes any context provided to the Context method.
  16563. func (c *SubscriptionsListCall) Pages(ctx context.Context, f func(*SubscriptionListResponse) error) error {
  16564. c.ctx_ = ctx
  16565. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16566. for {
  16567. x, err := c.Do()
  16568. if err != nil {
  16569. return err
  16570. }
  16571. if err := f(x); err != nil {
  16572. return err
  16573. }
  16574. if x.NextPageToken == "" {
  16575. return nil
  16576. }
  16577. c.PageToken(x.NextPageToken)
  16578. }
  16579. }
  16580. // method id "youtube.thumbnails.set":
  16581. type ThumbnailsSetCall struct {
  16582. s *Service
  16583. urlParams_ gensupport.URLParams
  16584. media_ io.Reader
  16585. resumableBuffer_ *gensupport.ResumableBuffer
  16586. mediaType_ string
  16587. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  16588. progressUpdater_ googleapi.ProgressUpdater
  16589. ctx_ context.Context
  16590. }
  16591. // Set: Uploads a custom video thumbnail to YouTube and sets it for a
  16592. // video.
  16593. func (r *ThumbnailsService) Set(videoId string) *ThumbnailsSetCall {
  16594. c := &ThumbnailsSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16595. c.urlParams_.Set("videoId", videoId)
  16596. return c
  16597. }
  16598. // OnBehalfOfContentOwner sets the optional parameter
  16599. // "onBehalfOfContentOwner": Note: This parameter is intended
  16600. // exclusively for YouTube content partners.
  16601. //
  16602. // The onBehalfOfContentOwner parameter indicates that the request's
  16603. // authorization credentials identify a YouTube CMS user who is acting
  16604. // on behalf of the content owner specified in the parameter value. This
  16605. // parameter is intended for YouTube content partners that own and
  16606. // manage many different YouTube channels. It allows content owners to
  16607. // authenticate once and get access to all their video and channel data,
  16608. // without having to provide authentication credentials for each
  16609. // individual channel. The actual CMS account that the user
  16610. // authenticates with must be linked to the specified YouTube content
  16611. // owner.
  16612. func (c *ThumbnailsSetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ThumbnailsSetCall {
  16613. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16614. return c
  16615. }
  16616. // Media specifies the media to upload in one or more chunks. The chunk
  16617. // size may be controlled by supplying a MediaOption generated by
  16618. // googleapi.ChunkSize. The chunk size defaults to
  16619. // googleapi.DefaultUploadChunkSize.
  16620. // At most one of Media and ResumableMedia may be set.
  16621. func (c *ThumbnailsSetCall) Media(r io.Reader, options ...googleapi.MediaOption) *ThumbnailsSetCall {
  16622. opts := googleapi.ProcessMediaOptions(options)
  16623. chunkSize := opts.ChunkSize
  16624. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  16625. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  16626. return c
  16627. }
  16628. // ResumableMedia specifies the media to upload in chunks and can be
  16629. // canceled with ctx.
  16630. //
  16631. // Deprecated: use Media instead.
  16632. //
  16633. // At most one of Media and ResumableMedia may be set. mediaType
  16634. // identifies the MIME media type of the upload, such as "image/png". If
  16635. // mediaType is "", it will be auto-detected. The provided ctx will
  16636. // supersede any context previously provided to the Context method.
  16637. func (c *ThumbnailsSetCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ThumbnailsSetCall {
  16638. c.ctx_ = ctx
  16639. rdr := gensupport.ReaderAtToReader(r, size)
  16640. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  16641. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  16642. c.media_ = nil
  16643. c.mediaSize_ = size
  16644. return c
  16645. }
  16646. // ProgressUpdater provides a callback function that will be called
  16647. // after every chunk. It should be a low-latency function in order to
  16648. // not slow down the upload operation. This should only be called when
  16649. // using ResumableMedia (as opposed to Media).
  16650. func (c *ThumbnailsSetCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ThumbnailsSetCall {
  16651. c.progressUpdater_ = pu
  16652. return c
  16653. }
  16654. // Fields allows partial responses to be retrieved. See
  16655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16656. // for more information.
  16657. func (c *ThumbnailsSetCall) Fields(s ...googleapi.Field) *ThumbnailsSetCall {
  16658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16659. return c
  16660. }
  16661. // Context sets the context to be used in this call's Do method. Any
  16662. // pending HTTP request will be aborted if the provided context is
  16663. // canceled.
  16664. // This context will supersede any context previously provided to the
  16665. // ResumableMedia method.
  16666. func (c *ThumbnailsSetCall) Context(ctx context.Context) *ThumbnailsSetCall {
  16667. c.ctx_ = ctx
  16668. return c
  16669. }
  16670. func (c *ThumbnailsSetCall) doRequest(alt string) (*http.Response, error) {
  16671. var body io.Reader = nil
  16672. c.urlParams_.Set("alt", alt)
  16673. urls := googleapi.ResolveRelative(c.s.BasePath, "thumbnails/set")
  16674. if c.media_ != nil || c.resumableBuffer_ != nil {
  16675. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  16676. protocol := "multipart"
  16677. if c.resumableBuffer_ != nil {
  16678. protocol = "resumable"
  16679. }
  16680. c.urlParams_.Set("uploadType", protocol)
  16681. }
  16682. urls += "?" + c.urlParams_.Encode()
  16683. body = new(bytes.Buffer)
  16684. ctype := "application/json"
  16685. if c.media_ != nil {
  16686. var combined io.ReadCloser
  16687. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  16688. defer combined.Close()
  16689. body = combined
  16690. }
  16691. req, _ := http.NewRequest("POST", urls, body)
  16692. googleapi.SetOpaque(req.URL)
  16693. if c.resumableBuffer_ != nil {
  16694. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  16695. }
  16696. req.Header.Set("Content-Type", ctype)
  16697. req.Header.Set("User-Agent", c.s.userAgent())
  16698. if c.ctx_ != nil {
  16699. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16700. }
  16701. return c.s.client.Do(req)
  16702. }
  16703. // Do executes the "youtube.thumbnails.set" call.
  16704. // Exactly one of *ThumbnailSetResponse or error will be non-nil. Any
  16705. // non-2xx status code is an error. Response headers are in either
  16706. // *ThumbnailSetResponse.ServerResponse.Header or (if a response was
  16707. // returned at all) in error.(*googleapi.Error).Header. Use
  16708. // googleapi.IsNotModified to check whether the returned error was
  16709. // because http.StatusNotModified was returned.
  16710. func (c *ThumbnailsSetCall) Do(opts ...googleapi.CallOption) (*ThumbnailSetResponse, error) {
  16711. gensupport.SetOptions(c.urlParams_, opts...)
  16712. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  16713. return c.doRequest("json")
  16714. }, gensupport.DefaultBackoffStrategy())
  16715. if res != nil && res.StatusCode == http.StatusNotModified {
  16716. if res.Body != nil {
  16717. res.Body.Close()
  16718. }
  16719. return nil, &googleapi.Error{
  16720. Code: res.StatusCode,
  16721. Header: res.Header,
  16722. }
  16723. }
  16724. if err != nil {
  16725. return nil, err
  16726. }
  16727. defer googleapi.CloseBody(res)
  16728. if err := googleapi.CheckResponse(res); err != nil {
  16729. return nil, err
  16730. }
  16731. if c.resumableBuffer_ != nil {
  16732. loc := res.Header.Get("Location")
  16733. rx := &gensupport.ResumableUpload{
  16734. Client: c.s.client,
  16735. UserAgent: c.s.userAgent(),
  16736. URI: loc,
  16737. Media: c.resumableBuffer_,
  16738. MediaType: c.mediaType_,
  16739. Callback: func(curr int64) {
  16740. if c.progressUpdater_ != nil {
  16741. c.progressUpdater_(curr, c.mediaSize_)
  16742. }
  16743. },
  16744. }
  16745. ctx := c.ctx_
  16746. if ctx == nil {
  16747. ctx = context.TODO()
  16748. }
  16749. res, err = rx.Upload(ctx)
  16750. if err != nil {
  16751. return nil, err
  16752. }
  16753. defer res.Body.Close()
  16754. if err := googleapi.CheckResponse(res); err != nil {
  16755. return nil, err
  16756. }
  16757. }
  16758. ret := &ThumbnailSetResponse{
  16759. ServerResponse: googleapi.ServerResponse{
  16760. Header: res.Header,
  16761. HTTPStatusCode: res.StatusCode,
  16762. },
  16763. }
  16764. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16765. return nil, err
  16766. }
  16767. return ret, nil
  16768. // {
  16769. // "description": "Uploads a custom video thumbnail to YouTube and sets it for a video.",
  16770. // "httpMethod": "POST",
  16771. // "id": "youtube.thumbnails.set",
  16772. // "mediaUpload": {
  16773. // "accept": [
  16774. // "application/octet-stream",
  16775. // "image/jpeg",
  16776. // "image/png"
  16777. // ],
  16778. // "maxSize": "2MB",
  16779. // "protocols": {
  16780. // "resumable": {
  16781. // "multipart": true,
  16782. // "path": "/resumable/upload/youtube/v3/thumbnails/set"
  16783. // },
  16784. // "simple": {
  16785. // "multipart": true,
  16786. // "path": "/upload/youtube/v3/thumbnails/set"
  16787. // }
  16788. // }
  16789. // },
  16790. // "parameterOrder": [
  16791. // "videoId"
  16792. // ],
  16793. // "parameters": {
  16794. // "onBehalfOfContentOwner": {
  16795. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  16796. // "location": "query",
  16797. // "type": "string"
  16798. // },
  16799. // "videoId": {
  16800. // "description": "The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided.",
  16801. // "location": "query",
  16802. // "required": true,
  16803. // "type": "string"
  16804. // }
  16805. // },
  16806. // "path": "thumbnails/set",
  16807. // "response": {
  16808. // "$ref": "ThumbnailSetResponse"
  16809. // },
  16810. // "scopes": [
  16811. // "https://www.googleapis.com/auth/youtube",
  16812. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16813. // "https://www.googleapis.com/auth/youtube.upload",
  16814. // "https://www.googleapis.com/auth/youtubepartner"
  16815. // ],
  16816. // "supportsMediaUpload": true
  16817. // }
  16818. }
  16819. // method id "youtube.videoAbuseReportReasons.list":
  16820. type VideoAbuseReportReasonsListCall struct {
  16821. s *Service
  16822. urlParams_ gensupport.URLParams
  16823. ifNoneMatch_ string
  16824. ctx_ context.Context
  16825. }
  16826. // List: Returns a list of abuse reasons that can be used for reporting
  16827. // abusive videos.
  16828. func (r *VideoAbuseReportReasonsService) List(part string) *VideoAbuseReportReasonsListCall {
  16829. c := &VideoAbuseReportReasonsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16830. c.urlParams_.Set("part", part)
  16831. return c
  16832. }
  16833. // Hl sets the optional parameter "hl": The hl parameter specifies the
  16834. // language that should be used for text values in the API response.
  16835. func (c *VideoAbuseReportReasonsListCall) Hl(hl string) *VideoAbuseReportReasonsListCall {
  16836. c.urlParams_.Set("hl", hl)
  16837. return c
  16838. }
  16839. // Fields allows partial responses to be retrieved. See
  16840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16841. // for more information.
  16842. func (c *VideoAbuseReportReasonsListCall) Fields(s ...googleapi.Field) *VideoAbuseReportReasonsListCall {
  16843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16844. return c
  16845. }
  16846. // IfNoneMatch sets the optional parameter which makes the operation
  16847. // fail if the object's ETag matches the given value. This is useful for
  16848. // getting updates only after the object has changed since the last
  16849. // request. Use googleapi.IsNotModified to check whether the response
  16850. // error from Do is the result of In-None-Match.
  16851. func (c *VideoAbuseReportReasonsListCall) IfNoneMatch(entityTag string) *VideoAbuseReportReasonsListCall {
  16852. c.ifNoneMatch_ = entityTag
  16853. return c
  16854. }
  16855. // Context sets the context to be used in this call's Do method. Any
  16856. // pending HTTP request will be aborted if the provided context is
  16857. // canceled.
  16858. func (c *VideoAbuseReportReasonsListCall) Context(ctx context.Context) *VideoAbuseReportReasonsListCall {
  16859. c.ctx_ = ctx
  16860. return c
  16861. }
  16862. func (c *VideoAbuseReportReasonsListCall) doRequest(alt string) (*http.Response, error) {
  16863. var body io.Reader = nil
  16864. c.urlParams_.Set("alt", alt)
  16865. urls := googleapi.ResolveRelative(c.s.BasePath, "videoAbuseReportReasons")
  16866. urls += "?" + c.urlParams_.Encode()
  16867. req, _ := http.NewRequest("GET", urls, body)
  16868. googleapi.SetOpaque(req.URL)
  16869. req.Header.Set("User-Agent", c.s.userAgent())
  16870. if c.ifNoneMatch_ != "" {
  16871. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  16872. }
  16873. if c.ctx_ != nil {
  16874. return ctxhttp.Do(c.ctx_, c.s.client, req)
  16875. }
  16876. return c.s.client.Do(req)
  16877. }
  16878. // Do executes the "youtube.videoAbuseReportReasons.list" call.
  16879. // Exactly one of *VideoAbuseReportReasonListResponse or error will be
  16880. // non-nil. Any non-2xx status code is an error. Response headers are in
  16881. // either *VideoAbuseReportReasonListResponse.ServerResponse.Header or
  16882. // (if a response was returned at all) in
  16883. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16884. // whether the returned error was because http.StatusNotModified was
  16885. // returned.
  16886. func (c *VideoAbuseReportReasonsListCall) Do(opts ...googleapi.CallOption) (*VideoAbuseReportReasonListResponse, error) {
  16887. gensupport.SetOptions(c.urlParams_, opts...)
  16888. res, err := c.doRequest("json")
  16889. if res != nil && res.StatusCode == http.StatusNotModified {
  16890. if res.Body != nil {
  16891. res.Body.Close()
  16892. }
  16893. return nil, &googleapi.Error{
  16894. Code: res.StatusCode,
  16895. Header: res.Header,
  16896. }
  16897. }
  16898. if err != nil {
  16899. return nil, err
  16900. }
  16901. defer googleapi.CloseBody(res)
  16902. if err := googleapi.CheckResponse(res); err != nil {
  16903. return nil, err
  16904. }
  16905. ret := &VideoAbuseReportReasonListResponse{
  16906. ServerResponse: googleapi.ServerResponse{
  16907. Header: res.Header,
  16908. HTTPStatusCode: res.StatusCode,
  16909. },
  16910. }
  16911. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  16912. return nil, err
  16913. }
  16914. return ret, nil
  16915. // {
  16916. // "description": "Returns a list of abuse reasons that can be used for reporting abusive videos.",
  16917. // "httpMethod": "GET",
  16918. // "id": "youtube.videoAbuseReportReasons.list",
  16919. // "parameterOrder": [
  16920. // "part"
  16921. // ],
  16922. // "parameters": {
  16923. // "hl": {
  16924. // "default": "en_US",
  16925. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  16926. // "location": "query",
  16927. // "type": "string"
  16928. // },
  16929. // "part": {
  16930. // "description": "The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet.",
  16931. // "location": "query",
  16932. // "required": true,
  16933. // "type": "string"
  16934. // }
  16935. // },
  16936. // "path": "videoAbuseReportReasons",
  16937. // "response": {
  16938. // "$ref": "VideoAbuseReportReasonListResponse"
  16939. // },
  16940. // "scopes": [
  16941. // "https://www.googleapis.com/auth/youtube",
  16942. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16943. // "https://www.googleapis.com/auth/youtube.readonly"
  16944. // ]
  16945. // }
  16946. }
  16947. // method id "youtube.videoCategories.list":
  16948. type VideoCategoriesListCall struct {
  16949. s *Service
  16950. urlParams_ gensupport.URLParams
  16951. ifNoneMatch_ string
  16952. ctx_ context.Context
  16953. }
  16954. // List: Returns a list of categories that can be associated with
  16955. // YouTube videos.
  16956. func (r *VideoCategoriesService) List(part string) *VideoCategoriesListCall {
  16957. c := &VideoCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16958. c.urlParams_.Set("part", part)
  16959. return c
  16960. }
  16961. // Hl sets the optional parameter "hl": The hl parameter specifies the
  16962. // language that should be used for text values in the API response.
  16963. func (c *VideoCategoriesListCall) Hl(hl string) *VideoCategoriesListCall {
  16964. c.urlParams_.Set("hl", hl)
  16965. return c
  16966. }
  16967. // Id sets the optional parameter "id": The id parameter specifies a
  16968. // comma-separated list of video category IDs for the resources that you
  16969. // are retrieving.
  16970. func (c *VideoCategoriesListCall) Id(id string) *VideoCategoriesListCall {
  16971. c.urlParams_.Set("id", id)
  16972. return c
  16973. }
  16974. // RegionCode sets the optional parameter "regionCode": The regionCode
  16975. // parameter instructs the API to return the list of video categories
  16976. // available in the specified country. The parameter value is an ISO
  16977. // 3166-1 alpha-2 country code.
  16978. func (c *VideoCategoriesListCall) RegionCode(regionCode string) *VideoCategoriesListCall {
  16979. c.urlParams_.Set("regionCode", regionCode)
  16980. return c
  16981. }
  16982. // Fields allows partial responses to be retrieved. See
  16983. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16984. // for more information.
  16985. func (c *VideoCategoriesListCall) Fields(s ...googleapi.Field) *VideoCategoriesListCall {
  16986. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16987. return c
  16988. }
  16989. // IfNoneMatch sets the optional parameter which makes the operation
  16990. // fail if the object's ETag matches the given value. This is useful for
  16991. // getting updates only after the object has changed since the last
  16992. // request. Use googleapi.IsNotModified to check whether the response
  16993. // error from Do is the result of In-None-Match.
  16994. func (c *VideoCategoriesListCall) IfNoneMatch(entityTag string) *VideoCategoriesListCall {
  16995. c.ifNoneMatch_ = entityTag
  16996. return c
  16997. }
  16998. // Context sets the context to be used in this call's Do method. Any
  16999. // pending HTTP request will be aborted if the provided context is
  17000. // canceled.
  17001. func (c *VideoCategoriesListCall) Context(ctx context.Context) *VideoCategoriesListCall {
  17002. c.ctx_ = ctx
  17003. return c
  17004. }
  17005. func (c *VideoCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  17006. var body io.Reader = nil
  17007. c.urlParams_.Set("alt", alt)
  17008. urls := googleapi.ResolveRelative(c.s.BasePath, "videoCategories")
  17009. urls += "?" + c.urlParams_.Encode()
  17010. req, _ := http.NewRequest("GET", urls, body)
  17011. googleapi.SetOpaque(req.URL)
  17012. req.Header.Set("User-Agent", c.s.userAgent())
  17013. if c.ifNoneMatch_ != "" {
  17014. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  17015. }
  17016. if c.ctx_ != nil {
  17017. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17018. }
  17019. return c.s.client.Do(req)
  17020. }
  17021. // Do executes the "youtube.videoCategories.list" call.
  17022. // Exactly one of *VideoCategoryListResponse or error will be non-nil.
  17023. // Any non-2xx status code is an error. Response headers are in either
  17024. // *VideoCategoryListResponse.ServerResponse.Header or (if a response
  17025. // was returned at all) in error.(*googleapi.Error).Header. Use
  17026. // googleapi.IsNotModified to check whether the returned error was
  17027. // because http.StatusNotModified was returned.
  17028. func (c *VideoCategoriesListCall) Do(opts ...googleapi.CallOption) (*VideoCategoryListResponse, error) {
  17029. gensupport.SetOptions(c.urlParams_, opts...)
  17030. res, err := c.doRequest("json")
  17031. if res != nil && res.StatusCode == http.StatusNotModified {
  17032. if res.Body != nil {
  17033. res.Body.Close()
  17034. }
  17035. return nil, &googleapi.Error{
  17036. Code: res.StatusCode,
  17037. Header: res.Header,
  17038. }
  17039. }
  17040. if err != nil {
  17041. return nil, err
  17042. }
  17043. defer googleapi.CloseBody(res)
  17044. if err := googleapi.CheckResponse(res); err != nil {
  17045. return nil, err
  17046. }
  17047. ret := &VideoCategoryListResponse{
  17048. ServerResponse: googleapi.ServerResponse{
  17049. Header: res.Header,
  17050. HTTPStatusCode: res.StatusCode,
  17051. },
  17052. }
  17053. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17054. return nil, err
  17055. }
  17056. return ret, nil
  17057. // {
  17058. // "description": "Returns a list of categories that can be associated with YouTube videos.",
  17059. // "httpMethod": "GET",
  17060. // "id": "youtube.videoCategories.list",
  17061. // "parameterOrder": [
  17062. // "part"
  17063. // ],
  17064. // "parameters": {
  17065. // "hl": {
  17066. // "default": "en_US",
  17067. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  17068. // "location": "query",
  17069. // "type": "string"
  17070. // },
  17071. // "id": {
  17072. // "description": "The id parameter specifies a comma-separated list of video category IDs for the resources that you are retrieving.",
  17073. // "location": "query",
  17074. // "type": "string"
  17075. // },
  17076. // "part": {
  17077. // "description": "The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet.",
  17078. // "location": "query",
  17079. // "required": true,
  17080. // "type": "string"
  17081. // },
  17082. // "regionCode": {
  17083. // "description": "The regionCode parameter instructs the API to return the list of video categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.",
  17084. // "location": "query",
  17085. // "type": "string"
  17086. // }
  17087. // },
  17088. // "path": "videoCategories",
  17089. // "response": {
  17090. // "$ref": "VideoCategoryListResponse"
  17091. // },
  17092. // "scopes": [
  17093. // "https://www.googleapis.com/auth/youtube",
  17094. // "https://www.googleapis.com/auth/youtube.force-ssl",
  17095. // "https://www.googleapis.com/auth/youtube.readonly",
  17096. // "https://www.googleapis.com/auth/youtubepartner"
  17097. // ]
  17098. // }
  17099. }
  17100. // method id "youtube.videos.delete":
  17101. type VideosDeleteCall struct {
  17102. s *Service
  17103. urlParams_ gensupport.URLParams
  17104. ctx_ context.Context
  17105. }
  17106. // Delete: Deletes a YouTube video.
  17107. func (r *VideosService) Delete(id string) *VideosDeleteCall {
  17108. c := &VideosDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17109. c.urlParams_.Set("id", id)
  17110. return c
  17111. }
  17112. // OnBehalfOfContentOwner sets the optional parameter
  17113. // "onBehalfOfContentOwner": Note: This parameter is intended
  17114. // exclusively for YouTube content partners.
  17115. //
  17116. // The onBehalfOfContentOwner parameter indicates that the request's
  17117. // authorization credentials identify a YouTube CMS user who is acting
  17118. // on behalf of the content owner specified in the parameter value. This
  17119. // parameter is intended for YouTube content partners that own and
  17120. // manage many different YouTube channels. It allows content owners to
  17121. // authenticate once and get access to all their video and channel data,
  17122. // without having to provide authentication credentials for each
  17123. // individual channel. The actual CMS account that the user
  17124. // authenticates with must be linked to the specified YouTube content
  17125. // owner.
  17126. func (c *VideosDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosDeleteCall {
  17127. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  17128. return c
  17129. }
  17130. // Fields allows partial responses to be retrieved. See
  17131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17132. // for more information.
  17133. func (c *VideosDeleteCall) Fields(s ...googleapi.Field) *VideosDeleteCall {
  17134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17135. return c
  17136. }
  17137. // Context sets the context to be used in this call's Do method. Any
  17138. // pending HTTP request will be aborted if the provided context is
  17139. // canceled.
  17140. func (c *VideosDeleteCall) Context(ctx context.Context) *VideosDeleteCall {
  17141. c.ctx_ = ctx
  17142. return c
  17143. }
  17144. func (c *VideosDeleteCall) doRequest(alt string) (*http.Response, error) {
  17145. var body io.Reader = nil
  17146. c.urlParams_.Set("alt", alt)
  17147. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  17148. urls += "?" + c.urlParams_.Encode()
  17149. req, _ := http.NewRequest("DELETE", urls, body)
  17150. googleapi.SetOpaque(req.URL)
  17151. req.Header.Set("User-Agent", c.s.userAgent())
  17152. if c.ctx_ != nil {
  17153. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17154. }
  17155. return c.s.client.Do(req)
  17156. }
  17157. // Do executes the "youtube.videos.delete" call.
  17158. func (c *VideosDeleteCall) Do(opts ...googleapi.CallOption) error {
  17159. gensupport.SetOptions(c.urlParams_, opts...)
  17160. res, err := c.doRequest("json")
  17161. if err != nil {
  17162. return err
  17163. }
  17164. defer googleapi.CloseBody(res)
  17165. if err := googleapi.CheckResponse(res); err != nil {
  17166. return err
  17167. }
  17168. return nil
  17169. // {
  17170. // "description": "Deletes a YouTube video.",
  17171. // "httpMethod": "DELETE",
  17172. // "id": "youtube.videos.delete",
  17173. // "parameterOrder": [
  17174. // "id"
  17175. // ],
  17176. // "parameters": {
  17177. // "id": {
  17178. // "description": "The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID.",
  17179. // "location": "query",
  17180. // "required": true,
  17181. // "type": "string"
  17182. // },
  17183. // "onBehalfOfContentOwner": {
  17184. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  17185. // "location": "query",
  17186. // "type": "string"
  17187. // }
  17188. // },
  17189. // "path": "videos",
  17190. // "scopes": [
  17191. // "https://www.googleapis.com/auth/youtube",
  17192. // "https://www.googleapis.com/auth/youtube.force-ssl",
  17193. // "https://www.googleapis.com/auth/youtubepartner"
  17194. // ]
  17195. // }
  17196. }
  17197. // method id "youtube.videos.getRating":
  17198. type VideosGetRatingCall struct {
  17199. s *Service
  17200. urlParams_ gensupport.URLParams
  17201. ifNoneMatch_ string
  17202. ctx_ context.Context
  17203. }
  17204. // GetRating: Retrieves the ratings that the authorized user gave to a
  17205. // list of specified videos.
  17206. func (r *VideosService) GetRating(id string) *VideosGetRatingCall {
  17207. c := &VideosGetRatingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17208. c.urlParams_.Set("id", id)
  17209. return c
  17210. }
  17211. // OnBehalfOfContentOwner sets the optional parameter
  17212. // "onBehalfOfContentOwner": Note: This parameter is intended
  17213. // exclusively for YouTube content partners.
  17214. //
  17215. // The onBehalfOfContentOwner parameter indicates that the request's
  17216. // authorization credentials identify a YouTube CMS user who is acting
  17217. // on behalf of the content owner specified in the parameter value. This
  17218. // parameter is intended for YouTube content partners that own and
  17219. // manage many different YouTube channels. It allows content owners to
  17220. // authenticate once and get access to all their video and channel data,
  17221. // without having to provide authentication credentials for each
  17222. // individual channel. The CMS account that the user authenticates with
  17223. // must be linked to the specified YouTube content owner.
  17224. func (c *VideosGetRatingCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosGetRatingCall {
  17225. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  17226. return c
  17227. }
  17228. // Fields allows partial responses to be retrieved. See
  17229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17230. // for more information.
  17231. func (c *VideosGetRatingCall) Fields(s ...googleapi.Field) *VideosGetRatingCall {
  17232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17233. return c
  17234. }
  17235. // IfNoneMatch sets the optional parameter which makes the operation
  17236. // fail if the object's ETag matches the given value. This is useful for
  17237. // getting updates only after the object has changed since the last
  17238. // request. Use googleapi.IsNotModified to check whether the response
  17239. // error from Do is the result of In-None-Match.
  17240. func (c *VideosGetRatingCall) IfNoneMatch(entityTag string) *VideosGetRatingCall {
  17241. c.ifNoneMatch_ = entityTag
  17242. return c
  17243. }
  17244. // Context sets the context to be used in this call's Do method. Any
  17245. // pending HTTP request will be aborted if the provided context is
  17246. // canceled.
  17247. func (c *VideosGetRatingCall) Context(ctx context.Context) *VideosGetRatingCall {
  17248. c.ctx_ = ctx
  17249. return c
  17250. }
  17251. func (c *VideosGetRatingCall) doRequest(alt string) (*http.Response, error) {
  17252. var body io.Reader = nil
  17253. c.urlParams_.Set("alt", alt)
  17254. urls := googleapi.ResolveRelative(c.s.BasePath, "videos/getRating")
  17255. urls += "?" + c.urlParams_.Encode()
  17256. req, _ := http.NewRequest("GET", urls, body)
  17257. googleapi.SetOpaque(req.URL)
  17258. req.Header.Set("User-Agent", c.s.userAgent())
  17259. if c.ifNoneMatch_ != "" {
  17260. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  17261. }
  17262. if c.ctx_ != nil {
  17263. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17264. }
  17265. return c.s.client.Do(req)
  17266. }
  17267. // Do executes the "youtube.videos.getRating" call.
  17268. // Exactly one of *VideoGetRatingResponse or error will be non-nil. Any
  17269. // non-2xx status code is an error. Response headers are in either
  17270. // *VideoGetRatingResponse.ServerResponse.Header or (if a response was
  17271. // returned at all) in error.(*googleapi.Error).Header. Use
  17272. // googleapi.IsNotModified to check whether the returned error was
  17273. // because http.StatusNotModified was returned.
  17274. func (c *VideosGetRatingCall) Do(opts ...googleapi.CallOption) (*VideoGetRatingResponse, error) {
  17275. gensupport.SetOptions(c.urlParams_, opts...)
  17276. res, err := c.doRequest("json")
  17277. if res != nil && res.StatusCode == http.StatusNotModified {
  17278. if res.Body != nil {
  17279. res.Body.Close()
  17280. }
  17281. return nil, &googleapi.Error{
  17282. Code: res.StatusCode,
  17283. Header: res.Header,
  17284. }
  17285. }
  17286. if err != nil {
  17287. return nil, err
  17288. }
  17289. defer googleapi.CloseBody(res)
  17290. if err := googleapi.CheckResponse(res); err != nil {
  17291. return nil, err
  17292. }
  17293. ret := &VideoGetRatingResponse{
  17294. ServerResponse: googleapi.ServerResponse{
  17295. Header: res.Header,
  17296. HTTPStatusCode: res.StatusCode,
  17297. },
  17298. }
  17299. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17300. return nil, err
  17301. }
  17302. return ret, nil
  17303. // {
  17304. // "description": "Retrieves the ratings that the authorized user gave to a list of specified videos.",
  17305. // "httpMethod": "GET",
  17306. // "id": "youtube.videos.getRating",
  17307. // "parameterOrder": [
  17308. // "id"
  17309. // ],
  17310. // "parameters": {
  17311. // "id": {
  17312. // "description": "The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) for which you are retrieving rating data. In a video resource, the id property specifies the video's ID.",
  17313. // "location": "query",
  17314. // "required": true,
  17315. // "type": "string"
  17316. // },
  17317. // "onBehalfOfContentOwner": {
  17318. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  17319. // "location": "query",
  17320. // "type": "string"
  17321. // }
  17322. // },
  17323. // "path": "videos/getRating",
  17324. // "response": {
  17325. // "$ref": "VideoGetRatingResponse"
  17326. // },
  17327. // "scopes": [
  17328. // "https://www.googleapis.com/auth/youtube",
  17329. // "https://www.googleapis.com/auth/youtube.force-ssl",
  17330. // "https://www.googleapis.com/auth/youtubepartner"
  17331. // ]
  17332. // }
  17333. }
  17334. // method id "youtube.videos.insert":
  17335. type VideosInsertCall struct {
  17336. s *Service
  17337. video *Video
  17338. urlParams_ gensupport.URLParams
  17339. media_ io.Reader
  17340. resumableBuffer_ *gensupport.ResumableBuffer
  17341. mediaType_ string
  17342. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  17343. progressUpdater_ googleapi.ProgressUpdater
  17344. ctx_ context.Context
  17345. }
  17346. // Insert: Uploads a video to YouTube and optionally sets the video's
  17347. // metadata.
  17348. func (r *VideosService) Insert(part string, video *Video) *VideosInsertCall {
  17349. c := &VideosInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17350. c.urlParams_.Set("part", part)
  17351. c.video = video
  17352. return c
  17353. }
  17354. // AutoLevels sets the optional parameter "autoLevels": The autoLevels
  17355. // parameter indicates whether YouTube should automatically enhance the
  17356. // video's lighting and color.
  17357. func (c *VideosInsertCall) AutoLevels(autoLevels bool) *VideosInsertCall {
  17358. c.urlParams_.Set("autoLevels", fmt.Sprint(autoLevels))
  17359. return c
  17360. }
  17361. // NotifySubscribers sets the optional parameter "notifySubscribers":
  17362. // The notifySubscribers parameter indicates whether YouTube should send
  17363. // a notification about the new video to users who subscribe to the
  17364. // video's channel. A parameter value of True indicates that subscribers
  17365. // will be notified of newly uploaded videos. However, a channel owner
  17366. // who is uploading many videos might prefer to set the value to False
  17367. // to avoid sending a notification about each new video to the channel's
  17368. // subscribers.
  17369. func (c *VideosInsertCall) NotifySubscribers(notifySubscribers bool) *VideosInsertCall {
  17370. c.urlParams_.Set("notifySubscribers", fmt.Sprint(notifySubscribers))
  17371. return c
  17372. }
  17373. // OnBehalfOfContentOwner sets the optional parameter
  17374. // "onBehalfOfContentOwner": Note: This parameter is intended
  17375. // exclusively for YouTube content partners.
  17376. //
  17377. // The onBehalfOfContentOwner parameter indicates that the request's
  17378. // authorization credentials identify a YouTube CMS user who is acting
  17379. // on behalf of the content owner specified in the parameter value. This
  17380. // parameter is intended for YouTube content partners that own and
  17381. // manage many different YouTube channels. It allows content owners to
  17382. // authenticate once and get access to all their video and channel data,
  17383. // without having to provide authentication credentials for each
  17384. // individual channel. The CMS account that the user authenticates with
  17385. // must be linked to the specified YouTube content owner.
  17386. func (c *VideosInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosInsertCall {
  17387. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  17388. return c
  17389. }
  17390. // OnBehalfOfContentOwnerChannel sets the optional parameter
  17391. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  17392. // properly authorized request. Note: This parameter is intended
  17393. // exclusively for YouTube content partners.
  17394. //
  17395. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  17396. // channel ID of the channel to which a video is being added. This
  17397. // parameter is required when a request specifies a value for the
  17398. // onBehalfOfContentOwner parameter, and it can only be used in
  17399. // conjunction with that parameter. In addition, the request must be
  17400. // authorized using a CMS account that is linked to the content owner
  17401. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  17402. // channel that the onBehalfOfContentOwnerChannel parameter value
  17403. // specifies must be linked to the content owner that the
  17404. // onBehalfOfContentOwner parameter specifies.
  17405. //
  17406. // This parameter is intended for YouTube content partners that own and
  17407. // manage many different YouTube channels. It allows content owners to
  17408. // authenticate once and perform actions on behalf of the channel
  17409. // specified in the parameter value, without having to provide
  17410. // authentication credentials for each separate channel.
  17411. func (c *VideosInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *VideosInsertCall {
  17412. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  17413. return c
  17414. }
  17415. // Stabilize sets the optional parameter "stabilize": The stabilize
  17416. // parameter indicates whether YouTube should adjust the video to remove
  17417. // shaky camera motions.
  17418. func (c *VideosInsertCall) Stabilize(stabilize bool) *VideosInsertCall {
  17419. c.urlParams_.Set("stabilize", fmt.Sprint(stabilize))
  17420. return c
  17421. }
  17422. // Media specifies the media to upload in one or more chunks. The chunk
  17423. // size may be controlled by supplying a MediaOption generated by
  17424. // googleapi.ChunkSize. The chunk size defaults to
  17425. // googleapi.DefaultUploadChunkSize.
  17426. // At most one of Media and ResumableMedia may be set.
  17427. func (c *VideosInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *VideosInsertCall {
  17428. opts := googleapi.ProcessMediaOptions(options)
  17429. chunkSize := opts.ChunkSize
  17430. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  17431. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  17432. return c
  17433. }
  17434. // ResumableMedia specifies the media to upload in chunks and can be
  17435. // canceled with ctx.
  17436. //
  17437. // Deprecated: use Media instead.
  17438. //
  17439. // At most one of Media and ResumableMedia may be set. mediaType
  17440. // identifies the MIME media type of the upload, such as "image/png". If
  17441. // mediaType is "", it will be auto-detected. The provided ctx will
  17442. // supersede any context previously provided to the Context method.
  17443. func (c *VideosInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *VideosInsertCall {
  17444. c.ctx_ = ctx
  17445. rdr := gensupport.ReaderAtToReader(r, size)
  17446. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  17447. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  17448. c.media_ = nil
  17449. c.mediaSize_ = size
  17450. return c
  17451. }
  17452. // ProgressUpdater provides a callback function that will be called
  17453. // after every chunk. It should be a low-latency function in order to
  17454. // not slow down the upload operation. This should only be called when
  17455. // using ResumableMedia (as opposed to Media).
  17456. func (c *VideosInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *VideosInsertCall {
  17457. c.progressUpdater_ = pu
  17458. return c
  17459. }
  17460. // Fields allows partial responses to be retrieved. See
  17461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17462. // for more information.
  17463. func (c *VideosInsertCall) Fields(s ...googleapi.Field) *VideosInsertCall {
  17464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17465. return c
  17466. }
  17467. // Context sets the context to be used in this call's Do method. Any
  17468. // pending HTTP request will be aborted if the provided context is
  17469. // canceled.
  17470. // This context will supersede any context previously provided to the
  17471. // ResumableMedia method.
  17472. func (c *VideosInsertCall) Context(ctx context.Context) *VideosInsertCall {
  17473. c.ctx_ = ctx
  17474. return c
  17475. }
  17476. func (c *VideosInsertCall) doRequest(alt string) (*http.Response, error) {
  17477. var body io.Reader = nil
  17478. body, err := googleapi.WithoutDataWrapper.JSONReader(c.video)
  17479. if err != nil {
  17480. return nil, err
  17481. }
  17482. ctype := "application/json"
  17483. c.urlParams_.Set("alt", alt)
  17484. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  17485. if c.media_ != nil || c.resumableBuffer_ != nil {
  17486. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  17487. protocol := "multipart"
  17488. if c.resumableBuffer_ != nil {
  17489. protocol = "resumable"
  17490. }
  17491. c.urlParams_.Set("uploadType", protocol)
  17492. }
  17493. urls += "?" + c.urlParams_.Encode()
  17494. if c.media_ != nil {
  17495. var combined io.ReadCloser
  17496. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  17497. defer combined.Close()
  17498. body = combined
  17499. }
  17500. req, _ := http.NewRequest("POST", urls, body)
  17501. googleapi.SetOpaque(req.URL)
  17502. if c.resumableBuffer_ != nil {
  17503. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  17504. }
  17505. req.Header.Set("Content-Type", ctype)
  17506. req.Header.Set("User-Agent", c.s.userAgent())
  17507. if c.ctx_ != nil {
  17508. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17509. }
  17510. return c.s.client.Do(req)
  17511. }
  17512. // Do executes the "youtube.videos.insert" call.
  17513. // Exactly one of *Video or error will be non-nil. Any non-2xx status
  17514. // code is an error. Response headers are in either
  17515. // *Video.ServerResponse.Header or (if a response was returned at all)
  17516. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  17517. // check whether the returned error was because http.StatusNotModified
  17518. // was returned.
  17519. func (c *VideosInsertCall) Do(opts ...googleapi.CallOption) (*Video, error) {
  17520. gensupport.SetOptions(c.urlParams_, opts...)
  17521. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  17522. return c.doRequest("json")
  17523. }, gensupport.DefaultBackoffStrategy())
  17524. if res != nil && res.StatusCode == http.StatusNotModified {
  17525. if res.Body != nil {
  17526. res.Body.Close()
  17527. }
  17528. return nil, &googleapi.Error{
  17529. Code: res.StatusCode,
  17530. Header: res.Header,
  17531. }
  17532. }
  17533. if err != nil {
  17534. return nil, err
  17535. }
  17536. defer googleapi.CloseBody(res)
  17537. if err := googleapi.CheckResponse(res); err != nil {
  17538. return nil, err
  17539. }
  17540. if c.resumableBuffer_ != nil {
  17541. loc := res.Header.Get("Location")
  17542. rx := &gensupport.ResumableUpload{
  17543. Client: c.s.client,
  17544. UserAgent: c.s.userAgent(),
  17545. URI: loc,
  17546. Media: c.resumableBuffer_,
  17547. MediaType: c.mediaType_,
  17548. Callback: func(curr int64) {
  17549. if c.progressUpdater_ != nil {
  17550. c.progressUpdater_(curr, c.mediaSize_)
  17551. }
  17552. },
  17553. }
  17554. ctx := c.ctx_
  17555. if ctx == nil {
  17556. ctx = context.TODO()
  17557. }
  17558. res, err = rx.Upload(ctx)
  17559. if err != nil {
  17560. return nil, err
  17561. }
  17562. defer res.Body.Close()
  17563. if err := googleapi.CheckResponse(res); err != nil {
  17564. return nil, err
  17565. }
  17566. }
  17567. ret := &Video{
  17568. ServerResponse: googleapi.ServerResponse{
  17569. Header: res.Header,
  17570. HTTPStatusCode: res.StatusCode,
  17571. },
  17572. }
  17573. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17574. return nil, err
  17575. }
  17576. return ret, nil
  17577. // {
  17578. // "description": "Uploads a video to YouTube and optionally sets the video's metadata.",
  17579. // "httpMethod": "POST",
  17580. // "id": "youtube.videos.insert",
  17581. // "mediaUpload": {
  17582. // "accept": [
  17583. // "application/octet-stream",
  17584. // "video/*"
  17585. // ],
  17586. // "maxSize": "64GB",
  17587. // "protocols": {
  17588. // "resumable": {
  17589. // "multipart": true,
  17590. // "path": "/resumable/upload/youtube/v3/videos"
  17591. // },
  17592. // "simple": {
  17593. // "multipart": true,
  17594. // "path": "/upload/youtube/v3/videos"
  17595. // }
  17596. // }
  17597. // },
  17598. // "parameterOrder": [
  17599. // "part"
  17600. // ],
  17601. // "parameters": {
  17602. // "autoLevels": {
  17603. // "description": "The autoLevels parameter indicates whether YouTube should automatically enhance the video's lighting and color.",
  17604. // "location": "query",
  17605. // "type": "boolean"
  17606. // },
  17607. // "notifySubscribers": {
  17608. // "default": "true",
  17609. // "description": "The notifySubscribers parameter indicates whether YouTube should send a notification about the new video to users who subscribe to the video's channel. A parameter value of True indicates that subscribers will be notified of newly uploaded videos. However, a channel owner who is uploading many videos might prefer to set the value to False to avoid sending a notification about each new video to the channel's subscribers.",
  17610. // "location": "query",
  17611. // "type": "boolean"
  17612. // },
  17613. // "onBehalfOfContentOwner": {
  17614. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  17615. // "location": "query",
  17616. // "type": "string"
  17617. // },
  17618. // "onBehalfOfContentOwnerChannel": {
  17619. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  17620. // "location": "query",
  17621. // "type": "string"
  17622. // },
  17623. // "part": {
  17624. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.",
  17625. // "location": "query",
  17626. // "required": true,
  17627. // "type": "string"
  17628. // },
  17629. // "stabilize": {
  17630. // "description": "The stabilize parameter indicates whether YouTube should adjust the video to remove shaky camera motions.",
  17631. // "location": "query",
  17632. // "type": "boolean"
  17633. // }
  17634. // },
  17635. // "path": "videos",
  17636. // "request": {
  17637. // "$ref": "Video"
  17638. // },
  17639. // "response": {
  17640. // "$ref": "Video"
  17641. // },
  17642. // "scopes": [
  17643. // "https://www.googleapis.com/auth/youtube",
  17644. // "https://www.googleapis.com/auth/youtube.force-ssl",
  17645. // "https://www.googleapis.com/auth/youtube.upload",
  17646. // "https://www.googleapis.com/auth/youtubepartner"
  17647. // ],
  17648. // "supportsMediaUpload": true
  17649. // }
  17650. }
  17651. // method id "youtube.videos.list":
  17652. type VideosListCall struct {
  17653. s *Service
  17654. urlParams_ gensupport.URLParams
  17655. ifNoneMatch_ string
  17656. ctx_ context.Context
  17657. }
  17658. // List: Returns a list of videos that match the API request parameters.
  17659. func (r *VideosService) List(part string) *VideosListCall {
  17660. c := &VideosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17661. c.urlParams_.Set("part", part)
  17662. return c
  17663. }
  17664. // Chart sets the optional parameter "chart": The chart parameter
  17665. // identifies the chart that you want to retrieve.
  17666. //
  17667. // Possible values:
  17668. // "mostPopular" - Return the most popular videos for the specified
  17669. // content region and video category.
  17670. func (c *VideosListCall) Chart(chart string) *VideosListCall {
  17671. c.urlParams_.Set("chart", chart)
  17672. return c
  17673. }
  17674. // Hl sets the optional parameter "hl": The hl parameter instructs the
  17675. // API to retrieve localized resource metadata for a specific
  17676. // application language that the YouTube website supports. The parameter
  17677. // value must be a language code included in the list returned by the
  17678. // i18nLanguages.list method.
  17679. //
  17680. // If localized resource details are available in that language, the
  17681. // resource's snippet.localized object will contain the localized
  17682. // values. However, if localized details are not available, the
  17683. // snippet.localized object will contain resource details in the
  17684. // resource's default language.
  17685. func (c *VideosListCall) Hl(hl string) *VideosListCall {
  17686. c.urlParams_.Set("hl", hl)
  17687. return c
  17688. }
  17689. // Id sets the optional parameter "id": The id parameter specifies a
  17690. // comma-separated list of the YouTube video ID(s) for the resource(s)
  17691. // that are being retrieved. In a video resource, the id property
  17692. // specifies the video's ID.
  17693. func (c *VideosListCall) Id(id string) *VideosListCall {
  17694. c.urlParams_.Set("id", id)
  17695. return c
  17696. }
  17697. // Locale sets the optional parameter "locale": DEPRECATED
  17698. func (c *VideosListCall) Locale(locale string) *VideosListCall {
  17699. c.urlParams_.Set("locale", locale)
  17700. return c
  17701. }
  17702. // MaxResults sets the optional parameter "maxResults": The maxResults
  17703. // parameter specifies the maximum number of items that should be
  17704. // returned in the result set.
  17705. //
  17706. // Note: This parameter is supported for use in conjunction with the
  17707. // myRating parameter, but it is not supported for use in conjunction
  17708. // with the id parameter.
  17709. func (c *VideosListCall) MaxResults(maxResults int64) *VideosListCall {
  17710. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17711. return c
  17712. }
  17713. // MyRating sets the optional parameter "myRating": Set this parameter's
  17714. // value to like or dislike to instruct the API to only return videos
  17715. // liked or disliked by the authenticated user.
  17716. //
  17717. // Possible values:
  17718. // "dislike" - Returns only videos disliked by the authenticated user.
  17719. // "like" - Returns only video liked by the authenticated user.
  17720. func (c *VideosListCall) MyRating(myRating string) *VideosListCall {
  17721. c.urlParams_.Set("myRating", myRating)
  17722. return c
  17723. }
  17724. // OnBehalfOfContentOwner sets the optional parameter
  17725. // "onBehalfOfContentOwner": Note: This parameter is intended
  17726. // exclusively for YouTube content partners.
  17727. //
  17728. // The onBehalfOfContentOwner parameter indicates that the request's
  17729. // authorization credentials identify a YouTube CMS user who is acting
  17730. // on behalf of the content owner specified in the parameter value. This
  17731. // parameter is intended for YouTube content partners that own and
  17732. // manage many different YouTube channels. It allows content owners to
  17733. // authenticate once and get access to all their video and channel data,
  17734. // without having to provide authentication credentials for each
  17735. // individual channel. The CMS account that the user authenticates with
  17736. // must be linked to the specified YouTube content owner.
  17737. func (c *VideosListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosListCall {
  17738. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  17739. return c
  17740. }
  17741. // PageToken sets the optional parameter "pageToken": The pageToken
  17742. // parameter identifies a specific page in the result set that should be
  17743. // returned. In an API response, the nextPageToken and prevPageToken
  17744. // properties identify other pages that could be retrieved.
  17745. //
  17746. // Note: This parameter is supported for use in conjunction with the
  17747. // myRating parameter, but it is not supported for use in conjunction
  17748. // with the id parameter.
  17749. func (c *VideosListCall) PageToken(pageToken string) *VideosListCall {
  17750. c.urlParams_.Set("pageToken", pageToken)
  17751. return c
  17752. }
  17753. // RegionCode sets the optional parameter "regionCode": The regionCode
  17754. // parameter instructs the API to select a video chart available in the
  17755. // specified region. This parameter can only be used in conjunction with
  17756. // the chart parameter. The parameter value is an ISO 3166-1 alpha-2
  17757. // country code.
  17758. func (c *VideosListCall) RegionCode(regionCode string) *VideosListCall {
  17759. c.urlParams_.Set("regionCode", regionCode)
  17760. return c
  17761. }
  17762. // VideoCategoryId sets the optional parameter "videoCategoryId": The
  17763. // videoCategoryId parameter identifies the video category for which the
  17764. // chart should be retrieved. This parameter can only be used in
  17765. // conjunction with the chart parameter. By default, charts are not
  17766. // restricted to a particular category.
  17767. func (c *VideosListCall) VideoCategoryId(videoCategoryId string) *VideosListCall {
  17768. c.urlParams_.Set("videoCategoryId", videoCategoryId)
  17769. return c
  17770. }
  17771. // Fields allows partial responses to be retrieved. See
  17772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17773. // for more information.
  17774. func (c *VideosListCall) Fields(s ...googleapi.Field) *VideosListCall {
  17775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17776. return c
  17777. }
  17778. // IfNoneMatch sets the optional parameter which makes the operation
  17779. // fail if the object's ETag matches the given value. This is useful for
  17780. // getting updates only after the object has changed since the last
  17781. // request. Use googleapi.IsNotModified to check whether the response
  17782. // error from Do is the result of In-None-Match.
  17783. func (c *VideosListCall) IfNoneMatch(entityTag string) *VideosListCall {
  17784. c.ifNoneMatch_ = entityTag
  17785. return c
  17786. }
  17787. // Context sets the context to be used in this call's Do method. Any
  17788. // pending HTTP request will be aborted if the provided context is
  17789. // canceled.
  17790. func (c *VideosListCall) Context(ctx context.Context) *VideosListCall {
  17791. c.ctx_ = ctx
  17792. return c
  17793. }
  17794. func (c *VideosListCall) doRequest(alt string) (*http.Response, error) {
  17795. var body io.Reader = nil
  17796. c.urlParams_.Set("alt", alt)
  17797. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  17798. urls += "?" + c.urlParams_.Encode()
  17799. req, _ := http.NewRequest("GET", urls, body)
  17800. googleapi.SetOpaque(req.URL)
  17801. req.Header.Set("User-Agent", c.s.userAgent())
  17802. if c.ifNoneMatch_ != "" {
  17803. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  17804. }
  17805. if c.ctx_ != nil {
  17806. return ctxhttp.Do(c.ctx_, c.s.client, req)
  17807. }
  17808. return c.s.client.Do(req)
  17809. }
  17810. // Do executes the "youtube.videos.list" call.
  17811. // Exactly one of *VideoListResponse or error will be non-nil. Any
  17812. // non-2xx status code is an error. Response headers are in either
  17813. // *VideoListResponse.ServerResponse.Header or (if a response was
  17814. // returned at all) in error.(*googleapi.Error).Header. Use
  17815. // googleapi.IsNotModified to check whether the returned error was
  17816. // because http.StatusNotModified was returned.
  17817. func (c *VideosListCall) Do(opts ...googleapi.CallOption) (*VideoListResponse, error) {
  17818. gensupport.SetOptions(c.urlParams_, opts...)
  17819. res, err := c.doRequest("json")
  17820. if res != nil && res.StatusCode == http.StatusNotModified {
  17821. if res.Body != nil {
  17822. res.Body.Close()
  17823. }
  17824. return nil, &googleapi.Error{
  17825. Code: res.StatusCode,
  17826. Header: res.Header,
  17827. }
  17828. }
  17829. if err != nil {
  17830. return nil, err
  17831. }
  17832. defer googleapi.CloseBody(res)
  17833. if err := googleapi.CheckResponse(res); err != nil {
  17834. return nil, err
  17835. }
  17836. ret := &VideoListResponse{
  17837. ServerResponse: googleapi.ServerResponse{
  17838. Header: res.Header,
  17839. HTTPStatusCode: res.StatusCode,
  17840. },
  17841. }
  17842. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  17843. return nil, err
  17844. }
  17845. return ret, nil
  17846. // {
  17847. // "description": "Returns a list of videos that match the API request parameters.",
  17848. // "httpMethod": "GET",
  17849. // "id": "youtube.videos.list",
  17850. // "parameterOrder": [
  17851. // "part"
  17852. // ],
  17853. // "parameters": {
  17854. // "chart": {
  17855. // "description": "The chart parameter identifies the chart that you want to retrieve.",
  17856. // "enum": [
  17857. // "mostPopular"
  17858. // ],
  17859. // "enumDescriptions": [
  17860. // "Return the most popular videos for the specified content region and video category."
  17861. // ],
  17862. // "location": "query",
  17863. // "type": "string"
  17864. // },
  17865. // "hl": {
  17866. // "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.",
  17867. // "location": "query",
  17868. // "type": "string"
  17869. // },
  17870. // "id": {
  17871. // "description": "The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID.",
  17872. // "location": "query",
  17873. // "type": "string"
  17874. // },
  17875. // "locale": {
  17876. // "description": "DEPRECATED",
  17877. // "location": "query",
  17878. // "type": "string"
  17879. // },
  17880. // "maxResults": {
  17881. // "default": "5",
  17882. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is supported for use in conjunction with the myRating parameter, but it is not supported for use in conjunction with the id parameter.",
  17883. // "format": "uint32",
  17884. // "location": "query",
  17885. // "maximum": "50",
  17886. // "minimum": "1",
  17887. // "type": "integer"
  17888. // },
  17889. // "myRating": {
  17890. // "description": "Set this parameter's value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user.",
  17891. // "enum": [
  17892. // "dislike",
  17893. // "like"
  17894. // ],
  17895. // "enumDescriptions": [
  17896. // "Returns only videos disliked by the authenticated user.",
  17897. // "Returns only video liked by the authenticated user."
  17898. // ],
  17899. // "location": "query",
  17900. // "type": "string"
  17901. // },
  17902. // "onBehalfOfContentOwner": {
  17903. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  17904. // "location": "query",
  17905. // "type": "string"
  17906. // },
  17907. // "pageToken": {
  17908. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.\n\nNote: This parameter is supported for use in conjunction with the myRating parameter, but it is not supported for use in conjunction with the id parameter.",
  17909. // "location": "query",
  17910. // "type": "string"
  17911. // },
  17912. // "part": {
  17913. // "description": "The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties.",
  17914. // "location": "query",
  17915. // "required": true,
  17916. // "type": "string"
  17917. // },
  17918. // "regionCode": {
  17919. // "description": "The regionCode parameter instructs the API to select a video chart available in the specified region. This parameter can only be used in conjunction with the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code.",
  17920. // "location": "query",
  17921. // "type": "string"
  17922. // },
  17923. // "videoCategoryId": {
  17924. // "default": "0",
  17925. // "description": "The videoCategoryId parameter identifies the video category for which the chart should be retrieved. This parameter can only be used in conjunction with the chart parameter. By default, charts are not restricted to a particular category.",
  17926. // "location": "query",
  17927. // "type": "string"
  17928. // }
  17929. // },
  17930. // "path": "videos",
  17931. // "response": {
  17932. // "$ref": "VideoListResponse"
  17933. // },
  17934. // "scopes": [
  17935. // "https://www.googleapis.com/auth/youtube",
  17936. // "https://www.googleapis.com/auth/youtube.force-ssl",
  17937. // "https://www.googleapis.com/auth/youtube.readonly",
  17938. // "https://www.googleapis.com/auth/youtubepartner"
  17939. // ]
  17940. // }
  17941. }
  17942. // Pages invokes f for each page of results.
  17943. // A non-nil error returned from f will halt the iteration.
  17944. // The provided context supersedes any context provided to the Context method.
  17945. func (c *VideosListCall) Pages(ctx context.Context, f func(*VideoListResponse) error) error {
  17946. c.ctx_ = ctx
  17947. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17948. for {
  17949. x, err := c.Do()
  17950. if err != nil {
  17951. return err
  17952. }
  17953. if err := f(x); err != nil {
  17954. return err
  17955. }
  17956. if x.NextPageToken == "" {
  17957. return nil
  17958. }
  17959. c.PageToken(x.NextPageToken)
  17960. }
  17961. }
  17962. // method id "youtube.videos.rate":
  17963. type VideosRateCall struct {
  17964. s *Service
  17965. urlParams_ gensupport.URLParams
  17966. ctx_ context.Context
  17967. }
  17968. // Rate: Add a like or dislike rating to a video or remove a rating from
  17969. // a video.
  17970. func (r *VideosService) Rate(id string, rating string) *VideosRateCall {
  17971. c := &VideosRateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17972. c.urlParams_.Set("id", id)
  17973. c.urlParams_.Set("rating", rating)
  17974. return c
  17975. }
  17976. // Fields allows partial responses to be retrieved. See
  17977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17978. // for more information.
  17979. func (c *VideosRateCall) Fields(s ...googleapi.Field) *VideosRateCall {
  17980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17981. return c
  17982. }
  17983. // Context sets the context to be used in this call's Do method. Any
  17984. // pending HTTP request will be aborted if the provided context is
  17985. // canceled.
  17986. func (c *VideosRateCall) Context(ctx context.Context) *VideosRateCall {
  17987. c.ctx_ = ctx
  17988. return c
  17989. }
  17990. func (c *VideosRateCall) doRequest(alt string) (*http.Response, error) {
  17991. var body io.Reader = nil
  17992. c.urlParams_.Set("alt", alt)
  17993. urls := googleapi.ResolveRelative(c.s.BasePath, "videos/rate")
  17994. urls += "?" + c.urlParams_.Encode()
  17995. req, _ := http.NewRequest("POST", urls, body)
  17996. googleapi.SetOpaque(req.URL)
  17997. req.Header.Set("User-Agent", c.s.userAgent())
  17998. if c.ctx_ != nil {
  17999. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18000. }
  18001. return c.s.client.Do(req)
  18002. }
  18003. // Do executes the "youtube.videos.rate" call.
  18004. func (c *VideosRateCall) Do(opts ...googleapi.CallOption) error {
  18005. gensupport.SetOptions(c.urlParams_, opts...)
  18006. res, err := c.doRequest("json")
  18007. if err != nil {
  18008. return err
  18009. }
  18010. defer googleapi.CloseBody(res)
  18011. if err := googleapi.CheckResponse(res); err != nil {
  18012. return err
  18013. }
  18014. return nil
  18015. // {
  18016. // "description": "Add a like or dislike rating to a video or remove a rating from a video.",
  18017. // "httpMethod": "POST",
  18018. // "id": "youtube.videos.rate",
  18019. // "parameterOrder": [
  18020. // "id",
  18021. // "rating"
  18022. // ],
  18023. // "parameters": {
  18024. // "id": {
  18025. // "description": "The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed.",
  18026. // "location": "query",
  18027. // "required": true,
  18028. // "type": "string"
  18029. // },
  18030. // "rating": {
  18031. // "description": "Specifies the rating to record.",
  18032. // "enum": [
  18033. // "dislike",
  18034. // "like",
  18035. // "none"
  18036. // ],
  18037. // "enumDescriptions": [
  18038. // "Records that the authenticated user disliked the video.",
  18039. // "Records that the authenticated user liked the video.",
  18040. // "Removes any rating that the authenticated user had previously set for the video."
  18041. // ],
  18042. // "location": "query",
  18043. // "required": true,
  18044. // "type": "string"
  18045. // }
  18046. // },
  18047. // "path": "videos/rate",
  18048. // "scopes": [
  18049. // "https://www.googleapis.com/auth/youtube",
  18050. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18051. // "https://www.googleapis.com/auth/youtubepartner"
  18052. // ]
  18053. // }
  18054. }
  18055. // method id "youtube.videos.reportAbuse":
  18056. type VideosReportAbuseCall struct {
  18057. s *Service
  18058. videoabusereport *VideoAbuseReport
  18059. urlParams_ gensupport.URLParams
  18060. ctx_ context.Context
  18061. }
  18062. // ReportAbuse: Report abuse for a video.
  18063. func (r *VideosService) ReportAbuse(videoabusereport *VideoAbuseReport) *VideosReportAbuseCall {
  18064. c := &VideosReportAbuseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18065. c.videoabusereport = videoabusereport
  18066. return c
  18067. }
  18068. // OnBehalfOfContentOwner sets the optional parameter
  18069. // "onBehalfOfContentOwner": Note: This parameter is intended
  18070. // exclusively for YouTube content partners.
  18071. //
  18072. // The onBehalfOfContentOwner parameter indicates that the request's
  18073. // authorization credentials identify a YouTube CMS user who is acting
  18074. // on behalf of the content owner specified in the parameter value. This
  18075. // parameter is intended for YouTube content partners that own and
  18076. // manage many different YouTube channels. It allows content owners to
  18077. // authenticate once and get access to all their video and channel data,
  18078. // without having to provide authentication credentials for each
  18079. // individual channel. The CMS account that the user authenticates with
  18080. // must be linked to the specified YouTube content owner.
  18081. func (c *VideosReportAbuseCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosReportAbuseCall {
  18082. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  18083. return c
  18084. }
  18085. // Fields allows partial responses to be retrieved. See
  18086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18087. // for more information.
  18088. func (c *VideosReportAbuseCall) Fields(s ...googleapi.Field) *VideosReportAbuseCall {
  18089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18090. return c
  18091. }
  18092. // Context sets the context to be used in this call's Do method. Any
  18093. // pending HTTP request will be aborted if the provided context is
  18094. // canceled.
  18095. func (c *VideosReportAbuseCall) Context(ctx context.Context) *VideosReportAbuseCall {
  18096. c.ctx_ = ctx
  18097. return c
  18098. }
  18099. func (c *VideosReportAbuseCall) doRequest(alt string) (*http.Response, error) {
  18100. var body io.Reader = nil
  18101. body, err := googleapi.WithoutDataWrapper.JSONReader(c.videoabusereport)
  18102. if err != nil {
  18103. return nil, err
  18104. }
  18105. ctype := "application/json"
  18106. c.urlParams_.Set("alt", alt)
  18107. urls := googleapi.ResolveRelative(c.s.BasePath, "videos/reportAbuse")
  18108. urls += "?" + c.urlParams_.Encode()
  18109. req, _ := http.NewRequest("POST", urls, body)
  18110. googleapi.SetOpaque(req.URL)
  18111. req.Header.Set("Content-Type", ctype)
  18112. req.Header.Set("User-Agent", c.s.userAgent())
  18113. if c.ctx_ != nil {
  18114. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18115. }
  18116. return c.s.client.Do(req)
  18117. }
  18118. // Do executes the "youtube.videos.reportAbuse" call.
  18119. func (c *VideosReportAbuseCall) Do(opts ...googleapi.CallOption) error {
  18120. gensupport.SetOptions(c.urlParams_, opts...)
  18121. res, err := c.doRequest("json")
  18122. if err != nil {
  18123. return err
  18124. }
  18125. defer googleapi.CloseBody(res)
  18126. if err := googleapi.CheckResponse(res); err != nil {
  18127. return err
  18128. }
  18129. return nil
  18130. // {
  18131. // "description": "Report abuse for a video.",
  18132. // "httpMethod": "POST",
  18133. // "id": "youtube.videos.reportAbuse",
  18134. // "parameters": {
  18135. // "onBehalfOfContentOwner": {
  18136. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  18137. // "location": "query",
  18138. // "type": "string"
  18139. // }
  18140. // },
  18141. // "path": "videos/reportAbuse",
  18142. // "request": {
  18143. // "$ref": "VideoAbuseReport"
  18144. // },
  18145. // "scopes": [
  18146. // "https://www.googleapis.com/auth/youtube",
  18147. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18148. // "https://www.googleapis.com/auth/youtubepartner"
  18149. // ]
  18150. // }
  18151. }
  18152. // method id "youtube.videos.update":
  18153. type VideosUpdateCall struct {
  18154. s *Service
  18155. video *Video
  18156. urlParams_ gensupport.URLParams
  18157. ctx_ context.Context
  18158. }
  18159. // Update: Updates a video's metadata.
  18160. func (r *VideosService) Update(part string, video *Video) *VideosUpdateCall {
  18161. c := &VideosUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18162. c.urlParams_.Set("part", part)
  18163. c.video = video
  18164. return c
  18165. }
  18166. // OnBehalfOfContentOwner sets the optional parameter
  18167. // "onBehalfOfContentOwner": Note: This parameter is intended
  18168. // exclusively for YouTube content partners.
  18169. //
  18170. // The onBehalfOfContentOwner parameter indicates that the request's
  18171. // authorization credentials identify a YouTube CMS user who is acting
  18172. // on behalf of the content owner specified in the parameter value. This
  18173. // parameter is intended for YouTube content partners that own and
  18174. // manage many different YouTube channels. It allows content owners to
  18175. // authenticate once and get access to all their video and channel data,
  18176. // without having to provide authentication credentials for each
  18177. // individual channel. The actual CMS account that the user
  18178. // authenticates with must be linked to the specified YouTube content
  18179. // owner.
  18180. func (c *VideosUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosUpdateCall {
  18181. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  18182. return c
  18183. }
  18184. // Fields allows partial responses to be retrieved. See
  18185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18186. // for more information.
  18187. func (c *VideosUpdateCall) Fields(s ...googleapi.Field) *VideosUpdateCall {
  18188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18189. return c
  18190. }
  18191. // Context sets the context to be used in this call's Do method. Any
  18192. // pending HTTP request will be aborted if the provided context is
  18193. // canceled.
  18194. func (c *VideosUpdateCall) Context(ctx context.Context) *VideosUpdateCall {
  18195. c.ctx_ = ctx
  18196. return c
  18197. }
  18198. func (c *VideosUpdateCall) doRequest(alt string) (*http.Response, error) {
  18199. var body io.Reader = nil
  18200. body, err := googleapi.WithoutDataWrapper.JSONReader(c.video)
  18201. if err != nil {
  18202. return nil, err
  18203. }
  18204. ctype := "application/json"
  18205. c.urlParams_.Set("alt", alt)
  18206. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  18207. urls += "?" + c.urlParams_.Encode()
  18208. req, _ := http.NewRequest("PUT", urls, body)
  18209. googleapi.SetOpaque(req.URL)
  18210. req.Header.Set("Content-Type", ctype)
  18211. req.Header.Set("User-Agent", c.s.userAgent())
  18212. if c.ctx_ != nil {
  18213. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18214. }
  18215. return c.s.client.Do(req)
  18216. }
  18217. // Do executes the "youtube.videos.update" call.
  18218. // Exactly one of *Video or error will be non-nil. Any non-2xx status
  18219. // code is an error. Response headers are in either
  18220. // *Video.ServerResponse.Header or (if a response was returned at all)
  18221. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  18222. // check whether the returned error was because http.StatusNotModified
  18223. // was returned.
  18224. func (c *VideosUpdateCall) Do(opts ...googleapi.CallOption) (*Video, error) {
  18225. gensupport.SetOptions(c.urlParams_, opts...)
  18226. res, err := c.doRequest("json")
  18227. if res != nil && res.StatusCode == http.StatusNotModified {
  18228. if res.Body != nil {
  18229. res.Body.Close()
  18230. }
  18231. return nil, &googleapi.Error{
  18232. Code: res.StatusCode,
  18233. Header: res.Header,
  18234. }
  18235. }
  18236. if err != nil {
  18237. return nil, err
  18238. }
  18239. defer googleapi.CloseBody(res)
  18240. if err := googleapi.CheckResponse(res); err != nil {
  18241. return nil, err
  18242. }
  18243. ret := &Video{
  18244. ServerResponse: googleapi.ServerResponse{
  18245. Header: res.Header,
  18246. HTTPStatusCode: res.StatusCode,
  18247. },
  18248. }
  18249. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  18250. return nil, err
  18251. }
  18252. return ret, nil
  18253. // {
  18254. // "description": "Updates a video's metadata.",
  18255. // "httpMethod": "PUT",
  18256. // "id": "youtube.videos.update",
  18257. // "parameterOrder": [
  18258. // "part"
  18259. // ],
  18260. // "parameters": {
  18261. // "onBehalfOfContentOwner": {
  18262. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  18263. // "location": "query",
  18264. // "type": "string"
  18265. // },
  18266. // "part": {
  18267. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting.\n\nIn addition, not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.",
  18268. // "location": "query",
  18269. // "required": true,
  18270. // "type": "string"
  18271. // }
  18272. // },
  18273. // "path": "videos",
  18274. // "request": {
  18275. // "$ref": "Video"
  18276. // },
  18277. // "response": {
  18278. // "$ref": "Video"
  18279. // },
  18280. // "scopes": [
  18281. // "https://www.googleapis.com/auth/youtube",
  18282. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18283. // "https://www.googleapis.com/auth/youtubepartner"
  18284. // ]
  18285. // }
  18286. }
  18287. // method id "youtube.watermarks.set":
  18288. type WatermarksSetCall struct {
  18289. s *Service
  18290. invideobranding *InvideoBranding
  18291. urlParams_ gensupport.URLParams
  18292. media_ io.Reader
  18293. resumableBuffer_ *gensupport.ResumableBuffer
  18294. mediaType_ string
  18295. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  18296. progressUpdater_ googleapi.ProgressUpdater
  18297. ctx_ context.Context
  18298. }
  18299. // Set: Uploads a watermark image to YouTube and sets it for a channel.
  18300. func (r *WatermarksService) Set(channelId string, invideobranding *InvideoBranding) *WatermarksSetCall {
  18301. c := &WatermarksSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18302. c.urlParams_.Set("channelId", channelId)
  18303. c.invideobranding = invideobranding
  18304. return c
  18305. }
  18306. // OnBehalfOfContentOwner sets the optional parameter
  18307. // "onBehalfOfContentOwner": Note: This parameter is intended
  18308. // exclusively for YouTube content partners.
  18309. //
  18310. // The onBehalfOfContentOwner parameter indicates that the request's
  18311. // authorization credentials identify a YouTube CMS user who is acting
  18312. // on behalf of the content owner specified in the parameter value. This
  18313. // parameter is intended for YouTube content partners that own and
  18314. // manage many different YouTube channels. It allows content owners to
  18315. // authenticate once and get access to all their video and channel data,
  18316. // without having to provide authentication credentials for each
  18317. // individual channel. The CMS account that the user authenticates with
  18318. // must be linked to the specified YouTube content owner.
  18319. func (c *WatermarksSetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *WatermarksSetCall {
  18320. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  18321. return c
  18322. }
  18323. // Media specifies the media to upload in one or more chunks. The chunk
  18324. // size may be controlled by supplying a MediaOption generated by
  18325. // googleapi.ChunkSize. The chunk size defaults to
  18326. // googleapi.DefaultUploadChunkSize.
  18327. // At most one of Media and ResumableMedia may be set.
  18328. func (c *WatermarksSetCall) Media(r io.Reader, options ...googleapi.MediaOption) *WatermarksSetCall {
  18329. opts := googleapi.ProcessMediaOptions(options)
  18330. chunkSize := opts.ChunkSize
  18331. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  18332. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  18333. return c
  18334. }
  18335. // ResumableMedia specifies the media to upload in chunks and can be
  18336. // canceled with ctx.
  18337. //
  18338. // Deprecated: use Media instead.
  18339. //
  18340. // At most one of Media and ResumableMedia may be set. mediaType
  18341. // identifies the MIME media type of the upload, such as "image/png". If
  18342. // mediaType is "", it will be auto-detected. The provided ctx will
  18343. // supersede any context previously provided to the Context method.
  18344. func (c *WatermarksSetCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *WatermarksSetCall {
  18345. c.ctx_ = ctx
  18346. rdr := gensupport.ReaderAtToReader(r, size)
  18347. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  18348. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  18349. c.media_ = nil
  18350. c.mediaSize_ = size
  18351. return c
  18352. }
  18353. // ProgressUpdater provides a callback function that will be called
  18354. // after every chunk. It should be a low-latency function in order to
  18355. // not slow down the upload operation. This should only be called when
  18356. // using ResumableMedia (as opposed to Media).
  18357. func (c *WatermarksSetCall) ProgressUpdater(pu googleapi.ProgressUpdater) *WatermarksSetCall {
  18358. c.progressUpdater_ = pu
  18359. return c
  18360. }
  18361. // Fields allows partial responses to be retrieved. See
  18362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18363. // for more information.
  18364. func (c *WatermarksSetCall) Fields(s ...googleapi.Field) *WatermarksSetCall {
  18365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18366. return c
  18367. }
  18368. // Context sets the context to be used in this call's Do method. Any
  18369. // pending HTTP request will be aborted if the provided context is
  18370. // canceled.
  18371. // This context will supersede any context previously provided to the
  18372. // ResumableMedia method.
  18373. func (c *WatermarksSetCall) Context(ctx context.Context) *WatermarksSetCall {
  18374. c.ctx_ = ctx
  18375. return c
  18376. }
  18377. func (c *WatermarksSetCall) doRequest(alt string) (*http.Response, error) {
  18378. var body io.Reader = nil
  18379. body, err := googleapi.WithoutDataWrapper.JSONReader(c.invideobranding)
  18380. if err != nil {
  18381. return nil, err
  18382. }
  18383. ctype := "application/json"
  18384. c.urlParams_.Set("alt", alt)
  18385. urls := googleapi.ResolveRelative(c.s.BasePath, "watermarks/set")
  18386. if c.media_ != nil || c.resumableBuffer_ != nil {
  18387. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  18388. protocol := "multipart"
  18389. if c.resumableBuffer_ != nil {
  18390. protocol = "resumable"
  18391. }
  18392. c.urlParams_.Set("uploadType", protocol)
  18393. }
  18394. urls += "?" + c.urlParams_.Encode()
  18395. if c.media_ != nil {
  18396. var combined io.ReadCloser
  18397. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  18398. defer combined.Close()
  18399. body = combined
  18400. }
  18401. req, _ := http.NewRequest("POST", urls, body)
  18402. googleapi.SetOpaque(req.URL)
  18403. if c.resumableBuffer_ != nil {
  18404. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  18405. }
  18406. req.Header.Set("Content-Type", ctype)
  18407. req.Header.Set("User-Agent", c.s.userAgent())
  18408. if c.ctx_ != nil {
  18409. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18410. }
  18411. return c.s.client.Do(req)
  18412. }
  18413. // Do executes the "youtube.watermarks.set" call.
  18414. func (c *WatermarksSetCall) Do(opts ...googleapi.CallOption) error {
  18415. gensupport.SetOptions(c.urlParams_, opts...)
  18416. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  18417. return c.doRequest("json")
  18418. }, gensupport.DefaultBackoffStrategy())
  18419. if err != nil {
  18420. return err
  18421. }
  18422. defer googleapi.CloseBody(res)
  18423. if err := googleapi.CheckResponse(res); err != nil {
  18424. return err
  18425. }
  18426. if c.resumableBuffer_ != nil {
  18427. loc := res.Header.Get("Location")
  18428. rx := &gensupport.ResumableUpload{
  18429. Client: c.s.client,
  18430. UserAgent: c.s.userAgent(),
  18431. URI: loc,
  18432. Media: c.resumableBuffer_,
  18433. MediaType: c.mediaType_,
  18434. Callback: func(curr int64) {
  18435. if c.progressUpdater_ != nil {
  18436. c.progressUpdater_(curr, c.mediaSize_)
  18437. }
  18438. },
  18439. }
  18440. ctx := c.ctx_
  18441. if ctx == nil {
  18442. ctx = context.TODO()
  18443. }
  18444. res, err = rx.Upload(ctx)
  18445. if err != nil {
  18446. return err
  18447. }
  18448. defer res.Body.Close()
  18449. if err := googleapi.CheckResponse(res); err != nil {
  18450. return err
  18451. }
  18452. }
  18453. return nil
  18454. // {
  18455. // "description": "Uploads a watermark image to YouTube and sets it for a channel.",
  18456. // "httpMethod": "POST",
  18457. // "id": "youtube.watermarks.set",
  18458. // "mediaUpload": {
  18459. // "accept": [
  18460. // "application/octet-stream",
  18461. // "image/jpeg",
  18462. // "image/png"
  18463. // ],
  18464. // "maxSize": "10MB",
  18465. // "protocols": {
  18466. // "resumable": {
  18467. // "multipart": true,
  18468. // "path": "/resumable/upload/youtube/v3/watermarks/set"
  18469. // },
  18470. // "simple": {
  18471. // "multipart": true,
  18472. // "path": "/upload/youtube/v3/watermarks/set"
  18473. // }
  18474. // }
  18475. // },
  18476. // "parameterOrder": [
  18477. // "channelId"
  18478. // ],
  18479. // "parameters": {
  18480. // "channelId": {
  18481. // "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being provided.",
  18482. // "location": "query",
  18483. // "required": true,
  18484. // "type": "string"
  18485. // },
  18486. // "onBehalfOfContentOwner": {
  18487. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  18488. // "location": "query",
  18489. // "type": "string"
  18490. // }
  18491. // },
  18492. // "path": "watermarks/set",
  18493. // "request": {
  18494. // "$ref": "InvideoBranding"
  18495. // },
  18496. // "scopes": [
  18497. // "https://www.googleapis.com/auth/youtube",
  18498. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18499. // "https://www.googleapis.com/auth/youtube.upload",
  18500. // "https://www.googleapis.com/auth/youtubepartner"
  18501. // ],
  18502. // "supportsMediaUpload": true
  18503. // }
  18504. }
  18505. // method id "youtube.watermarks.unset":
  18506. type WatermarksUnsetCall struct {
  18507. s *Service
  18508. urlParams_ gensupport.URLParams
  18509. ctx_ context.Context
  18510. }
  18511. // Unset: Deletes a channel's watermark image.
  18512. func (r *WatermarksService) Unset(channelId string) *WatermarksUnsetCall {
  18513. c := &WatermarksUnsetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18514. c.urlParams_.Set("channelId", channelId)
  18515. return c
  18516. }
  18517. // OnBehalfOfContentOwner sets the optional parameter
  18518. // "onBehalfOfContentOwner": Note: This parameter is intended
  18519. // exclusively for YouTube content partners.
  18520. //
  18521. // The onBehalfOfContentOwner parameter indicates that the request's
  18522. // authorization credentials identify a YouTube CMS user who is acting
  18523. // on behalf of the content owner specified in the parameter value. This
  18524. // parameter is intended for YouTube content partners that own and
  18525. // manage many different YouTube channels. It allows content owners to
  18526. // authenticate once and get access to all their video and channel data,
  18527. // without having to provide authentication credentials for each
  18528. // individual channel. The CMS account that the user authenticates with
  18529. // must be linked to the specified YouTube content owner.
  18530. func (c *WatermarksUnsetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *WatermarksUnsetCall {
  18531. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  18532. return c
  18533. }
  18534. // Fields allows partial responses to be retrieved. See
  18535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18536. // for more information.
  18537. func (c *WatermarksUnsetCall) Fields(s ...googleapi.Field) *WatermarksUnsetCall {
  18538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18539. return c
  18540. }
  18541. // Context sets the context to be used in this call's Do method. Any
  18542. // pending HTTP request will be aborted if the provided context is
  18543. // canceled.
  18544. func (c *WatermarksUnsetCall) Context(ctx context.Context) *WatermarksUnsetCall {
  18545. c.ctx_ = ctx
  18546. return c
  18547. }
  18548. func (c *WatermarksUnsetCall) doRequest(alt string) (*http.Response, error) {
  18549. var body io.Reader = nil
  18550. c.urlParams_.Set("alt", alt)
  18551. urls := googleapi.ResolveRelative(c.s.BasePath, "watermarks/unset")
  18552. urls += "?" + c.urlParams_.Encode()
  18553. req, _ := http.NewRequest("POST", urls, body)
  18554. googleapi.SetOpaque(req.URL)
  18555. req.Header.Set("User-Agent", c.s.userAgent())
  18556. if c.ctx_ != nil {
  18557. return ctxhttp.Do(c.ctx_, c.s.client, req)
  18558. }
  18559. return c.s.client.Do(req)
  18560. }
  18561. // Do executes the "youtube.watermarks.unset" call.
  18562. func (c *WatermarksUnsetCall) Do(opts ...googleapi.CallOption) error {
  18563. gensupport.SetOptions(c.urlParams_, opts...)
  18564. res, err := c.doRequest("json")
  18565. if err != nil {
  18566. return err
  18567. }
  18568. defer googleapi.CloseBody(res)
  18569. if err := googleapi.CheckResponse(res); err != nil {
  18570. return err
  18571. }
  18572. return nil
  18573. // {
  18574. // "description": "Deletes a channel's watermark image.",
  18575. // "httpMethod": "POST",
  18576. // "id": "youtube.watermarks.unset",
  18577. // "parameterOrder": [
  18578. // "channelId"
  18579. // ],
  18580. // "parameters": {
  18581. // "channelId": {
  18582. // "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being unset.",
  18583. // "location": "query",
  18584. // "required": true,
  18585. // "type": "string"
  18586. // },
  18587. // "onBehalfOfContentOwner": {
  18588. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  18589. // "location": "query",
  18590. // "type": "string"
  18591. // }
  18592. // },
  18593. // "path": "watermarks/unset",
  18594. // "scopes": [
  18595. // "https://www.googleapis.com/auth/youtube",
  18596. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18597. // "https://www.googleapis.com/auth/youtubepartner"
  18598. // ]
  18599. // }
  18600. }