analytics-gen.go 546 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994
  1. // Package analytics provides access to the Google Analytics API.
  2. //
  3. // See https://developers.google.com/analytics/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/analytics/v3"
  8. // ...
  9. // analyticsService, err := analytics.New(oauthHttpClient)
  10. package analytics // import "google.golang.org/api/analytics/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 = "analytics:v3"
  41. const apiName = "analytics"
  42. const apiVersion = "v3"
  43. const basePath = "https://www.googleapis.com/analytics/v3/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your Google Analytics data
  47. AnalyticsScope = "https://www.googleapis.com/auth/analytics"
  48. // Edit Google Analytics management entities
  49. AnalyticsEditScope = "https://www.googleapis.com/auth/analytics.edit"
  50. // Manage Google Analytics Account users by email address
  51. AnalyticsManageUsersScope = "https://www.googleapis.com/auth/analytics.manage.users"
  52. // View Google Analytics user permissions
  53. AnalyticsManageUsersReadonlyScope = "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  54. // Create a new Google Analytics account along with its default property
  55. // and view
  56. AnalyticsProvisionScope = "https://www.googleapis.com/auth/analytics.provision"
  57. // View your Google Analytics data
  58. AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.readonly"
  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.Data = NewDataService(s)
  66. s.Management = NewManagementService(s)
  67. s.Metadata = NewMetadataService(s)
  68. s.Provisioning = NewProvisioningService(s)
  69. return s, nil
  70. }
  71. type Service struct {
  72. client *http.Client
  73. BasePath string // API endpoint base URL
  74. UserAgent string // optional additional User-Agent fragment
  75. Data *DataService
  76. Management *ManagementService
  77. Metadata *MetadataService
  78. Provisioning *ProvisioningService
  79. }
  80. func (s *Service) userAgent() string {
  81. if s.UserAgent == "" {
  82. return googleapi.UserAgent
  83. }
  84. return googleapi.UserAgent + " " + s.UserAgent
  85. }
  86. func NewDataService(s *Service) *DataService {
  87. rs := &DataService{s: s}
  88. rs.Ga = NewDataGaService(s)
  89. rs.Mcf = NewDataMcfService(s)
  90. rs.Realtime = NewDataRealtimeService(s)
  91. return rs
  92. }
  93. type DataService struct {
  94. s *Service
  95. Ga *DataGaService
  96. Mcf *DataMcfService
  97. Realtime *DataRealtimeService
  98. }
  99. func NewDataGaService(s *Service) *DataGaService {
  100. rs := &DataGaService{s: s}
  101. return rs
  102. }
  103. type DataGaService struct {
  104. s *Service
  105. }
  106. func NewDataMcfService(s *Service) *DataMcfService {
  107. rs := &DataMcfService{s: s}
  108. return rs
  109. }
  110. type DataMcfService struct {
  111. s *Service
  112. }
  113. func NewDataRealtimeService(s *Service) *DataRealtimeService {
  114. rs := &DataRealtimeService{s: s}
  115. return rs
  116. }
  117. type DataRealtimeService struct {
  118. s *Service
  119. }
  120. func NewManagementService(s *Service) *ManagementService {
  121. rs := &ManagementService{s: s}
  122. rs.AccountSummaries = NewManagementAccountSummariesService(s)
  123. rs.AccountUserLinks = NewManagementAccountUserLinksService(s)
  124. rs.Accounts = NewManagementAccountsService(s)
  125. rs.CustomDataSources = NewManagementCustomDataSourcesService(s)
  126. rs.CustomDimensions = NewManagementCustomDimensionsService(s)
  127. rs.CustomMetrics = NewManagementCustomMetricsService(s)
  128. rs.Experiments = NewManagementExperimentsService(s)
  129. rs.Filters = NewManagementFiltersService(s)
  130. rs.Goals = NewManagementGoalsService(s)
  131. rs.ProfileFilterLinks = NewManagementProfileFilterLinksService(s)
  132. rs.ProfileUserLinks = NewManagementProfileUserLinksService(s)
  133. rs.Profiles = NewManagementProfilesService(s)
  134. rs.Segments = NewManagementSegmentsService(s)
  135. rs.UnsampledReports = NewManagementUnsampledReportsService(s)
  136. rs.Uploads = NewManagementUploadsService(s)
  137. rs.WebPropertyAdWordsLinks = NewManagementWebPropertyAdWordsLinksService(s)
  138. rs.Webproperties = NewManagementWebpropertiesService(s)
  139. rs.WebpropertyUserLinks = NewManagementWebpropertyUserLinksService(s)
  140. return rs
  141. }
  142. type ManagementService struct {
  143. s *Service
  144. AccountSummaries *ManagementAccountSummariesService
  145. AccountUserLinks *ManagementAccountUserLinksService
  146. Accounts *ManagementAccountsService
  147. CustomDataSources *ManagementCustomDataSourcesService
  148. CustomDimensions *ManagementCustomDimensionsService
  149. CustomMetrics *ManagementCustomMetricsService
  150. Experiments *ManagementExperimentsService
  151. Filters *ManagementFiltersService
  152. Goals *ManagementGoalsService
  153. ProfileFilterLinks *ManagementProfileFilterLinksService
  154. ProfileUserLinks *ManagementProfileUserLinksService
  155. Profiles *ManagementProfilesService
  156. Segments *ManagementSegmentsService
  157. UnsampledReports *ManagementUnsampledReportsService
  158. Uploads *ManagementUploadsService
  159. WebPropertyAdWordsLinks *ManagementWebPropertyAdWordsLinksService
  160. Webproperties *ManagementWebpropertiesService
  161. WebpropertyUserLinks *ManagementWebpropertyUserLinksService
  162. }
  163. func NewManagementAccountSummariesService(s *Service) *ManagementAccountSummariesService {
  164. rs := &ManagementAccountSummariesService{s: s}
  165. return rs
  166. }
  167. type ManagementAccountSummariesService struct {
  168. s *Service
  169. }
  170. func NewManagementAccountUserLinksService(s *Service) *ManagementAccountUserLinksService {
  171. rs := &ManagementAccountUserLinksService{s: s}
  172. return rs
  173. }
  174. type ManagementAccountUserLinksService struct {
  175. s *Service
  176. }
  177. func NewManagementAccountsService(s *Service) *ManagementAccountsService {
  178. rs := &ManagementAccountsService{s: s}
  179. return rs
  180. }
  181. type ManagementAccountsService struct {
  182. s *Service
  183. }
  184. func NewManagementCustomDataSourcesService(s *Service) *ManagementCustomDataSourcesService {
  185. rs := &ManagementCustomDataSourcesService{s: s}
  186. return rs
  187. }
  188. type ManagementCustomDataSourcesService struct {
  189. s *Service
  190. }
  191. func NewManagementCustomDimensionsService(s *Service) *ManagementCustomDimensionsService {
  192. rs := &ManagementCustomDimensionsService{s: s}
  193. return rs
  194. }
  195. type ManagementCustomDimensionsService struct {
  196. s *Service
  197. }
  198. func NewManagementCustomMetricsService(s *Service) *ManagementCustomMetricsService {
  199. rs := &ManagementCustomMetricsService{s: s}
  200. return rs
  201. }
  202. type ManagementCustomMetricsService struct {
  203. s *Service
  204. }
  205. func NewManagementExperimentsService(s *Service) *ManagementExperimentsService {
  206. rs := &ManagementExperimentsService{s: s}
  207. return rs
  208. }
  209. type ManagementExperimentsService struct {
  210. s *Service
  211. }
  212. func NewManagementFiltersService(s *Service) *ManagementFiltersService {
  213. rs := &ManagementFiltersService{s: s}
  214. return rs
  215. }
  216. type ManagementFiltersService struct {
  217. s *Service
  218. }
  219. func NewManagementGoalsService(s *Service) *ManagementGoalsService {
  220. rs := &ManagementGoalsService{s: s}
  221. return rs
  222. }
  223. type ManagementGoalsService struct {
  224. s *Service
  225. }
  226. func NewManagementProfileFilterLinksService(s *Service) *ManagementProfileFilterLinksService {
  227. rs := &ManagementProfileFilterLinksService{s: s}
  228. return rs
  229. }
  230. type ManagementProfileFilterLinksService struct {
  231. s *Service
  232. }
  233. func NewManagementProfileUserLinksService(s *Service) *ManagementProfileUserLinksService {
  234. rs := &ManagementProfileUserLinksService{s: s}
  235. return rs
  236. }
  237. type ManagementProfileUserLinksService struct {
  238. s *Service
  239. }
  240. func NewManagementProfilesService(s *Service) *ManagementProfilesService {
  241. rs := &ManagementProfilesService{s: s}
  242. return rs
  243. }
  244. type ManagementProfilesService struct {
  245. s *Service
  246. }
  247. func NewManagementSegmentsService(s *Service) *ManagementSegmentsService {
  248. rs := &ManagementSegmentsService{s: s}
  249. return rs
  250. }
  251. type ManagementSegmentsService struct {
  252. s *Service
  253. }
  254. func NewManagementUnsampledReportsService(s *Service) *ManagementUnsampledReportsService {
  255. rs := &ManagementUnsampledReportsService{s: s}
  256. return rs
  257. }
  258. type ManagementUnsampledReportsService struct {
  259. s *Service
  260. }
  261. func NewManagementUploadsService(s *Service) *ManagementUploadsService {
  262. rs := &ManagementUploadsService{s: s}
  263. return rs
  264. }
  265. type ManagementUploadsService struct {
  266. s *Service
  267. }
  268. func NewManagementWebPropertyAdWordsLinksService(s *Service) *ManagementWebPropertyAdWordsLinksService {
  269. rs := &ManagementWebPropertyAdWordsLinksService{s: s}
  270. return rs
  271. }
  272. type ManagementWebPropertyAdWordsLinksService struct {
  273. s *Service
  274. }
  275. func NewManagementWebpropertiesService(s *Service) *ManagementWebpropertiesService {
  276. rs := &ManagementWebpropertiesService{s: s}
  277. return rs
  278. }
  279. type ManagementWebpropertiesService struct {
  280. s *Service
  281. }
  282. func NewManagementWebpropertyUserLinksService(s *Service) *ManagementWebpropertyUserLinksService {
  283. rs := &ManagementWebpropertyUserLinksService{s: s}
  284. return rs
  285. }
  286. type ManagementWebpropertyUserLinksService struct {
  287. s *Service
  288. }
  289. func NewMetadataService(s *Service) *MetadataService {
  290. rs := &MetadataService{s: s}
  291. rs.Columns = NewMetadataColumnsService(s)
  292. return rs
  293. }
  294. type MetadataService struct {
  295. s *Service
  296. Columns *MetadataColumnsService
  297. }
  298. func NewMetadataColumnsService(s *Service) *MetadataColumnsService {
  299. rs := &MetadataColumnsService{s: s}
  300. return rs
  301. }
  302. type MetadataColumnsService struct {
  303. s *Service
  304. }
  305. func NewProvisioningService(s *Service) *ProvisioningService {
  306. rs := &ProvisioningService{s: s}
  307. return rs
  308. }
  309. type ProvisioningService struct {
  310. s *Service
  311. }
  312. // Account: JSON template for Analytics account entry.
  313. type Account struct {
  314. // ChildLink: Child link for an account entry. Points to the list of web
  315. // properties for this account.
  316. ChildLink *AccountChildLink `json:"childLink,omitempty"`
  317. // Created: Time the account was created.
  318. Created string `json:"created,omitempty"`
  319. // Id: Account ID.
  320. Id string `json:"id,omitempty"`
  321. // Kind: Resource type for Analytics account.
  322. Kind string `json:"kind,omitempty"`
  323. // Name: Account name.
  324. Name string `json:"name,omitempty"`
  325. // Permissions: Permissions the user has for this account.
  326. Permissions *AccountPermissions `json:"permissions,omitempty"`
  327. // SelfLink: Link for this account.
  328. SelfLink string `json:"selfLink,omitempty"`
  329. // Updated: Time the account was last modified.
  330. Updated string `json:"updated,omitempty"`
  331. // ForceSendFields is a list of field names (e.g. "ChildLink") to
  332. // unconditionally include in API requests. By default, fields with
  333. // empty values are omitted from API requests. However, any non-pointer,
  334. // non-interface field appearing in ForceSendFields will be sent to the
  335. // server regardless of whether the field is empty or not. This may be
  336. // used to include empty fields in Patch requests.
  337. ForceSendFields []string `json:"-"`
  338. }
  339. func (s *Account) MarshalJSON() ([]byte, error) {
  340. type noMethod Account
  341. raw := noMethod(*s)
  342. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  343. }
  344. // AccountChildLink: Child link for an account entry. Points to the list
  345. // of web properties for this account.
  346. type AccountChildLink struct {
  347. // Href: Link to the list of web properties for this account.
  348. Href string `json:"href,omitempty"`
  349. // Type: Type of the child link. Its value is "analytics#webproperties".
  350. Type string `json:"type,omitempty"`
  351. // ForceSendFields is a list of field names (e.g. "Href") to
  352. // unconditionally include in API requests. By default, fields with
  353. // empty values are omitted from API requests. However, any non-pointer,
  354. // non-interface field appearing in ForceSendFields will be sent to the
  355. // server regardless of whether the field is empty or not. This may be
  356. // used to include empty fields in Patch requests.
  357. ForceSendFields []string `json:"-"`
  358. }
  359. func (s *AccountChildLink) MarshalJSON() ([]byte, error) {
  360. type noMethod AccountChildLink
  361. raw := noMethod(*s)
  362. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  363. }
  364. // AccountPermissions: Permissions the user has for this account.
  365. type AccountPermissions struct {
  366. // Effective: All the permissions that the user has for this account.
  367. // These include any implied permissions (e.g., EDIT implies VIEW).
  368. Effective []string `json:"effective,omitempty"`
  369. // ForceSendFields is a list of field names (e.g. "Effective") to
  370. // unconditionally include in API requests. By default, fields with
  371. // empty values are omitted from API requests. However, any non-pointer,
  372. // non-interface field appearing in ForceSendFields will be sent to the
  373. // server regardless of whether the field is empty or not. This may be
  374. // used to include empty fields in Patch requests.
  375. ForceSendFields []string `json:"-"`
  376. }
  377. func (s *AccountPermissions) MarshalJSON() ([]byte, error) {
  378. type noMethod AccountPermissions
  379. raw := noMethod(*s)
  380. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  381. }
  382. // AccountRef: JSON template for a linked account.
  383. type AccountRef struct {
  384. // Href: Link for this account.
  385. Href string `json:"href,omitempty"`
  386. // Id: Account ID.
  387. Id string `json:"id,omitempty"`
  388. // Kind: Analytics account reference.
  389. Kind string `json:"kind,omitempty"`
  390. // Name: Account name.
  391. Name string `json:"name,omitempty"`
  392. // ForceSendFields is a list of field names (e.g. "Href") to
  393. // unconditionally include in API requests. By default, fields with
  394. // empty values are omitted from API requests. However, any non-pointer,
  395. // non-interface field appearing in ForceSendFields will be sent to the
  396. // server regardless of whether the field is empty or not. This may be
  397. // used to include empty fields in Patch requests.
  398. ForceSendFields []string `json:"-"`
  399. }
  400. func (s *AccountRef) MarshalJSON() ([]byte, error) {
  401. type noMethod AccountRef
  402. raw := noMethod(*s)
  403. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  404. }
  405. // AccountSummaries: An AccountSummary collection lists a summary of
  406. // accounts, properties and views (profiles) to which the user has
  407. // access. Each resource in the collection corresponds to a single
  408. // AccountSummary.
  409. type AccountSummaries struct {
  410. // Items: A list of AccountSummaries.
  411. Items []*AccountSummary `json:"items,omitempty"`
  412. // ItemsPerPage: The maximum number of resources the response can
  413. // contain, regardless of the actual number of resources returned. Its
  414. // value ranges from 1 to 1000 with a value of 1000 by default, or
  415. // otherwise specified by the max-results query parameter.
  416. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  417. // Kind: Collection type.
  418. Kind string `json:"kind,omitempty"`
  419. // NextLink: Link to next page for this AccountSummary collection.
  420. NextLink string `json:"nextLink,omitempty"`
  421. // PreviousLink: Link to previous page for this AccountSummary
  422. // collection.
  423. PreviousLink string `json:"previousLink,omitempty"`
  424. // StartIndex: The starting index of the resources, which is 1 by
  425. // default or otherwise specified by the start-index query parameter.
  426. StartIndex int64 `json:"startIndex,omitempty"`
  427. // TotalResults: The total number of results for the query, regardless
  428. // of the number of results in the response.
  429. TotalResults int64 `json:"totalResults,omitempty"`
  430. // Username: Email ID of the authenticated user
  431. Username string `json:"username,omitempty"`
  432. // ServerResponse contains the HTTP response code and headers from the
  433. // server.
  434. googleapi.ServerResponse `json:"-"`
  435. // ForceSendFields is a list of field names (e.g. "Items") to
  436. // unconditionally include in API requests. By default, fields with
  437. // empty values are omitted from API requests. However, any non-pointer,
  438. // non-interface field appearing in ForceSendFields will be sent to the
  439. // server regardless of whether the field is empty or not. This may be
  440. // used to include empty fields in Patch requests.
  441. ForceSendFields []string `json:"-"`
  442. }
  443. func (s *AccountSummaries) MarshalJSON() ([]byte, error) {
  444. type noMethod AccountSummaries
  445. raw := noMethod(*s)
  446. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  447. }
  448. // AccountSummary: JSON template for an Analytics AccountSummary. An
  449. // AccountSummary is a lightweight tree comprised of
  450. // properties/profiles.
  451. type AccountSummary struct {
  452. // Id: Account ID.
  453. Id string `json:"id,omitempty"`
  454. // Kind: Resource type for Analytics AccountSummary.
  455. Kind string `json:"kind,omitempty"`
  456. // Name: Account name.
  457. Name string `json:"name,omitempty"`
  458. // WebProperties: List of web properties under this account.
  459. WebProperties []*WebPropertySummary `json:"webProperties,omitempty"`
  460. // ForceSendFields is a list of field names (e.g. "Id") to
  461. // unconditionally include in API requests. By default, fields with
  462. // empty values are omitted from API requests. However, any non-pointer,
  463. // non-interface field appearing in ForceSendFields will be sent to the
  464. // server regardless of whether the field is empty or not. This may be
  465. // used to include empty fields in Patch requests.
  466. ForceSendFields []string `json:"-"`
  467. }
  468. func (s *AccountSummary) MarshalJSON() ([]byte, error) {
  469. type noMethod AccountSummary
  470. raw := noMethod(*s)
  471. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  472. }
  473. // AccountTicket: JSON template for an Analytics account ticket. The
  474. // account ticket consists of the ticket ID and the basic information
  475. // for the account, property and profile.
  476. type AccountTicket struct {
  477. // Account: Account for this ticket.
  478. Account *Account `json:"account,omitempty"`
  479. // Id: Account ticket ID used to access the account ticket.
  480. Id string `json:"id,omitempty"`
  481. // Kind: Resource type for account ticket.
  482. Kind string `json:"kind,omitempty"`
  483. // Profile: View (Profile) for the account.
  484. Profile *Profile `json:"profile,omitempty"`
  485. // RedirectUri: Redirect URI where the user will be sent after accepting
  486. // Terms of Service. Must be configured in APIs console as a callback
  487. // URL.
  488. RedirectUri string `json:"redirectUri,omitempty"`
  489. // Webproperty: Web property for the account.
  490. Webproperty *Webproperty `json:"webproperty,omitempty"`
  491. // ServerResponse contains the HTTP response code and headers from the
  492. // server.
  493. googleapi.ServerResponse `json:"-"`
  494. // ForceSendFields is a list of field names (e.g. "Account") 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 *AccountTicket) MarshalJSON() ([]byte, error) {
  503. type noMethod AccountTicket
  504. raw := noMethod(*s)
  505. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  506. }
  507. // Accounts: An account collection provides a list of Analytics accounts
  508. // to which a user has access. The account collection is the entry point
  509. // to all management information. Each resource in the collection
  510. // corresponds to a single Analytics account.
  511. type Accounts struct {
  512. // Items: A list of accounts.
  513. Items []*Account `json:"items,omitempty"`
  514. // ItemsPerPage: The maximum number of entries the response can contain,
  515. // regardless of the actual number of entries returned. Its value ranges
  516. // from 1 to 1000 with a value of 1000 by default, or otherwise
  517. // specified by the max-results query parameter.
  518. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  519. // Kind: Collection type.
  520. Kind string `json:"kind,omitempty"`
  521. // NextLink: Next link for this account collection.
  522. NextLink string `json:"nextLink,omitempty"`
  523. // PreviousLink: Previous link for this account collection.
  524. PreviousLink string `json:"previousLink,omitempty"`
  525. // StartIndex: The starting index of the entries, which is 1 by default
  526. // or otherwise specified by the start-index query parameter.
  527. StartIndex int64 `json:"startIndex,omitempty"`
  528. // TotalResults: The total number of results for the query, regardless
  529. // of the number of results in the response.
  530. TotalResults int64 `json:"totalResults,omitempty"`
  531. // Username: Email ID of the authenticated user
  532. Username string `json:"username,omitempty"`
  533. // ServerResponse contains the HTTP response code and headers from the
  534. // server.
  535. googleapi.ServerResponse `json:"-"`
  536. // ForceSendFields is a list of field names (e.g. "Items") to
  537. // unconditionally include in API requests. By default, fields with
  538. // empty values are omitted from API requests. However, any non-pointer,
  539. // non-interface field appearing in ForceSendFields will be sent to the
  540. // server regardless of whether the field is empty or not. This may be
  541. // used to include empty fields in Patch requests.
  542. ForceSendFields []string `json:"-"`
  543. }
  544. func (s *Accounts) MarshalJSON() ([]byte, error) {
  545. type noMethod Accounts
  546. raw := noMethod(*s)
  547. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  548. }
  549. // AdWordsAccount: JSON template for an AdWords account.
  550. type AdWordsAccount struct {
  551. // AutoTaggingEnabled: True if auto-tagging is enabled on the AdWords
  552. // account. Read-only after the insert operation.
  553. AutoTaggingEnabled bool `json:"autoTaggingEnabled,omitempty"`
  554. // CustomerId: Customer ID. This field is required when creating an
  555. // AdWords link.
  556. CustomerId string `json:"customerId,omitempty"`
  557. // Kind: Resource type for AdWords account.
  558. Kind string `json:"kind,omitempty"`
  559. // ForceSendFields is a list of field names (e.g. "AutoTaggingEnabled")
  560. // to unconditionally include in API requests. By default, fields with
  561. // empty values are omitted from API requests. However, any non-pointer,
  562. // non-interface field appearing in ForceSendFields will be sent to the
  563. // server regardless of whether the field is empty or not. This may be
  564. // used to include empty fields in Patch requests.
  565. ForceSendFields []string `json:"-"`
  566. }
  567. func (s *AdWordsAccount) MarshalJSON() ([]byte, error) {
  568. type noMethod AdWordsAccount
  569. raw := noMethod(*s)
  570. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  571. }
  572. // AnalyticsDataimportDeleteUploadDataRequest: Request template for the
  573. // delete upload data request.
  574. type AnalyticsDataimportDeleteUploadDataRequest struct {
  575. // CustomDataImportUids: A list of upload UIDs.
  576. CustomDataImportUids []string `json:"customDataImportUids,omitempty"`
  577. // ForceSendFields is a list of field names (e.g.
  578. // "CustomDataImportUids") to unconditionally include in API requests.
  579. // By default, fields with empty values are omitted from API requests.
  580. // However, any non-pointer, non-interface field appearing in
  581. // ForceSendFields will be sent to the server regardless of whether the
  582. // field is empty or not. This may be used to include empty fields in
  583. // Patch requests.
  584. ForceSendFields []string `json:"-"`
  585. }
  586. func (s *AnalyticsDataimportDeleteUploadDataRequest) MarshalJSON() ([]byte, error) {
  587. type noMethod AnalyticsDataimportDeleteUploadDataRequest
  588. raw := noMethod(*s)
  589. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  590. }
  591. // Column: JSON template for a metadata column.
  592. type Column struct {
  593. // Attributes: Map of attribute name and value for this column.
  594. Attributes map[string]string `json:"attributes,omitempty"`
  595. // Id: Column id.
  596. Id string `json:"id,omitempty"`
  597. // Kind: Resource type for Analytics column.
  598. Kind string `json:"kind,omitempty"`
  599. // ForceSendFields is a list of field names (e.g. "Attributes") to
  600. // unconditionally include in API requests. By default, fields with
  601. // empty values are omitted from API requests. However, any non-pointer,
  602. // non-interface field appearing in ForceSendFields will be sent to the
  603. // server regardless of whether the field is empty or not. This may be
  604. // used to include empty fields in Patch requests.
  605. ForceSendFields []string `json:"-"`
  606. }
  607. func (s *Column) MarshalJSON() ([]byte, error) {
  608. type noMethod Column
  609. raw := noMethod(*s)
  610. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  611. }
  612. // Columns: Lists columns (dimensions and metrics) for a particular
  613. // report type.
  614. type Columns struct {
  615. // AttributeNames: List of attributes names returned by columns.
  616. AttributeNames []string `json:"attributeNames,omitempty"`
  617. // Etag: Etag of collection. This etag can be compared with the last
  618. // response etag to check if response has changed.
  619. Etag string `json:"etag,omitempty"`
  620. // Items: List of columns for a report type.
  621. Items []*Column `json:"items,omitempty"`
  622. // Kind: Collection type.
  623. Kind string `json:"kind,omitempty"`
  624. // TotalResults: Total number of columns returned in the response.
  625. TotalResults int64 `json:"totalResults,omitempty"`
  626. // ServerResponse contains the HTTP response code and headers from the
  627. // server.
  628. googleapi.ServerResponse `json:"-"`
  629. // ForceSendFields is a list of field names (e.g. "AttributeNames") to
  630. // unconditionally include in API requests. By default, fields with
  631. // empty values are omitted from API requests. However, any non-pointer,
  632. // non-interface field appearing in ForceSendFields will be sent to the
  633. // server regardless of whether the field is empty or not. This may be
  634. // used to include empty fields in Patch requests.
  635. ForceSendFields []string `json:"-"`
  636. }
  637. func (s *Columns) MarshalJSON() ([]byte, error) {
  638. type noMethod Columns
  639. raw := noMethod(*s)
  640. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  641. }
  642. // CustomDataSource: JSON template for an Analytics custom data source.
  643. type CustomDataSource struct {
  644. // AccountId: Account ID to which this custom data source belongs.
  645. AccountId string `json:"accountId,omitempty"`
  646. ChildLink *CustomDataSourceChildLink `json:"childLink,omitempty"`
  647. // Created: Time this custom data source was created.
  648. Created string `json:"created,omitempty"`
  649. // Description: Description of custom data source.
  650. Description string `json:"description,omitempty"`
  651. // Id: Custom data source ID.
  652. Id string `json:"id,omitempty"`
  653. ImportBehavior string `json:"importBehavior,omitempty"`
  654. // Kind: Resource type for Analytics custom data source.
  655. Kind string `json:"kind,omitempty"`
  656. // Name: Name of this custom data source.
  657. Name string `json:"name,omitempty"`
  658. // ParentLink: Parent link for this custom data source. Points to the
  659. // web property to which this custom data source belongs.
  660. ParentLink *CustomDataSourceParentLink `json:"parentLink,omitempty"`
  661. // ProfilesLinked: IDs of views (profiles) linked to the custom data
  662. // source.
  663. ProfilesLinked []string `json:"profilesLinked,omitempty"`
  664. // SelfLink: Link for this Analytics custom data source.
  665. SelfLink string `json:"selfLink,omitempty"`
  666. // Type: Type of the custom data source.
  667. Type string `json:"type,omitempty"`
  668. // Updated: Time this custom data source was last modified.
  669. Updated string `json:"updated,omitempty"`
  670. UploadType string `json:"uploadType,omitempty"`
  671. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  672. // custom data source belongs.
  673. WebPropertyId string `json:"webPropertyId,omitempty"`
  674. // ForceSendFields is a list of field names (e.g. "AccountId") to
  675. // unconditionally include in API requests. By default, fields with
  676. // empty values are omitted from API requests. However, any non-pointer,
  677. // non-interface field appearing in ForceSendFields will be sent to the
  678. // server regardless of whether the field is empty or not. This may be
  679. // used to include empty fields in Patch requests.
  680. ForceSendFields []string `json:"-"`
  681. }
  682. func (s *CustomDataSource) MarshalJSON() ([]byte, error) {
  683. type noMethod CustomDataSource
  684. raw := noMethod(*s)
  685. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  686. }
  687. type CustomDataSourceChildLink struct {
  688. // Href: Link to the list of daily uploads for this custom data source.
  689. // Link to the list of uploads for this custom data source.
  690. Href string `json:"href,omitempty"`
  691. // Type: Value is "analytics#dailyUploads". Value is
  692. // "analytics#uploads".
  693. Type string `json:"type,omitempty"`
  694. // ForceSendFields is a list of field names (e.g. "Href") to
  695. // unconditionally include in API requests. By default, fields with
  696. // empty values are omitted from API requests. However, any non-pointer,
  697. // non-interface field appearing in ForceSendFields will be sent to the
  698. // server regardless of whether the field is empty or not. This may be
  699. // used to include empty fields in Patch requests.
  700. ForceSendFields []string `json:"-"`
  701. }
  702. func (s *CustomDataSourceChildLink) MarshalJSON() ([]byte, error) {
  703. type noMethod CustomDataSourceChildLink
  704. raw := noMethod(*s)
  705. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  706. }
  707. // CustomDataSourceParentLink: Parent link for this custom data source.
  708. // Points to the web property to which this custom data source belongs.
  709. type CustomDataSourceParentLink struct {
  710. // Href: Link to the web property to which this custom data source
  711. // belongs.
  712. Href string `json:"href,omitempty"`
  713. // Type: Value is "analytics#webproperty".
  714. Type string `json:"type,omitempty"`
  715. // ForceSendFields is a list of field names (e.g. "Href") to
  716. // unconditionally include in API requests. By default, fields with
  717. // empty values are omitted from API requests. However, any non-pointer,
  718. // non-interface field appearing in ForceSendFields will be sent to the
  719. // server regardless of whether the field is empty or not. This may be
  720. // used to include empty fields in Patch requests.
  721. ForceSendFields []string `json:"-"`
  722. }
  723. func (s *CustomDataSourceParentLink) MarshalJSON() ([]byte, error) {
  724. type noMethod CustomDataSourceParentLink
  725. raw := noMethod(*s)
  726. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  727. }
  728. // CustomDataSources: Lists Analytics custom data sources to which the
  729. // user has access. Each resource in the collection corresponds to a
  730. // single Analytics custom data source.
  731. type CustomDataSources struct {
  732. // Items: Collection of custom data sources.
  733. Items []*CustomDataSource `json:"items,omitempty"`
  734. // ItemsPerPage: The maximum number of resources the response can
  735. // contain, regardless of the actual number of resources returned. Its
  736. // value ranges from 1 to 1000 with a value of 1000 by default, or
  737. // otherwise specified by the max-results query parameter.
  738. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  739. // Kind: Collection type.
  740. Kind string `json:"kind,omitempty"`
  741. // NextLink: Link to next page for this custom data source collection.
  742. NextLink string `json:"nextLink,omitempty"`
  743. // PreviousLink: Link to previous page for this custom data source
  744. // collection.
  745. PreviousLink string `json:"previousLink,omitempty"`
  746. // StartIndex: The starting index of the resources, which is 1 by
  747. // default or otherwise specified by the start-index query parameter.
  748. StartIndex int64 `json:"startIndex,omitempty"`
  749. // TotalResults: The total number of results for the query, regardless
  750. // of the number of results in the response.
  751. TotalResults int64 `json:"totalResults,omitempty"`
  752. // Username: Email ID of the authenticated user
  753. Username string `json:"username,omitempty"`
  754. // ServerResponse contains the HTTP response code and headers from the
  755. // server.
  756. googleapi.ServerResponse `json:"-"`
  757. // ForceSendFields is a list of field names (e.g. "Items") to
  758. // unconditionally include in API requests. By default, fields with
  759. // empty values are omitted from API requests. However, any non-pointer,
  760. // non-interface field appearing in ForceSendFields will be sent to the
  761. // server regardless of whether the field is empty or not. This may be
  762. // used to include empty fields in Patch requests.
  763. ForceSendFields []string `json:"-"`
  764. }
  765. func (s *CustomDataSources) MarshalJSON() ([]byte, error) {
  766. type noMethod CustomDataSources
  767. raw := noMethod(*s)
  768. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  769. }
  770. // CustomDimension: JSON template for Analytics Custom Dimension.
  771. type CustomDimension struct {
  772. // AccountId: Account ID.
  773. AccountId string `json:"accountId,omitempty"`
  774. // Active: Boolean indicating whether the custom dimension is active.
  775. Active bool `json:"active,omitempty"`
  776. // Created: Time the custom dimension was created.
  777. Created string `json:"created,omitempty"`
  778. // Id: Custom dimension ID.
  779. Id string `json:"id,omitempty"`
  780. // Index: Index of the custom dimension.
  781. Index int64 `json:"index,omitempty"`
  782. // Kind: Kind value for a custom dimension. Set to
  783. // "analytics#customDimension". It is a read-only field.
  784. Kind string `json:"kind,omitempty"`
  785. // Name: Name of the custom dimension.
  786. Name string `json:"name,omitempty"`
  787. // ParentLink: Parent link for the custom dimension. Points to the
  788. // property to which the custom dimension belongs.
  789. ParentLink *CustomDimensionParentLink `json:"parentLink,omitempty"`
  790. // Scope: Scope of the custom dimension: HIT, SESSION, USER or PRODUCT.
  791. Scope string `json:"scope,omitempty"`
  792. // SelfLink: Link for the custom dimension
  793. SelfLink string `json:"selfLink,omitempty"`
  794. // Updated: Time the custom dimension was last modified.
  795. Updated string `json:"updated,omitempty"`
  796. // WebPropertyId: Property ID.
  797. WebPropertyId string `json:"webPropertyId,omitempty"`
  798. // ServerResponse contains the HTTP response code and headers from the
  799. // server.
  800. googleapi.ServerResponse `json:"-"`
  801. // ForceSendFields is a list of field names (e.g. "AccountId") to
  802. // unconditionally include in API requests. By default, fields with
  803. // empty values are omitted from API requests. However, any non-pointer,
  804. // non-interface field appearing in ForceSendFields will be sent to the
  805. // server regardless of whether the field is empty or not. This may be
  806. // used to include empty fields in Patch requests.
  807. ForceSendFields []string `json:"-"`
  808. }
  809. func (s *CustomDimension) MarshalJSON() ([]byte, error) {
  810. type noMethod CustomDimension
  811. raw := noMethod(*s)
  812. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  813. }
  814. // CustomDimensionParentLink: Parent link for the custom dimension.
  815. // Points to the property to which the custom dimension belongs.
  816. type CustomDimensionParentLink struct {
  817. // Href: Link to the property to which the custom dimension belongs.
  818. Href string `json:"href,omitempty"`
  819. // Type: Type of the parent link. Set to "analytics#webproperty".
  820. Type string `json:"type,omitempty"`
  821. // ForceSendFields is a list of field names (e.g. "Href") to
  822. // unconditionally include in API requests. By default, fields with
  823. // empty values are omitted from API requests. However, any non-pointer,
  824. // non-interface field appearing in ForceSendFields will be sent to the
  825. // server regardless of whether the field is empty or not. This may be
  826. // used to include empty fields in Patch requests.
  827. ForceSendFields []string `json:"-"`
  828. }
  829. func (s *CustomDimensionParentLink) MarshalJSON() ([]byte, error) {
  830. type noMethod CustomDimensionParentLink
  831. raw := noMethod(*s)
  832. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  833. }
  834. // CustomDimensions: A custom dimension collection lists Analytics
  835. // custom dimensions to which the user has access. Each resource in the
  836. // collection corresponds to a single Analytics custom dimension.
  837. type CustomDimensions struct {
  838. // Items: Collection of custom dimensions.
  839. Items []*CustomDimension `json:"items,omitempty"`
  840. // ItemsPerPage: The maximum number of resources the response can
  841. // contain, regardless of the actual number of resources returned. Its
  842. // value ranges from 1 to 1000 with a value of 1000 by default, or
  843. // otherwise specified by the max-results query parameter.
  844. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  845. // Kind: Collection type.
  846. Kind string `json:"kind,omitempty"`
  847. // NextLink: Link to next page for this custom dimension collection.
  848. NextLink string `json:"nextLink,omitempty"`
  849. // PreviousLink: Link to previous page for this custom dimension
  850. // collection.
  851. PreviousLink string `json:"previousLink,omitempty"`
  852. // StartIndex: The starting index of the resources, which is 1 by
  853. // default or otherwise specified by the start-index query parameter.
  854. StartIndex int64 `json:"startIndex,omitempty"`
  855. // TotalResults: The total number of results for the query, regardless
  856. // of the number of results in the response.
  857. TotalResults int64 `json:"totalResults,omitempty"`
  858. // Username: Email ID of the authenticated user
  859. Username string `json:"username,omitempty"`
  860. // ServerResponse contains the HTTP response code and headers from the
  861. // server.
  862. googleapi.ServerResponse `json:"-"`
  863. // ForceSendFields is a list of field names (e.g. "Items") to
  864. // unconditionally include in API requests. By default, fields with
  865. // empty values are omitted from API requests. However, any non-pointer,
  866. // non-interface field appearing in ForceSendFields will be sent to the
  867. // server regardless of whether the field is empty or not. This may be
  868. // used to include empty fields in Patch requests.
  869. ForceSendFields []string `json:"-"`
  870. }
  871. func (s *CustomDimensions) MarshalJSON() ([]byte, error) {
  872. type noMethod CustomDimensions
  873. raw := noMethod(*s)
  874. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  875. }
  876. // CustomMetric: JSON template for Analytics Custom Metric.
  877. type CustomMetric struct {
  878. // AccountId: Account ID.
  879. AccountId string `json:"accountId,omitempty"`
  880. // Active: Boolean indicating whether the custom metric is active.
  881. Active bool `json:"active,omitempty"`
  882. // Created: Time the custom metric was created.
  883. Created string `json:"created,omitempty"`
  884. // Id: Custom metric ID.
  885. Id string `json:"id,omitempty"`
  886. // Index: Index of the custom metric.
  887. Index int64 `json:"index,omitempty"`
  888. // Kind: Kind value for a custom metric. Set to
  889. // "analytics#customMetric". It is a read-only field.
  890. Kind string `json:"kind,omitempty"`
  891. // MaxValue: Max value of custom metric.
  892. MaxValue string `json:"max_value,omitempty"`
  893. // MinValue: Min value of custom metric.
  894. MinValue string `json:"min_value,omitempty"`
  895. // Name: Name of the custom metric.
  896. Name string `json:"name,omitempty"`
  897. // ParentLink: Parent link for the custom metric. Points to the property
  898. // to which the custom metric belongs.
  899. ParentLink *CustomMetricParentLink `json:"parentLink,omitempty"`
  900. // Scope: Scope of the custom metric: HIT or PRODUCT.
  901. Scope string `json:"scope,omitempty"`
  902. // SelfLink: Link for the custom metric
  903. SelfLink string `json:"selfLink,omitempty"`
  904. // Type: Data type of custom metric.
  905. Type string `json:"type,omitempty"`
  906. // Updated: Time the custom metric was last modified.
  907. Updated string `json:"updated,omitempty"`
  908. // WebPropertyId: Property ID.
  909. WebPropertyId string `json:"webPropertyId,omitempty"`
  910. // ServerResponse contains the HTTP response code and headers from the
  911. // server.
  912. googleapi.ServerResponse `json:"-"`
  913. // ForceSendFields is a list of field names (e.g. "AccountId") to
  914. // unconditionally include in API requests. By default, fields with
  915. // empty values are omitted from API requests. However, any non-pointer,
  916. // non-interface field appearing in ForceSendFields will be sent to the
  917. // server regardless of whether the field is empty or not. This may be
  918. // used to include empty fields in Patch requests.
  919. ForceSendFields []string `json:"-"`
  920. }
  921. func (s *CustomMetric) MarshalJSON() ([]byte, error) {
  922. type noMethod CustomMetric
  923. raw := noMethod(*s)
  924. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  925. }
  926. // CustomMetricParentLink: Parent link for the custom metric. Points to
  927. // the property to which the custom metric belongs.
  928. type CustomMetricParentLink struct {
  929. // Href: Link to the property to which the custom metric belongs.
  930. Href string `json:"href,omitempty"`
  931. // Type: Type of the parent link. Set to "analytics#webproperty".
  932. Type string `json:"type,omitempty"`
  933. // ForceSendFields is a list of field names (e.g. "Href") to
  934. // unconditionally include in API requests. By default, fields with
  935. // empty values are omitted from API requests. However, any non-pointer,
  936. // non-interface field appearing in ForceSendFields will be sent to the
  937. // server regardless of whether the field is empty or not. This may be
  938. // used to include empty fields in Patch requests.
  939. ForceSendFields []string `json:"-"`
  940. }
  941. func (s *CustomMetricParentLink) MarshalJSON() ([]byte, error) {
  942. type noMethod CustomMetricParentLink
  943. raw := noMethod(*s)
  944. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  945. }
  946. // CustomMetrics: A custom metric collection lists Analytics custom
  947. // metrics to which the user has access. Each resource in the collection
  948. // corresponds to a single Analytics custom metric.
  949. type CustomMetrics struct {
  950. // Items: Collection of custom metrics.
  951. Items []*CustomMetric `json:"items,omitempty"`
  952. // ItemsPerPage: The maximum number of resources the response can
  953. // contain, regardless of the actual number of resources returned. Its
  954. // value ranges from 1 to 1000 with a value of 1000 by default, or
  955. // otherwise specified by the max-results query parameter.
  956. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  957. // Kind: Collection type.
  958. Kind string `json:"kind,omitempty"`
  959. // NextLink: Link to next page for this custom metric collection.
  960. NextLink string `json:"nextLink,omitempty"`
  961. // PreviousLink: Link to previous page for this custom metric
  962. // collection.
  963. PreviousLink string `json:"previousLink,omitempty"`
  964. // StartIndex: The starting index of the resources, which is 1 by
  965. // default or otherwise specified by the start-index query parameter.
  966. StartIndex int64 `json:"startIndex,omitempty"`
  967. // TotalResults: The total number of results for the query, regardless
  968. // of the number of results in the response.
  969. TotalResults int64 `json:"totalResults,omitempty"`
  970. // Username: Email ID of the authenticated user
  971. Username string `json:"username,omitempty"`
  972. // ServerResponse contains the HTTP response code and headers from the
  973. // server.
  974. googleapi.ServerResponse `json:"-"`
  975. // ForceSendFields is a list of field names (e.g. "Items") to
  976. // unconditionally include in API requests. By default, fields with
  977. // empty values are omitted from API requests. However, any non-pointer,
  978. // non-interface field appearing in ForceSendFields will be sent to the
  979. // server regardless of whether the field is empty or not. This may be
  980. // used to include empty fields in Patch requests.
  981. ForceSendFields []string `json:"-"`
  982. }
  983. func (s *CustomMetrics) MarshalJSON() ([]byte, error) {
  984. type noMethod CustomMetrics
  985. raw := noMethod(*s)
  986. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  987. }
  988. // EntityAdWordsLink: JSON template for Analytics Entity AdWords Link.
  989. type EntityAdWordsLink struct {
  990. // AdWordsAccounts: A list of AdWords client accounts. These cannot be
  991. // MCC accounts. This field is required when creating an AdWords link.
  992. // It cannot be empty.
  993. AdWordsAccounts []*AdWordsAccount `json:"adWordsAccounts,omitempty"`
  994. // Entity: Web property being linked.
  995. Entity *EntityAdWordsLinkEntity `json:"entity,omitempty"`
  996. // Id: Entity AdWords link ID
  997. Id string `json:"id,omitempty"`
  998. // Kind: Resource type for entity AdWords link.
  999. Kind string `json:"kind,omitempty"`
  1000. // Name: Name of the link. This field is required when creating an
  1001. // AdWords link.
  1002. Name string `json:"name,omitempty"`
  1003. // ProfileIds: IDs of linked Views (Profiles) represented as strings.
  1004. ProfileIds []string `json:"profileIds,omitempty"`
  1005. // SelfLink: URL link for this Google Analytics - Google AdWords link.
  1006. SelfLink string `json:"selfLink,omitempty"`
  1007. // ServerResponse contains the HTTP response code and headers from the
  1008. // server.
  1009. googleapi.ServerResponse `json:"-"`
  1010. // ForceSendFields is a list of field names (e.g. "AdWordsAccounts") to
  1011. // unconditionally include in API requests. By default, fields with
  1012. // empty values are omitted from API requests. However, any non-pointer,
  1013. // non-interface field appearing in ForceSendFields will be sent to the
  1014. // server regardless of whether the field is empty or not. This may be
  1015. // used to include empty fields in Patch requests.
  1016. ForceSendFields []string `json:"-"`
  1017. }
  1018. func (s *EntityAdWordsLink) MarshalJSON() ([]byte, error) {
  1019. type noMethod EntityAdWordsLink
  1020. raw := noMethod(*s)
  1021. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1022. }
  1023. // EntityAdWordsLinkEntity: Web property being linked.
  1024. type EntityAdWordsLinkEntity struct {
  1025. WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"`
  1026. // ForceSendFields is a list of field names (e.g. "WebPropertyRef") to
  1027. // unconditionally include in API requests. By default, fields with
  1028. // empty values are omitted from API requests. However, any non-pointer,
  1029. // non-interface field appearing in ForceSendFields will be sent to the
  1030. // server regardless of whether the field is empty or not. This may be
  1031. // used to include empty fields in Patch requests.
  1032. ForceSendFields []string `json:"-"`
  1033. }
  1034. func (s *EntityAdWordsLinkEntity) MarshalJSON() ([]byte, error) {
  1035. type noMethod EntityAdWordsLinkEntity
  1036. raw := noMethod(*s)
  1037. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1038. }
  1039. // EntityAdWordsLinks: An entity AdWords link collection provides a list
  1040. // of GA-AdWords links Each resource in this collection corresponds to a
  1041. // single link.
  1042. type EntityAdWordsLinks struct {
  1043. // Items: A list of entity AdWords links.
  1044. Items []*EntityAdWordsLink `json:"items,omitempty"`
  1045. // ItemsPerPage: The maximum number of entries the response can contain,
  1046. // regardless of the actual number of entries returned. Its value ranges
  1047. // from 1 to 1000 with a value of 1000 by default, or otherwise
  1048. // specified by the max-results query parameter.
  1049. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1050. // Kind: Collection type.
  1051. Kind string `json:"kind,omitempty"`
  1052. // NextLink: Next link for this AdWords link collection.
  1053. NextLink string `json:"nextLink,omitempty"`
  1054. // PreviousLink: Previous link for this AdWords link collection.
  1055. PreviousLink string `json:"previousLink,omitempty"`
  1056. // StartIndex: The starting index of the entries, which is 1 by default
  1057. // or otherwise specified by the start-index query parameter.
  1058. StartIndex int64 `json:"startIndex,omitempty"`
  1059. // TotalResults: The total number of results for the query, regardless
  1060. // of the number of results in the response.
  1061. TotalResults int64 `json:"totalResults,omitempty"`
  1062. // ServerResponse contains the HTTP response code and headers from the
  1063. // server.
  1064. googleapi.ServerResponse `json:"-"`
  1065. // ForceSendFields is a list of field names (e.g. "Items") to
  1066. // unconditionally include in API requests. By default, fields with
  1067. // empty values are omitted from API requests. However, any non-pointer,
  1068. // non-interface field appearing in ForceSendFields will be sent to the
  1069. // server regardless of whether the field is empty or not. This may be
  1070. // used to include empty fields in Patch requests.
  1071. ForceSendFields []string `json:"-"`
  1072. }
  1073. func (s *EntityAdWordsLinks) MarshalJSON() ([]byte, error) {
  1074. type noMethod EntityAdWordsLinks
  1075. raw := noMethod(*s)
  1076. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1077. }
  1078. // EntityUserLink: JSON template for an Analytics Entity-User Link.
  1079. // Returns permissions that a user has for an entity.
  1080. type EntityUserLink struct {
  1081. // Entity: Entity for this link. It can be an account, a web property,
  1082. // or a view (profile).
  1083. Entity *EntityUserLinkEntity `json:"entity,omitempty"`
  1084. // Id: Entity user link ID
  1085. Id string `json:"id,omitempty"`
  1086. // Kind: Resource type for entity user link.
  1087. Kind string `json:"kind,omitempty"`
  1088. // Permissions: Permissions the user has for this entity.
  1089. Permissions *EntityUserLinkPermissions `json:"permissions,omitempty"`
  1090. // SelfLink: Self link for this resource.
  1091. SelfLink string `json:"selfLink,omitempty"`
  1092. // UserRef: User reference.
  1093. UserRef *UserRef `json:"userRef,omitempty"`
  1094. // ServerResponse contains the HTTP response code and headers from the
  1095. // server.
  1096. googleapi.ServerResponse `json:"-"`
  1097. // ForceSendFields is a list of field names (e.g. "Entity") to
  1098. // unconditionally include in API requests. By default, fields with
  1099. // empty values are omitted from API requests. However, any non-pointer,
  1100. // non-interface field appearing in ForceSendFields will be sent to the
  1101. // server regardless of whether the field is empty or not. This may be
  1102. // used to include empty fields in Patch requests.
  1103. ForceSendFields []string `json:"-"`
  1104. }
  1105. func (s *EntityUserLink) MarshalJSON() ([]byte, error) {
  1106. type noMethod EntityUserLink
  1107. raw := noMethod(*s)
  1108. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1109. }
  1110. // EntityUserLinkEntity: Entity for this link. It can be an account, a
  1111. // web property, or a view (profile).
  1112. type EntityUserLinkEntity struct {
  1113. // AccountRef: Account for this link.
  1114. AccountRef *AccountRef `json:"accountRef,omitempty"`
  1115. // ProfileRef: View (Profile) for this link.
  1116. ProfileRef *ProfileRef `json:"profileRef,omitempty"`
  1117. // WebPropertyRef: Web property for this link.
  1118. WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"`
  1119. // ForceSendFields is a list of field names (e.g. "AccountRef") to
  1120. // unconditionally include in API requests. By default, fields with
  1121. // empty values are omitted from API requests. However, any non-pointer,
  1122. // non-interface field appearing in ForceSendFields will be sent to the
  1123. // server regardless of whether the field is empty or not. This may be
  1124. // used to include empty fields in Patch requests.
  1125. ForceSendFields []string `json:"-"`
  1126. }
  1127. func (s *EntityUserLinkEntity) MarshalJSON() ([]byte, error) {
  1128. type noMethod EntityUserLinkEntity
  1129. raw := noMethod(*s)
  1130. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1131. }
  1132. // EntityUserLinkPermissions: Permissions the user has for this entity.
  1133. type EntityUserLinkPermissions struct {
  1134. // Effective: Effective permissions represent all the permissions that a
  1135. // user has for this entity. These include any implied permissions
  1136. // (e.g., EDIT implies VIEW) or inherited permissions from the parent
  1137. // entity. Effective permissions are read-only.
  1138. Effective []string `json:"effective,omitempty"`
  1139. // Local: Permissions that a user has been assigned at this very level.
  1140. // Does not include any implied or inherited permissions. Local
  1141. // permissions are modifiable.
  1142. Local []string `json:"local,omitempty"`
  1143. // ForceSendFields is a list of field names (e.g. "Effective") to
  1144. // unconditionally include in API requests. By default, fields with
  1145. // empty values are omitted from API requests. However, any non-pointer,
  1146. // non-interface field appearing in ForceSendFields will be sent to the
  1147. // server regardless of whether the field is empty or not. This may be
  1148. // used to include empty fields in Patch requests.
  1149. ForceSendFields []string `json:"-"`
  1150. }
  1151. func (s *EntityUserLinkPermissions) MarshalJSON() ([]byte, error) {
  1152. type noMethod EntityUserLinkPermissions
  1153. raw := noMethod(*s)
  1154. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1155. }
  1156. // EntityUserLinks: An entity user link collection provides a list of
  1157. // Analytics ACL links Each resource in this collection corresponds to a
  1158. // single link.
  1159. type EntityUserLinks struct {
  1160. // Items: A list of entity user links.
  1161. Items []*EntityUserLink `json:"items,omitempty"`
  1162. // ItemsPerPage: The maximum number of entries the response can contain,
  1163. // regardless of the actual number of entries returned. Its value ranges
  1164. // from 1 to 1000 with a value of 1000 by default, or otherwise
  1165. // specified by the max-results query parameter.
  1166. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1167. // Kind: Collection type.
  1168. Kind string `json:"kind,omitempty"`
  1169. // NextLink: Next link for this account collection.
  1170. NextLink string `json:"nextLink,omitempty"`
  1171. // PreviousLink: Previous link for this account collection.
  1172. PreviousLink string `json:"previousLink,omitempty"`
  1173. // StartIndex: The starting index of the entries, which is 1 by default
  1174. // or otherwise specified by the start-index query parameter.
  1175. StartIndex int64 `json:"startIndex,omitempty"`
  1176. // TotalResults: The total number of results for the query, regardless
  1177. // of the number of results in the response.
  1178. TotalResults int64 `json:"totalResults,omitempty"`
  1179. // ServerResponse contains the HTTP response code and headers from the
  1180. // server.
  1181. googleapi.ServerResponse `json:"-"`
  1182. // ForceSendFields is a list of field names (e.g. "Items") to
  1183. // unconditionally include in API requests. By default, fields with
  1184. // empty values are omitted from API requests. However, any non-pointer,
  1185. // non-interface field appearing in ForceSendFields will be sent to the
  1186. // server regardless of whether the field is empty or not. This may be
  1187. // used to include empty fields in Patch requests.
  1188. ForceSendFields []string `json:"-"`
  1189. }
  1190. func (s *EntityUserLinks) MarshalJSON() ([]byte, error) {
  1191. type noMethod EntityUserLinks
  1192. raw := noMethod(*s)
  1193. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1194. }
  1195. // Experiment: JSON template for Analytics experiment resource.
  1196. type Experiment struct {
  1197. // AccountId: Account ID to which this experiment belongs. This field is
  1198. // read-only.
  1199. AccountId string `json:"accountId,omitempty"`
  1200. // Created: Time the experiment was created. This field is read-only.
  1201. Created string `json:"created,omitempty"`
  1202. // Description: Notes about this experiment.
  1203. Description string `json:"description,omitempty"`
  1204. // EditableInGaUi: If true, the end user will be able to edit the
  1205. // experiment via the Google Analytics user interface.
  1206. EditableInGaUi bool `json:"editableInGaUi,omitempty"`
  1207. // EndTime: The ending time of the experiment (the time the status
  1208. // changed from RUNNING to ENDED). This field is present only if the
  1209. // experiment has ended. This field is read-only.
  1210. EndTime string `json:"endTime,omitempty"`
  1211. // EqualWeighting: Boolean specifying whether to distribute traffic
  1212. // evenly across all variations. If the value is False, content
  1213. // experiments follows the default behavior of adjusting traffic
  1214. // dynamically based on variation performance. Optional -- defaults to
  1215. // False. This field may not be changed for an experiment whose status
  1216. // is ENDED.
  1217. EqualWeighting bool `json:"equalWeighting,omitempty"`
  1218. // Id: Experiment ID. Required for patch and update. Disallowed for
  1219. // create.
  1220. Id string `json:"id,omitempty"`
  1221. // InternalWebPropertyId: Internal ID for the web property to which this
  1222. // experiment belongs. This field is read-only.
  1223. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  1224. // Kind: Resource type for an Analytics experiment. This field is
  1225. // read-only.
  1226. Kind string `json:"kind,omitempty"`
  1227. // MinimumExperimentLengthInDays: An integer number in [3, 90].
  1228. // Specifies the minimum length of the experiment. Can be changed for a
  1229. // running experiment. This field may not be changed for an experiments
  1230. // whose status is ENDED.
  1231. MinimumExperimentLengthInDays int64 `json:"minimumExperimentLengthInDays,omitempty"`
  1232. // Name: Experiment name. This field may not be changed for an
  1233. // experiment whose status is ENDED. This field is required when
  1234. // creating an experiment.
  1235. Name string `json:"name,omitempty"`
  1236. // ObjectiveMetric: The metric that the experiment is optimizing. Valid
  1237. // values: "ga:goal(n)Completions", "ga:adsenseAdsClicks",
  1238. // "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces",
  1239. // "ga:pageviews", "ga:sessionDuration", "ga:transactions",
  1240. // "ga:transactionRevenue". This field is required if status is
  1241. // "RUNNING" and servingFramework is one of "REDIRECT" or "API".
  1242. ObjectiveMetric string `json:"objectiveMetric,omitempty"`
  1243. // OptimizationType: Whether the objectiveMetric should be minimized or
  1244. // maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults
  1245. // to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be
  1246. // modified when status is "RUNNING" or "ENDED".
  1247. OptimizationType string `json:"optimizationType,omitempty"`
  1248. // ParentLink: Parent link for an experiment. Points to the view
  1249. // (profile) to which this experiment belongs.
  1250. ParentLink *ExperimentParentLink `json:"parentLink,omitempty"`
  1251. // ProfileId: View (Profile) ID to which this experiment belongs. This
  1252. // field is read-only.
  1253. ProfileId string `json:"profileId,omitempty"`
  1254. // ReasonExperimentEnded: Why the experiment ended. Possible values:
  1255. // "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED",
  1256. // "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED".
  1257. // "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no
  1258. // winner was projected to be found. If the experiment status is changed
  1259. // via the API to ENDED this field is set to STOPPED_BY_USER. This field
  1260. // is read-only.
  1261. ReasonExperimentEnded string `json:"reasonExperimentEnded,omitempty"`
  1262. // RewriteVariationUrlsAsOriginal: Boolean specifying whether variations
  1263. // URLS are rewritten to match those of the original. This field may not
  1264. // be changed for an experiments whose status is ENDED.
  1265. RewriteVariationUrlsAsOriginal bool `json:"rewriteVariationUrlsAsOriginal,omitempty"`
  1266. // SelfLink: Link for this experiment. This field is read-only.
  1267. SelfLink string `json:"selfLink,omitempty"`
  1268. // ServingFramework: The framework used to serve the experiment
  1269. // variations and evaluate the results. One of:
  1270. // - REDIRECT: Google Analytics redirects traffic to different variation
  1271. // pages, reports the chosen variation and evaluates the results.
  1272. // - API: Google Analytics chooses and reports the variation to serve
  1273. // and evaluates the results; the caller is responsible for serving the
  1274. // selected variation.
  1275. // - EXTERNAL: The variations will be served externally and the chosen
  1276. // variation reported to Google Analytics. The caller is responsible for
  1277. // serving the selected variation and evaluating the results.
  1278. ServingFramework string `json:"servingFramework,omitempty"`
  1279. // Snippet: The snippet of code to include on the control page(s). This
  1280. // field is read-only.
  1281. Snippet string `json:"snippet,omitempty"`
  1282. // StartTime: The starting time of the experiment (the time the status
  1283. // changed from READY_TO_RUN to RUNNING). This field is present only if
  1284. // the experiment has started. This field is read-only.
  1285. StartTime string `json:"startTime,omitempty"`
  1286. // Status: Experiment status. Possible values: "DRAFT", "READY_TO_RUN",
  1287. // "RUNNING", "ENDED". Experiments can be created in the "DRAFT",
  1288. // "READY_TO_RUN" or "RUNNING" state. This field is required when
  1289. // creating an experiment.
  1290. Status string `json:"status,omitempty"`
  1291. // TrafficCoverage: A floating-point number in (0, 1]. Specifies the
  1292. // fraction of the traffic that participates in the experiment. Can be
  1293. // changed for a running experiment. This field may not be changed for
  1294. // an experiments whose status is ENDED.
  1295. TrafficCoverage float64 `json:"trafficCoverage,omitempty"`
  1296. // Updated: Time the experiment was last modified. This field is
  1297. // read-only.
  1298. Updated string `json:"updated,omitempty"`
  1299. // Variations: Array of variations. The first variation in the array is
  1300. // the original. The number of variations may not change once an
  1301. // experiment is in the RUNNING state. At least two variations are
  1302. // required before status can be set to RUNNING.
  1303. Variations []*ExperimentVariations `json:"variations,omitempty"`
  1304. // WebPropertyId: Web property ID to which this experiment belongs. The
  1305. // web property ID is of the form UA-XXXXX-YY. This field is read-only.
  1306. WebPropertyId string `json:"webPropertyId,omitempty"`
  1307. // WinnerConfidenceLevel: A floating-point number in (0, 1). Specifies
  1308. // the necessary confidence level to choose a winner. This field may not
  1309. // be changed for an experiments whose status is ENDED.
  1310. WinnerConfidenceLevel float64 `json:"winnerConfidenceLevel,omitempty"`
  1311. // WinnerFound: Boolean specifying whether a winner has been found for
  1312. // this experiment. This field is read-only.
  1313. WinnerFound bool `json:"winnerFound,omitempty"`
  1314. // ServerResponse contains the HTTP response code and headers from the
  1315. // server.
  1316. googleapi.ServerResponse `json:"-"`
  1317. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1318. // unconditionally include in API requests. By default, fields with
  1319. // empty values are omitted from API requests. However, any non-pointer,
  1320. // non-interface field appearing in ForceSendFields will be sent to the
  1321. // server regardless of whether the field is empty or not. This may be
  1322. // used to include empty fields in Patch requests.
  1323. ForceSendFields []string `json:"-"`
  1324. }
  1325. func (s *Experiment) MarshalJSON() ([]byte, error) {
  1326. type noMethod Experiment
  1327. raw := noMethod(*s)
  1328. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1329. }
  1330. // ExperimentParentLink: Parent link for an experiment. Points to the
  1331. // view (profile) to which this experiment belongs.
  1332. type ExperimentParentLink struct {
  1333. // Href: Link to the view (profile) to which this experiment belongs.
  1334. // This field is read-only.
  1335. Href string `json:"href,omitempty"`
  1336. // Type: Value is "analytics#profile". This field is read-only.
  1337. Type string `json:"type,omitempty"`
  1338. // ForceSendFields is a list of field names (e.g. "Href") 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 *ExperimentParentLink) MarshalJSON() ([]byte, error) {
  1347. type noMethod ExperimentParentLink
  1348. raw := noMethod(*s)
  1349. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1350. }
  1351. type ExperimentVariations struct {
  1352. // Name: The name of the variation. This field is required when creating
  1353. // an experiment. This field may not be changed for an experiment whose
  1354. // status is ENDED.
  1355. Name string `json:"name,omitempty"`
  1356. // Status: Status of the variation. Possible values: "ACTIVE",
  1357. // "INACTIVE". INACTIVE variations are not served. This field may not be
  1358. // changed for an experiment whose status is ENDED.
  1359. Status string `json:"status,omitempty"`
  1360. // Url: The URL of the variation. This field may not be changed for an
  1361. // experiment whose status is RUNNING or ENDED.
  1362. Url string `json:"url,omitempty"`
  1363. // Weight: Weight that this variation should receive. Only present if
  1364. // the experiment is running. This field is read-only.
  1365. Weight float64 `json:"weight,omitempty"`
  1366. // Won: True if the experiment has ended and this variation performed
  1367. // (statistically) significantly better than the original. This field is
  1368. // read-only.
  1369. Won bool `json:"won,omitempty"`
  1370. // ForceSendFields is a list of field names (e.g. "Name") to
  1371. // unconditionally include in API requests. By default, fields with
  1372. // empty values are omitted from API requests. However, any non-pointer,
  1373. // non-interface field appearing in ForceSendFields will be sent to the
  1374. // server regardless of whether the field is empty or not. This may be
  1375. // used to include empty fields in Patch requests.
  1376. ForceSendFields []string `json:"-"`
  1377. }
  1378. func (s *ExperimentVariations) MarshalJSON() ([]byte, error) {
  1379. type noMethod ExperimentVariations
  1380. raw := noMethod(*s)
  1381. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1382. }
  1383. // Experiments: An experiment collection lists Analytics experiments to
  1384. // which the user has access. Each view (profile) can have a set of
  1385. // experiments. Each resource in the Experiment collection corresponds
  1386. // to a single Analytics experiment.
  1387. type Experiments struct {
  1388. // Items: A list of experiments.
  1389. Items []*Experiment `json:"items,omitempty"`
  1390. // ItemsPerPage: The maximum number of resources the response can
  1391. // contain, regardless of the actual number of resources returned. Its
  1392. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1393. // otherwise specified by the max-results query parameter.
  1394. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1395. // Kind: Collection type.
  1396. Kind string `json:"kind,omitempty"`
  1397. // NextLink: Link to next page for this experiment collection.
  1398. NextLink string `json:"nextLink,omitempty"`
  1399. // PreviousLink: Link to previous page for this experiment collection.
  1400. PreviousLink string `json:"previousLink,omitempty"`
  1401. // StartIndex: The starting index of the resources, which is 1 by
  1402. // default or otherwise specified by the start-index query parameter.
  1403. StartIndex int64 `json:"startIndex,omitempty"`
  1404. // TotalResults: The total number of results for the query, regardless
  1405. // of the number of resources in the result.
  1406. TotalResults int64 `json:"totalResults,omitempty"`
  1407. // Username: Email ID of the authenticated user
  1408. Username string `json:"username,omitempty"`
  1409. // ServerResponse contains the HTTP response code and headers from the
  1410. // server.
  1411. googleapi.ServerResponse `json:"-"`
  1412. // ForceSendFields is a list of field names (e.g. "Items") to
  1413. // unconditionally include in API requests. By default, fields with
  1414. // empty values are omitted from API requests. However, any non-pointer,
  1415. // non-interface field appearing in ForceSendFields will be sent to the
  1416. // server regardless of whether the field is empty or not. This may be
  1417. // used to include empty fields in Patch requests.
  1418. ForceSendFields []string `json:"-"`
  1419. }
  1420. func (s *Experiments) MarshalJSON() ([]byte, error) {
  1421. type noMethod Experiments
  1422. raw := noMethod(*s)
  1423. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1424. }
  1425. // Filter: JSON template for an Analytics account filter.
  1426. type Filter struct {
  1427. // AccountId: Account ID to which this filter belongs.
  1428. AccountId string `json:"accountId,omitempty"`
  1429. // AdvancedDetails: Details for the filter of the type ADVANCED.
  1430. AdvancedDetails *FilterAdvancedDetails `json:"advancedDetails,omitempty"`
  1431. // Created: Time this filter was created.
  1432. Created string `json:"created,omitempty"`
  1433. // ExcludeDetails: Details for the filter of the type EXCLUDE.
  1434. ExcludeDetails *FilterExpression `json:"excludeDetails,omitempty"`
  1435. // Id: Filter ID.
  1436. Id string `json:"id,omitempty"`
  1437. // IncludeDetails: Details for the filter of the type INCLUDE.
  1438. IncludeDetails *FilterExpression `json:"includeDetails,omitempty"`
  1439. // Kind: Resource type for Analytics filter.
  1440. Kind string `json:"kind,omitempty"`
  1441. // LowercaseDetails: Details for the filter of the type LOWER.
  1442. LowercaseDetails *FilterLowercaseDetails `json:"lowercaseDetails,omitempty"`
  1443. // Name: Name of this filter.
  1444. Name string `json:"name,omitempty"`
  1445. // ParentLink: Parent link for this filter. Points to the account to
  1446. // which this filter belongs.
  1447. ParentLink *FilterParentLink `json:"parentLink,omitempty"`
  1448. // SearchAndReplaceDetails: Details for the filter of the type
  1449. // SEARCH_AND_REPLACE.
  1450. SearchAndReplaceDetails *FilterSearchAndReplaceDetails `json:"searchAndReplaceDetails,omitempty"`
  1451. // SelfLink: Link for this filter.
  1452. SelfLink string `json:"selfLink,omitempty"`
  1453. // Type: Type of this filter. Possible values are INCLUDE, EXCLUDE,
  1454. // LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED.
  1455. Type string `json:"type,omitempty"`
  1456. // Updated: Time this filter was last modified.
  1457. Updated string `json:"updated,omitempty"`
  1458. // UppercaseDetails: Details for the filter of the type UPPER.
  1459. UppercaseDetails *FilterUppercaseDetails `json:"uppercaseDetails,omitempty"`
  1460. // ServerResponse contains the HTTP response code and headers from the
  1461. // server.
  1462. googleapi.ServerResponse `json:"-"`
  1463. // ForceSendFields is a list of field names (e.g. "AccountId") 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 *Filter) MarshalJSON() ([]byte, error) {
  1472. type noMethod Filter
  1473. raw := noMethod(*s)
  1474. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1475. }
  1476. // FilterAdvancedDetails: Details for the filter of the type ADVANCED.
  1477. type FilterAdvancedDetails struct {
  1478. // CaseSensitive: Indicates if the filter expressions are case
  1479. // sensitive.
  1480. CaseSensitive bool `json:"caseSensitive,omitempty"`
  1481. // ExtractA: Expression to extract from field A.
  1482. ExtractA string `json:"extractA,omitempty"`
  1483. // ExtractB: Expression to extract from field B.
  1484. ExtractB string `json:"extractB,omitempty"`
  1485. // FieldA: Field A.
  1486. FieldA string `json:"fieldA,omitempty"`
  1487. // FieldAIndex: The Index of the custom dimension. Required if field is
  1488. // a CUSTOM_DIMENSION.
  1489. FieldAIndex int64 `json:"fieldAIndex,omitempty"`
  1490. // FieldARequired: Indicates if field A is required to match.
  1491. FieldARequired bool `json:"fieldARequired,omitempty"`
  1492. // FieldB: Field B.
  1493. FieldB string `json:"fieldB,omitempty"`
  1494. // FieldBIndex: The Index of the custom dimension. Required if field is
  1495. // a CUSTOM_DIMENSION.
  1496. FieldBIndex int64 `json:"fieldBIndex,omitempty"`
  1497. // FieldBRequired: Indicates if field B is required to match.
  1498. FieldBRequired bool `json:"fieldBRequired,omitempty"`
  1499. // OutputConstructor: Expression used to construct the output value.
  1500. OutputConstructor string `json:"outputConstructor,omitempty"`
  1501. // OutputToField: Output field.
  1502. OutputToField string `json:"outputToField,omitempty"`
  1503. // OutputToFieldIndex: The Index of the custom dimension. Required if
  1504. // field is a CUSTOM_DIMENSION.
  1505. OutputToFieldIndex int64 `json:"outputToFieldIndex,omitempty"`
  1506. // OverrideOutputField: Indicates if the existing value of the output
  1507. // field, if any, should be overridden by the output expression.
  1508. OverrideOutputField bool `json:"overrideOutputField,omitempty"`
  1509. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  1510. // unconditionally include in API requests. By default, fields with
  1511. // empty values are omitted from API requests. However, any non-pointer,
  1512. // non-interface field appearing in ForceSendFields will be sent to the
  1513. // server regardless of whether the field is empty or not. This may be
  1514. // used to include empty fields in Patch requests.
  1515. ForceSendFields []string `json:"-"`
  1516. }
  1517. func (s *FilterAdvancedDetails) MarshalJSON() ([]byte, error) {
  1518. type noMethod FilterAdvancedDetails
  1519. raw := noMethod(*s)
  1520. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1521. }
  1522. // FilterLowercaseDetails: Details for the filter of the type LOWER.
  1523. type FilterLowercaseDetails struct {
  1524. // Field: Field to use in the filter.
  1525. Field string `json:"field,omitempty"`
  1526. // FieldIndex: The Index of the custom dimension. Required if field is a
  1527. // CUSTOM_DIMENSION.
  1528. FieldIndex int64 `json:"fieldIndex,omitempty"`
  1529. // ForceSendFields is a list of field names (e.g. "Field") to
  1530. // unconditionally include in API requests. By default, fields with
  1531. // empty values are omitted from API requests. However, any non-pointer,
  1532. // non-interface field appearing in ForceSendFields will be sent to the
  1533. // server regardless of whether the field is empty or not. This may be
  1534. // used to include empty fields in Patch requests.
  1535. ForceSendFields []string `json:"-"`
  1536. }
  1537. func (s *FilterLowercaseDetails) MarshalJSON() ([]byte, error) {
  1538. type noMethod FilterLowercaseDetails
  1539. raw := noMethod(*s)
  1540. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1541. }
  1542. // FilterParentLink: Parent link for this filter. Points to the account
  1543. // to which this filter belongs.
  1544. type FilterParentLink struct {
  1545. // Href: Link to the account to which this filter belongs.
  1546. Href string `json:"href,omitempty"`
  1547. // Type: Value is "analytics#account".
  1548. Type string `json:"type,omitempty"`
  1549. // ForceSendFields is a list of field names (e.g. "Href") to
  1550. // unconditionally include in API requests. By default, fields with
  1551. // empty values are omitted from API requests. However, any non-pointer,
  1552. // non-interface field appearing in ForceSendFields will be sent to the
  1553. // server regardless of whether the field is empty or not. This may be
  1554. // used to include empty fields in Patch requests.
  1555. ForceSendFields []string `json:"-"`
  1556. }
  1557. func (s *FilterParentLink) MarshalJSON() ([]byte, error) {
  1558. type noMethod FilterParentLink
  1559. raw := noMethod(*s)
  1560. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1561. }
  1562. // FilterSearchAndReplaceDetails: Details for the filter of the type
  1563. // SEARCH_AND_REPLACE.
  1564. type FilterSearchAndReplaceDetails struct {
  1565. // CaseSensitive: Determines if the filter is case sensitive.
  1566. CaseSensitive bool `json:"caseSensitive,omitempty"`
  1567. // Field: Field to use in the filter.
  1568. Field string `json:"field,omitempty"`
  1569. // FieldIndex: The Index of the custom dimension. Required if field is a
  1570. // CUSTOM_DIMENSION.
  1571. FieldIndex int64 `json:"fieldIndex,omitempty"`
  1572. // ReplaceString: Term to replace the search term with.
  1573. ReplaceString string `json:"replaceString,omitempty"`
  1574. // SearchString: Term to search.
  1575. SearchString string `json:"searchString,omitempty"`
  1576. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  1577. // unconditionally include in API requests. By default, fields with
  1578. // empty values are omitted from API requests. However, any non-pointer,
  1579. // non-interface field appearing in ForceSendFields will be sent to the
  1580. // server regardless of whether the field is empty or not. This may be
  1581. // used to include empty fields in Patch requests.
  1582. ForceSendFields []string `json:"-"`
  1583. }
  1584. func (s *FilterSearchAndReplaceDetails) MarshalJSON() ([]byte, error) {
  1585. type noMethod FilterSearchAndReplaceDetails
  1586. raw := noMethod(*s)
  1587. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1588. }
  1589. // FilterUppercaseDetails: Details for the filter of the type UPPER.
  1590. type FilterUppercaseDetails struct {
  1591. // Field: Field to use in the filter.
  1592. Field string `json:"field,omitempty"`
  1593. // FieldIndex: The Index of the custom dimension. Required if field is a
  1594. // CUSTOM_DIMENSION.
  1595. FieldIndex int64 `json:"fieldIndex,omitempty"`
  1596. // ForceSendFields is a list of field names (e.g. "Field") to
  1597. // unconditionally include in API requests. By default, fields with
  1598. // empty values are omitted from API requests. However, any non-pointer,
  1599. // non-interface field appearing in ForceSendFields will be sent to the
  1600. // server regardless of whether the field is empty or not. This may be
  1601. // used to include empty fields in Patch requests.
  1602. ForceSendFields []string `json:"-"`
  1603. }
  1604. func (s *FilterUppercaseDetails) MarshalJSON() ([]byte, error) {
  1605. type noMethod FilterUppercaseDetails
  1606. raw := noMethod(*s)
  1607. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1608. }
  1609. // FilterExpression: JSON template for an Analytics filter expression.
  1610. type FilterExpression struct {
  1611. // CaseSensitive: Determines if the filter is case sensitive.
  1612. CaseSensitive bool `json:"caseSensitive,omitempty"`
  1613. // ExpressionValue: Filter expression value
  1614. ExpressionValue string `json:"expressionValue,omitempty"`
  1615. // Field: Field to filter. Possible values:
  1616. // - Content and Traffic
  1617. // - PAGE_REQUEST_URI,
  1618. // - PAGE_HOSTNAME,
  1619. // - PAGE_TITLE,
  1620. // - REFERRAL,
  1621. // - COST_DATA_URI (Campaign target URL),
  1622. // - HIT_TYPE,
  1623. // - INTERNAL_SEARCH_TERM,
  1624. // - INTERNAL_SEARCH_TYPE,
  1625. // - SOURCE_PROPERTY_TRACKING_ID,
  1626. // - Campaign or AdGroup
  1627. // - CAMPAIGN_SOURCE,
  1628. // - CAMPAIGN_MEDIUM,
  1629. // - CAMPAIGN_NAME,
  1630. // - CAMPAIGN_AD_GROUP,
  1631. // - CAMPAIGN_TERM,
  1632. // - CAMPAIGN_CONTENT,
  1633. // - CAMPAIGN_CODE,
  1634. // - CAMPAIGN_REFERRAL_PATH,
  1635. // - E-Commerce
  1636. // - TRANSACTION_COUNTRY,
  1637. // - TRANSACTION_REGION,
  1638. // - TRANSACTION_CITY,
  1639. // - TRANSACTION_AFFILIATION (Store or order location),
  1640. // - ITEM_NAME,
  1641. // - ITEM_CODE,
  1642. // - ITEM_VARIATION,
  1643. // - TRANSACTION_ID,
  1644. // - TRANSACTION_CURRENCY_CODE,
  1645. // - PRODUCT_ACTION_TYPE,
  1646. // - Audience/Users
  1647. // - BROWSER,
  1648. // - BROWSER_VERSION,
  1649. // - BROWSER_SIZE,
  1650. // - PLATFORM,
  1651. // - PLATFORM_VERSION,
  1652. // - LANGUAGE,
  1653. // - SCREEN_RESOLUTION,
  1654. // - SCREEN_COLORS,
  1655. // - JAVA_ENABLED (Boolean Field),
  1656. // - FLASH_VERSION,
  1657. // - GEO_SPEED (Connection speed),
  1658. // - VISITOR_TYPE,
  1659. // - GEO_ORGANIZATION (ISP organization),
  1660. // - GEO_DOMAIN,
  1661. // - GEO_IP_ADDRESS,
  1662. // - GEO_IP_VERSION,
  1663. // - Location
  1664. // - GEO_COUNTRY,
  1665. // - GEO_REGION,
  1666. // - GEO_CITY,
  1667. // - Event
  1668. // - EVENT_CATEGORY,
  1669. // - EVENT_ACTION,
  1670. // - EVENT_LABEL,
  1671. // - Other
  1672. // - CUSTOM_FIELD_1,
  1673. // - CUSTOM_FIELD_2,
  1674. // - USER_DEFINED_VALUE,
  1675. // - Application
  1676. // - APP_ID,
  1677. // - APP_INSTALLER_ID,
  1678. // - APP_NAME,
  1679. // - APP_VERSION,
  1680. // - SCREEN,
  1681. // - IS_APP (Boolean Field),
  1682. // - IS_FATAL_EXCEPTION (Boolean Field),
  1683. // - EXCEPTION_DESCRIPTION,
  1684. // - Mobile device
  1685. // - IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile),
  1686. //
  1687. // - IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet),
  1688. //
  1689. // - DEVICE_CATEGORY,
  1690. // - MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field),
  1691. // - MOBILE_HAS_NFC_SUPPORT (Boolean Field),
  1692. // - MOBILE_HAS_CELLULAR_RADIO (Boolean Field),
  1693. // - MOBILE_HAS_WIFI_SUPPORT (Boolean Field),
  1694. // - MOBILE_BRAND_NAME,
  1695. // - MOBILE_MODEL_NAME,
  1696. // - MOBILE_MARKETING_NAME,
  1697. // - MOBILE_POINTING_METHOD,
  1698. // - Social
  1699. // - SOCIAL_NETWORK,
  1700. // - SOCIAL_ACTION,
  1701. // - SOCIAL_ACTION_TARGET,
  1702. // - Custom dimension
  1703. // - CUSTOM_DIMENSION (See accompanying field index),
  1704. Field string `json:"field,omitempty"`
  1705. // FieldIndex: The Index of the custom dimension. Set only if the field
  1706. // is a is CUSTOM_DIMENSION.
  1707. FieldIndex int64 `json:"fieldIndex,omitempty"`
  1708. // Kind: Kind value for filter expression
  1709. Kind string `json:"kind,omitempty"`
  1710. // MatchType: Match type for this filter. Possible values are
  1711. // BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN,
  1712. // GEO_IP_ADDRESS, PAGE_REQUEST_URI, or PAGE_HOSTNAME filters can use
  1713. // any match type; all other filters must use MATCHES.
  1714. MatchType string `json:"matchType,omitempty"`
  1715. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  1716. // unconditionally include in API requests. By default, fields with
  1717. // empty values are omitted from API requests. However, any non-pointer,
  1718. // non-interface field appearing in ForceSendFields will be sent to the
  1719. // server regardless of whether the field is empty or not. This may be
  1720. // used to include empty fields in Patch requests.
  1721. ForceSendFields []string `json:"-"`
  1722. }
  1723. func (s *FilterExpression) MarshalJSON() ([]byte, error) {
  1724. type noMethod FilterExpression
  1725. raw := noMethod(*s)
  1726. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1727. }
  1728. // FilterRef: JSON template for a profile filter link.
  1729. type FilterRef struct {
  1730. // AccountId: Account ID to which this filter belongs.
  1731. AccountId string `json:"accountId,omitempty"`
  1732. // Href: Link for this filter.
  1733. Href string `json:"href,omitempty"`
  1734. // Id: Filter ID.
  1735. Id string `json:"id,omitempty"`
  1736. // Kind: Kind value for filter reference.
  1737. Kind string `json:"kind,omitempty"`
  1738. // Name: Name of this filter.
  1739. Name string `json:"name,omitempty"`
  1740. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1741. // unconditionally include in API requests. By default, fields with
  1742. // empty values are omitted from API requests. However, any non-pointer,
  1743. // non-interface field appearing in ForceSendFields will be sent to the
  1744. // server regardless of whether the field is empty or not. This may be
  1745. // used to include empty fields in Patch requests.
  1746. ForceSendFields []string `json:"-"`
  1747. }
  1748. func (s *FilterRef) MarshalJSON() ([]byte, error) {
  1749. type noMethod FilterRef
  1750. raw := noMethod(*s)
  1751. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1752. }
  1753. // Filters: A filter collection lists filters created by users in an
  1754. // Analytics account. Each resource in the collection corresponds to a
  1755. // filter.
  1756. type Filters struct {
  1757. // Items: A list of filters.
  1758. Items []*Filter `json:"items,omitempty"`
  1759. // ItemsPerPage: The maximum number of resources the response can
  1760. // contain, regardless of the actual number of resources returned. Its
  1761. // value ranges from 1 to 1,000 with a value of 1000 by default, or
  1762. // otherwise specified by the max-results query parameter.
  1763. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1764. // Kind: Collection type.
  1765. Kind string `json:"kind,omitempty"`
  1766. // NextLink: Link to next page for this filter collection.
  1767. NextLink string `json:"nextLink,omitempty"`
  1768. // PreviousLink: Link to previous page for this filter collection.
  1769. PreviousLink string `json:"previousLink,omitempty"`
  1770. // StartIndex: The starting index of the resources, which is 1 by
  1771. // default or otherwise specified by the start-index query parameter.
  1772. StartIndex int64 `json:"startIndex,omitempty"`
  1773. // TotalResults: The total number of results for the query, regardless
  1774. // of the number of results in the response.
  1775. TotalResults int64 `json:"totalResults,omitempty"`
  1776. // Username: Email ID of the authenticated user
  1777. Username string `json:"username,omitempty"`
  1778. // ServerResponse contains the HTTP response code and headers from the
  1779. // server.
  1780. googleapi.ServerResponse `json:"-"`
  1781. // ForceSendFields is a list of field names (e.g. "Items") to
  1782. // unconditionally include in API requests. By default, fields with
  1783. // empty values are omitted from API requests. However, any non-pointer,
  1784. // non-interface field appearing in ForceSendFields will be sent to the
  1785. // server regardless of whether the field is empty or not. This may be
  1786. // used to include empty fields in Patch requests.
  1787. ForceSendFields []string `json:"-"`
  1788. }
  1789. func (s *Filters) MarshalJSON() ([]byte, error) {
  1790. type noMethod Filters
  1791. raw := noMethod(*s)
  1792. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1793. }
  1794. // GaData: Analytics data for a given view (profile).
  1795. type GaData struct {
  1796. // ColumnHeaders: Column headers that list dimension names followed by
  1797. // the metric names. The order of dimensions and metrics is same as
  1798. // specified in the request.
  1799. ColumnHeaders []*GaDataColumnHeaders `json:"columnHeaders,omitempty"`
  1800. // ContainsSampledData: Determines if Analytics data contains samples.
  1801. ContainsSampledData bool `json:"containsSampledData,omitempty"`
  1802. DataTable *GaDataDataTable `json:"dataTable,omitempty"`
  1803. // Id: Unique ID for this data response.
  1804. Id string `json:"id,omitempty"`
  1805. // ItemsPerPage: The maximum number of rows the response can contain,
  1806. // regardless of the actual number of rows returned. Its value ranges
  1807. // from 1 to 10,000 with a value of 1000 by default, or otherwise
  1808. // specified by the max-results query parameter.
  1809. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1810. // Kind: Resource type.
  1811. Kind string `json:"kind,omitempty"`
  1812. // NextLink: Link to next page for this Analytics data query.
  1813. NextLink string `json:"nextLink,omitempty"`
  1814. // PreviousLink: Link to previous page for this Analytics data query.
  1815. PreviousLink string `json:"previousLink,omitempty"`
  1816. // ProfileInfo: Information for the view (profile), for which the
  1817. // Analytics data was requested.
  1818. ProfileInfo *GaDataProfileInfo `json:"profileInfo,omitempty"`
  1819. // Query: Analytics data request query parameters.
  1820. Query *GaDataQuery `json:"query,omitempty"`
  1821. // Rows: Analytics data rows, where each row contains a list of
  1822. // dimension values followed by the metric values. The order of
  1823. // dimensions and metrics is same as specified in the request.
  1824. Rows [][]string `json:"rows,omitempty"`
  1825. // SampleSize: The number of samples used to calculate the result.
  1826. SampleSize int64 `json:"sampleSize,omitempty,string"`
  1827. // SampleSpace: Total size of the sample space from which the samples
  1828. // were selected.
  1829. SampleSpace int64 `json:"sampleSpace,omitempty,string"`
  1830. // SelfLink: Link to this page.
  1831. SelfLink string `json:"selfLink,omitempty"`
  1832. // TotalResults: The total number of rows for the query, regardless of
  1833. // the number of rows in the response.
  1834. TotalResults int64 `json:"totalResults,omitempty"`
  1835. // TotalsForAllResults: Total values for the requested metrics over all
  1836. // the results, not just the results returned in this response. The
  1837. // order of the metric totals is same as the metric order specified in
  1838. // the request.
  1839. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  1840. // ServerResponse contains the HTTP response code and headers from the
  1841. // server.
  1842. googleapi.ServerResponse `json:"-"`
  1843. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  1844. // unconditionally include in API requests. By default, fields with
  1845. // empty values are omitted from API requests. However, any non-pointer,
  1846. // non-interface field appearing in ForceSendFields will be sent to the
  1847. // server regardless of whether the field is empty or not. This may be
  1848. // used to include empty fields in Patch requests.
  1849. ForceSendFields []string `json:"-"`
  1850. }
  1851. func (s *GaData) MarshalJSON() ([]byte, error) {
  1852. type noMethod GaData
  1853. raw := noMethod(*s)
  1854. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1855. }
  1856. type GaDataColumnHeaders struct {
  1857. // ColumnType: Column Type. Either DIMENSION or METRIC.
  1858. ColumnType string `json:"columnType,omitempty"`
  1859. // DataType: Data type. Dimension column headers have only STRING as the
  1860. // data type. Metric column headers have data types for metric values
  1861. // such as INTEGER, DOUBLE, CURRENCY etc.
  1862. DataType string `json:"dataType,omitempty"`
  1863. // Name: Column name.
  1864. Name string `json:"name,omitempty"`
  1865. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  1866. // unconditionally include in API requests. By default, fields with
  1867. // empty values are omitted from API requests. However, any non-pointer,
  1868. // non-interface field appearing in ForceSendFields will be sent to the
  1869. // server regardless of whether the field is empty or not. This may be
  1870. // used to include empty fields in Patch requests.
  1871. ForceSendFields []string `json:"-"`
  1872. }
  1873. func (s *GaDataColumnHeaders) MarshalJSON() ([]byte, error) {
  1874. type noMethod GaDataColumnHeaders
  1875. raw := noMethod(*s)
  1876. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1877. }
  1878. type GaDataDataTable struct {
  1879. Cols []*GaDataDataTableCols `json:"cols,omitempty"`
  1880. Rows []*GaDataDataTableRows `json:"rows,omitempty"`
  1881. // ForceSendFields is a list of field names (e.g. "Cols") to
  1882. // unconditionally include in API requests. By default, fields with
  1883. // empty values are omitted from API requests. However, any non-pointer,
  1884. // non-interface field appearing in ForceSendFields will be sent to the
  1885. // server regardless of whether the field is empty or not. This may be
  1886. // used to include empty fields in Patch requests.
  1887. ForceSendFields []string `json:"-"`
  1888. }
  1889. func (s *GaDataDataTable) MarshalJSON() ([]byte, error) {
  1890. type noMethod GaDataDataTable
  1891. raw := noMethod(*s)
  1892. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1893. }
  1894. type GaDataDataTableCols struct {
  1895. Id string `json:"id,omitempty"`
  1896. Label string `json:"label,omitempty"`
  1897. Type string `json:"type,omitempty"`
  1898. // ForceSendFields is a list of field names (e.g. "Id") to
  1899. // unconditionally include in API requests. By default, fields with
  1900. // empty values are omitted from API requests. However, any non-pointer,
  1901. // non-interface field appearing in ForceSendFields will be sent to the
  1902. // server regardless of whether the field is empty or not. This may be
  1903. // used to include empty fields in Patch requests.
  1904. ForceSendFields []string `json:"-"`
  1905. }
  1906. func (s *GaDataDataTableCols) MarshalJSON() ([]byte, error) {
  1907. type noMethod GaDataDataTableCols
  1908. raw := noMethod(*s)
  1909. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1910. }
  1911. type GaDataDataTableRows struct {
  1912. C []*GaDataDataTableRowsC `json:"c,omitempty"`
  1913. // ForceSendFields is a list of field names (e.g. "C") to
  1914. // unconditionally include in API requests. By default, fields with
  1915. // empty values are omitted from API requests. However, any non-pointer,
  1916. // non-interface field appearing in ForceSendFields will be sent to the
  1917. // server regardless of whether the field is empty or not. This may be
  1918. // used to include empty fields in Patch requests.
  1919. ForceSendFields []string `json:"-"`
  1920. }
  1921. func (s *GaDataDataTableRows) MarshalJSON() ([]byte, error) {
  1922. type noMethod GaDataDataTableRows
  1923. raw := noMethod(*s)
  1924. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1925. }
  1926. type GaDataDataTableRowsC struct {
  1927. V string `json:"v,omitempty"`
  1928. // ForceSendFields is a list of field names (e.g. "V") to
  1929. // unconditionally include in API requests. By default, fields with
  1930. // empty values are omitted from API requests. However, any non-pointer,
  1931. // non-interface field appearing in ForceSendFields will be sent to the
  1932. // server regardless of whether the field is empty or not. This may be
  1933. // used to include empty fields in Patch requests.
  1934. ForceSendFields []string `json:"-"`
  1935. }
  1936. func (s *GaDataDataTableRowsC) MarshalJSON() ([]byte, error) {
  1937. type noMethod GaDataDataTableRowsC
  1938. raw := noMethod(*s)
  1939. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1940. }
  1941. // GaDataProfileInfo: Information for the view (profile), for which the
  1942. // Analytics data was requested.
  1943. type GaDataProfileInfo struct {
  1944. // AccountId: Account ID to which this view (profile) belongs.
  1945. AccountId string `json:"accountId,omitempty"`
  1946. // InternalWebPropertyId: Internal ID for the web property to which this
  1947. // view (profile) belongs.
  1948. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  1949. // ProfileId: View (Profile) ID.
  1950. ProfileId string `json:"profileId,omitempty"`
  1951. // ProfileName: View (Profile) name.
  1952. ProfileName string `json:"profileName,omitempty"`
  1953. // TableId: Table ID for view (profile).
  1954. TableId string `json:"tableId,omitempty"`
  1955. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  1956. WebPropertyId string `json:"webPropertyId,omitempty"`
  1957. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1958. // unconditionally include in API requests. By default, fields with
  1959. // empty values are omitted from API requests. However, any non-pointer,
  1960. // non-interface field appearing in ForceSendFields will be sent to the
  1961. // server regardless of whether the field is empty or not. This may be
  1962. // used to include empty fields in Patch requests.
  1963. ForceSendFields []string `json:"-"`
  1964. }
  1965. func (s *GaDataProfileInfo) MarshalJSON() ([]byte, error) {
  1966. type noMethod GaDataProfileInfo
  1967. raw := noMethod(*s)
  1968. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1969. }
  1970. // GaDataQuery: Analytics data request query parameters.
  1971. type GaDataQuery struct {
  1972. // Dimensions: List of analytics dimensions.
  1973. Dimensions string `json:"dimensions,omitempty"`
  1974. // EndDate: End date.
  1975. EndDate string `json:"end-date,omitempty"`
  1976. // Filters: Comma-separated list of dimension or metric filters.
  1977. Filters string `json:"filters,omitempty"`
  1978. // Ids: Unique table ID.
  1979. Ids string `json:"ids,omitempty"`
  1980. // MaxResults: Maximum results per page.
  1981. MaxResults int64 `json:"max-results,omitempty"`
  1982. // Metrics: List of analytics metrics.
  1983. Metrics []string `json:"metrics,omitempty"`
  1984. // SamplingLevel: Desired sampling level
  1985. SamplingLevel string `json:"samplingLevel,omitempty"`
  1986. // Segment: Analytics advanced segment.
  1987. Segment string `json:"segment,omitempty"`
  1988. // Sort: List of dimensions or metrics based on which Analytics data is
  1989. // sorted.
  1990. Sort []string `json:"sort,omitempty"`
  1991. // StartDate: Start date.
  1992. StartDate string `json:"start-date,omitempty"`
  1993. // StartIndex: Start index.
  1994. StartIndex int64 `json:"start-index,omitempty"`
  1995. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  1996. // unconditionally include in API requests. By default, fields with
  1997. // empty values are omitted from API requests. However, any non-pointer,
  1998. // non-interface field appearing in ForceSendFields will be sent to the
  1999. // server regardless of whether the field is empty or not. This may be
  2000. // used to include empty fields in Patch requests.
  2001. ForceSendFields []string `json:"-"`
  2002. }
  2003. func (s *GaDataQuery) MarshalJSON() ([]byte, error) {
  2004. type noMethod GaDataQuery
  2005. raw := noMethod(*s)
  2006. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2007. }
  2008. // Goal: JSON template for Analytics goal resource.
  2009. type Goal struct {
  2010. // AccountId: Account ID to which this goal belongs.
  2011. AccountId string `json:"accountId,omitempty"`
  2012. // Active: Determines whether this goal is active.
  2013. Active bool `json:"active,omitempty"`
  2014. // Created: Time this goal was created.
  2015. Created string `json:"created,omitempty"`
  2016. // EventDetails: Details for the goal of the type EVENT.
  2017. EventDetails *GoalEventDetails `json:"eventDetails,omitempty"`
  2018. // Id: Goal ID.
  2019. Id string `json:"id,omitempty"`
  2020. // InternalWebPropertyId: Internal ID for the web property to which this
  2021. // goal belongs.
  2022. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2023. // Kind: Resource type for an Analytics goal.
  2024. Kind string `json:"kind,omitempty"`
  2025. // Name: Goal name.
  2026. Name string `json:"name,omitempty"`
  2027. // ParentLink: Parent link for a goal. Points to the view (profile) to
  2028. // which this goal belongs.
  2029. ParentLink *GoalParentLink `json:"parentLink,omitempty"`
  2030. // ProfileId: View (Profile) ID to which this goal belongs.
  2031. ProfileId string `json:"profileId,omitempty"`
  2032. // SelfLink: Link for this goal.
  2033. SelfLink string `json:"selfLink,omitempty"`
  2034. // Type: Goal type. Possible values are URL_DESTINATION,
  2035. // VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT.
  2036. Type string `json:"type,omitempty"`
  2037. // Updated: Time this goal was last modified.
  2038. Updated string `json:"updated,omitempty"`
  2039. // UrlDestinationDetails: Details for the goal of the type
  2040. // URL_DESTINATION.
  2041. UrlDestinationDetails *GoalUrlDestinationDetails `json:"urlDestinationDetails,omitempty"`
  2042. // Value: Goal value.
  2043. Value float64 `json:"value,omitempty"`
  2044. // VisitNumPagesDetails: Details for the goal of the type
  2045. // VISIT_NUM_PAGES.
  2046. VisitNumPagesDetails *GoalVisitNumPagesDetails `json:"visitNumPagesDetails,omitempty"`
  2047. // VisitTimeOnSiteDetails: Details for the goal of the type
  2048. // VISIT_TIME_ON_SITE.
  2049. VisitTimeOnSiteDetails *GoalVisitTimeOnSiteDetails `json:"visitTimeOnSiteDetails,omitempty"`
  2050. // WebPropertyId: Web property ID to which this goal belongs. The web
  2051. // property ID is of the form UA-XXXXX-YY.
  2052. WebPropertyId string `json:"webPropertyId,omitempty"`
  2053. // ServerResponse contains the HTTP response code and headers from the
  2054. // server.
  2055. googleapi.ServerResponse `json:"-"`
  2056. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2057. // unconditionally include in API requests. By default, fields with
  2058. // empty values are omitted from API requests. However, any non-pointer,
  2059. // non-interface field appearing in ForceSendFields will be sent to the
  2060. // server regardless of whether the field is empty or not. This may be
  2061. // used to include empty fields in Patch requests.
  2062. ForceSendFields []string `json:"-"`
  2063. }
  2064. func (s *Goal) MarshalJSON() ([]byte, error) {
  2065. type noMethod Goal
  2066. raw := noMethod(*s)
  2067. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2068. }
  2069. // GoalEventDetails: Details for the goal of the type EVENT.
  2070. type GoalEventDetails struct {
  2071. // EventConditions: List of event conditions.
  2072. EventConditions []*GoalEventDetailsEventConditions `json:"eventConditions,omitempty"`
  2073. // UseEventValue: Determines if the event value should be used as the
  2074. // value for this goal.
  2075. UseEventValue bool `json:"useEventValue,omitempty"`
  2076. // ForceSendFields is a list of field names (e.g. "EventConditions") to
  2077. // unconditionally include in API requests. By default, fields with
  2078. // empty values are omitted from API requests. However, any non-pointer,
  2079. // non-interface field appearing in ForceSendFields will be sent to the
  2080. // server regardless of whether the field is empty or not. This may be
  2081. // used to include empty fields in Patch requests.
  2082. ForceSendFields []string `json:"-"`
  2083. }
  2084. func (s *GoalEventDetails) MarshalJSON() ([]byte, error) {
  2085. type noMethod GoalEventDetails
  2086. raw := noMethod(*s)
  2087. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2088. }
  2089. type GoalEventDetailsEventConditions struct {
  2090. // ComparisonType: Type of comparison. Possible values are LESS_THAN,
  2091. // GREATER_THAN or EQUAL.
  2092. ComparisonType string `json:"comparisonType,omitempty"`
  2093. // ComparisonValue: Value used for this comparison.
  2094. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2095. // Expression: Expression used for this match.
  2096. Expression string `json:"expression,omitempty"`
  2097. // MatchType: Type of the match to be performed. Possible values are
  2098. // REGEXP, BEGINS_WITH, or EXACT.
  2099. MatchType string `json:"matchType,omitempty"`
  2100. // Type: Type of this event condition. Possible values are CATEGORY,
  2101. // ACTION, LABEL, or VALUE.
  2102. Type string `json:"type,omitempty"`
  2103. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2104. // unconditionally include in API requests. By default, fields with
  2105. // empty values are omitted from API requests. However, any non-pointer,
  2106. // non-interface field appearing in ForceSendFields will be sent to the
  2107. // server regardless of whether the field is empty or not. This may be
  2108. // used to include empty fields in Patch requests.
  2109. ForceSendFields []string `json:"-"`
  2110. }
  2111. func (s *GoalEventDetailsEventConditions) MarshalJSON() ([]byte, error) {
  2112. type noMethod GoalEventDetailsEventConditions
  2113. raw := noMethod(*s)
  2114. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2115. }
  2116. // GoalParentLink: Parent link for a goal. Points to the view (profile)
  2117. // to which this goal belongs.
  2118. type GoalParentLink struct {
  2119. // Href: Link to the view (profile) to which this goal belongs.
  2120. Href string `json:"href,omitempty"`
  2121. // Type: Value is "analytics#profile".
  2122. Type string `json:"type,omitempty"`
  2123. // ForceSendFields is a list of field names (e.g. "Href") to
  2124. // unconditionally include in API requests. By default, fields with
  2125. // empty values are omitted from API requests. However, any non-pointer,
  2126. // non-interface field appearing in ForceSendFields will be sent to the
  2127. // server regardless of whether the field is empty or not. This may be
  2128. // used to include empty fields in Patch requests.
  2129. ForceSendFields []string `json:"-"`
  2130. }
  2131. func (s *GoalParentLink) MarshalJSON() ([]byte, error) {
  2132. type noMethod GoalParentLink
  2133. raw := noMethod(*s)
  2134. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2135. }
  2136. // GoalUrlDestinationDetails: Details for the goal of the type
  2137. // URL_DESTINATION.
  2138. type GoalUrlDestinationDetails struct {
  2139. // CaseSensitive: Determines if the goal URL must exactly match the
  2140. // capitalization of visited URLs.
  2141. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2142. // FirstStepRequired: Determines if the first step in this goal is
  2143. // required.
  2144. FirstStepRequired bool `json:"firstStepRequired,omitempty"`
  2145. // MatchType: Match type for the goal URL. Possible values are HEAD,
  2146. // EXACT, or REGEX.
  2147. MatchType string `json:"matchType,omitempty"`
  2148. // Steps: List of steps configured for this goal funnel.
  2149. Steps []*GoalUrlDestinationDetailsSteps `json:"steps,omitempty"`
  2150. // Url: URL for this goal.
  2151. Url string `json:"url,omitempty"`
  2152. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2153. // unconditionally include in API requests. By default, fields with
  2154. // empty values are omitted from API requests. However, any non-pointer,
  2155. // non-interface field appearing in ForceSendFields will be sent to the
  2156. // server regardless of whether the field is empty or not. This may be
  2157. // used to include empty fields in Patch requests.
  2158. ForceSendFields []string `json:"-"`
  2159. }
  2160. func (s *GoalUrlDestinationDetails) MarshalJSON() ([]byte, error) {
  2161. type noMethod GoalUrlDestinationDetails
  2162. raw := noMethod(*s)
  2163. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2164. }
  2165. type GoalUrlDestinationDetailsSteps struct {
  2166. // Name: Step name.
  2167. Name string `json:"name,omitempty"`
  2168. // Number: Step number.
  2169. Number int64 `json:"number,omitempty"`
  2170. // Url: URL for this step.
  2171. Url string `json:"url,omitempty"`
  2172. // ForceSendFields is a list of field names (e.g. "Name") to
  2173. // unconditionally include in API requests. By default, fields with
  2174. // empty values are omitted from API requests. However, any non-pointer,
  2175. // non-interface field appearing in ForceSendFields will be sent to the
  2176. // server regardless of whether the field is empty or not. This may be
  2177. // used to include empty fields in Patch requests.
  2178. ForceSendFields []string `json:"-"`
  2179. }
  2180. func (s *GoalUrlDestinationDetailsSteps) MarshalJSON() ([]byte, error) {
  2181. type noMethod GoalUrlDestinationDetailsSteps
  2182. raw := noMethod(*s)
  2183. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2184. }
  2185. // GoalVisitNumPagesDetails: Details for the goal of the type
  2186. // VISIT_NUM_PAGES.
  2187. type GoalVisitNumPagesDetails struct {
  2188. // ComparisonType: Type of comparison. Possible values are LESS_THAN,
  2189. // GREATER_THAN, or EQUAL.
  2190. ComparisonType string `json:"comparisonType,omitempty"`
  2191. // ComparisonValue: Value used for this comparison.
  2192. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2193. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2194. // unconditionally include in API requests. By default, fields with
  2195. // empty values are omitted from API requests. However, any non-pointer,
  2196. // non-interface field appearing in ForceSendFields will be sent to the
  2197. // server regardless of whether the field is empty or not. This may be
  2198. // used to include empty fields in Patch requests.
  2199. ForceSendFields []string `json:"-"`
  2200. }
  2201. func (s *GoalVisitNumPagesDetails) MarshalJSON() ([]byte, error) {
  2202. type noMethod GoalVisitNumPagesDetails
  2203. raw := noMethod(*s)
  2204. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2205. }
  2206. // GoalVisitTimeOnSiteDetails: Details for the goal of the type
  2207. // VISIT_TIME_ON_SITE.
  2208. type GoalVisitTimeOnSiteDetails struct {
  2209. // ComparisonType: Type of comparison. Possible values are LESS_THAN or
  2210. // GREATER_THAN.
  2211. ComparisonType string `json:"comparisonType,omitempty"`
  2212. // ComparisonValue: Value used for this comparison.
  2213. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2214. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2215. // unconditionally include in API requests. By default, fields with
  2216. // empty values are omitted from API requests. However, any non-pointer,
  2217. // non-interface field appearing in ForceSendFields will be sent to the
  2218. // server regardless of whether the field is empty or not. This may be
  2219. // used to include empty fields in Patch requests.
  2220. ForceSendFields []string `json:"-"`
  2221. }
  2222. func (s *GoalVisitTimeOnSiteDetails) MarshalJSON() ([]byte, error) {
  2223. type noMethod GoalVisitTimeOnSiteDetails
  2224. raw := noMethod(*s)
  2225. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2226. }
  2227. // Goals: A goal collection lists Analytics goals to which the user has
  2228. // access. Each view (profile) can have a set of goals. Each resource in
  2229. // the Goal collection corresponds to a single Analytics goal.
  2230. type Goals struct {
  2231. // Items: A list of goals.
  2232. Items []*Goal `json:"items,omitempty"`
  2233. // ItemsPerPage: The maximum number of resources the response can
  2234. // contain, regardless of the actual number of resources returned. Its
  2235. // value ranges from 1 to 1000 with a value of 1000 by default, or
  2236. // otherwise specified by the max-results query parameter.
  2237. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2238. // Kind: Collection type.
  2239. Kind string `json:"kind,omitempty"`
  2240. // NextLink: Link to next page for this goal collection.
  2241. NextLink string `json:"nextLink,omitempty"`
  2242. // PreviousLink: Link to previous page for this goal collection.
  2243. PreviousLink string `json:"previousLink,omitempty"`
  2244. // StartIndex: The starting index of the resources, which is 1 by
  2245. // default or otherwise specified by the start-index query parameter.
  2246. StartIndex int64 `json:"startIndex,omitempty"`
  2247. // TotalResults: The total number of results for the query, regardless
  2248. // of the number of resources in the result.
  2249. TotalResults int64 `json:"totalResults,omitempty"`
  2250. // Username: Email ID of the authenticated user
  2251. Username string `json:"username,omitempty"`
  2252. // ServerResponse contains the HTTP response code and headers from the
  2253. // server.
  2254. googleapi.ServerResponse `json:"-"`
  2255. // ForceSendFields is a list of field names (e.g. "Items") to
  2256. // unconditionally include in API requests. By default, fields with
  2257. // empty values are omitted from API requests. However, any non-pointer,
  2258. // non-interface field appearing in ForceSendFields will be sent to the
  2259. // server regardless of whether the field is empty or not. This may be
  2260. // used to include empty fields in Patch requests.
  2261. ForceSendFields []string `json:"-"`
  2262. }
  2263. func (s *Goals) MarshalJSON() ([]byte, error) {
  2264. type noMethod Goals
  2265. raw := noMethod(*s)
  2266. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2267. }
  2268. // McfData: Multi-Channel Funnels data for a given view (profile).
  2269. type McfData struct {
  2270. // ColumnHeaders: Column headers that list dimension names followed by
  2271. // the metric names. The order of dimensions and metrics is same as
  2272. // specified in the request.
  2273. ColumnHeaders []*McfDataColumnHeaders `json:"columnHeaders,omitempty"`
  2274. // ContainsSampledData: Determines if the Analytics data contains
  2275. // sampled data.
  2276. ContainsSampledData bool `json:"containsSampledData,omitempty"`
  2277. // Id: Unique ID for this data response.
  2278. Id string `json:"id,omitempty"`
  2279. // ItemsPerPage: The maximum number of rows the response can contain,
  2280. // regardless of the actual number of rows returned. Its value ranges
  2281. // from 1 to 10,000 with a value of 1000 by default, or otherwise
  2282. // specified by the max-results query parameter.
  2283. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2284. // Kind: Resource type.
  2285. Kind string `json:"kind,omitempty"`
  2286. // NextLink: Link to next page for this Analytics data query.
  2287. NextLink string `json:"nextLink,omitempty"`
  2288. // PreviousLink: Link to previous page for this Analytics data query.
  2289. PreviousLink string `json:"previousLink,omitempty"`
  2290. // ProfileInfo: Information for the view (profile), for which the
  2291. // Analytics data was requested.
  2292. ProfileInfo *McfDataProfileInfo `json:"profileInfo,omitempty"`
  2293. // Query: Analytics data request query parameters.
  2294. Query *McfDataQuery `json:"query,omitempty"`
  2295. // Rows: Analytics data rows, where each row contains a list of
  2296. // dimension values followed by the metric values. The order of
  2297. // dimensions and metrics is same as specified in the request.
  2298. Rows [][]*McfDataRowsItem `json:"rows,omitempty"`
  2299. // SampleSize: The number of samples used to calculate the result.
  2300. SampleSize int64 `json:"sampleSize,omitempty,string"`
  2301. // SampleSpace: Total size of the sample space from which the samples
  2302. // were selected.
  2303. SampleSpace int64 `json:"sampleSpace,omitempty,string"`
  2304. // SelfLink: Link to this page.
  2305. SelfLink string `json:"selfLink,omitempty"`
  2306. // TotalResults: The total number of rows for the query, regardless of
  2307. // the number of rows in the response.
  2308. TotalResults int64 `json:"totalResults,omitempty"`
  2309. // TotalsForAllResults: Total values for the requested metrics over all
  2310. // the results, not just the results returned in this response. The
  2311. // order of the metric totals is same as the metric order specified in
  2312. // the request.
  2313. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  2314. // ServerResponse contains the HTTP response code and headers from the
  2315. // server.
  2316. googleapi.ServerResponse `json:"-"`
  2317. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  2318. // unconditionally include in API requests. By default, fields with
  2319. // empty values are omitted from API requests. However, any non-pointer,
  2320. // non-interface field appearing in ForceSendFields will be sent to the
  2321. // server regardless of whether the field is empty or not. This may be
  2322. // used to include empty fields in Patch requests.
  2323. ForceSendFields []string `json:"-"`
  2324. }
  2325. func (s *McfData) MarshalJSON() ([]byte, error) {
  2326. type noMethod McfData
  2327. raw := noMethod(*s)
  2328. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2329. }
  2330. type McfDataColumnHeaders struct {
  2331. // ColumnType: Column Type. Either DIMENSION or METRIC.
  2332. ColumnType string `json:"columnType,omitempty"`
  2333. // DataType: Data type. Dimension and metric values data types such as
  2334. // INTEGER, DOUBLE, CURRENCY, MCF_SEQUENCE etc.
  2335. DataType string `json:"dataType,omitempty"`
  2336. // Name: Column name.
  2337. Name string `json:"name,omitempty"`
  2338. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  2339. // unconditionally include in API requests. By default, fields with
  2340. // empty values are omitted from API requests. However, any non-pointer,
  2341. // non-interface field appearing in ForceSendFields will be sent to the
  2342. // server regardless of whether the field is empty or not. This may be
  2343. // used to include empty fields in Patch requests.
  2344. ForceSendFields []string `json:"-"`
  2345. }
  2346. func (s *McfDataColumnHeaders) MarshalJSON() ([]byte, error) {
  2347. type noMethod McfDataColumnHeaders
  2348. raw := noMethod(*s)
  2349. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2350. }
  2351. // McfDataProfileInfo: Information for the view (profile), for which the
  2352. // Analytics data was requested.
  2353. type McfDataProfileInfo struct {
  2354. // AccountId: Account ID to which this view (profile) belongs.
  2355. AccountId string `json:"accountId,omitempty"`
  2356. // InternalWebPropertyId: Internal ID for the web property to which this
  2357. // view (profile) belongs.
  2358. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2359. // ProfileId: View (Profile) ID.
  2360. ProfileId string `json:"profileId,omitempty"`
  2361. // ProfileName: View (Profile) name.
  2362. ProfileName string `json:"profileName,omitempty"`
  2363. // TableId: Table ID for view (profile).
  2364. TableId string `json:"tableId,omitempty"`
  2365. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  2366. WebPropertyId string `json:"webPropertyId,omitempty"`
  2367. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2368. // unconditionally include in API requests. By default, fields with
  2369. // empty values are omitted from API requests. However, any non-pointer,
  2370. // non-interface field appearing in ForceSendFields will be sent to the
  2371. // server regardless of whether the field is empty or not. This may be
  2372. // used to include empty fields in Patch requests.
  2373. ForceSendFields []string `json:"-"`
  2374. }
  2375. func (s *McfDataProfileInfo) MarshalJSON() ([]byte, error) {
  2376. type noMethod McfDataProfileInfo
  2377. raw := noMethod(*s)
  2378. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2379. }
  2380. // McfDataQuery: Analytics data request query parameters.
  2381. type McfDataQuery struct {
  2382. // Dimensions: List of analytics dimensions.
  2383. Dimensions string `json:"dimensions,omitempty"`
  2384. // EndDate: End date.
  2385. EndDate string `json:"end-date,omitempty"`
  2386. // Filters: Comma-separated list of dimension or metric filters.
  2387. Filters string `json:"filters,omitempty"`
  2388. // Ids: Unique table ID.
  2389. Ids string `json:"ids,omitempty"`
  2390. // MaxResults: Maximum results per page.
  2391. MaxResults int64 `json:"max-results,omitempty"`
  2392. // Metrics: List of analytics metrics.
  2393. Metrics []string `json:"metrics,omitempty"`
  2394. // SamplingLevel: Desired sampling level
  2395. SamplingLevel string `json:"samplingLevel,omitempty"`
  2396. // Segment: Analytics advanced segment.
  2397. Segment string `json:"segment,omitempty"`
  2398. // Sort: List of dimensions or metrics based on which Analytics data is
  2399. // sorted.
  2400. Sort []string `json:"sort,omitempty"`
  2401. // StartDate: Start date.
  2402. StartDate string `json:"start-date,omitempty"`
  2403. // StartIndex: Start index.
  2404. StartIndex int64 `json:"start-index,omitempty"`
  2405. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  2406. // unconditionally include in API requests. By default, fields with
  2407. // empty values are omitted from API requests. However, any non-pointer,
  2408. // non-interface field appearing in ForceSendFields will be sent to the
  2409. // server regardless of whether the field is empty or not. This may be
  2410. // used to include empty fields in Patch requests.
  2411. ForceSendFields []string `json:"-"`
  2412. }
  2413. func (s *McfDataQuery) MarshalJSON() ([]byte, error) {
  2414. type noMethod McfDataQuery
  2415. raw := noMethod(*s)
  2416. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2417. }
  2418. // McfDataRowsItem: A union object representing a dimension or metric
  2419. // value. Only one of "primitiveValue" or "conversionPathValue"
  2420. // attribute will be populated.
  2421. type McfDataRowsItem struct {
  2422. // ConversionPathValue: A conversion path dimension value, containing a
  2423. // list of interactions with their attributes.
  2424. ConversionPathValue []*McfDataRowsItemConversionPathValue `json:"conversionPathValue,omitempty"`
  2425. // PrimitiveValue: A primitive dimension value. A primitive metric
  2426. // value.
  2427. PrimitiveValue string `json:"primitiveValue,omitempty"`
  2428. // ForceSendFields is a list of field names (e.g. "ConversionPathValue")
  2429. // to unconditionally include in API requests. By default, fields with
  2430. // empty values are omitted from API requests. However, any non-pointer,
  2431. // non-interface field appearing in ForceSendFields will be sent to the
  2432. // server regardless of whether the field is empty or not. This may be
  2433. // used to include empty fields in Patch requests.
  2434. ForceSendFields []string `json:"-"`
  2435. }
  2436. func (s *McfDataRowsItem) MarshalJSON() ([]byte, error) {
  2437. type noMethod McfDataRowsItem
  2438. raw := noMethod(*s)
  2439. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2440. }
  2441. type McfDataRowsItemConversionPathValue struct {
  2442. // InteractionType: Type of an interaction on conversion path. Such as
  2443. // CLICK, IMPRESSION etc.
  2444. InteractionType string `json:"interactionType,omitempty"`
  2445. // NodeValue: Node value of an interaction on conversion path. Such as
  2446. // source, medium etc.
  2447. NodeValue string `json:"nodeValue,omitempty"`
  2448. // ForceSendFields is a list of field names (e.g. "InteractionType") to
  2449. // unconditionally include in API requests. By default, fields with
  2450. // empty values are omitted from API requests. However, any non-pointer,
  2451. // non-interface field appearing in ForceSendFields will be sent to the
  2452. // server regardless of whether the field is empty or not. This may be
  2453. // used to include empty fields in Patch requests.
  2454. ForceSendFields []string `json:"-"`
  2455. }
  2456. func (s *McfDataRowsItemConversionPathValue) MarshalJSON() ([]byte, error) {
  2457. type noMethod McfDataRowsItemConversionPathValue
  2458. raw := noMethod(*s)
  2459. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2460. }
  2461. // Profile: JSON template for an Analytics view (profile).
  2462. type Profile struct {
  2463. // AccountId: Account ID to which this view (profile) belongs.
  2464. AccountId string `json:"accountId,omitempty"`
  2465. // BotFilteringEnabled: Indicates whether bot filtering is enabled for
  2466. // this view (profile).
  2467. BotFilteringEnabled bool `json:"botFilteringEnabled,omitempty"`
  2468. // ChildLink: Child link for this view (profile). Points to the list of
  2469. // goals for this view (profile).
  2470. ChildLink *ProfileChildLink `json:"childLink,omitempty"`
  2471. // Created: Time this view (profile) was created.
  2472. Created string `json:"created,omitempty"`
  2473. // Currency: The currency type associated with this view (profile),
  2474. // defaults to USD. The supported values are:
  2475. // ARS, AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HUF, IDR,
  2476. // INR, JPY, KRW, LTL, MXN, NOK, NZD, PHP, PLN, RUB, SEK, THB, TRY, TWD,
  2477. // USD, VND, ZAR
  2478. Currency string `json:"currency,omitempty"`
  2479. // DefaultPage: Default page for this view (profile).
  2480. DefaultPage string `json:"defaultPage,omitempty"`
  2481. // ECommerceTracking: Indicates whether ecommerce tracking is enabled
  2482. // for this view (profile).
  2483. ECommerceTracking bool `json:"eCommerceTracking,omitempty"`
  2484. // EnhancedECommerceTracking: Indicates whether enhanced ecommerce
  2485. // tracking is enabled for this view (profile). This property can only
  2486. // be enabled if ecommerce tracking is enabled.
  2487. EnhancedECommerceTracking bool `json:"enhancedECommerceTracking,omitempty"`
  2488. // ExcludeQueryParameters: The query parameters that are excluded from
  2489. // this view (profile).
  2490. ExcludeQueryParameters string `json:"excludeQueryParameters,omitempty"`
  2491. // Id: View (Profile) ID.
  2492. Id string `json:"id,omitempty"`
  2493. // InternalWebPropertyId: Internal ID for the web property to which this
  2494. // view (profile) belongs.
  2495. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2496. // Kind: Resource type for Analytics view (profile).
  2497. Kind string `json:"kind,omitempty"`
  2498. // Name: Name of this view (profile).
  2499. Name string `json:"name,omitempty"`
  2500. // ParentLink: Parent link for this view (profile). Points to the web
  2501. // property to which this view (profile) belongs.
  2502. ParentLink *ProfileParentLink `json:"parentLink,omitempty"`
  2503. // Permissions: Permissions the user has for this view (profile).
  2504. Permissions *ProfilePermissions `json:"permissions,omitempty"`
  2505. // SelfLink: Link for this view (profile).
  2506. SelfLink string `json:"selfLink,omitempty"`
  2507. // SiteSearchCategoryParameters: Site search category parameters for
  2508. // this view (profile).
  2509. SiteSearchCategoryParameters string `json:"siteSearchCategoryParameters,omitempty"`
  2510. // SiteSearchQueryParameters: The site search query parameters for this
  2511. // view (profile).
  2512. SiteSearchQueryParameters string `json:"siteSearchQueryParameters,omitempty"`
  2513. // StripSiteSearchCategoryParameters: Whether or not Analytics will
  2514. // strip search category parameters from the URLs in your reports.
  2515. StripSiteSearchCategoryParameters bool `json:"stripSiteSearchCategoryParameters,omitempty"`
  2516. // StripSiteSearchQueryParameters: Whether or not Analytics will strip
  2517. // search query parameters from the URLs in your reports.
  2518. StripSiteSearchQueryParameters bool `json:"stripSiteSearchQueryParameters,omitempty"`
  2519. // Timezone: Time zone for which this view (profile) has been
  2520. // configured. Time zones are identified by strings from the TZ
  2521. // database.
  2522. Timezone string `json:"timezone,omitempty"`
  2523. // Type: View (Profile) type. Supported types: WEB or APP.
  2524. Type string `json:"type,omitempty"`
  2525. // Updated: Time this view (profile) was last modified.
  2526. Updated string `json:"updated,omitempty"`
  2527. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  2528. // view (profile) belongs.
  2529. WebPropertyId string `json:"webPropertyId,omitempty"`
  2530. // WebsiteUrl: Website URL for this view (profile).
  2531. WebsiteUrl string `json:"websiteUrl,omitempty"`
  2532. // ServerResponse contains the HTTP response code and headers from the
  2533. // server.
  2534. googleapi.ServerResponse `json:"-"`
  2535. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2536. // unconditionally include in API requests. By default, fields with
  2537. // empty values are omitted from API requests. However, any non-pointer,
  2538. // non-interface field appearing in ForceSendFields will be sent to the
  2539. // server regardless of whether the field is empty or not. This may be
  2540. // used to include empty fields in Patch requests.
  2541. ForceSendFields []string `json:"-"`
  2542. }
  2543. func (s *Profile) MarshalJSON() ([]byte, error) {
  2544. type noMethod Profile
  2545. raw := noMethod(*s)
  2546. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2547. }
  2548. // ProfileChildLink: Child link for this view (profile). Points to the
  2549. // list of goals for this view (profile).
  2550. type ProfileChildLink struct {
  2551. // Href: Link to the list of goals for this view (profile).
  2552. Href string `json:"href,omitempty"`
  2553. // Type: Value is "analytics#goals".
  2554. Type string `json:"type,omitempty"`
  2555. // ForceSendFields is a list of field names (e.g. "Href") to
  2556. // unconditionally include in API requests. By default, fields with
  2557. // empty values are omitted from API requests. However, any non-pointer,
  2558. // non-interface field appearing in ForceSendFields will be sent to the
  2559. // server regardless of whether the field is empty or not. This may be
  2560. // used to include empty fields in Patch requests.
  2561. ForceSendFields []string `json:"-"`
  2562. }
  2563. func (s *ProfileChildLink) MarshalJSON() ([]byte, error) {
  2564. type noMethod ProfileChildLink
  2565. raw := noMethod(*s)
  2566. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2567. }
  2568. // ProfileParentLink: Parent link for this view (profile). Points to the
  2569. // web property to which this view (profile) belongs.
  2570. type ProfileParentLink struct {
  2571. // Href: Link to the web property to which this view (profile) belongs.
  2572. Href string `json:"href,omitempty"`
  2573. // Type: Value is "analytics#webproperty".
  2574. Type string `json:"type,omitempty"`
  2575. // ForceSendFields is a list of field names (e.g. "Href") to
  2576. // unconditionally include in API requests. By default, fields with
  2577. // empty values are omitted from API requests. However, any non-pointer,
  2578. // non-interface field appearing in ForceSendFields will be sent to the
  2579. // server regardless of whether the field is empty or not. This may be
  2580. // used to include empty fields in Patch requests.
  2581. ForceSendFields []string `json:"-"`
  2582. }
  2583. func (s *ProfileParentLink) MarshalJSON() ([]byte, error) {
  2584. type noMethod ProfileParentLink
  2585. raw := noMethod(*s)
  2586. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2587. }
  2588. // ProfilePermissions: Permissions the user has for this view (profile).
  2589. type ProfilePermissions struct {
  2590. // Effective: All the permissions that the user has for this view
  2591. // (profile). These include any implied permissions (e.g., EDIT implies
  2592. // VIEW) or inherited permissions from the parent web property.
  2593. Effective []string `json:"effective,omitempty"`
  2594. // ForceSendFields is a list of field names (e.g. "Effective") to
  2595. // unconditionally include in API requests. By default, fields with
  2596. // empty values are omitted from API requests. However, any non-pointer,
  2597. // non-interface field appearing in ForceSendFields will be sent to the
  2598. // server regardless of whether the field is empty or not. This may be
  2599. // used to include empty fields in Patch requests.
  2600. ForceSendFields []string `json:"-"`
  2601. }
  2602. func (s *ProfilePermissions) MarshalJSON() ([]byte, error) {
  2603. type noMethod ProfilePermissions
  2604. raw := noMethod(*s)
  2605. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2606. }
  2607. // ProfileFilterLink: JSON template for an Analytics profile filter
  2608. // link.
  2609. type ProfileFilterLink struct {
  2610. // FilterRef: Filter for this link.
  2611. FilterRef *FilterRef `json:"filterRef,omitempty"`
  2612. // Id: Profile filter link ID.
  2613. Id string `json:"id,omitempty"`
  2614. // Kind: Resource type for Analytics filter.
  2615. Kind string `json:"kind,omitempty"`
  2616. // ProfileRef: View (Profile) for this link.
  2617. ProfileRef *ProfileRef `json:"profileRef,omitempty"`
  2618. // Rank: The rank of this profile filter link relative to the other
  2619. // filters linked to the same profile.
  2620. // For readonly (i.e., list and get) operations, the rank always starts
  2621. // at 1.
  2622. // For write (i.e., create, update, or delete) operations, you may
  2623. // specify a value between 0 and 255 inclusively, [0, 255]. In order to
  2624. // insert a link at the end of the list, either don't specify a rank or
  2625. // set a rank to a number greater than the largest rank in the list. In
  2626. // order to insert a link to the beginning of the list specify a rank
  2627. // that is less than or equal to 1. The new link will move all existing
  2628. // filters with the same or lower rank down the list. After the link is
  2629. // inserted/updated/deleted all profile filter links will be renumbered
  2630. // starting at 1.
  2631. Rank int64 `json:"rank,omitempty"`
  2632. // SelfLink: Link for this profile filter link.
  2633. SelfLink string `json:"selfLink,omitempty"`
  2634. // ServerResponse contains the HTTP response code and headers from the
  2635. // server.
  2636. googleapi.ServerResponse `json:"-"`
  2637. // ForceSendFields is a list of field names (e.g. "FilterRef") to
  2638. // unconditionally include in API requests. By default, fields with
  2639. // empty values are omitted from API requests. However, any non-pointer,
  2640. // non-interface field appearing in ForceSendFields will be sent to the
  2641. // server regardless of whether the field is empty or not. This may be
  2642. // used to include empty fields in Patch requests.
  2643. ForceSendFields []string `json:"-"`
  2644. }
  2645. func (s *ProfileFilterLink) MarshalJSON() ([]byte, error) {
  2646. type noMethod ProfileFilterLink
  2647. raw := noMethod(*s)
  2648. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2649. }
  2650. // ProfileFilterLinks: A profile filter link collection lists profile
  2651. // filter links between profiles and filters. Each resource in the
  2652. // collection corresponds to a profile filter link.
  2653. type ProfileFilterLinks struct {
  2654. // Items: A list of profile filter links.
  2655. Items []*ProfileFilterLink `json:"items,omitempty"`
  2656. // ItemsPerPage: The maximum number of resources the response can
  2657. // contain, regardless of the actual number of resources returned. Its
  2658. // value ranges from 1 to 1,000 with a value of 1000 by default, or
  2659. // otherwise specified by the max-results query parameter.
  2660. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2661. // Kind: Collection type.
  2662. Kind string `json:"kind,omitempty"`
  2663. // NextLink: Link to next page for this profile filter link collection.
  2664. NextLink string `json:"nextLink,omitempty"`
  2665. // PreviousLink: Link to previous page for this profile filter link
  2666. // collection.
  2667. PreviousLink string `json:"previousLink,omitempty"`
  2668. // StartIndex: The starting index of the resources, which is 1 by
  2669. // default or otherwise specified by the start-index query parameter.
  2670. StartIndex int64 `json:"startIndex,omitempty"`
  2671. // TotalResults: The total number of results for the query, regardless
  2672. // of the number of results in the response.
  2673. TotalResults int64 `json:"totalResults,omitempty"`
  2674. // Username: Email ID of the authenticated user
  2675. Username string `json:"username,omitempty"`
  2676. // ServerResponse contains the HTTP response code and headers from the
  2677. // server.
  2678. googleapi.ServerResponse `json:"-"`
  2679. // ForceSendFields is a list of field names (e.g. "Items") to
  2680. // unconditionally include in API requests. By default, fields with
  2681. // empty values are omitted from API requests. However, any non-pointer,
  2682. // non-interface field appearing in ForceSendFields will be sent to the
  2683. // server regardless of whether the field is empty or not. This may be
  2684. // used to include empty fields in Patch requests.
  2685. ForceSendFields []string `json:"-"`
  2686. }
  2687. func (s *ProfileFilterLinks) MarshalJSON() ([]byte, error) {
  2688. type noMethod ProfileFilterLinks
  2689. raw := noMethod(*s)
  2690. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2691. }
  2692. // ProfileRef: JSON template for a linked view (profile).
  2693. type ProfileRef struct {
  2694. // AccountId: Account ID to which this view (profile) belongs.
  2695. AccountId string `json:"accountId,omitempty"`
  2696. // Href: Link for this view (profile).
  2697. Href string `json:"href,omitempty"`
  2698. // Id: View (Profile) ID.
  2699. Id string `json:"id,omitempty"`
  2700. // InternalWebPropertyId: Internal ID for the web property to which this
  2701. // view (profile) belongs.
  2702. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2703. // Kind: Analytics view (profile) reference.
  2704. Kind string `json:"kind,omitempty"`
  2705. // Name: Name of this view (profile).
  2706. Name string `json:"name,omitempty"`
  2707. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  2708. // view (profile) belongs.
  2709. WebPropertyId string `json:"webPropertyId,omitempty"`
  2710. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2711. // unconditionally include in API requests. By default, fields with
  2712. // empty values are omitted from API requests. However, any non-pointer,
  2713. // non-interface field appearing in ForceSendFields will be sent to the
  2714. // server regardless of whether the field is empty or not. This may be
  2715. // used to include empty fields in Patch requests.
  2716. ForceSendFields []string `json:"-"`
  2717. }
  2718. func (s *ProfileRef) MarshalJSON() ([]byte, error) {
  2719. type noMethod ProfileRef
  2720. raw := noMethod(*s)
  2721. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2722. }
  2723. // ProfileSummary: JSON template for an Analytics ProfileSummary.
  2724. // ProfileSummary returns basic information (i.e., summary) for a
  2725. // profile.
  2726. type ProfileSummary struct {
  2727. // Id: View (profile) ID.
  2728. Id string `json:"id,omitempty"`
  2729. // Kind: Resource type for Analytics ProfileSummary.
  2730. Kind string `json:"kind,omitempty"`
  2731. // Name: View (profile) name.
  2732. Name string `json:"name,omitempty"`
  2733. // Type: View (Profile) type. Supported types: WEB or APP.
  2734. Type string `json:"type,omitempty"`
  2735. // ForceSendFields is a list of field names (e.g. "Id") to
  2736. // unconditionally include in API requests. By default, fields with
  2737. // empty values are omitted from API requests. However, any non-pointer,
  2738. // non-interface field appearing in ForceSendFields will be sent to the
  2739. // server regardless of whether the field is empty or not. This may be
  2740. // used to include empty fields in Patch requests.
  2741. ForceSendFields []string `json:"-"`
  2742. }
  2743. func (s *ProfileSummary) MarshalJSON() ([]byte, error) {
  2744. type noMethod ProfileSummary
  2745. raw := noMethod(*s)
  2746. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2747. }
  2748. // Profiles: A view (profile) collection lists Analytics views
  2749. // (profiles) to which the user has access. Each resource in the
  2750. // collection corresponds to a single Analytics view (profile).
  2751. type Profiles struct {
  2752. // Items: A list of views (profiles).
  2753. Items []*Profile `json:"items,omitempty"`
  2754. // ItemsPerPage: The maximum number of resources the response can
  2755. // contain, regardless of the actual number of resources returned. Its
  2756. // value ranges from 1 to 1000 with a value of 1000 by default, or
  2757. // otherwise specified by the max-results query parameter.
  2758. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2759. // Kind: Collection type.
  2760. Kind string `json:"kind,omitempty"`
  2761. // NextLink: Link to next page for this view (profile) collection.
  2762. NextLink string `json:"nextLink,omitempty"`
  2763. // PreviousLink: Link to previous page for this view (profile)
  2764. // collection.
  2765. PreviousLink string `json:"previousLink,omitempty"`
  2766. // StartIndex: The starting index of the resources, which is 1 by
  2767. // default or otherwise specified by the start-index query parameter.
  2768. StartIndex int64 `json:"startIndex,omitempty"`
  2769. // TotalResults: The total number of results for the query, regardless
  2770. // of the number of results in the response.
  2771. TotalResults int64 `json:"totalResults,omitempty"`
  2772. // Username: Email ID of the authenticated user
  2773. Username string `json:"username,omitempty"`
  2774. // ServerResponse contains the HTTP response code and headers from the
  2775. // server.
  2776. googleapi.ServerResponse `json:"-"`
  2777. // ForceSendFields is a list of field names (e.g. "Items") to
  2778. // unconditionally include in API requests. By default, fields with
  2779. // empty values are omitted from API requests. However, any non-pointer,
  2780. // non-interface field appearing in ForceSendFields will be sent to the
  2781. // server regardless of whether the field is empty or not. This may be
  2782. // used to include empty fields in Patch requests.
  2783. ForceSendFields []string `json:"-"`
  2784. }
  2785. func (s *Profiles) MarshalJSON() ([]byte, error) {
  2786. type noMethod Profiles
  2787. raw := noMethod(*s)
  2788. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2789. }
  2790. // RealtimeData: Real time data for a given view (profile).
  2791. type RealtimeData struct {
  2792. // ColumnHeaders: Column headers that list dimension names followed by
  2793. // the metric names. The order of dimensions and metrics is same as
  2794. // specified in the request.
  2795. ColumnHeaders []*RealtimeDataColumnHeaders `json:"columnHeaders,omitempty"`
  2796. // Id: Unique ID for this data response.
  2797. Id string `json:"id,omitempty"`
  2798. // Kind: Resource type.
  2799. Kind string `json:"kind,omitempty"`
  2800. // ProfileInfo: Information for the view (profile), for which the real
  2801. // time data was requested.
  2802. ProfileInfo *RealtimeDataProfileInfo `json:"profileInfo,omitempty"`
  2803. // Query: Real time data request query parameters.
  2804. Query *RealtimeDataQuery `json:"query,omitempty"`
  2805. // Rows: Real time data rows, where each row contains a list of
  2806. // dimension values followed by the metric values. The order of
  2807. // dimensions and metrics is same as specified in the request.
  2808. Rows [][]string `json:"rows,omitempty"`
  2809. // SelfLink: Link to this page.
  2810. SelfLink string `json:"selfLink,omitempty"`
  2811. // TotalResults: The total number of rows for the query, regardless of
  2812. // the number of rows in the response.
  2813. TotalResults int64 `json:"totalResults,omitempty"`
  2814. // TotalsForAllResults: Total values for the requested metrics over all
  2815. // the results, not just the results returned in this response. The
  2816. // order of the metric totals is same as the metric order specified in
  2817. // the request.
  2818. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  2819. // ServerResponse contains the HTTP response code and headers from the
  2820. // server.
  2821. googleapi.ServerResponse `json:"-"`
  2822. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  2823. // unconditionally include in API requests. By default, fields with
  2824. // empty values are omitted from API requests. However, any non-pointer,
  2825. // non-interface field appearing in ForceSendFields will be sent to the
  2826. // server regardless of whether the field is empty or not. This may be
  2827. // used to include empty fields in Patch requests.
  2828. ForceSendFields []string `json:"-"`
  2829. }
  2830. func (s *RealtimeData) MarshalJSON() ([]byte, error) {
  2831. type noMethod RealtimeData
  2832. raw := noMethod(*s)
  2833. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2834. }
  2835. type RealtimeDataColumnHeaders struct {
  2836. // ColumnType: Column Type. Either DIMENSION or METRIC.
  2837. ColumnType string `json:"columnType,omitempty"`
  2838. // DataType: Data type. Dimension column headers have only STRING as the
  2839. // data type. Metric column headers have data types for metric values
  2840. // such as INTEGER, DOUBLE, CURRENCY etc.
  2841. DataType string `json:"dataType,omitempty"`
  2842. // Name: Column name.
  2843. Name string `json:"name,omitempty"`
  2844. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  2845. // unconditionally include in API requests. By default, fields with
  2846. // empty values are omitted from API requests. However, any non-pointer,
  2847. // non-interface field appearing in ForceSendFields will be sent to the
  2848. // server regardless of whether the field is empty or not. This may be
  2849. // used to include empty fields in Patch requests.
  2850. ForceSendFields []string `json:"-"`
  2851. }
  2852. func (s *RealtimeDataColumnHeaders) MarshalJSON() ([]byte, error) {
  2853. type noMethod RealtimeDataColumnHeaders
  2854. raw := noMethod(*s)
  2855. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2856. }
  2857. // RealtimeDataProfileInfo: Information for the view (profile), for
  2858. // which the real time data was requested.
  2859. type RealtimeDataProfileInfo struct {
  2860. // AccountId: Account ID to which this view (profile) belongs.
  2861. AccountId string `json:"accountId,omitempty"`
  2862. // InternalWebPropertyId: Internal ID for the web property to which this
  2863. // view (profile) belongs.
  2864. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2865. // ProfileId: View (Profile) ID.
  2866. ProfileId string `json:"profileId,omitempty"`
  2867. // ProfileName: View (Profile) name.
  2868. ProfileName string `json:"profileName,omitempty"`
  2869. // TableId: Table ID for view (profile).
  2870. TableId string `json:"tableId,omitempty"`
  2871. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  2872. WebPropertyId string `json:"webPropertyId,omitempty"`
  2873. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2874. // unconditionally include in API requests. By default, fields with
  2875. // empty values are omitted from API requests. However, any non-pointer,
  2876. // non-interface field appearing in ForceSendFields will be sent to the
  2877. // server regardless of whether the field is empty or not. This may be
  2878. // used to include empty fields in Patch requests.
  2879. ForceSendFields []string `json:"-"`
  2880. }
  2881. func (s *RealtimeDataProfileInfo) MarshalJSON() ([]byte, error) {
  2882. type noMethod RealtimeDataProfileInfo
  2883. raw := noMethod(*s)
  2884. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2885. }
  2886. // RealtimeDataQuery: Real time data request query parameters.
  2887. type RealtimeDataQuery struct {
  2888. // Dimensions: List of real time dimensions.
  2889. Dimensions string `json:"dimensions,omitempty"`
  2890. // Filters: Comma-separated list of dimension or metric filters.
  2891. Filters string `json:"filters,omitempty"`
  2892. // Ids: Unique table ID.
  2893. Ids string `json:"ids,omitempty"`
  2894. // MaxResults: Maximum results per page.
  2895. MaxResults int64 `json:"max-results,omitempty"`
  2896. // Metrics: List of real time metrics.
  2897. Metrics []string `json:"metrics,omitempty"`
  2898. // Sort: List of dimensions or metrics based on which real time data is
  2899. // sorted.
  2900. Sort []string `json:"sort,omitempty"`
  2901. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  2902. // unconditionally include in API requests. By default, fields with
  2903. // empty values are omitted from API requests. However, any non-pointer,
  2904. // non-interface field appearing in ForceSendFields will be sent to the
  2905. // server regardless of whether the field is empty or not. This may be
  2906. // used to include empty fields in Patch requests.
  2907. ForceSendFields []string `json:"-"`
  2908. }
  2909. func (s *RealtimeDataQuery) MarshalJSON() ([]byte, error) {
  2910. type noMethod RealtimeDataQuery
  2911. raw := noMethod(*s)
  2912. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2913. }
  2914. // Segment: JSON template for an Analytics segment.
  2915. type Segment struct {
  2916. // Created: Time the segment was created.
  2917. Created string `json:"created,omitempty"`
  2918. // Definition: Segment definition.
  2919. Definition string `json:"definition,omitempty"`
  2920. // Id: Segment ID.
  2921. Id string `json:"id,omitempty"`
  2922. // Kind: Resource type for Analytics segment.
  2923. Kind string `json:"kind,omitempty"`
  2924. // Name: Segment name.
  2925. Name string `json:"name,omitempty"`
  2926. // SegmentId: Segment ID. Can be used with the 'segment' parameter in
  2927. // Core Reporting API.
  2928. SegmentId string `json:"segmentId,omitempty"`
  2929. // SelfLink: Link for this segment.
  2930. SelfLink string `json:"selfLink,omitempty"`
  2931. // Type: Type for a segment. Possible values are "BUILT_IN" or "CUSTOM".
  2932. Type string `json:"type,omitempty"`
  2933. // Updated: Time the segment was last modified.
  2934. Updated string `json:"updated,omitempty"`
  2935. // ForceSendFields is a list of field names (e.g. "Created") to
  2936. // unconditionally include in API requests. By default, fields with
  2937. // empty values are omitted from API requests. However, any non-pointer,
  2938. // non-interface field appearing in ForceSendFields will be sent to the
  2939. // server regardless of whether the field is empty or not. This may be
  2940. // used to include empty fields in Patch requests.
  2941. ForceSendFields []string `json:"-"`
  2942. }
  2943. func (s *Segment) MarshalJSON() ([]byte, error) {
  2944. type noMethod Segment
  2945. raw := noMethod(*s)
  2946. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2947. }
  2948. // Segments: An segment collection lists Analytics segments that the
  2949. // user has access to. Each resource in the collection corresponds to a
  2950. // single Analytics segment.
  2951. type Segments struct {
  2952. // Items: A list of segments.
  2953. Items []*Segment `json:"items,omitempty"`
  2954. // ItemsPerPage: The maximum number of resources the response can
  2955. // contain, regardless of the actual number of resources returned. Its
  2956. // value ranges from 1 to 1000 with a value of 1000 by default, or
  2957. // otherwise specified by the max-results query parameter.
  2958. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2959. // Kind: Collection type for segments.
  2960. Kind string `json:"kind,omitempty"`
  2961. // NextLink: Link to next page for this segment collection.
  2962. NextLink string `json:"nextLink,omitempty"`
  2963. // PreviousLink: Link to previous page for this segment collection.
  2964. PreviousLink string `json:"previousLink,omitempty"`
  2965. // StartIndex: The starting index of the resources, which is 1 by
  2966. // default or otherwise specified by the start-index query parameter.
  2967. StartIndex int64 `json:"startIndex,omitempty"`
  2968. // TotalResults: The total number of results for the query, regardless
  2969. // of the number of results in the response.
  2970. TotalResults int64 `json:"totalResults,omitempty"`
  2971. // Username: Email ID of the authenticated user
  2972. Username string `json:"username,omitempty"`
  2973. // ServerResponse contains the HTTP response code and headers from the
  2974. // server.
  2975. googleapi.ServerResponse `json:"-"`
  2976. // ForceSendFields is a list of field names (e.g. "Items") to
  2977. // unconditionally include in API requests. By default, fields with
  2978. // empty values are omitted from API requests. However, any non-pointer,
  2979. // non-interface field appearing in ForceSendFields will be sent to the
  2980. // server regardless of whether the field is empty or not. This may be
  2981. // used to include empty fields in Patch requests.
  2982. ForceSendFields []string `json:"-"`
  2983. }
  2984. func (s *Segments) MarshalJSON() ([]byte, error) {
  2985. type noMethod Segments
  2986. raw := noMethod(*s)
  2987. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2988. }
  2989. // UnsampledReport: JSON template for Analytics unsampled report
  2990. // resource.
  2991. type UnsampledReport struct {
  2992. // AccountId: Account ID to which this unsampled report belongs.
  2993. AccountId string `json:"accountId,omitempty"`
  2994. // CloudStorageDownloadDetails: Download details for a file stored in
  2995. // Google Cloud Storage.
  2996. CloudStorageDownloadDetails *UnsampledReportCloudStorageDownloadDetails `json:"cloudStorageDownloadDetails,omitempty"`
  2997. // Created: Time this unsampled report was created.
  2998. Created string `json:"created,omitempty"`
  2999. // Dimensions: The dimensions for the unsampled report.
  3000. Dimensions string `json:"dimensions,omitempty"`
  3001. // DownloadType: The type of download you need to use for the report
  3002. // data file.
  3003. DownloadType string `json:"downloadType,omitempty"`
  3004. // DriveDownloadDetails: Download details for a file stored in Google
  3005. // Drive.
  3006. DriveDownloadDetails *UnsampledReportDriveDownloadDetails `json:"driveDownloadDetails,omitempty"`
  3007. // EndDate: The end date for the unsampled report.
  3008. EndDate string `json:"end-date,omitempty"`
  3009. // Filters: The filters for the unsampled report.
  3010. Filters string `json:"filters,omitempty"`
  3011. // Id: Unsampled report ID.
  3012. Id string `json:"id,omitempty"`
  3013. // Kind: Resource type for an Analytics unsampled report.
  3014. Kind string `json:"kind,omitempty"`
  3015. // Metrics: The metrics for the unsampled report.
  3016. Metrics string `json:"metrics,omitempty"`
  3017. // ProfileId: View (Profile) ID to which this unsampled report belongs.
  3018. ProfileId string `json:"profileId,omitempty"`
  3019. // Segment: The segment for the unsampled report.
  3020. Segment string `json:"segment,omitempty"`
  3021. // SelfLink: Link for this unsampled report.
  3022. SelfLink string `json:"selfLink,omitempty"`
  3023. // StartDate: The start date for the unsampled report.
  3024. StartDate string `json:"start-date,omitempty"`
  3025. // Status: Status of this unsampled report. Possible values are PENDING,
  3026. // COMPLETED, or FAILED.
  3027. Status string `json:"status,omitempty"`
  3028. // Title: Title of the unsampled report.
  3029. Title string `json:"title,omitempty"`
  3030. // Updated: Time this unsampled report was last modified.
  3031. Updated string `json:"updated,omitempty"`
  3032. // WebPropertyId: Web property ID to which this unsampled report
  3033. // belongs. The web property ID is of the form UA-XXXXX-YY.
  3034. WebPropertyId string `json:"webPropertyId,omitempty"`
  3035. // ServerResponse contains the HTTP response code and headers from the
  3036. // server.
  3037. googleapi.ServerResponse `json:"-"`
  3038. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3039. // unconditionally include in API requests. By default, fields with
  3040. // empty values are omitted from API requests. However, any non-pointer,
  3041. // non-interface field appearing in ForceSendFields will be sent to the
  3042. // server regardless of whether the field is empty or not. This may be
  3043. // used to include empty fields in Patch requests.
  3044. ForceSendFields []string `json:"-"`
  3045. }
  3046. func (s *UnsampledReport) MarshalJSON() ([]byte, error) {
  3047. type noMethod UnsampledReport
  3048. raw := noMethod(*s)
  3049. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3050. }
  3051. // UnsampledReportCloudStorageDownloadDetails: Download details for a
  3052. // file stored in Google Cloud Storage.
  3053. type UnsampledReportCloudStorageDownloadDetails struct {
  3054. // BucketId: Id of the bucket the file object is stored in.
  3055. BucketId string `json:"bucketId,omitempty"`
  3056. // ObjectId: Id of the file object containing the report data.
  3057. ObjectId string `json:"objectId,omitempty"`
  3058. // ForceSendFields is a list of field names (e.g. "BucketId") to
  3059. // unconditionally include in API requests. By default, fields with
  3060. // empty values are omitted from API requests. However, any non-pointer,
  3061. // non-interface field appearing in ForceSendFields will be sent to the
  3062. // server regardless of whether the field is empty or not. This may be
  3063. // used to include empty fields in Patch requests.
  3064. ForceSendFields []string `json:"-"`
  3065. }
  3066. func (s *UnsampledReportCloudStorageDownloadDetails) MarshalJSON() ([]byte, error) {
  3067. type noMethod UnsampledReportCloudStorageDownloadDetails
  3068. raw := noMethod(*s)
  3069. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3070. }
  3071. // UnsampledReportDriveDownloadDetails: Download details for a file
  3072. // stored in Google Drive.
  3073. type UnsampledReportDriveDownloadDetails struct {
  3074. // DocumentId: Id of the document/file containing the report data.
  3075. DocumentId string `json:"documentId,omitempty"`
  3076. // ForceSendFields is a list of field names (e.g. "DocumentId") to
  3077. // unconditionally include in API requests. By default, fields with
  3078. // empty values are omitted from API requests. However, any non-pointer,
  3079. // non-interface field appearing in ForceSendFields will be sent to the
  3080. // server regardless of whether the field is empty or not. This may be
  3081. // used to include empty fields in Patch requests.
  3082. ForceSendFields []string `json:"-"`
  3083. }
  3084. func (s *UnsampledReportDriveDownloadDetails) MarshalJSON() ([]byte, error) {
  3085. type noMethod UnsampledReportDriveDownloadDetails
  3086. raw := noMethod(*s)
  3087. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3088. }
  3089. // UnsampledReports: An unsampled report collection lists Analytics
  3090. // unsampled reports to which the user has access. Each view (profile)
  3091. // can have a set of unsampled reports. Each resource in the unsampled
  3092. // report collection corresponds to a single Analytics unsampled report.
  3093. type UnsampledReports struct {
  3094. // Items: A list of unsampled reports.
  3095. Items []*UnsampledReport `json:"items,omitempty"`
  3096. // ItemsPerPage: The maximum number of resources the response can
  3097. // contain, regardless of the actual number of resources returned. Its
  3098. // value ranges from 1 to 1000 with a value of 1000 by default, or
  3099. // otherwise specified by the max-results query parameter.
  3100. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3101. // Kind: Collection type.
  3102. Kind string `json:"kind,omitempty"`
  3103. // NextLink: Link to next page for this unsampled report collection.
  3104. NextLink string `json:"nextLink,omitempty"`
  3105. // PreviousLink: Link to previous page for this unsampled report
  3106. // collection.
  3107. PreviousLink string `json:"previousLink,omitempty"`
  3108. // StartIndex: The starting index of the resources, which is 1 by
  3109. // default or otherwise specified by the start-index query parameter.
  3110. StartIndex int64 `json:"startIndex,omitempty"`
  3111. // TotalResults: The total number of results for the query, regardless
  3112. // of the number of resources in the result.
  3113. TotalResults int64 `json:"totalResults,omitempty"`
  3114. // Username: Email ID of the authenticated user
  3115. Username string `json:"username,omitempty"`
  3116. // ServerResponse contains the HTTP response code and headers from the
  3117. // server.
  3118. googleapi.ServerResponse `json:"-"`
  3119. // ForceSendFields is a list of field names (e.g. "Items") to
  3120. // unconditionally include in API requests. By default, fields with
  3121. // empty values are omitted from API requests. However, any non-pointer,
  3122. // non-interface field appearing in ForceSendFields will be sent to the
  3123. // server regardless of whether the field is empty or not. This may be
  3124. // used to include empty fields in Patch requests.
  3125. ForceSendFields []string `json:"-"`
  3126. }
  3127. func (s *UnsampledReports) MarshalJSON() ([]byte, error) {
  3128. type noMethod UnsampledReports
  3129. raw := noMethod(*s)
  3130. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3131. }
  3132. // Upload: Metadata returned for an upload operation.
  3133. type Upload struct {
  3134. // AccountId: Account Id to which this upload belongs.
  3135. AccountId int64 `json:"accountId,omitempty,string"`
  3136. // CustomDataSourceId: Custom data source Id to which this data import
  3137. // belongs.
  3138. CustomDataSourceId string `json:"customDataSourceId,omitempty"`
  3139. // Errors: Data import errors collection.
  3140. Errors []string `json:"errors,omitempty"`
  3141. // Id: A unique ID for this upload.
  3142. Id string `json:"id,omitempty"`
  3143. // Kind: Resource type for Analytics upload.
  3144. Kind string `json:"kind,omitempty"`
  3145. // Status: Upload status. Possible values: PENDING, COMPLETED, FAILED,
  3146. // DELETING, DELETED.
  3147. Status string `json:"status,omitempty"`
  3148. // ServerResponse contains the HTTP response code and headers from the
  3149. // server.
  3150. googleapi.ServerResponse `json:"-"`
  3151. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3152. // unconditionally include in API requests. By default, fields with
  3153. // empty values are omitted from API requests. However, any non-pointer,
  3154. // non-interface field appearing in ForceSendFields will be sent to the
  3155. // server regardless of whether the field is empty or not. This may be
  3156. // used to include empty fields in Patch requests.
  3157. ForceSendFields []string `json:"-"`
  3158. }
  3159. func (s *Upload) MarshalJSON() ([]byte, error) {
  3160. type noMethod Upload
  3161. raw := noMethod(*s)
  3162. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3163. }
  3164. // Uploads: Upload collection lists Analytics uploads to which the user
  3165. // has access. Each custom data source can have a set of uploads. Each
  3166. // resource in the upload collection corresponds to a single Analytics
  3167. // data upload.
  3168. type Uploads struct {
  3169. // Items: A list of uploads.
  3170. Items []*Upload `json:"items,omitempty"`
  3171. // ItemsPerPage: The maximum number of resources the response can
  3172. // contain, regardless of the actual number of resources returned. Its
  3173. // value ranges from 1 to 1000 with a value of 1000 by default, or
  3174. // otherwise specified by the max-results query parameter.
  3175. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3176. // Kind: Collection type.
  3177. Kind string `json:"kind,omitempty"`
  3178. // NextLink: Link to next page for this upload collection.
  3179. NextLink string `json:"nextLink,omitempty"`
  3180. // PreviousLink: Link to previous page for this upload collection.
  3181. PreviousLink string `json:"previousLink,omitempty"`
  3182. // StartIndex: The starting index of the resources, which is 1 by
  3183. // default or otherwise specified by the start-index query parameter.
  3184. StartIndex int64 `json:"startIndex,omitempty"`
  3185. // TotalResults: The total number of results for the query, regardless
  3186. // of the number of resources in the result.
  3187. TotalResults int64 `json:"totalResults,omitempty"`
  3188. // ServerResponse contains the HTTP response code and headers from the
  3189. // server.
  3190. googleapi.ServerResponse `json:"-"`
  3191. // ForceSendFields is a list of field names (e.g. "Items") to
  3192. // unconditionally include in API requests. By default, fields with
  3193. // empty values are omitted from API requests. However, any non-pointer,
  3194. // non-interface field appearing in ForceSendFields will be sent to the
  3195. // server regardless of whether the field is empty or not. This may be
  3196. // used to include empty fields in Patch requests.
  3197. ForceSendFields []string `json:"-"`
  3198. }
  3199. func (s *Uploads) MarshalJSON() ([]byte, error) {
  3200. type noMethod Uploads
  3201. raw := noMethod(*s)
  3202. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3203. }
  3204. // UserRef: JSON template for a user reference.
  3205. type UserRef struct {
  3206. // Email: Email ID of this user.
  3207. Email string `json:"email,omitempty"`
  3208. // Id: User ID.
  3209. Id string `json:"id,omitempty"`
  3210. Kind string `json:"kind,omitempty"`
  3211. // ForceSendFields is a list of field names (e.g. "Email") to
  3212. // unconditionally include in API requests. By default, fields with
  3213. // empty values are omitted from API requests. However, any non-pointer,
  3214. // non-interface field appearing in ForceSendFields will be sent to the
  3215. // server regardless of whether the field is empty or not. This may be
  3216. // used to include empty fields in Patch requests.
  3217. ForceSendFields []string `json:"-"`
  3218. }
  3219. func (s *UserRef) MarshalJSON() ([]byte, error) {
  3220. type noMethod UserRef
  3221. raw := noMethod(*s)
  3222. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3223. }
  3224. // WebPropertyRef: JSON template for a web property reference.
  3225. type WebPropertyRef struct {
  3226. // AccountId: Account ID to which this web property belongs.
  3227. AccountId string `json:"accountId,omitempty"`
  3228. // Href: Link for this web property.
  3229. Href string `json:"href,omitempty"`
  3230. // Id: Web property ID of the form UA-XXXXX-YY.
  3231. Id string `json:"id,omitempty"`
  3232. // InternalWebPropertyId: Internal ID for this web property.
  3233. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3234. // Kind: Analytics web property reference.
  3235. Kind string `json:"kind,omitempty"`
  3236. // Name: Name of this web property.
  3237. Name string `json:"name,omitempty"`
  3238. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3239. // unconditionally include in API requests. By default, fields with
  3240. // empty values are omitted from API requests. However, any non-pointer,
  3241. // non-interface field appearing in ForceSendFields will be sent to the
  3242. // server regardless of whether the field is empty or not. This may be
  3243. // used to include empty fields in Patch requests.
  3244. ForceSendFields []string `json:"-"`
  3245. }
  3246. func (s *WebPropertyRef) MarshalJSON() ([]byte, error) {
  3247. type noMethod WebPropertyRef
  3248. raw := noMethod(*s)
  3249. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3250. }
  3251. // WebPropertySummary: JSON template for an Analytics
  3252. // WebPropertySummary. WebPropertySummary returns basic information
  3253. // (i.e., summary) for a web property.
  3254. type WebPropertySummary struct {
  3255. // Id: Web property ID of the form UA-XXXXX-YY.
  3256. Id string `json:"id,omitempty"`
  3257. // InternalWebPropertyId: Internal ID for this web property.
  3258. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3259. // Kind: Resource type for Analytics WebPropertySummary.
  3260. Kind string `json:"kind,omitempty"`
  3261. // Level: Level for this web property. Possible values are STANDARD or
  3262. // PREMIUM.
  3263. Level string `json:"level,omitempty"`
  3264. // Name: Web property name.
  3265. Name string `json:"name,omitempty"`
  3266. // Profiles: List of profiles under this web property.
  3267. Profiles []*ProfileSummary `json:"profiles,omitempty"`
  3268. // WebsiteUrl: Website url for this web property.
  3269. WebsiteUrl string `json:"websiteUrl,omitempty"`
  3270. // ForceSendFields is a list of field names (e.g. "Id") to
  3271. // unconditionally include in API requests. By default, fields with
  3272. // empty values are omitted from API requests. However, any non-pointer,
  3273. // non-interface field appearing in ForceSendFields will be sent to the
  3274. // server regardless of whether the field is empty or not. This may be
  3275. // used to include empty fields in Patch requests.
  3276. ForceSendFields []string `json:"-"`
  3277. }
  3278. func (s *WebPropertySummary) MarshalJSON() ([]byte, error) {
  3279. type noMethod WebPropertySummary
  3280. raw := noMethod(*s)
  3281. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3282. }
  3283. // Webproperties: A web property collection lists Analytics web
  3284. // properties to which the user has access. Each resource in the
  3285. // collection corresponds to a single Analytics web property.
  3286. type Webproperties struct {
  3287. // Items: A list of web properties.
  3288. Items []*Webproperty `json:"items,omitempty"`
  3289. // ItemsPerPage: The maximum number of resources the response can
  3290. // contain, regardless of the actual number of resources returned. Its
  3291. // value ranges from 1 to 1000 with a value of 1000 by default, or
  3292. // otherwise specified by the max-results query parameter.
  3293. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3294. // Kind: Collection type.
  3295. Kind string `json:"kind,omitempty"`
  3296. // NextLink: Link to next page for this web property collection.
  3297. NextLink string `json:"nextLink,omitempty"`
  3298. // PreviousLink: Link to previous page for this web property collection.
  3299. PreviousLink string `json:"previousLink,omitempty"`
  3300. // StartIndex: The starting index of the resources, which is 1 by
  3301. // default or otherwise specified by the start-index query parameter.
  3302. StartIndex int64 `json:"startIndex,omitempty"`
  3303. // TotalResults: The total number of results for the query, regardless
  3304. // of the number of results in the response.
  3305. TotalResults int64 `json:"totalResults,omitempty"`
  3306. // Username: Email ID of the authenticated user
  3307. Username string `json:"username,omitempty"`
  3308. // ServerResponse contains the HTTP response code and headers from the
  3309. // server.
  3310. googleapi.ServerResponse `json:"-"`
  3311. // ForceSendFields is a list of field names (e.g. "Items") to
  3312. // unconditionally include in API requests. By default, fields with
  3313. // empty values are omitted from API requests. However, any non-pointer,
  3314. // non-interface field appearing in ForceSendFields will be sent to the
  3315. // server regardless of whether the field is empty or not. This may be
  3316. // used to include empty fields in Patch requests.
  3317. ForceSendFields []string `json:"-"`
  3318. }
  3319. func (s *Webproperties) MarshalJSON() ([]byte, error) {
  3320. type noMethod Webproperties
  3321. raw := noMethod(*s)
  3322. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3323. }
  3324. // Webproperty: JSON template for an Analytics web property.
  3325. type Webproperty struct {
  3326. // AccountId: Account ID to which this web property belongs.
  3327. AccountId string `json:"accountId,omitempty"`
  3328. // ChildLink: Child link for this web property. Points to the list of
  3329. // views (profiles) for this web property.
  3330. ChildLink *WebpropertyChildLink `json:"childLink,omitempty"`
  3331. // Created: Time this web property was created.
  3332. Created string `json:"created,omitempty"`
  3333. // DefaultProfileId: Default view (profile) ID.
  3334. DefaultProfileId int64 `json:"defaultProfileId,omitempty,string"`
  3335. // Id: Web property ID of the form UA-XXXXX-YY.
  3336. Id string `json:"id,omitempty"`
  3337. // IndustryVertical: The industry vertical/category selected for this
  3338. // web property.
  3339. IndustryVertical string `json:"industryVertical,omitempty"`
  3340. // InternalWebPropertyId: Internal ID for this web property.
  3341. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3342. // Kind: Resource type for Analytics WebProperty.
  3343. Kind string `json:"kind,omitempty"`
  3344. // Level: Level for this web property. Possible values are STANDARD or
  3345. // PREMIUM.
  3346. Level string `json:"level,omitempty"`
  3347. // Name: Name of this web property.
  3348. Name string `json:"name,omitempty"`
  3349. // ParentLink: Parent link for this web property. Points to the account
  3350. // to which this web property belongs.
  3351. ParentLink *WebpropertyParentLink `json:"parentLink,omitempty"`
  3352. // Permissions: Permissions the user has for this web property.
  3353. Permissions *WebpropertyPermissions `json:"permissions,omitempty"`
  3354. // ProfileCount: View (Profile) count for this web property.
  3355. ProfileCount int64 `json:"profileCount,omitempty"`
  3356. // SelfLink: Link for this web property.
  3357. SelfLink string `json:"selfLink,omitempty"`
  3358. // Updated: Time this web property was last modified.
  3359. Updated string `json:"updated,omitempty"`
  3360. // WebsiteUrl: Website url for this web property.
  3361. WebsiteUrl string `json:"websiteUrl,omitempty"`
  3362. // ServerResponse contains the HTTP response code and headers from the
  3363. // server.
  3364. googleapi.ServerResponse `json:"-"`
  3365. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3366. // unconditionally include in API requests. By default, fields with
  3367. // empty values are omitted from API requests. However, any non-pointer,
  3368. // non-interface field appearing in ForceSendFields will be sent to the
  3369. // server regardless of whether the field is empty or not. This may be
  3370. // used to include empty fields in Patch requests.
  3371. ForceSendFields []string `json:"-"`
  3372. }
  3373. func (s *Webproperty) MarshalJSON() ([]byte, error) {
  3374. type noMethod Webproperty
  3375. raw := noMethod(*s)
  3376. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3377. }
  3378. // WebpropertyChildLink: Child link for this web property. Points to the
  3379. // list of views (profiles) for this web property.
  3380. type WebpropertyChildLink struct {
  3381. // Href: Link to the list of views (profiles) for this web property.
  3382. Href string `json:"href,omitempty"`
  3383. // Type: Type of the parent link. Its value is "analytics#profiles".
  3384. Type string `json:"type,omitempty"`
  3385. // ForceSendFields is a list of field names (e.g. "Href") to
  3386. // unconditionally include in API requests. By default, fields with
  3387. // empty values are omitted from API requests. However, any non-pointer,
  3388. // non-interface field appearing in ForceSendFields will be sent to the
  3389. // server regardless of whether the field is empty or not. This may be
  3390. // used to include empty fields in Patch requests.
  3391. ForceSendFields []string `json:"-"`
  3392. }
  3393. func (s *WebpropertyChildLink) MarshalJSON() ([]byte, error) {
  3394. type noMethod WebpropertyChildLink
  3395. raw := noMethod(*s)
  3396. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3397. }
  3398. // WebpropertyParentLink: Parent link for this web property. Points to
  3399. // the account to which this web property belongs.
  3400. type WebpropertyParentLink struct {
  3401. // Href: Link to the account for this web property.
  3402. Href string `json:"href,omitempty"`
  3403. // Type: Type of the parent link. Its value is "analytics#account".
  3404. Type string `json:"type,omitempty"`
  3405. // ForceSendFields is a list of field names (e.g. "Href") to
  3406. // unconditionally include in API requests. By default, fields with
  3407. // empty values are omitted from API requests. However, any non-pointer,
  3408. // non-interface field appearing in ForceSendFields will be sent to the
  3409. // server regardless of whether the field is empty or not. This may be
  3410. // used to include empty fields in Patch requests.
  3411. ForceSendFields []string `json:"-"`
  3412. }
  3413. func (s *WebpropertyParentLink) MarshalJSON() ([]byte, error) {
  3414. type noMethod WebpropertyParentLink
  3415. raw := noMethod(*s)
  3416. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3417. }
  3418. // WebpropertyPermissions: Permissions the user has for this web
  3419. // property.
  3420. type WebpropertyPermissions struct {
  3421. // Effective: All the permissions that the user has for this web
  3422. // property. These include any implied permissions (e.g., EDIT implies
  3423. // VIEW) or inherited permissions from the parent account.
  3424. Effective []string `json:"effective,omitempty"`
  3425. // ForceSendFields is a list of field names (e.g. "Effective") to
  3426. // unconditionally include in API requests. By default, fields with
  3427. // empty values are omitted from API requests. However, any non-pointer,
  3428. // non-interface field appearing in ForceSendFields will be sent to the
  3429. // server regardless of whether the field is empty or not. This may be
  3430. // used to include empty fields in Patch requests.
  3431. ForceSendFields []string `json:"-"`
  3432. }
  3433. func (s *WebpropertyPermissions) MarshalJSON() ([]byte, error) {
  3434. type noMethod WebpropertyPermissions
  3435. raw := noMethod(*s)
  3436. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3437. }
  3438. // method id "analytics.data.ga.get":
  3439. type DataGaGetCall struct {
  3440. s *Service
  3441. urlParams_ gensupport.URLParams
  3442. ifNoneMatch_ string
  3443. ctx_ context.Context
  3444. }
  3445. // Get: Returns Analytics data for a view (profile).
  3446. func (r *DataGaService) Get(ids string, startDate string, endDate string, metrics string) *DataGaGetCall {
  3447. c := &DataGaGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3448. c.urlParams_.Set("ids", ids)
  3449. c.urlParams_.Set("start-date", startDate)
  3450. c.urlParams_.Set("end-date", endDate)
  3451. c.urlParams_.Set("metrics", metrics)
  3452. return c
  3453. }
  3454. // Dimensions sets the optional parameter "dimensions": A
  3455. // comma-separated list of Analytics dimensions. E.g.,
  3456. // 'ga:browser,ga:city'.
  3457. func (c *DataGaGetCall) Dimensions(dimensions string) *DataGaGetCall {
  3458. c.urlParams_.Set("dimensions", dimensions)
  3459. return c
  3460. }
  3461. // Filters sets the optional parameter "filters": A comma-separated list
  3462. // of dimension or metric filters to be applied to Analytics data.
  3463. func (c *DataGaGetCall) Filters(filters string) *DataGaGetCall {
  3464. c.urlParams_.Set("filters", filters)
  3465. return c
  3466. }
  3467. // IncludeEmptyRows sets the optional parameter "include-empty-rows":
  3468. // The response will include empty rows if this parameter is set to
  3469. // true, the default is true
  3470. func (c *DataGaGetCall) IncludeEmptyRows(includeEmptyRows bool) *DataGaGetCall {
  3471. c.urlParams_.Set("include-empty-rows", fmt.Sprint(includeEmptyRows))
  3472. return c
  3473. }
  3474. // MaxResults sets the optional parameter "max-results": The maximum
  3475. // number of entries to include in this feed.
  3476. func (c *DataGaGetCall) MaxResults(maxResults int64) *DataGaGetCall {
  3477. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  3478. return c
  3479. }
  3480. // Output sets the optional parameter "output": The selected format for
  3481. // the response. Default format is JSON.
  3482. //
  3483. // Possible values:
  3484. // "dataTable" - Returns the response in Google Charts Data Table
  3485. // format. This is useful in creating visualization using Google Charts.
  3486. // "json" - Returns the response in standard JSON format.
  3487. func (c *DataGaGetCall) Output(output string) *DataGaGetCall {
  3488. c.urlParams_.Set("output", output)
  3489. return c
  3490. }
  3491. // SamplingLevel sets the optional parameter "samplingLevel": The
  3492. // desired sampling level.
  3493. //
  3494. // Possible values:
  3495. // "DEFAULT" - Returns response with a sample size that balances speed
  3496. // and accuracy.
  3497. // "FASTER" - Returns a fast response with a smaller sample size.
  3498. // "HIGHER_PRECISION" - Returns a more accurate response using a large
  3499. // sample size, but this may result in the response being slower.
  3500. func (c *DataGaGetCall) SamplingLevel(samplingLevel string) *DataGaGetCall {
  3501. c.urlParams_.Set("samplingLevel", samplingLevel)
  3502. return c
  3503. }
  3504. // Segment sets the optional parameter "segment": An Analytics segment
  3505. // to be applied to data.
  3506. func (c *DataGaGetCall) Segment(segment string) *DataGaGetCall {
  3507. c.urlParams_.Set("segment", segment)
  3508. return c
  3509. }
  3510. // Sort sets the optional parameter "sort": A comma-separated list of
  3511. // dimensions or metrics that determine the sort order for Analytics
  3512. // data.
  3513. func (c *DataGaGetCall) Sort(sort string) *DataGaGetCall {
  3514. c.urlParams_.Set("sort", sort)
  3515. return c
  3516. }
  3517. // StartIndex sets the optional parameter "start-index": An index of the
  3518. // first entity to retrieve. Use this parameter as a pagination
  3519. // mechanism along with the max-results parameter.
  3520. func (c *DataGaGetCall) StartIndex(startIndex int64) *DataGaGetCall {
  3521. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  3522. return c
  3523. }
  3524. // Fields allows partial responses to be retrieved. See
  3525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3526. // for more information.
  3527. func (c *DataGaGetCall) Fields(s ...googleapi.Field) *DataGaGetCall {
  3528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3529. return c
  3530. }
  3531. // IfNoneMatch sets the optional parameter which makes the operation
  3532. // fail if the object's ETag matches the given value. This is useful for
  3533. // getting updates only after the object has changed since the last
  3534. // request. Use googleapi.IsNotModified to check whether the response
  3535. // error from Do is the result of In-None-Match.
  3536. func (c *DataGaGetCall) IfNoneMatch(entityTag string) *DataGaGetCall {
  3537. c.ifNoneMatch_ = entityTag
  3538. return c
  3539. }
  3540. // Context sets the context to be used in this call's Do method. Any
  3541. // pending HTTP request will be aborted if the provided context is
  3542. // canceled.
  3543. func (c *DataGaGetCall) Context(ctx context.Context) *DataGaGetCall {
  3544. c.ctx_ = ctx
  3545. return c
  3546. }
  3547. func (c *DataGaGetCall) doRequest(alt string) (*http.Response, error) {
  3548. var body io.Reader = nil
  3549. c.urlParams_.Set("alt", alt)
  3550. urls := googleapi.ResolveRelative(c.s.BasePath, "data/ga")
  3551. urls += "?" + c.urlParams_.Encode()
  3552. req, _ := http.NewRequest("GET", urls, body)
  3553. googleapi.SetOpaque(req.URL)
  3554. req.Header.Set("User-Agent", c.s.userAgent())
  3555. if c.ifNoneMatch_ != "" {
  3556. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3557. }
  3558. if c.ctx_ != nil {
  3559. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3560. }
  3561. return c.s.client.Do(req)
  3562. }
  3563. // Do executes the "analytics.data.ga.get" call.
  3564. // Exactly one of *GaData or error will be non-nil. Any non-2xx status
  3565. // code is an error. Response headers are in either
  3566. // *GaData.ServerResponse.Header or (if a response was returned at all)
  3567. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3568. // check whether the returned error was because http.StatusNotModified
  3569. // was returned.
  3570. func (c *DataGaGetCall) Do(opts ...googleapi.CallOption) (*GaData, error) {
  3571. gensupport.SetOptions(c.urlParams_, opts...)
  3572. res, err := c.doRequest("json")
  3573. if res != nil && res.StatusCode == http.StatusNotModified {
  3574. if res.Body != nil {
  3575. res.Body.Close()
  3576. }
  3577. return nil, &googleapi.Error{
  3578. Code: res.StatusCode,
  3579. Header: res.Header,
  3580. }
  3581. }
  3582. if err != nil {
  3583. return nil, err
  3584. }
  3585. defer googleapi.CloseBody(res)
  3586. if err := googleapi.CheckResponse(res); err != nil {
  3587. return nil, err
  3588. }
  3589. ret := &GaData{
  3590. ServerResponse: googleapi.ServerResponse{
  3591. Header: res.Header,
  3592. HTTPStatusCode: res.StatusCode,
  3593. },
  3594. }
  3595. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3596. return nil, err
  3597. }
  3598. return ret, nil
  3599. // {
  3600. // "description": "Returns Analytics data for a view (profile).",
  3601. // "httpMethod": "GET",
  3602. // "id": "analytics.data.ga.get",
  3603. // "parameterOrder": [
  3604. // "ids",
  3605. // "start-date",
  3606. // "end-date",
  3607. // "metrics"
  3608. // ],
  3609. // "parameters": {
  3610. // "dimensions": {
  3611. // "description": "A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.",
  3612. // "location": "query",
  3613. // "pattern": "(ga:.+)?",
  3614. // "type": "string"
  3615. // },
  3616. // "end-date": {
  3617. // "description": "End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday.",
  3618. // "location": "query",
  3619. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  3620. // "required": true,
  3621. // "type": "string"
  3622. // },
  3623. // "filters": {
  3624. // "description": "A comma-separated list of dimension or metric filters to be applied to Analytics data.",
  3625. // "location": "query",
  3626. // "pattern": "ga:.+",
  3627. // "type": "string"
  3628. // },
  3629. // "ids": {
  3630. // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  3631. // "location": "query",
  3632. // "pattern": "ga:[0-9]+",
  3633. // "required": true,
  3634. // "type": "string"
  3635. // },
  3636. // "include-empty-rows": {
  3637. // "description": "The response will include empty rows if this parameter is set to true, the default is true",
  3638. // "location": "query",
  3639. // "type": "boolean"
  3640. // },
  3641. // "max-results": {
  3642. // "description": "The maximum number of entries to include in this feed.",
  3643. // "format": "int32",
  3644. // "location": "query",
  3645. // "type": "integer"
  3646. // },
  3647. // "metrics": {
  3648. // "description": "A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified.",
  3649. // "location": "query",
  3650. // "pattern": "ga:.+",
  3651. // "required": true,
  3652. // "type": "string"
  3653. // },
  3654. // "output": {
  3655. // "description": "The selected format for the response. Default format is JSON.",
  3656. // "enum": [
  3657. // "dataTable",
  3658. // "json"
  3659. // ],
  3660. // "enumDescriptions": [
  3661. // "Returns the response in Google Charts Data Table format. This is useful in creating visualization using Google Charts.",
  3662. // "Returns the response in standard JSON format."
  3663. // ],
  3664. // "location": "query",
  3665. // "type": "string"
  3666. // },
  3667. // "samplingLevel": {
  3668. // "description": "The desired sampling level.",
  3669. // "enum": [
  3670. // "DEFAULT",
  3671. // "FASTER",
  3672. // "HIGHER_PRECISION"
  3673. // ],
  3674. // "enumDescriptions": [
  3675. // "Returns response with a sample size that balances speed and accuracy.",
  3676. // "Returns a fast response with a smaller sample size.",
  3677. // "Returns a more accurate response using a large sample size, but this may result in the response being slower."
  3678. // ],
  3679. // "location": "query",
  3680. // "type": "string"
  3681. // },
  3682. // "segment": {
  3683. // "description": "An Analytics segment to be applied to data.",
  3684. // "location": "query",
  3685. // "type": "string"
  3686. // },
  3687. // "sort": {
  3688. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for Analytics data.",
  3689. // "location": "query",
  3690. // "pattern": "(-)?ga:.+",
  3691. // "type": "string"
  3692. // },
  3693. // "start-date": {
  3694. // "description": "Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.",
  3695. // "location": "query",
  3696. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  3697. // "required": true,
  3698. // "type": "string"
  3699. // },
  3700. // "start-index": {
  3701. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  3702. // "format": "int32",
  3703. // "location": "query",
  3704. // "minimum": "1",
  3705. // "type": "integer"
  3706. // }
  3707. // },
  3708. // "path": "data/ga",
  3709. // "response": {
  3710. // "$ref": "GaData"
  3711. // },
  3712. // "scopes": [
  3713. // "https://www.googleapis.com/auth/analytics",
  3714. // "https://www.googleapis.com/auth/analytics.readonly"
  3715. // ]
  3716. // }
  3717. }
  3718. // method id "analytics.data.mcf.get":
  3719. type DataMcfGetCall struct {
  3720. s *Service
  3721. urlParams_ gensupport.URLParams
  3722. ifNoneMatch_ string
  3723. ctx_ context.Context
  3724. }
  3725. // Get: Returns Analytics Multi-Channel Funnels data for a view
  3726. // (profile).
  3727. func (r *DataMcfService) Get(ids string, startDate string, endDate string, metrics string) *DataMcfGetCall {
  3728. c := &DataMcfGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3729. c.urlParams_.Set("ids", ids)
  3730. c.urlParams_.Set("start-date", startDate)
  3731. c.urlParams_.Set("end-date", endDate)
  3732. c.urlParams_.Set("metrics", metrics)
  3733. return c
  3734. }
  3735. // Dimensions sets the optional parameter "dimensions": A
  3736. // comma-separated list of Multi-Channel Funnels dimensions. E.g.,
  3737. // 'mcf:source,mcf:medium'.
  3738. func (c *DataMcfGetCall) Dimensions(dimensions string) *DataMcfGetCall {
  3739. c.urlParams_.Set("dimensions", dimensions)
  3740. return c
  3741. }
  3742. // Filters sets the optional parameter "filters": A comma-separated list
  3743. // of dimension or metric filters to be applied to the Analytics data.
  3744. func (c *DataMcfGetCall) Filters(filters string) *DataMcfGetCall {
  3745. c.urlParams_.Set("filters", filters)
  3746. return c
  3747. }
  3748. // MaxResults sets the optional parameter "max-results": The maximum
  3749. // number of entries to include in this feed.
  3750. func (c *DataMcfGetCall) MaxResults(maxResults int64) *DataMcfGetCall {
  3751. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  3752. return c
  3753. }
  3754. // SamplingLevel sets the optional parameter "samplingLevel": The
  3755. // desired sampling level.
  3756. //
  3757. // Possible values:
  3758. // "DEFAULT" - Returns response with a sample size that balances speed
  3759. // and accuracy.
  3760. // "FASTER" - Returns a fast response with a smaller sample size.
  3761. // "HIGHER_PRECISION" - Returns a more accurate response using a large
  3762. // sample size, but this may result in the response being slower.
  3763. func (c *DataMcfGetCall) SamplingLevel(samplingLevel string) *DataMcfGetCall {
  3764. c.urlParams_.Set("samplingLevel", samplingLevel)
  3765. return c
  3766. }
  3767. // Sort sets the optional parameter "sort": A comma-separated list of
  3768. // dimensions or metrics that determine the sort order for the Analytics
  3769. // data.
  3770. func (c *DataMcfGetCall) Sort(sort string) *DataMcfGetCall {
  3771. c.urlParams_.Set("sort", sort)
  3772. return c
  3773. }
  3774. // StartIndex sets the optional parameter "start-index": An index of the
  3775. // first entity to retrieve. Use this parameter as a pagination
  3776. // mechanism along with the max-results parameter.
  3777. func (c *DataMcfGetCall) StartIndex(startIndex int64) *DataMcfGetCall {
  3778. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  3779. return c
  3780. }
  3781. // Fields allows partial responses to be retrieved. See
  3782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3783. // for more information.
  3784. func (c *DataMcfGetCall) Fields(s ...googleapi.Field) *DataMcfGetCall {
  3785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3786. return c
  3787. }
  3788. // IfNoneMatch sets the optional parameter which makes the operation
  3789. // fail if the object's ETag matches the given value. This is useful for
  3790. // getting updates only after the object has changed since the last
  3791. // request. Use googleapi.IsNotModified to check whether the response
  3792. // error from Do is the result of In-None-Match.
  3793. func (c *DataMcfGetCall) IfNoneMatch(entityTag string) *DataMcfGetCall {
  3794. c.ifNoneMatch_ = entityTag
  3795. return c
  3796. }
  3797. // Context sets the context to be used in this call's Do method. Any
  3798. // pending HTTP request will be aborted if the provided context is
  3799. // canceled.
  3800. func (c *DataMcfGetCall) Context(ctx context.Context) *DataMcfGetCall {
  3801. c.ctx_ = ctx
  3802. return c
  3803. }
  3804. func (c *DataMcfGetCall) doRequest(alt string) (*http.Response, error) {
  3805. var body io.Reader = nil
  3806. c.urlParams_.Set("alt", alt)
  3807. urls := googleapi.ResolveRelative(c.s.BasePath, "data/mcf")
  3808. urls += "?" + c.urlParams_.Encode()
  3809. req, _ := http.NewRequest("GET", urls, body)
  3810. googleapi.SetOpaque(req.URL)
  3811. req.Header.Set("User-Agent", c.s.userAgent())
  3812. if c.ifNoneMatch_ != "" {
  3813. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3814. }
  3815. if c.ctx_ != nil {
  3816. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3817. }
  3818. return c.s.client.Do(req)
  3819. }
  3820. // Do executes the "analytics.data.mcf.get" call.
  3821. // Exactly one of *McfData or error will be non-nil. Any non-2xx status
  3822. // code is an error. Response headers are in either
  3823. // *McfData.ServerResponse.Header or (if a response was returned at all)
  3824. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3825. // check whether the returned error was because http.StatusNotModified
  3826. // was returned.
  3827. func (c *DataMcfGetCall) Do(opts ...googleapi.CallOption) (*McfData, error) {
  3828. gensupport.SetOptions(c.urlParams_, opts...)
  3829. res, err := c.doRequest("json")
  3830. if res != nil && res.StatusCode == http.StatusNotModified {
  3831. if res.Body != nil {
  3832. res.Body.Close()
  3833. }
  3834. return nil, &googleapi.Error{
  3835. Code: res.StatusCode,
  3836. Header: res.Header,
  3837. }
  3838. }
  3839. if err != nil {
  3840. return nil, err
  3841. }
  3842. defer googleapi.CloseBody(res)
  3843. if err := googleapi.CheckResponse(res); err != nil {
  3844. return nil, err
  3845. }
  3846. ret := &McfData{
  3847. ServerResponse: googleapi.ServerResponse{
  3848. Header: res.Header,
  3849. HTTPStatusCode: res.StatusCode,
  3850. },
  3851. }
  3852. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3853. return nil, err
  3854. }
  3855. return ret, nil
  3856. // {
  3857. // "description": "Returns Analytics Multi-Channel Funnels data for a view (profile).",
  3858. // "httpMethod": "GET",
  3859. // "id": "analytics.data.mcf.get",
  3860. // "parameterOrder": [
  3861. // "ids",
  3862. // "start-date",
  3863. // "end-date",
  3864. // "metrics"
  3865. // ],
  3866. // "parameters": {
  3867. // "dimensions": {
  3868. // "description": "A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'.",
  3869. // "location": "query",
  3870. // "pattern": "(mcf:.+)?",
  3871. // "type": "string"
  3872. // },
  3873. // "end-date": {
  3874. // "description": "End date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.",
  3875. // "location": "query",
  3876. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  3877. // "required": true,
  3878. // "type": "string"
  3879. // },
  3880. // "filters": {
  3881. // "description": "A comma-separated list of dimension or metric filters to be applied to the Analytics data.",
  3882. // "location": "query",
  3883. // "pattern": "mcf:.+",
  3884. // "type": "string"
  3885. // },
  3886. // "ids": {
  3887. // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  3888. // "location": "query",
  3889. // "pattern": "ga:[0-9]+",
  3890. // "required": true,
  3891. // "type": "string"
  3892. // },
  3893. // "max-results": {
  3894. // "description": "The maximum number of entries to include in this feed.",
  3895. // "format": "int32",
  3896. // "location": "query",
  3897. // "type": "integer"
  3898. // },
  3899. // "metrics": {
  3900. // "description": "A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified.",
  3901. // "location": "query",
  3902. // "pattern": "mcf:.+",
  3903. // "required": true,
  3904. // "type": "string"
  3905. // },
  3906. // "samplingLevel": {
  3907. // "description": "The desired sampling level.",
  3908. // "enum": [
  3909. // "DEFAULT",
  3910. // "FASTER",
  3911. // "HIGHER_PRECISION"
  3912. // ],
  3913. // "enumDescriptions": [
  3914. // "Returns response with a sample size that balances speed and accuracy.",
  3915. // "Returns a fast response with a smaller sample size.",
  3916. // "Returns a more accurate response using a large sample size, but this may result in the response being slower."
  3917. // ],
  3918. // "location": "query",
  3919. // "type": "string"
  3920. // },
  3921. // "sort": {
  3922. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data.",
  3923. // "location": "query",
  3924. // "pattern": "(-)?mcf:.+",
  3925. // "type": "string"
  3926. // },
  3927. // "start-date": {
  3928. // "description": "Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.",
  3929. // "location": "query",
  3930. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  3931. // "required": true,
  3932. // "type": "string"
  3933. // },
  3934. // "start-index": {
  3935. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  3936. // "format": "int32",
  3937. // "location": "query",
  3938. // "minimum": "1",
  3939. // "type": "integer"
  3940. // }
  3941. // },
  3942. // "path": "data/mcf",
  3943. // "response": {
  3944. // "$ref": "McfData"
  3945. // },
  3946. // "scopes": [
  3947. // "https://www.googleapis.com/auth/analytics",
  3948. // "https://www.googleapis.com/auth/analytics.readonly"
  3949. // ]
  3950. // }
  3951. }
  3952. // method id "analytics.data.realtime.get":
  3953. type DataRealtimeGetCall struct {
  3954. s *Service
  3955. urlParams_ gensupport.URLParams
  3956. ifNoneMatch_ string
  3957. ctx_ context.Context
  3958. }
  3959. // Get: Returns real time data for a view (profile).
  3960. func (r *DataRealtimeService) Get(ids string, metrics string) *DataRealtimeGetCall {
  3961. c := &DataRealtimeGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3962. c.urlParams_.Set("ids", ids)
  3963. c.urlParams_.Set("metrics", metrics)
  3964. return c
  3965. }
  3966. // Dimensions sets the optional parameter "dimensions": A
  3967. // comma-separated list of real time dimensions. E.g.,
  3968. // 'rt:medium,rt:city'.
  3969. func (c *DataRealtimeGetCall) Dimensions(dimensions string) *DataRealtimeGetCall {
  3970. c.urlParams_.Set("dimensions", dimensions)
  3971. return c
  3972. }
  3973. // Filters sets the optional parameter "filters": A comma-separated list
  3974. // of dimension or metric filters to be applied to real time data.
  3975. func (c *DataRealtimeGetCall) Filters(filters string) *DataRealtimeGetCall {
  3976. c.urlParams_.Set("filters", filters)
  3977. return c
  3978. }
  3979. // MaxResults sets the optional parameter "max-results": The maximum
  3980. // number of entries to include in this feed.
  3981. func (c *DataRealtimeGetCall) MaxResults(maxResults int64) *DataRealtimeGetCall {
  3982. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  3983. return c
  3984. }
  3985. // Sort sets the optional parameter "sort": A comma-separated list of
  3986. // dimensions or metrics that determine the sort order for real time
  3987. // data.
  3988. func (c *DataRealtimeGetCall) Sort(sort string) *DataRealtimeGetCall {
  3989. c.urlParams_.Set("sort", sort)
  3990. return c
  3991. }
  3992. // Fields allows partial responses to be retrieved. See
  3993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3994. // for more information.
  3995. func (c *DataRealtimeGetCall) Fields(s ...googleapi.Field) *DataRealtimeGetCall {
  3996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3997. return c
  3998. }
  3999. // IfNoneMatch sets the optional parameter which makes the operation
  4000. // fail if the object's ETag matches the given value. This is useful for
  4001. // getting updates only after the object has changed since the last
  4002. // request. Use googleapi.IsNotModified to check whether the response
  4003. // error from Do is the result of In-None-Match.
  4004. func (c *DataRealtimeGetCall) IfNoneMatch(entityTag string) *DataRealtimeGetCall {
  4005. c.ifNoneMatch_ = entityTag
  4006. return c
  4007. }
  4008. // Context sets the context to be used in this call's Do method. Any
  4009. // pending HTTP request will be aborted if the provided context is
  4010. // canceled.
  4011. func (c *DataRealtimeGetCall) Context(ctx context.Context) *DataRealtimeGetCall {
  4012. c.ctx_ = ctx
  4013. return c
  4014. }
  4015. func (c *DataRealtimeGetCall) doRequest(alt string) (*http.Response, error) {
  4016. var body io.Reader = nil
  4017. c.urlParams_.Set("alt", alt)
  4018. urls := googleapi.ResolveRelative(c.s.BasePath, "data/realtime")
  4019. urls += "?" + c.urlParams_.Encode()
  4020. req, _ := http.NewRequest("GET", urls, body)
  4021. googleapi.SetOpaque(req.URL)
  4022. req.Header.Set("User-Agent", c.s.userAgent())
  4023. if c.ifNoneMatch_ != "" {
  4024. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4025. }
  4026. if c.ctx_ != nil {
  4027. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4028. }
  4029. return c.s.client.Do(req)
  4030. }
  4031. // Do executes the "analytics.data.realtime.get" call.
  4032. // Exactly one of *RealtimeData or error will be non-nil. Any non-2xx
  4033. // status code is an error. Response headers are in either
  4034. // *RealtimeData.ServerResponse.Header or (if a response was returned at
  4035. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4036. // to check whether the returned error was because
  4037. // http.StatusNotModified was returned.
  4038. func (c *DataRealtimeGetCall) Do(opts ...googleapi.CallOption) (*RealtimeData, error) {
  4039. gensupport.SetOptions(c.urlParams_, opts...)
  4040. res, err := c.doRequest("json")
  4041. if res != nil && res.StatusCode == http.StatusNotModified {
  4042. if res.Body != nil {
  4043. res.Body.Close()
  4044. }
  4045. return nil, &googleapi.Error{
  4046. Code: res.StatusCode,
  4047. Header: res.Header,
  4048. }
  4049. }
  4050. if err != nil {
  4051. return nil, err
  4052. }
  4053. defer googleapi.CloseBody(res)
  4054. if err := googleapi.CheckResponse(res); err != nil {
  4055. return nil, err
  4056. }
  4057. ret := &RealtimeData{
  4058. ServerResponse: googleapi.ServerResponse{
  4059. Header: res.Header,
  4060. HTTPStatusCode: res.StatusCode,
  4061. },
  4062. }
  4063. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4064. return nil, err
  4065. }
  4066. return ret, nil
  4067. // {
  4068. // "description": "Returns real time data for a view (profile).",
  4069. // "httpMethod": "GET",
  4070. // "id": "analytics.data.realtime.get",
  4071. // "parameterOrder": [
  4072. // "ids",
  4073. // "metrics"
  4074. // ],
  4075. // "parameters": {
  4076. // "dimensions": {
  4077. // "description": "A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'.",
  4078. // "location": "query",
  4079. // "pattern": "(ga:.+)|(rt:.+)",
  4080. // "type": "string"
  4081. // },
  4082. // "filters": {
  4083. // "description": "A comma-separated list of dimension or metric filters to be applied to real time data.",
  4084. // "location": "query",
  4085. // "pattern": "(ga:.+)|(rt:.+)",
  4086. // "type": "string"
  4087. // },
  4088. // "ids": {
  4089. // "description": "Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  4090. // "location": "query",
  4091. // "pattern": "ga:[0-9]+",
  4092. // "required": true,
  4093. // "type": "string"
  4094. // },
  4095. // "max-results": {
  4096. // "description": "The maximum number of entries to include in this feed.",
  4097. // "format": "int32",
  4098. // "location": "query",
  4099. // "type": "integer"
  4100. // },
  4101. // "metrics": {
  4102. // "description": "A comma-separated list of real time metrics. E.g., 'rt:activeUsers'. At least one metric must be specified.",
  4103. // "location": "query",
  4104. // "pattern": "(ga:.+)|(rt:.+)",
  4105. // "required": true,
  4106. // "type": "string"
  4107. // },
  4108. // "sort": {
  4109. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for real time data.",
  4110. // "location": "query",
  4111. // "pattern": "(-)?((ga:.+)|(rt:.+))",
  4112. // "type": "string"
  4113. // }
  4114. // },
  4115. // "path": "data/realtime",
  4116. // "response": {
  4117. // "$ref": "RealtimeData"
  4118. // },
  4119. // "scopes": [
  4120. // "https://www.googleapis.com/auth/analytics",
  4121. // "https://www.googleapis.com/auth/analytics.readonly"
  4122. // ]
  4123. // }
  4124. }
  4125. // method id "analytics.management.accountSummaries.list":
  4126. type ManagementAccountSummariesListCall struct {
  4127. s *Service
  4128. urlParams_ gensupport.URLParams
  4129. ifNoneMatch_ string
  4130. ctx_ context.Context
  4131. }
  4132. // List: Lists account summaries (lightweight tree comprised of
  4133. // accounts/properties/profiles) to which the user has access.
  4134. func (r *ManagementAccountSummariesService) List() *ManagementAccountSummariesListCall {
  4135. c := &ManagementAccountSummariesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4136. return c
  4137. }
  4138. // MaxResults sets the optional parameter "max-results": The maximum
  4139. // number of account summaries to include in this response, where the
  4140. // largest acceptable value is 1000.
  4141. func (c *ManagementAccountSummariesListCall) MaxResults(maxResults int64) *ManagementAccountSummariesListCall {
  4142. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  4143. return c
  4144. }
  4145. // StartIndex sets the optional parameter "start-index": An index of the
  4146. // first entity to retrieve. Use this parameter as a pagination
  4147. // mechanism along with the max-results parameter.
  4148. func (c *ManagementAccountSummariesListCall) StartIndex(startIndex int64) *ManagementAccountSummariesListCall {
  4149. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  4150. return c
  4151. }
  4152. // Fields allows partial responses to be retrieved. See
  4153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4154. // for more information.
  4155. func (c *ManagementAccountSummariesListCall) Fields(s ...googleapi.Field) *ManagementAccountSummariesListCall {
  4156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4157. return c
  4158. }
  4159. // IfNoneMatch sets the optional parameter which makes the operation
  4160. // fail if the object's ETag matches the given value. This is useful for
  4161. // getting updates only after the object has changed since the last
  4162. // request. Use googleapi.IsNotModified to check whether the response
  4163. // error from Do is the result of In-None-Match.
  4164. func (c *ManagementAccountSummariesListCall) IfNoneMatch(entityTag string) *ManagementAccountSummariesListCall {
  4165. c.ifNoneMatch_ = entityTag
  4166. return c
  4167. }
  4168. // Context sets the context to be used in this call's Do method. Any
  4169. // pending HTTP request will be aborted if the provided context is
  4170. // canceled.
  4171. func (c *ManagementAccountSummariesListCall) Context(ctx context.Context) *ManagementAccountSummariesListCall {
  4172. c.ctx_ = ctx
  4173. return c
  4174. }
  4175. func (c *ManagementAccountSummariesListCall) doRequest(alt string) (*http.Response, error) {
  4176. var body io.Reader = nil
  4177. c.urlParams_.Set("alt", alt)
  4178. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accountSummaries")
  4179. urls += "?" + c.urlParams_.Encode()
  4180. req, _ := http.NewRequest("GET", urls, body)
  4181. googleapi.SetOpaque(req.URL)
  4182. req.Header.Set("User-Agent", c.s.userAgent())
  4183. if c.ifNoneMatch_ != "" {
  4184. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4185. }
  4186. if c.ctx_ != nil {
  4187. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4188. }
  4189. return c.s.client.Do(req)
  4190. }
  4191. // Do executes the "analytics.management.accountSummaries.list" call.
  4192. // Exactly one of *AccountSummaries or error will be non-nil. Any
  4193. // non-2xx status code is an error. Response headers are in either
  4194. // *AccountSummaries.ServerResponse.Header or (if a response was
  4195. // returned at all) in error.(*googleapi.Error).Header. Use
  4196. // googleapi.IsNotModified to check whether the returned error was
  4197. // because http.StatusNotModified was returned.
  4198. func (c *ManagementAccountSummariesListCall) Do(opts ...googleapi.CallOption) (*AccountSummaries, error) {
  4199. gensupport.SetOptions(c.urlParams_, opts...)
  4200. res, err := c.doRequest("json")
  4201. if res != nil && res.StatusCode == http.StatusNotModified {
  4202. if res.Body != nil {
  4203. res.Body.Close()
  4204. }
  4205. return nil, &googleapi.Error{
  4206. Code: res.StatusCode,
  4207. Header: res.Header,
  4208. }
  4209. }
  4210. if err != nil {
  4211. return nil, err
  4212. }
  4213. defer googleapi.CloseBody(res)
  4214. if err := googleapi.CheckResponse(res); err != nil {
  4215. return nil, err
  4216. }
  4217. ret := &AccountSummaries{
  4218. ServerResponse: googleapi.ServerResponse{
  4219. Header: res.Header,
  4220. HTTPStatusCode: res.StatusCode,
  4221. },
  4222. }
  4223. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4224. return nil, err
  4225. }
  4226. return ret, nil
  4227. // {
  4228. // "description": "Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access.",
  4229. // "httpMethod": "GET",
  4230. // "id": "analytics.management.accountSummaries.list",
  4231. // "parameters": {
  4232. // "max-results": {
  4233. // "description": "The maximum number of account summaries to include in this response, where the largest acceptable value is 1000.",
  4234. // "format": "int32",
  4235. // "location": "query",
  4236. // "type": "integer"
  4237. // },
  4238. // "start-index": {
  4239. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  4240. // "format": "int32",
  4241. // "location": "query",
  4242. // "minimum": "1",
  4243. // "type": "integer"
  4244. // }
  4245. // },
  4246. // "path": "management/accountSummaries",
  4247. // "response": {
  4248. // "$ref": "AccountSummaries"
  4249. // },
  4250. // "scopes": [
  4251. // "https://www.googleapis.com/auth/analytics.edit",
  4252. // "https://www.googleapis.com/auth/analytics.readonly"
  4253. // ]
  4254. // }
  4255. }
  4256. // method id "analytics.management.accountUserLinks.delete":
  4257. type ManagementAccountUserLinksDeleteCall struct {
  4258. s *Service
  4259. accountId string
  4260. linkId string
  4261. urlParams_ gensupport.URLParams
  4262. ctx_ context.Context
  4263. }
  4264. // Delete: Removes a user from the given account.
  4265. func (r *ManagementAccountUserLinksService) Delete(accountId string, linkId string) *ManagementAccountUserLinksDeleteCall {
  4266. c := &ManagementAccountUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4267. c.accountId = accountId
  4268. c.linkId = linkId
  4269. return c
  4270. }
  4271. // Fields allows partial responses to be retrieved. See
  4272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4273. // for more information.
  4274. func (c *ManagementAccountUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksDeleteCall {
  4275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4276. return c
  4277. }
  4278. // Context sets the context to be used in this call's Do method. Any
  4279. // pending HTTP request will be aborted if the provided context is
  4280. // canceled.
  4281. func (c *ManagementAccountUserLinksDeleteCall) Context(ctx context.Context) *ManagementAccountUserLinksDeleteCall {
  4282. c.ctx_ = ctx
  4283. return c
  4284. }
  4285. func (c *ManagementAccountUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  4286. var body io.Reader = nil
  4287. c.urlParams_.Set("alt", alt)
  4288. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}")
  4289. urls += "?" + c.urlParams_.Encode()
  4290. req, _ := http.NewRequest("DELETE", urls, body)
  4291. googleapi.Expand(req.URL, map[string]string{
  4292. "accountId": c.accountId,
  4293. "linkId": c.linkId,
  4294. })
  4295. req.Header.Set("User-Agent", c.s.userAgent())
  4296. if c.ctx_ != nil {
  4297. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4298. }
  4299. return c.s.client.Do(req)
  4300. }
  4301. // Do executes the "analytics.management.accountUserLinks.delete" call.
  4302. func (c *ManagementAccountUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  4303. gensupport.SetOptions(c.urlParams_, opts...)
  4304. res, err := c.doRequest("json")
  4305. if err != nil {
  4306. return err
  4307. }
  4308. defer googleapi.CloseBody(res)
  4309. if err := googleapi.CheckResponse(res); err != nil {
  4310. return err
  4311. }
  4312. return nil
  4313. // {
  4314. // "description": "Removes a user from the given account.",
  4315. // "httpMethod": "DELETE",
  4316. // "id": "analytics.management.accountUserLinks.delete",
  4317. // "parameterOrder": [
  4318. // "accountId",
  4319. // "linkId"
  4320. // ],
  4321. // "parameters": {
  4322. // "accountId": {
  4323. // "description": "Account ID to delete the user link for.",
  4324. // "location": "path",
  4325. // "required": true,
  4326. // "type": "string"
  4327. // },
  4328. // "linkId": {
  4329. // "description": "Link ID to delete the user link for.",
  4330. // "location": "path",
  4331. // "required": true,
  4332. // "type": "string"
  4333. // }
  4334. // },
  4335. // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}",
  4336. // "scopes": [
  4337. // "https://www.googleapis.com/auth/analytics.manage.users"
  4338. // ]
  4339. // }
  4340. }
  4341. // method id "analytics.management.accountUserLinks.insert":
  4342. type ManagementAccountUserLinksInsertCall struct {
  4343. s *Service
  4344. accountId string
  4345. entityuserlink *EntityUserLink
  4346. urlParams_ gensupport.URLParams
  4347. ctx_ context.Context
  4348. }
  4349. // Insert: Adds a new user to the given account.
  4350. func (r *ManagementAccountUserLinksService) Insert(accountId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksInsertCall {
  4351. c := &ManagementAccountUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4352. c.accountId = accountId
  4353. c.entityuserlink = entityuserlink
  4354. return c
  4355. }
  4356. // Fields allows partial responses to be retrieved. See
  4357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4358. // for more information.
  4359. func (c *ManagementAccountUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksInsertCall {
  4360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4361. return c
  4362. }
  4363. // Context sets the context to be used in this call's Do method. Any
  4364. // pending HTTP request will be aborted if the provided context is
  4365. // canceled.
  4366. func (c *ManagementAccountUserLinksInsertCall) Context(ctx context.Context) *ManagementAccountUserLinksInsertCall {
  4367. c.ctx_ = ctx
  4368. return c
  4369. }
  4370. func (c *ManagementAccountUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  4371. var body io.Reader = nil
  4372. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  4373. if err != nil {
  4374. return nil, err
  4375. }
  4376. ctype := "application/json"
  4377. c.urlParams_.Set("alt", alt)
  4378. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks")
  4379. urls += "?" + c.urlParams_.Encode()
  4380. req, _ := http.NewRequest("POST", urls, body)
  4381. googleapi.Expand(req.URL, map[string]string{
  4382. "accountId": c.accountId,
  4383. })
  4384. req.Header.Set("Content-Type", ctype)
  4385. req.Header.Set("User-Agent", c.s.userAgent())
  4386. if c.ctx_ != nil {
  4387. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4388. }
  4389. return c.s.client.Do(req)
  4390. }
  4391. // Do executes the "analytics.management.accountUserLinks.insert" call.
  4392. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  4393. // status code is an error. Response headers are in either
  4394. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  4395. // at all) in error.(*googleapi.Error).Header. Use
  4396. // googleapi.IsNotModified to check whether the returned error was
  4397. // because http.StatusNotModified was returned.
  4398. func (c *ManagementAccountUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  4399. gensupport.SetOptions(c.urlParams_, opts...)
  4400. res, err := c.doRequest("json")
  4401. if res != nil && res.StatusCode == http.StatusNotModified {
  4402. if res.Body != nil {
  4403. res.Body.Close()
  4404. }
  4405. return nil, &googleapi.Error{
  4406. Code: res.StatusCode,
  4407. Header: res.Header,
  4408. }
  4409. }
  4410. if err != nil {
  4411. return nil, err
  4412. }
  4413. defer googleapi.CloseBody(res)
  4414. if err := googleapi.CheckResponse(res); err != nil {
  4415. return nil, err
  4416. }
  4417. ret := &EntityUserLink{
  4418. ServerResponse: googleapi.ServerResponse{
  4419. Header: res.Header,
  4420. HTTPStatusCode: res.StatusCode,
  4421. },
  4422. }
  4423. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4424. return nil, err
  4425. }
  4426. return ret, nil
  4427. // {
  4428. // "description": "Adds a new user to the given account.",
  4429. // "httpMethod": "POST",
  4430. // "id": "analytics.management.accountUserLinks.insert",
  4431. // "parameterOrder": [
  4432. // "accountId"
  4433. // ],
  4434. // "parameters": {
  4435. // "accountId": {
  4436. // "description": "Account ID to create the user link for.",
  4437. // "location": "path",
  4438. // "required": true,
  4439. // "type": "string"
  4440. // }
  4441. // },
  4442. // "path": "management/accounts/{accountId}/entityUserLinks",
  4443. // "request": {
  4444. // "$ref": "EntityUserLink"
  4445. // },
  4446. // "response": {
  4447. // "$ref": "EntityUserLink"
  4448. // },
  4449. // "scopes": [
  4450. // "https://www.googleapis.com/auth/analytics.manage.users"
  4451. // ]
  4452. // }
  4453. }
  4454. // method id "analytics.management.accountUserLinks.list":
  4455. type ManagementAccountUserLinksListCall struct {
  4456. s *Service
  4457. accountId string
  4458. urlParams_ gensupport.URLParams
  4459. ifNoneMatch_ string
  4460. ctx_ context.Context
  4461. }
  4462. // List: Lists account-user links for a given account.
  4463. func (r *ManagementAccountUserLinksService) List(accountId string) *ManagementAccountUserLinksListCall {
  4464. c := &ManagementAccountUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4465. c.accountId = accountId
  4466. return c
  4467. }
  4468. // MaxResults sets the optional parameter "max-results": The maximum
  4469. // number of account-user links to include in this response.
  4470. func (c *ManagementAccountUserLinksListCall) MaxResults(maxResults int64) *ManagementAccountUserLinksListCall {
  4471. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  4472. return c
  4473. }
  4474. // StartIndex sets the optional parameter "start-index": An index of the
  4475. // first account-user link to retrieve. Use this parameter as a
  4476. // pagination mechanism along with the max-results parameter.
  4477. func (c *ManagementAccountUserLinksListCall) StartIndex(startIndex int64) *ManagementAccountUserLinksListCall {
  4478. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  4479. return c
  4480. }
  4481. // Fields allows partial responses to be retrieved. See
  4482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4483. // for more information.
  4484. func (c *ManagementAccountUserLinksListCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksListCall {
  4485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4486. return c
  4487. }
  4488. // IfNoneMatch sets the optional parameter which makes the operation
  4489. // fail if the object's ETag matches the given value. This is useful for
  4490. // getting updates only after the object has changed since the last
  4491. // request. Use googleapi.IsNotModified to check whether the response
  4492. // error from Do is the result of In-None-Match.
  4493. func (c *ManagementAccountUserLinksListCall) IfNoneMatch(entityTag string) *ManagementAccountUserLinksListCall {
  4494. c.ifNoneMatch_ = entityTag
  4495. return c
  4496. }
  4497. // Context sets the context to be used in this call's Do method. Any
  4498. // pending HTTP request will be aborted if the provided context is
  4499. // canceled.
  4500. func (c *ManagementAccountUserLinksListCall) Context(ctx context.Context) *ManagementAccountUserLinksListCall {
  4501. c.ctx_ = ctx
  4502. return c
  4503. }
  4504. func (c *ManagementAccountUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  4505. var body io.Reader = nil
  4506. c.urlParams_.Set("alt", alt)
  4507. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks")
  4508. urls += "?" + c.urlParams_.Encode()
  4509. req, _ := http.NewRequest("GET", urls, body)
  4510. googleapi.Expand(req.URL, map[string]string{
  4511. "accountId": c.accountId,
  4512. })
  4513. req.Header.Set("User-Agent", c.s.userAgent())
  4514. if c.ifNoneMatch_ != "" {
  4515. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4516. }
  4517. if c.ctx_ != nil {
  4518. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4519. }
  4520. return c.s.client.Do(req)
  4521. }
  4522. // Do executes the "analytics.management.accountUserLinks.list" call.
  4523. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  4524. // status code is an error. Response headers are in either
  4525. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  4526. // at all) in error.(*googleapi.Error).Header. Use
  4527. // googleapi.IsNotModified to check whether the returned error was
  4528. // because http.StatusNotModified was returned.
  4529. func (c *ManagementAccountUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  4530. gensupport.SetOptions(c.urlParams_, opts...)
  4531. res, err := c.doRequest("json")
  4532. if res != nil && res.StatusCode == http.StatusNotModified {
  4533. if res.Body != nil {
  4534. res.Body.Close()
  4535. }
  4536. return nil, &googleapi.Error{
  4537. Code: res.StatusCode,
  4538. Header: res.Header,
  4539. }
  4540. }
  4541. if err != nil {
  4542. return nil, err
  4543. }
  4544. defer googleapi.CloseBody(res)
  4545. if err := googleapi.CheckResponse(res); err != nil {
  4546. return nil, err
  4547. }
  4548. ret := &EntityUserLinks{
  4549. ServerResponse: googleapi.ServerResponse{
  4550. Header: res.Header,
  4551. HTTPStatusCode: res.StatusCode,
  4552. },
  4553. }
  4554. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4555. return nil, err
  4556. }
  4557. return ret, nil
  4558. // {
  4559. // "description": "Lists account-user links for a given account.",
  4560. // "httpMethod": "GET",
  4561. // "id": "analytics.management.accountUserLinks.list",
  4562. // "parameterOrder": [
  4563. // "accountId"
  4564. // ],
  4565. // "parameters": {
  4566. // "accountId": {
  4567. // "description": "Account ID to retrieve the user links for.",
  4568. // "location": "path",
  4569. // "required": true,
  4570. // "type": "string"
  4571. // },
  4572. // "max-results": {
  4573. // "description": "The maximum number of account-user links to include in this response.",
  4574. // "format": "int32",
  4575. // "location": "query",
  4576. // "type": "integer"
  4577. // },
  4578. // "start-index": {
  4579. // "description": "An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  4580. // "format": "int32",
  4581. // "location": "query",
  4582. // "minimum": "1",
  4583. // "type": "integer"
  4584. // }
  4585. // },
  4586. // "path": "management/accounts/{accountId}/entityUserLinks",
  4587. // "response": {
  4588. // "$ref": "EntityUserLinks"
  4589. // },
  4590. // "scopes": [
  4591. // "https://www.googleapis.com/auth/analytics.manage.users",
  4592. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  4593. // ]
  4594. // }
  4595. }
  4596. // method id "analytics.management.accountUserLinks.update":
  4597. type ManagementAccountUserLinksUpdateCall struct {
  4598. s *Service
  4599. accountId string
  4600. linkId string
  4601. entityuserlink *EntityUserLink
  4602. urlParams_ gensupport.URLParams
  4603. ctx_ context.Context
  4604. }
  4605. // Update: Updates permissions for an existing user on the given
  4606. // account.
  4607. func (r *ManagementAccountUserLinksService) Update(accountId string, linkId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksUpdateCall {
  4608. c := &ManagementAccountUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4609. c.accountId = accountId
  4610. c.linkId = linkId
  4611. c.entityuserlink = entityuserlink
  4612. return c
  4613. }
  4614. // Fields allows partial responses to be retrieved. See
  4615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4616. // for more information.
  4617. func (c *ManagementAccountUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksUpdateCall {
  4618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4619. return c
  4620. }
  4621. // Context sets the context to be used in this call's Do method. Any
  4622. // pending HTTP request will be aborted if the provided context is
  4623. // canceled.
  4624. func (c *ManagementAccountUserLinksUpdateCall) Context(ctx context.Context) *ManagementAccountUserLinksUpdateCall {
  4625. c.ctx_ = ctx
  4626. return c
  4627. }
  4628. func (c *ManagementAccountUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  4629. var body io.Reader = nil
  4630. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  4631. if err != nil {
  4632. return nil, err
  4633. }
  4634. ctype := "application/json"
  4635. c.urlParams_.Set("alt", alt)
  4636. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}")
  4637. urls += "?" + c.urlParams_.Encode()
  4638. req, _ := http.NewRequest("PUT", urls, body)
  4639. googleapi.Expand(req.URL, map[string]string{
  4640. "accountId": c.accountId,
  4641. "linkId": c.linkId,
  4642. })
  4643. req.Header.Set("Content-Type", ctype)
  4644. req.Header.Set("User-Agent", c.s.userAgent())
  4645. if c.ctx_ != nil {
  4646. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4647. }
  4648. return c.s.client.Do(req)
  4649. }
  4650. // Do executes the "analytics.management.accountUserLinks.update" call.
  4651. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  4652. // status code is an error. Response headers are in either
  4653. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  4654. // at all) in error.(*googleapi.Error).Header. Use
  4655. // googleapi.IsNotModified to check whether the returned error was
  4656. // because http.StatusNotModified was returned.
  4657. func (c *ManagementAccountUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  4658. gensupport.SetOptions(c.urlParams_, opts...)
  4659. res, err := c.doRequest("json")
  4660. if res != nil && res.StatusCode == http.StatusNotModified {
  4661. if res.Body != nil {
  4662. res.Body.Close()
  4663. }
  4664. return nil, &googleapi.Error{
  4665. Code: res.StatusCode,
  4666. Header: res.Header,
  4667. }
  4668. }
  4669. if err != nil {
  4670. return nil, err
  4671. }
  4672. defer googleapi.CloseBody(res)
  4673. if err := googleapi.CheckResponse(res); err != nil {
  4674. return nil, err
  4675. }
  4676. ret := &EntityUserLink{
  4677. ServerResponse: googleapi.ServerResponse{
  4678. Header: res.Header,
  4679. HTTPStatusCode: res.StatusCode,
  4680. },
  4681. }
  4682. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4683. return nil, err
  4684. }
  4685. return ret, nil
  4686. // {
  4687. // "description": "Updates permissions for an existing user on the given account.",
  4688. // "httpMethod": "PUT",
  4689. // "id": "analytics.management.accountUserLinks.update",
  4690. // "parameterOrder": [
  4691. // "accountId",
  4692. // "linkId"
  4693. // ],
  4694. // "parameters": {
  4695. // "accountId": {
  4696. // "description": "Account ID to update the account-user link for.",
  4697. // "location": "path",
  4698. // "required": true,
  4699. // "type": "string"
  4700. // },
  4701. // "linkId": {
  4702. // "description": "Link ID to update the account-user link for.",
  4703. // "location": "path",
  4704. // "required": true,
  4705. // "type": "string"
  4706. // }
  4707. // },
  4708. // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}",
  4709. // "request": {
  4710. // "$ref": "EntityUserLink"
  4711. // },
  4712. // "response": {
  4713. // "$ref": "EntityUserLink"
  4714. // },
  4715. // "scopes": [
  4716. // "https://www.googleapis.com/auth/analytics.manage.users"
  4717. // ]
  4718. // }
  4719. }
  4720. // method id "analytics.management.accounts.list":
  4721. type ManagementAccountsListCall struct {
  4722. s *Service
  4723. urlParams_ gensupport.URLParams
  4724. ifNoneMatch_ string
  4725. ctx_ context.Context
  4726. }
  4727. // List: Lists all accounts to which the user has access.
  4728. func (r *ManagementAccountsService) List() *ManagementAccountsListCall {
  4729. c := &ManagementAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4730. return c
  4731. }
  4732. // MaxResults sets the optional parameter "max-results": The maximum
  4733. // number of accounts to include in this response.
  4734. func (c *ManagementAccountsListCall) MaxResults(maxResults int64) *ManagementAccountsListCall {
  4735. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  4736. return c
  4737. }
  4738. // StartIndex sets the optional parameter "start-index": An index of the
  4739. // first account to retrieve. Use this parameter as a pagination
  4740. // mechanism along with the max-results parameter.
  4741. func (c *ManagementAccountsListCall) StartIndex(startIndex int64) *ManagementAccountsListCall {
  4742. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  4743. return c
  4744. }
  4745. // Fields allows partial responses to be retrieved. See
  4746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4747. // for more information.
  4748. func (c *ManagementAccountsListCall) Fields(s ...googleapi.Field) *ManagementAccountsListCall {
  4749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4750. return c
  4751. }
  4752. // IfNoneMatch sets the optional parameter which makes the operation
  4753. // fail if the object's ETag matches the given value. This is useful for
  4754. // getting updates only after the object has changed since the last
  4755. // request. Use googleapi.IsNotModified to check whether the response
  4756. // error from Do is the result of In-None-Match.
  4757. func (c *ManagementAccountsListCall) IfNoneMatch(entityTag string) *ManagementAccountsListCall {
  4758. c.ifNoneMatch_ = entityTag
  4759. return c
  4760. }
  4761. // Context sets the context to be used in this call's Do method. Any
  4762. // pending HTTP request will be aborted if the provided context is
  4763. // canceled.
  4764. func (c *ManagementAccountsListCall) Context(ctx context.Context) *ManagementAccountsListCall {
  4765. c.ctx_ = ctx
  4766. return c
  4767. }
  4768. func (c *ManagementAccountsListCall) doRequest(alt string) (*http.Response, error) {
  4769. var body io.Reader = nil
  4770. c.urlParams_.Set("alt", alt)
  4771. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts")
  4772. urls += "?" + c.urlParams_.Encode()
  4773. req, _ := http.NewRequest("GET", urls, body)
  4774. googleapi.SetOpaque(req.URL)
  4775. req.Header.Set("User-Agent", c.s.userAgent())
  4776. if c.ifNoneMatch_ != "" {
  4777. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4778. }
  4779. if c.ctx_ != nil {
  4780. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4781. }
  4782. return c.s.client.Do(req)
  4783. }
  4784. // Do executes the "analytics.management.accounts.list" call.
  4785. // Exactly one of *Accounts or error will be non-nil. Any non-2xx status
  4786. // code is an error. Response headers are in either
  4787. // *Accounts.ServerResponse.Header or (if a response was returned at
  4788. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4789. // to check whether the returned error was because
  4790. // http.StatusNotModified was returned.
  4791. func (c *ManagementAccountsListCall) Do(opts ...googleapi.CallOption) (*Accounts, error) {
  4792. gensupport.SetOptions(c.urlParams_, opts...)
  4793. res, err := c.doRequest("json")
  4794. if res != nil && res.StatusCode == http.StatusNotModified {
  4795. if res.Body != nil {
  4796. res.Body.Close()
  4797. }
  4798. return nil, &googleapi.Error{
  4799. Code: res.StatusCode,
  4800. Header: res.Header,
  4801. }
  4802. }
  4803. if err != nil {
  4804. return nil, err
  4805. }
  4806. defer googleapi.CloseBody(res)
  4807. if err := googleapi.CheckResponse(res); err != nil {
  4808. return nil, err
  4809. }
  4810. ret := &Accounts{
  4811. ServerResponse: googleapi.ServerResponse{
  4812. Header: res.Header,
  4813. HTTPStatusCode: res.StatusCode,
  4814. },
  4815. }
  4816. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4817. return nil, err
  4818. }
  4819. return ret, nil
  4820. // {
  4821. // "description": "Lists all accounts to which the user has access.",
  4822. // "httpMethod": "GET",
  4823. // "id": "analytics.management.accounts.list",
  4824. // "parameters": {
  4825. // "max-results": {
  4826. // "description": "The maximum number of accounts to include in this response.",
  4827. // "format": "int32",
  4828. // "location": "query",
  4829. // "type": "integer"
  4830. // },
  4831. // "start-index": {
  4832. // "description": "An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  4833. // "format": "int32",
  4834. // "location": "query",
  4835. // "minimum": "1",
  4836. // "type": "integer"
  4837. // }
  4838. // },
  4839. // "path": "management/accounts",
  4840. // "response": {
  4841. // "$ref": "Accounts"
  4842. // },
  4843. // "scopes": [
  4844. // "https://www.googleapis.com/auth/analytics",
  4845. // "https://www.googleapis.com/auth/analytics.edit",
  4846. // "https://www.googleapis.com/auth/analytics.readonly"
  4847. // ]
  4848. // }
  4849. }
  4850. // method id "analytics.management.customDataSources.list":
  4851. type ManagementCustomDataSourcesListCall struct {
  4852. s *Service
  4853. accountId string
  4854. webPropertyId string
  4855. urlParams_ gensupport.URLParams
  4856. ifNoneMatch_ string
  4857. ctx_ context.Context
  4858. }
  4859. // List: List custom data sources to which the user has access.
  4860. func (r *ManagementCustomDataSourcesService) List(accountId string, webPropertyId string) *ManagementCustomDataSourcesListCall {
  4861. c := &ManagementCustomDataSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4862. c.accountId = accountId
  4863. c.webPropertyId = webPropertyId
  4864. return c
  4865. }
  4866. // MaxResults sets the optional parameter "max-results": The maximum
  4867. // number of custom data sources to include in this response.
  4868. func (c *ManagementCustomDataSourcesListCall) MaxResults(maxResults int64) *ManagementCustomDataSourcesListCall {
  4869. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  4870. return c
  4871. }
  4872. // StartIndex sets the optional parameter "start-index": A 1-based index
  4873. // of the first custom data source to retrieve. Use this parameter as a
  4874. // pagination mechanism along with the max-results parameter.
  4875. func (c *ManagementCustomDataSourcesListCall) StartIndex(startIndex int64) *ManagementCustomDataSourcesListCall {
  4876. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  4877. return c
  4878. }
  4879. // Fields allows partial responses to be retrieved. See
  4880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4881. // for more information.
  4882. func (c *ManagementCustomDataSourcesListCall) Fields(s ...googleapi.Field) *ManagementCustomDataSourcesListCall {
  4883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4884. return c
  4885. }
  4886. // IfNoneMatch sets the optional parameter which makes the operation
  4887. // fail if the object's ETag matches the given value. This is useful for
  4888. // getting updates only after the object has changed since the last
  4889. // request. Use googleapi.IsNotModified to check whether the response
  4890. // error from Do is the result of In-None-Match.
  4891. func (c *ManagementCustomDataSourcesListCall) IfNoneMatch(entityTag string) *ManagementCustomDataSourcesListCall {
  4892. c.ifNoneMatch_ = entityTag
  4893. return c
  4894. }
  4895. // Context sets the context to be used in this call's Do method. Any
  4896. // pending HTTP request will be aborted if the provided context is
  4897. // canceled.
  4898. func (c *ManagementCustomDataSourcesListCall) Context(ctx context.Context) *ManagementCustomDataSourcesListCall {
  4899. c.ctx_ = ctx
  4900. return c
  4901. }
  4902. func (c *ManagementCustomDataSourcesListCall) doRequest(alt string) (*http.Response, error) {
  4903. var body io.Reader = nil
  4904. c.urlParams_.Set("alt", alt)
  4905. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources")
  4906. urls += "?" + c.urlParams_.Encode()
  4907. req, _ := http.NewRequest("GET", urls, body)
  4908. googleapi.Expand(req.URL, map[string]string{
  4909. "accountId": c.accountId,
  4910. "webPropertyId": c.webPropertyId,
  4911. })
  4912. req.Header.Set("User-Agent", c.s.userAgent())
  4913. if c.ifNoneMatch_ != "" {
  4914. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4915. }
  4916. if c.ctx_ != nil {
  4917. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4918. }
  4919. return c.s.client.Do(req)
  4920. }
  4921. // Do executes the "analytics.management.customDataSources.list" call.
  4922. // Exactly one of *CustomDataSources or error will be non-nil. Any
  4923. // non-2xx status code is an error. Response headers are in either
  4924. // *CustomDataSources.ServerResponse.Header or (if a response was
  4925. // returned at all) in error.(*googleapi.Error).Header. Use
  4926. // googleapi.IsNotModified to check whether the returned error was
  4927. // because http.StatusNotModified was returned.
  4928. func (c *ManagementCustomDataSourcesListCall) Do(opts ...googleapi.CallOption) (*CustomDataSources, error) {
  4929. gensupport.SetOptions(c.urlParams_, opts...)
  4930. res, err := c.doRequest("json")
  4931. if res != nil && res.StatusCode == http.StatusNotModified {
  4932. if res.Body != nil {
  4933. res.Body.Close()
  4934. }
  4935. return nil, &googleapi.Error{
  4936. Code: res.StatusCode,
  4937. Header: res.Header,
  4938. }
  4939. }
  4940. if err != nil {
  4941. return nil, err
  4942. }
  4943. defer googleapi.CloseBody(res)
  4944. if err := googleapi.CheckResponse(res); err != nil {
  4945. return nil, err
  4946. }
  4947. ret := &CustomDataSources{
  4948. ServerResponse: googleapi.ServerResponse{
  4949. Header: res.Header,
  4950. HTTPStatusCode: res.StatusCode,
  4951. },
  4952. }
  4953. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4954. return nil, err
  4955. }
  4956. return ret, nil
  4957. // {
  4958. // "description": "List custom data sources to which the user has access.",
  4959. // "httpMethod": "GET",
  4960. // "id": "analytics.management.customDataSources.list",
  4961. // "parameterOrder": [
  4962. // "accountId",
  4963. // "webPropertyId"
  4964. // ],
  4965. // "parameters": {
  4966. // "accountId": {
  4967. // "description": "Account Id for the custom data sources to retrieve.",
  4968. // "location": "path",
  4969. // "pattern": "\\d+",
  4970. // "required": true,
  4971. // "type": "string"
  4972. // },
  4973. // "max-results": {
  4974. // "description": "The maximum number of custom data sources to include in this response.",
  4975. // "format": "int32",
  4976. // "location": "query",
  4977. // "minimum": "1",
  4978. // "type": "integer"
  4979. // },
  4980. // "start-index": {
  4981. // "description": "A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  4982. // "format": "int32",
  4983. // "location": "query",
  4984. // "minimum": "1",
  4985. // "type": "integer"
  4986. // },
  4987. // "webPropertyId": {
  4988. // "description": "Web property Id for the custom data sources to retrieve.",
  4989. // "location": "path",
  4990. // "pattern": "UA-(\\d+)-(\\d+)",
  4991. // "required": true,
  4992. // "type": "string"
  4993. // }
  4994. // },
  4995. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources",
  4996. // "response": {
  4997. // "$ref": "CustomDataSources"
  4998. // },
  4999. // "scopes": [
  5000. // "https://www.googleapis.com/auth/analytics",
  5001. // "https://www.googleapis.com/auth/analytics.edit",
  5002. // "https://www.googleapis.com/auth/analytics.readonly"
  5003. // ]
  5004. // }
  5005. }
  5006. // method id "analytics.management.customDimensions.get":
  5007. type ManagementCustomDimensionsGetCall struct {
  5008. s *Service
  5009. accountId string
  5010. webPropertyId string
  5011. customDimensionId string
  5012. urlParams_ gensupport.URLParams
  5013. ifNoneMatch_ string
  5014. ctx_ context.Context
  5015. }
  5016. // Get: Get a custom dimension to which the user has access.
  5017. func (r *ManagementCustomDimensionsService) Get(accountId string, webPropertyId string, customDimensionId string) *ManagementCustomDimensionsGetCall {
  5018. c := &ManagementCustomDimensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5019. c.accountId = accountId
  5020. c.webPropertyId = webPropertyId
  5021. c.customDimensionId = customDimensionId
  5022. return c
  5023. }
  5024. // Fields allows partial responses to be retrieved. See
  5025. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5026. // for more information.
  5027. func (c *ManagementCustomDimensionsGetCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsGetCall {
  5028. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5029. return c
  5030. }
  5031. // IfNoneMatch sets the optional parameter which makes the operation
  5032. // fail if the object's ETag matches the given value. This is useful for
  5033. // getting updates only after the object has changed since the last
  5034. // request. Use googleapi.IsNotModified to check whether the response
  5035. // error from Do is the result of In-None-Match.
  5036. func (c *ManagementCustomDimensionsGetCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsGetCall {
  5037. c.ifNoneMatch_ = entityTag
  5038. return c
  5039. }
  5040. // Context sets the context to be used in this call's Do method. Any
  5041. // pending HTTP request will be aborted if the provided context is
  5042. // canceled.
  5043. func (c *ManagementCustomDimensionsGetCall) Context(ctx context.Context) *ManagementCustomDimensionsGetCall {
  5044. c.ctx_ = ctx
  5045. return c
  5046. }
  5047. func (c *ManagementCustomDimensionsGetCall) doRequest(alt string) (*http.Response, error) {
  5048. var body io.Reader = nil
  5049. c.urlParams_.Set("alt", alt)
  5050. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  5051. urls += "?" + c.urlParams_.Encode()
  5052. req, _ := http.NewRequest("GET", urls, body)
  5053. googleapi.Expand(req.URL, map[string]string{
  5054. "accountId": c.accountId,
  5055. "webPropertyId": c.webPropertyId,
  5056. "customDimensionId": c.customDimensionId,
  5057. })
  5058. req.Header.Set("User-Agent", c.s.userAgent())
  5059. if c.ifNoneMatch_ != "" {
  5060. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5061. }
  5062. if c.ctx_ != nil {
  5063. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5064. }
  5065. return c.s.client.Do(req)
  5066. }
  5067. // Do executes the "analytics.management.customDimensions.get" call.
  5068. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  5069. // status code is an error. Response headers are in either
  5070. // *CustomDimension.ServerResponse.Header or (if a response was returned
  5071. // at all) in error.(*googleapi.Error).Header. Use
  5072. // googleapi.IsNotModified to check whether the returned error was
  5073. // because http.StatusNotModified was returned.
  5074. func (c *ManagementCustomDimensionsGetCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  5075. gensupport.SetOptions(c.urlParams_, opts...)
  5076. res, err := c.doRequest("json")
  5077. if res != nil && res.StatusCode == http.StatusNotModified {
  5078. if res.Body != nil {
  5079. res.Body.Close()
  5080. }
  5081. return nil, &googleapi.Error{
  5082. Code: res.StatusCode,
  5083. Header: res.Header,
  5084. }
  5085. }
  5086. if err != nil {
  5087. return nil, err
  5088. }
  5089. defer googleapi.CloseBody(res)
  5090. if err := googleapi.CheckResponse(res); err != nil {
  5091. return nil, err
  5092. }
  5093. ret := &CustomDimension{
  5094. ServerResponse: googleapi.ServerResponse{
  5095. Header: res.Header,
  5096. HTTPStatusCode: res.StatusCode,
  5097. },
  5098. }
  5099. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5100. return nil, err
  5101. }
  5102. return ret, nil
  5103. // {
  5104. // "description": "Get a custom dimension to which the user has access.",
  5105. // "httpMethod": "GET",
  5106. // "id": "analytics.management.customDimensions.get",
  5107. // "parameterOrder": [
  5108. // "accountId",
  5109. // "webPropertyId",
  5110. // "customDimensionId"
  5111. // ],
  5112. // "parameters": {
  5113. // "accountId": {
  5114. // "description": "Account ID for the custom dimension to retrieve.",
  5115. // "location": "path",
  5116. // "required": true,
  5117. // "type": "string"
  5118. // },
  5119. // "customDimensionId": {
  5120. // "description": "The ID of the custom dimension to retrieve.",
  5121. // "location": "path",
  5122. // "required": true,
  5123. // "type": "string"
  5124. // },
  5125. // "webPropertyId": {
  5126. // "description": "Web property ID for the custom dimension to retrieve.",
  5127. // "location": "path",
  5128. // "required": true,
  5129. // "type": "string"
  5130. // }
  5131. // },
  5132. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  5133. // "response": {
  5134. // "$ref": "CustomDimension"
  5135. // },
  5136. // "scopes": [
  5137. // "https://www.googleapis.com/auth/analytics.edit",
  5138. // "https://www.googleapis.com/auth/analytics.readonly"
  5139. // ]
  5140. // }
  5141. }
  5142. // method id "analytics.management.customDimensions.insert":
  5143. type ManagementCustomDimensionsInsertCall struct {
  5144. s *Service
  5145. accountId string
  5146. webPropertyId string
  5147. customdimension *CustomDimension
  5148. urlParams_ gensupport.URLParams
  5149. ctx_ context.Context
  5150. }
  5151. // Insert: Create a new custom dimension.
  5152. func (r *ManagementCustomDimensionsService) Insert(accountId string, webPropertyId string, customdimension *CustomDimension) *ManagementCustomDimensionsInsertCall {
  5153. c := &ManagementCustomDimensionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5154. c.accountId = accountId
  5155. c.webPropertyId = webPropertyId
  5156. c.customdimension = customdimension
  5157. return c
  5158. }
  5159. // Fields allows partial responses to be retrieved. See
  5160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5161. // for more information.
  5162. func (c *ManagementCustomDimensionsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsInsertCall {
  5163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5164. return c
  5165. }
  5166. // Context sets the context to be used in this call's Do method. Any
  5167. // pending HTTP request will be aborted if the provided context is
  5168. // canceled.
  5169. func (c *ManagementCustomDimensionsInsertCall) Context(ctx context.Context) *ManagementCustomDimensionsInsertCall {
  5170. c.ctx_ = ctx
  5171. return c
  5172. }
  5173. func (c *ManagementCustomDimensionsInsertCall) doRequest(alt string) (*http.Response, error) {
  5174. var body io.Reader = nil
  5175. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  5176. if err != nil {
  5177. return nil, err
  5178. }
  5179. ctype := "application/json"
  5180. c.urlParams_.Set("alt", alt)
  5181. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions")
  5182. urls += "?" + c.urlParams_.Encode()
  5183. req, _ := http.NewRequest("POST", urls, body)
  5184. googleapi.Expand(req.URL, map[string]string{
  5185. "accountId": c.accountId,
  5186. "webPropertyId": c.webPropertyId,
  5187. })
  5188. req.Header.Set("Content-Type", ctype)
  5189. req.Header.Set("User-Agent", c.s.userAgent())
  5190. if c.ctx_ != nil {
  5191. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5192. }
  5193. return c.s.client.Do(req)
  5194. }
  5195. // Do executes the "analytics.management.customDimensions.insert" call.
  5196. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  5197. // status code is an error. Response headers are in either
  5198. // *CustomDimension.ServerResponse.Header or (if a response was returned
  5199. // at all) in error.(*googleapi.Error).Header. Use
  5200. // googleapi.IsNotModified to check whether the returned error was
  5201. // because http.StatusNotModified was returned.
  5202. func (c *ManagementCustomDimensionsInsertCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  5203. gensupport.SetOptions(c.urlParams_, opts...)
  5204. res, err := c.doRequest("json")
  5205. if res != nil && res.StatusCode == http.StatusNotModified {
  5206. if res.Body != nil {
  5207. res.Body.Close()
  5208. }
  5209. return nil, &googleapi.Error{
  5210. Code: res.StatusCode,
  5211. Header: res.Header,
  5212. }
  5213. }
  5214. if err != nil {
  5215. return nil, err
  5216. }
  5217. defer googleapi.CloseBody(res)
  5218. if err := googleapi.CheckResponse(res); err != nil {
  5219. return nil, err
  5220. }
  5221. ret := &CustomDimension{
  5222. ServerResponse: googleapi.ServerResponse{
  5223. Header: res.Header,
  5224. HTTPStatusCode: res.StatusCode,
  5225. },
  5226. }
  5227. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5228. return nil, err
  5229. }
  5230. return ret, nil
  5231. // {
  5232. // "description": "Create a new custom dimension.",
  5233. // "httpMethod": "POST",
  5234. // "id": "analytics.management.customDimensions.insert",
  5235. // "parameterOrder": [
  5236. // "accountId",
  5237. // "webPropertyId"
  5238. // ],
  5239. // "parameters": {
  5240. // "accountId": {
  5241. // "description": "Account ID for the custom dimension to create.",
  5242. // "location": "path",
  5243. // "required": true,
  5244. // "type": "string"
  5245. // },
  5246. // "webPropertyId": {
  5247. // "description": "Web property ID for the custom dimension to create.",
  5248. // "location": "path",
  5249. // "required": true,
  5250. // "type": "string"
  5251. // }
  5252. // },
  5253. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions",
  5254. // "request": {
  5255. // "$ref": "CustomDimension"
  5256. // },
  5257. // "response": {
  5258. // "$ref": "CustomDimension"
  5259. // },
  5260. // "scopes": [
  5261. // "https://www.googleapis.com/auth/analytics.edit"
  5262. // ]
  5263. // }
  5264. }
  5265. // method id "analytics.management.customDimensions.list":
  5266. type ManagementCustomDimensionsListCall struct {
  5267. s *Service
  5268. accountId string
  5269. webPropertyId string
  5270. urlParams_ gensupport.URLParams
  5271. ifNoneMatch_ string
  5272. ctx_ context.Context
  5273. }
  5274. // List: Lists custom dimensions to which the user has access.
  5275. func (r *ManagementCustomDimensionsService) List(accountId string, webPropertyId string) *ManagementCustomDimensionsListCall {
  5276. c := &ManagementCustomDimensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5277. c.accountId = accountId
  5278. c.webPropertyId = webPropertyId
  5279. return c
  5280. }
  5281. // MaxResults sets the optional parameter "max-results": The maximum
  5282. // number of custom dimensions to include in this response.
  5283. func (c *ManagementCustomDimensionsListCall) MaxResults(maxResults int64) *ManagementCustomDimensionsListCall {
  5284. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5285. return c
  5286. }
  5287. // StartIndex sets the optional parameter "start-index": An index of the
  5288. // first entity to retrieve. Use this parameter as a pagination
  5289. // mechanism along with the max-results parameter.
  5290. func (c *ManagementCustomDimensionsListCall) StartIndex(startIndex int64) *ManagementCustomDimensionsListCall {
  5291. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5292. return c
  5293. }
  5294. // Fields allows partial responses to be retrieved. See
  5295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5296. // for more information.
  5297. func (c *ManagementCustomDimensionsListCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsListCall {
  5298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5299. return c
  5300. }
  5301. // IfNoneMatch sets the optional parameter which makes the operation
  5302. // fail if the object's ETag matches the given value. This is useful for
  5303. // getting updates only after the object has changed since the last
  5304. // request. Use googleapi.IsNotModified to check whether the response
  5305. // error from Do is the result of In-None-Match.
  5306. func (c *ManagementCustomDimensionsListCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsListCall {
  5307. c.ifNoneMatch_ = entityTag
  5308. return c
  5309. }
  5310. // Context sets the context to be used in this call's Do method. Any
  5311. // pending HTTP request will be aborted if the provided context is
  5312. // canceled.
  5313. func (c *ManagementCustomDimensionsListCall) Context(ctx context.Context) *ManagementCustomDimensionsListCall {
  5314. c.ctx_ = ctx
  5315. return c
  5316. }
  5317. func (c *ManagementCustomDimensionsListCall) doRequest(alt string) (*http.Response, error) {
  5318. var body io.Reader = nil
  5319. c.urlParams_.Set("alt", alt)
  5320. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions")
  5321. urls += "?" + c.urlParams_.Encode()
  5322. req, _ := http.NewRequest("GET", urls, body)
  5323. googleapi.Expand(req.URL, map[string]string{
  5324. "accountId": c.accountId,
  5325. "webPropertyId": c.webPropertyId,
  5326. })
  5327. req.Header.Set("User-Agent", c.s.userAgent())
  5328. if c.ifNoneMatch_ != "" {
  5329. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5330. }
  5331. if c.ctx_ != nil {
  5332. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5333. }
  5334. return c.s.client.Do(req)
  5335. }
  5336. // Do executes the "analytics.management.customDimensions.list" call.
  5337. // Exactly one of *CustomDimensions or error will be non-nil. Any
  5338. // non-2xx status code is an error. Response headers are in either
  5339. // *CustomDimensions.ServerResponse.Header or (if a response was
  5340. // returned at all) in error.(*googleapi.Error).Header. Use
  5341. // googleapi.IsNotModified to check whether the returned error was
  5342. // because http.StatusNotModified was returned.
  5343. func (c *ManagementCustomDimensionsListCall) Do(opts ...googleapi.CallOption) (*CustomDimensions, error) {
  5344. gensupport.SetOptions(c.urlParams_, opts...)
  5345. res, err := c.doRequest("json")
  5346. if res != nil && res.StatusCode == http.StatusNotModified {
  5347. if res.Body != nil {
  5348. res.Body.Close()
  5349. }
  5350. return nil, &googleapi.Error{
  5351. Code: res.StatusCode,
  5352. Header: res.Header,
  5353. }
  5354. }
  5355. if err != nil {
  5356. return nil, err
  5357. }
  5358. defer googleapi.CloseBody(res)
  5359. if err := googleapi.CheckResponse(res); err != nil {
  5360. return nil, err
  5361. }
  5362. ret := &CustomDimensions{
  5363. ServerResponse: googleapi.ServerResponse{
  5364. Header: res.Header,
  5365. HTTPStatusCode: res.StatusCode,
  5366. },
  5367. }
  5368. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5369. return nil, err
  5370. }
  5371. return ret, nil
  5372. // {
  5373. // "description": "Lists custom dimensions to which the user has access.",
  5374. // "httpMethod": "GET",
  5375. // "id": "analytics.management.customDimensions.list",
  5376. // "parameterOrder": [
  5377. // "accountId",
  5378. // "webPropertyId"
  5379. // ],
  5380. // "parameters": {
  5381. // "accountId": {
  5382. // "description": "Account ID for the custom dimensions to retrieve.",
  5383. // "location": "path",
  5384. // "required": true,
  5385. // "type": "string"
  5386. // },
  5387. // "max-results": {
  5388. // "description": "The maximum number of custom dimensions to include in this response.",
  5389. // "format": "int32",
  5390. // "location": "query",
  5391. // "type": "integer"
  5392. // },
  5393. // "start-index": {
  5394. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5395. // "format": "int32",
  5396. // "location": "query",
  5397. // "minimum": "1",
  5398. // "type": "integer"
  5399. // },
  5400. // "webPropertyId": {
  5401. // "description": "Web property ID for the custom dimensions to retrieve.",
  5402. // "location": "path",
  5403. // "required": true,
  5404. // "type": "string"
  5405. // }
  5406. // },
  5407. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions",
  5408. // "response": {
  5409. // "$ref": "CustomDimensions"
  5410. // },
  5411. // "scopes": [
  5412. // "https://www.googleapis.com/auth/analytics",
  5413. // "https://www.googleapis.com/auth/analytics.readonly"
  5414. // ]
  5415. // }
  5416. }
  5417. // method id "analytics.management.customDimensions.patch":
  5418. type ManagementCustomDimensionsPatchCall struct {
  5419. s *Service
  5420. accountId string
  5421. webPropertyId string
  5422. customDimensionId string
  5423. customdimension *CustomDimension
  5424. urlParams_ gensupport.URLParams
  5425. ctx_ context.Context
  5426. }
  5427. // Patch: Updates an existing custom dimension. This method supports
  5428. // patch semantics.
  5429. func (r *ManagementCustomDimensionsService) Patch(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsPatchCall {
  5430. c := &ManagementCustomDimensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5431. c.accountId = accountId
  5432. c.webPropertyId = webPropertyId
  5433. c.customDimensionId = customDimensionId
  5434. c.customdimension = customdimension
  5435. return c
  5436. }
  5437. // IgnoreCustomDataSourceLinks sets the optional parameter
  5438. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  5439. // warnings related to the custom dimension being linked to a custom
  5440. // data source / data set.
  5441. func (c *ManagementCustomDimensionsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsPatchCall {
  5442. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  5443. return c
  5444. }
  5445. // Fields allows partial responses to be retrieved. See
  5446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5447. // for more information.
  5448. func (c *ManagementCustomDimensionsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsPatchCall {
  5449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5450. return c
  5451. }
  5452. // Context sets the context to be used in this call's Do method. Any
  5453. // pending HTTP request will be aborted if the provided context is
  5454. // canceled.
  5455. func (c *ManagementCustomDimensionsPatchCall) Context(ctx context.Context) *ManagementCustomDimensionsPatchCall {
  5456. c.ctx_ = ctx
  5457. return c
  5458. }
  5459. func (c *ManagementCustomDimensionsPatchCall) doRequest(alt string) (*http.Response, error) {
  5460. var body io.Reader = nil
  5461. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  5462. if err != nil {
  5463. return nil, err
  5464. }
  5465. ctype := "application/json"
  5466. c.urlParams_.Set("alt", alt)
  5467. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  5468. urls += "?" + c.urlParams_.Encode()
  5469. req, _ := http.NewRequest("PATCH", urls, body)
  5470. googleapi.Expand(req.URL, map[string]string{
  5471. "accountId": c.accountId,
  5472. "webPropertyId": c.webPropertyId,
  5473. "customDimensionId": c.customDimensionId,
  5474. })
  5475. req.Header.Set("Content-Type", ctype)
  5476. req.Header.Set("User-Agent", c.s.userAgent())
  5477. if c.ctx_ != nil {
  5478. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5479. }
  5480. return c.s.client.Do(req)
  5481. }
  5482. // Do executes the "analytics.management.customDimensions.patch" call.
  5483. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  5484. // status code is an error. Response headers are in either
  5485. // *CustomDimension.ServerResponse.Header or (if a response was returned
  5486. // at all) in error.(*googleapi.Error).Header. Use
  5487. // googleapi.IsNotModified to check whether the returned error was
  5488. // because http.StatusNotModified was returned.
  5489. func (c *ManagementCustomDimensionsPatchCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  5490. gensupport.SetOptions(c.urlParams_, opts...)
  5491. res, err := c.doRequest("json")
  5492. if res != nil && res.StatusCode == http.StatusNotModified {
  5493. if res.Body != nil {
  5494. res.Body.Close()
  5495. }
  5496. return nil, &googleapi.Error{
  5497. Code: res.StatusCode,
  5498. Header: res.Header,
  5499. }
  5500. }
  5501. if err != nil {
  5502. return nil, err
  5503. }
  5504. defer googleapi.CloseBody(res)
  5505. if err := googleapi.CheckResponse(res); err != nil {
  5506. return nil, err
  5507. }
  5508. ret := &CustomDimension{
  5509. ServerResponse: googleapi.ServerResponse{
  5510. Header: res.Header,
  5511. HTTPStatusCode: res.StatusCode,
  5512. },
  5513. }
  5514. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5515. return nil, err
  5516. }
  5517. return ret, nil
  5518. // {
  5519. // "description": "Updates an existing custom dimension. This method supports patch semantics.",
  5520. // "httpMethod": "PATCH",
  5521. // "id": "analytics.management.customDimensions.patch",
  5522. // "parameterOrder": [
  5523. // "accountId",
  5524. // "webPropertyId",
  5525. // "customDimensionId"
  5526. // ],
  5527. // "parameters": {
  5528. // "accountId": {
  5529. // "description": "Account ID for the custom dimension to update.",
  5530. // "location": "path",
  5531. // "required": true,
  5532. // "type": "string"
  5533. // },
  5534. // "customDimensionId": {
  5535. // "description": "Custom dimension ID for the custom dimension to update.",
  5536. // "location": "path",
  5537. // "required": true,
  5538. // "type": "string"
  5539. // },
  5540. // "ignoreCustomDataSourceLinks": {
  5541. // "default": "false",
  5542. // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.",
  5543. // "location": "query",
  5544. // "type": "boolean"
  5545. // },
  5546. // "webPropertyId": {
  5547. // "description": "Web property ID for the custom dimension to update.",
  5548. // "location": "path",
  5549. // "required": true,
  5550. // "type": "string"
  5551. // }
  5552. // },
  5553. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  5554. // "request": {
  5555. // "$ref": "CustomDimension"
  5556. // },
  5557. // "response": {
  5558. // "$ref": "CustomDimension"
  5559. // },
  5560. // "scopes": [
  5561. // "https://www.googleapis.com/auth/analytics.edit"
  5562. // ]
  5563. // }
  5564. }
  5565. // method id "analytics.management.customDimensions.update":
  5566. type ManagementCustomDimensionsUpdateCall struct {
  5567. s *Service
  5568. accountId string
  5569. webPropertyId string
  5570. customDimensionId string
  5571. customdimension *CustomDimension
  5572. urlParams_ gensupport.URLParams
  5573. ctx_ context.Context
  5574. }
  5575. // Update: Updates an existing custom dimension.
  5576. func (r *ManagementCustomDimensionsService) Update(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsUpdateCall {
  5577. c := &ManagementCustomDimensionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5578. c.accountId = accountId
  5579. c.webPropertyId = webPropertyId
  5580. c.customDimensionId = customDimensionId
  5581. c.customdimension = customdimension
  5582. return c
  5583. }
  5584. // IgnoreCustomDataSourceLinks sets the optional parameter
  5585. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  5586. // warnings related to the custom dimension being linked to a custom
  5587. // data source / data set.
  5588. func (c *ManagementCustomDimensionsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsUpdateCall {
  5589. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  5590. return c
  5591. }
  5592. // Fields allows partial responses to be retrieved. See
  5593. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5594. // for more information.
  5595. func (c *ManagementCustomDimensionsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsUpdateCall {
  5596. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5597. return c
  5598. }
  5599. // Context sets the context to be used in this call's Do method. Any
  5600. // pending HTTP request will be aborted if the provided context is
  5601. // canceled.
  5602. func (c *ManagementCustomDimensionsUpdateCall) Context(ctx context.Context) *ManagementCustomDimensionsUpdateCall {
  5603. c.ctx_ = ctx
  5604. return c
  5605. }
  5606. func (c *ManagementCustomDimensionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  5607. var body io.Reader = nil
  5608. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  5609. if err != nil {
  5610. return nil, err
  5611. }
  5612. ctype := "application/json"
  5613. c.urlParams_.Set("alt", alt)
  5614. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  5615. urls += "?" + c.urlParams_.Encode()
  5616. req, _ := http.NewRequest("PUT", urls, body)
  5617. googleapi.Expand(req.URL, map[string]string{
  5618. "accountId": c.accountId,
  5619. "webPropertyId": c.webPropertyId,
  5620. "customDimensionId": c.customDimensionId,
  5621. })
  5622. req.Header.Set("Content-Type", ctype)
  5623. req.Header.Set("User-Agent", c.s.userAgent())
  5624. if c.ctx_ != nil {
  5625. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5626. }
  5627. return c.s.client.Do(req)
  5628. }
  5629. // Do executes the "analytics.management.customDimensions.update" call.
  5630. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  5631. // status code is an error. Response headers are in either
  5632. // *CustomDimension.ServerResponse.Header or (if a response was returned
  5633. // at all) in error.(*googleapi.Error).Header. Use
  5634. // googleapi.IsNotModified to check whether the returned error was
  5635. // because http.StatusNotModified was returned.
  5636. func (c *ManagementCustomDimensionsUpdateCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  5637. gensupport.SetOptions(c.urlParams_, opts...)
  5638. res, err := c.doRequest("json")
  5639. if res != nil && res.StatusCode == http.StatusNotModified {
  5640. if res.Body != nil {
  5641. res.Body.Close()
  5642. }
  5643. return nil, &googleapi.Error{
  5644. Code: res.StatusCode,
  5645. Header: res.Header,
  5646. }
  5647. }
  5648. if err != nil {
  5649. return nil, err
  5650. }
  5651. defer googleapi.CloseBody(res)
  5652. if err := googleapi.CheckResponse(res); err != nil {
  5653. return nil, err
  5654. }
  5655. ret := &CustomDimension{
  5656. ServerResponse: googleapi.ServerResponse{
  5657. Header: res.Header,
  5658. HTTPStatusCode: res.StatusCode,
  5659. },
  5660. }
  5661. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5662. return nil, err
  5663. }
  5664. return ret, nil
  5665. // {
  5666. // "description": "Updates an existing custom dimension.",
  5667. // "httpMethod": "PUT",
  5668. // "id": "analytics.management.customDimensions.update",
  5669. // "parameterOrder": [
  5670. // "accountId",
  5671. // "webPropertyId",
  5672. // "customDimensionId"
  5673. // ],
  5674. // "parameters": {
  5675. // "accountId": {
  5676. // "description": "Account ID for the custom dimension to update.",
  5677. // "location": "path",
  5678. // "required": true,
  5679. // "type": "string"
  5680. // },
  5681. // "customDimensionId": {
  5682. // "description": "Custom dimension ID for the custom dimension to update.",
  5683. // "location": "path",
  5684. // "required": true,
  5685. // "type": "string"
  5686. // },
  5687. // "ignoreCustomDataSourceLinks": {
  5688. // "default": "false",
  5689. // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.",
  5690. // "location": "query",
  5691. // "type": "boolean"
  5692. // },
  5693. // "webPropertyId": {
  5694. // "description": "Web property ID for the custom dimension to update.",
  5695. // "location": "path",
  5696. // "required": true,
  5697. // "type": "string"
  5698. // }
  5699. // },
  5700. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  5701. // "request": {
  5702. // "$ref": "CustomDimension"
  5703. // },
  5704. // "response": {
  5705. // "$ref": "CustomDimension"
  5706. // },
  5707. // "scopes": [
  5708. // "https://www.googleapis.com/auth/analytics.edit"
  5709. // ]
  5710. // }
  5711. }
  5712. // method id "analytics.management.customMetrics.get":
  5713. type ManagementCustomMetricsGetCall struct {
  5714. s *Service
  5715. accountId string
  5716. webPropertyId string
  5717. customMetricId string
  5718. urlParams_ gensupport.URLParams
  5719. ifNoneMatch_ string
  5720. ctx_ context.Context
  5721. }
  5722. // Get: Get a custom metric to which the user has access.
  5723. func (r *ManagementCustomMetricsService) Get(accountId string, webPropertyId string, customMetricId string) *ManagementCustomMetricsGetCall {
  5724. c := &ManagementCustomMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5725. c.accountId = accountId
  5726. c.webPropertyId = webPropertyId
  5727. c.customMetricId = customMetricId
  5728. return c
  5729. }
  5730. // Fields allows partial responses to be retrieved. See
  5731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5732. // for more information.
  5733. func (c *ManagementCustomMetricsGetCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsGetCall {
  5734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5735. return c
  5736. }
  5737. // IfNoneMatch sets the optional parameter which makes the operation
  5738. // fail if the object's ETag matches the given value. This is useful for
  5739. // getting updates only after the object has changed since the last
  5740. // request. Use googleapi.IsNotModified to check whether the response
  5741. // error from Do is the result of In-None-Match.
  5742. func (c *ManagementCustomMetricsGetCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsGetCall {
  5743. c.ifNoneMatch_ = entityTag
  5744. return c
  5745. }
  5746. // Context sets the context to be used in this call's Do method. Any
  5747. // pending HTTP request will be aborted if the provided context is
  5748. // canceled.
  5749. func (c *ManagementCustomMetricsGetCall) Context(ctx context.Context) *ManagementCustomMetricsGetCall {
  5750. c.ctx_ = ctx
  5751. return c
  5752. }
  5753. func (c *ManagementCustomMetricsGetCall) doRequest(alt string) (*http.Response, error) {
  5754. var body io.Reader = nil
  5755. c.urlParams_.Set("alt", alt)
  5756. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  5757. urls += "?" + c.urlParams_.Encode()
  5758. req, _ := http.NewRequest("GET", urls, body)
  5759. googleapi.Expand(req.URL, map[string]string{
  5760. "accountId": c.accountId,
  5761. "webPropertyId": c.webPropertyId,
  5762. "customMetricId": c.customMetricId,
  5763. })
  5764. req.Header.Set("User-Agent", c.s.userAgent())
  5765. if c.ifNoneMatch_ != "" {
  5766. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5767. }
  5768. if c.ctx_ != nil {
  5769. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5770. }
  5771. return c.s.client.Do(req)
  5772. }
  5773. // Do executes the "analytics.management.customMetrics.get" call.
  5774. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  5775. // status code is an error. Response headers are in either
  5776. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  5777. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5778. // to check whether the returned error was because
  5779. // http.StatusNotModified was returned.
  5780. func (c *ManagementCustomMetricsGetCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  5781. gensupport.SetOptions(c.urlParams_, opts...)
  5782. res, err := c.doRequest("json")
  5783. if res != nil && res.StatusCode == http.StatusNotModified {
  5784. if res.Body != nil {
  5785. res.Body.Close()
  5786. }
  5787. return nil, &googleapi.Error{
  5788. Code: res.StatusCode,
  5789. Header: res.Header,
  5790. }
  5791. }
  5792. if err != nil {
  5793. return nil, err
  5794. }
  5795. defer googleapi.CloseBody(res)
  5796. if err := googleapi.CheckResponse(res); err != nil {
  5797. return nil, err
  5798. }
  5799. ret := &CustomMetric{
  5800. ServerResponse: googleapi.ServerResponse{
  5801. Header: res.Header,
  5802. HTTPStatusCode: res.StatusCode,
  5803. },
  5804. }
  5805. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5806. return nil, err
  5807. }
  5808. return ret, nil
  5809. // {
  5810. // "description": "Get a custom metric to which the user has access.",
  5811. // "httpMethod": "GET",
  5812. // "id": "analytics.management.customMetrics.get",
  5813. // "parameterOrder": [
  5814. // "accountId",
  5815. // "webPropertyId",
  5816. // "customMetricId"
  5817. // ],
  5818. // "parameters": {
  5819. // "accountId": {
  5820. // "description": "Account ID for the custom metric to retrieve.",
  5821. // "location": "path",
  5822. // "required": true,
  5823. // "type": "string"
  5824. // },
  5825. // "customMetricId": {
  5826. // "description": "The ID of the custom metric to retrieve.",
  5827. // "location": "path",
  5828. // "required": true,
  5829. // "type": "string"
  5830. // },
  5831. // "webPropertyId": {
  5832. // "description": "Web property ID for the custom metric to retrieve.",
  5833. // "location": "path",
  5834. // "required": true,
  5835. // "type": "string"
  5836. // }
  5837. // },
  5838. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  5839. // "response": {
  5840. // "$ref": "CustomMetric"
  5841. // },
  5842. // "scopes": [
  5843. // "https://www.googleapis.com/auth/analytics.edit",
  5844. // "https://www.googleapis.com/auth/analytics.readonly"
  5845. // ]
  5846. // }
  5847. }
  5848. // method id "analytics.management.customMetrics.insert":
  5849. type ManagementCustomMetricsInsertCall struct {
  5850. s *Service
  5851. accountId string
  5852. webPropertyId string
  5853. custommetric *CustomMetric
  5854. urlParams_ gensupport.URLParams
  5855. ctx_ context.Context
  5856. }
  5857. // Insert: Create a new custom metric.
  5858. func (r *ManagementCustomMetricsService) Insert(accountId string, webPropertyId string, custommetric *CustomMetric) *ManagementCustomMetricsInsertCall {
  5859. c := &ManagementCustomMetricsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5860. c.accountId = accountId
  5861. c.webPropertyId = webPropertyId
  5862. c.custommetric = custommetric
  5863. return c
  5864. }
  5865. // Fields allows partial responses to be retrieved. See
  5866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5867. // for more information.
  5868. func (c *ManagementCustomMetricsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsInsertCall {
  5869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5870. return c
  5871. }
  5872. // Context sets the context to be used in this call's Do method. Any
  5873. // pending HTTP request will be aborted if the provided context is
  5874. // canceled.
  5875. func (c *ManagementCustomMetricsInsertCall) Context(ctx context.Context) *ManagementCustomMetricsInsertCall {
  5876. c.ctx_ = ctx
  5877. return c
  5878. }
  5879. func (c *ManagementCustomMetricsInsertCall) doRequest(alt string) (*http.Response, error) {
  5880. var body io.Reader = nil
  5881. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  5882. if err != nil {
  5883. return nil, err
  5884. }
  5885. ctype := "application/json"
  5886. c.urlParams_.Set("alt", alt)
  5887. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics")
  5888. urls += "?" + c.urlParams_.Encode()
  5889. req, _ := http.NewRequest("POST", urls, body)
  5890. googleapi.Expand(req.URL, map[string]string{
  5891. "accountId": c.accountId,
  5892. "webPropertyId": c.webPropertyId,
  5893. })
  5894. req.Header.Set("Content-Type", ctype)
  5895. req.Header.Set("User-Agent", c.s.userAgent())
  5896. if c.ctx_ != nil {
  5897. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5898. }
  5899. return c.s.client.Do(req)
  5900. }
  5901. // Do executes the "analytics.management.customMetrics.insert" call.
  5902. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  5903. // status code is an error. Response headers are in either
  5904. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  5905. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5906. // to check whether the returned error was because
  5907. // http.StatusNotModified was returned.
  5908. func (c *ManagementCustomMetricsInsertCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  5909. gensupport.SetOptions(c.urlParams_, opts...)
  5910. res, err := c.doRequest("json")
  5911. if res != nil && res.StatusCode == http.StatusNotModified {
  5912. if res.Body != nil {
  5913. res.Body.Close()
  5914. }
  5915. return nil, &googleapi.Error{
  5916. Code: res.StatusCode,
  5917. Header: res.Header,
  5918. }
  5919. }
  5920. if err != nil {
  5921. return nil, err
  5922. }
  5923. defer googleapi.CloseBody(res)
  5924. if err := googleapi.CheckResponse(res); err != nil {
  5925. return nil, err
  5926. }
  5927. ret := &CustomMetric{
  5928. ServerResponse: googleapi.ServerResponse{
  5929. Header: res.Header,
  5930. HTTPStatusCode: res.StatusCode,
  5931. },
  5932. }
  5933. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5934. return nil, err
  5935. }
  5936. return ret, nil
  5937. // {
  5938. // "description": "Create a new custom metric.",
  5939. // "httpMethod": "POST",
  5940. // "id": "analytics.management.customMetrics.insert",
  5941. // "parameterOrder": [
  5942. // "accountId",
  5943. // "webPropertyId"
  5944. // ],
  5945. // "parameters": {
  5946. // "accountId": {
  5947. // "description": "Account ID for the custom metric to create.",
  5948. // "location": "path",
  5949. // "required": true,
  5950. // "type": "string"
  5951. // },
  5952. // "webPropertyId": {
  5953. // "description": "Web property ID for the custom dimension to create.",
  5954. // "location": "path",
  5955. // "required": true,
  5956. // "type": "string"
  5957. // }
  5958. // },
  5959. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics",
  5960. // "request": {
  5961. // "$ref": "CustomMetric"
  5962. // },
  5963. // "response": {
  5964. // "$ref": "CustomMetric"
  5965. // },
  5966. // "scopes": [
  5967. // "https://www.googleapis.com/auth/analytics.edit"
  5968. // ]
  5969. // }
  5970. }
  5971. // method id "analytics.management.customMetrics.list":
  5972. type ManagementCustomMetricsListCall struct {
  5973. s *Service
  5974. accountId string
  5975. webPropertyId string
  5976. urlParams_ gensupport.URLParams
  5977. ifNoneMatch_ string
  5978. ctx_ context.Context
  5979. }
  5980. // List: Lists custom metrics to which the user has access.
  5981. func (r *ManagementCustomMetricsService) List(accountId string, webPropertyId string) *ManagementCustomMetricsListCall {
  5982. c := &ManagementCustomMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5983. c.accountId = accountId
  5984. c.webPropertyId = webPropertyId
  5985. return c
  5986. }
  5987. // MaxResults sets the optional parameter "max-results": The maximum
  5988. // number of custom metrics to include in this response.
  5989. func (c *ManagementCustomMetricsListCall) MaxResults(maxResults int64) *ManagementCustomMetricsListCall {
  5990. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5991. return c
  5992. }
  5993. // StartIndex sets the optional parameter "start-index": An index of the
  5994. // first entity to retrieve. Use this parameter as a pagination
  5995. // mechanism along with the max-results parameter.
  5996. func (c *ManagementCustomMetricsListCall) StartIndex(startIndex int64) *ManagementCustomMetricsListCall {
  5997. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5998. return c
  5999. }
  6000. // Fields allows partial responses to be retrieved. See
  6001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6002. // for more information.
  6003. func (c *ManagementCustomMetricsListCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsListCall {
  6004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6005. return c
  6006. }
  6007. // IfNoneMatch sets the optional parameter which makes the operation
  6008. // fail if the object's ETag matches the given value. This is useful for
  6009. // getting updates only after the object has changed since the last
  6010. // request. Use googleapi.IsNotModified to check whether the response
  6011. // error from Do is the result of In-None-Match.
  6012. func (c *ManagementCustomMetricsListCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsListCall {
  6013. c.ifNoneMatch_ = entityTag
  6014. return c
  6015. }
  6016. // Context sets the context to be used in this call's Do method. Any
  6017. // pending HTTP request will be aborted if the provided context is
  6018. // canceled.
  6019. func (c *ManagementCustomMetricsListCall) Context(ctx context.Context) *ManagementCustomMetricsListCall {
  6020. c.ctx_ = ctx
  6021. return c
  6022. }
  6023. func (c *ManagementCustomMetricsListCall) doRequest(alt string) (*http.Response, error) {
  6024. var body io.Reader = nil
  6025. c.urlParams_.Set("alt", alt)
  6026. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics")
  6027. urls += "?" + c.urlParams_.Encode()
  6028. req, _ := http.NewRequest("GET", urls, body)
  6029. googleapi.Expand(req.URL, map[string]string{
  6030. "accountId": c.accountId,
  6031. "webPropertyId": c.webPropertyId,
  6032. })
  6033. req.Header.Set("User-Agent", c.s.userAgent())
  6034. if c.ifNoneMatch_ != "" {
  6035. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6036. }
  6037. if c.ctx_ != nil {
  6038. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6039. }
  6040. return c.s.client.Do(req)
  6041. }
  6042. // Do executes the "analytics.management.customMetrics.list" call.
  6043. // Exactly one of *CustomMetrics or error will be non-nil. Any non-2xx
  6044. // status code is an error. Response headers are in either
  6045. // *CustomMetrics.ServerResponse.Header or (if a response was returned
  6046. // at all) in error.(*googleapi.Error).Header. Use
  6047. // googleapi.IsNotModified to check whether the returned error was
  6048. // because http.StatusNotModified was returned.
  6049. func (c *ManagementCustomMetricsListCall) Do(opts ...googleapi.CallOption) (*CustomMetrics, error) {
  6050. gensupport.SetOptions(c.urlParams_, opts...)
  6051. res, err := c.doRequest("json")
  6052. if res != nil && res.StatusCode == http.StatusNotModified {
  6053. if res.Body != nil {
  6054. res.Body.Close()
  6055. }
  6056. return nil, &googleapi.Error{
  6057. Code: res.StatusCode,
  6058. Header: res.Header,
  6059. }
  6060. }
  6061. if err != nil {
  6062. return nil, err
  6063. }
  6064. defer googleapi.CloseBody(res)
  6065. if err := googleapi.CheckResponse(res); err != nil {
  6066. return nil, err
  6067. }
  6068. ret := &CustomMetrics{
  6069. ServerResponse: googleapi.ServerResponse{
  6070. Header: res.Header,
  6071. HTTPStatusCode: res.StatusCode,
  6072. },
  6073. }
  6074. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6075. return nil, err
  6076. }
  6077. return ret, nil
  6078. // {
  6079. // "description": "Lists custom metrics to which the user has access.",
  6080. // "httpMethod": "GET",
  6081. // "id": "analytics.management.customMetrics.list",
  6082. // "parameterOrder": [
  6083. // "accountId",
  6084. // "webPropertyId"
  6085. // ],
  6086. // "parameters": {
  6087. // "accountId": {
  6088. // "description": "Account ID for the custom metrics to retrieve.",
  6089. // "location": "path",
  6090. // "required": true,
  6091. // "type": "string"
  6092. // },
  6093. // "max-results": {
  6094. // "description": "The maximum number of custom metrics to include in this response.",
  6095. // "format": "int32",
  6096. // "location": "query",
  6097. // "type": "integer"
  6098. // },
  6099. // "start-index": {
  6100. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  6101. // "format": "int32",
  6102. // "location": "query",
  6103. // "minimum": "1",
  6104. // "type": "integer"
  6105. // },
  6106. // "webPropertyId": {
  6107. // "description": "Web property ID for the custom metrics to retrieve.",
  6108. // "location": "path",
  6109. // "required": true,
  6110. // "type": "string"
  6111. // }
  6112. // },
  6113. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics",
  6114. // "response": {
  6115. // "$ref": "CustomMetrics"
  6116. // },
  6117. // "scopes": [
  6118. // "https://www.googleapis.com/auth/analytics",
  6119. // "https://www.googleapis.com/auth/analytics.readonly"
  6120. // ]
  6121. // }
  6122. }
  6123. // method id "analytics.management.customMetrics.patch":
  6124. type ManagementCustomMetricsPatchCall struct {
  6125. s *Service
  6126. accountId string
  6127. webPropertyId string
  6128. customMetricId string
  6129. custommetric *CustomMetric
  6130. urlParams_ gensupport.URLParams
  6131. ctx_ context.Context
  6132. }
  6133. // Patch: Updates an existing custom metric. This method supports patch
  6134. // semantics.
  6135. func (r *ManagementCustomMetricsService) Patch(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsPatchCall {
  6136. c := &ManagementCustomMetricsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6137. c.accountId = accountId
  6138. c.webPropertyId = webPropertyId
  6139. c.customMetricId = customMetricId
  6140. c.custommetric = custommetric
  6141. return c
  6142. }
  6143. // IgnoreCustomDataSourceLinks sets the optional parameter
  6144. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  6145. // warnings related to the custom metric being linked to a custom data
  6146. // source / data set.
  6147. func (c *ManagementCustomMetricsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsPatchCall {
  6148. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  6149. return c
  6150. }
  6151. // Fields allows partial responses to be retrieved. See
  6152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6153. // for more information.
  6154. func (c *ManagementCustomMetricsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsPatchCall {
  6155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6156. return c
  6157. }
  6158. // Context sets the context to be used in this call's Do method. Any
  6159. // pending HTTP request will be aborted if the provided context is
  6160. // canceled.
  6161. func (c *ManagementCustomMetricsPatchCall) Context(ctx context.Context) *ManagementCustomMetricsPatchCall {
  6162. c.ctx_ = ctx
  6163. return c
  6164. }
  6165. func (c *ManagementCustomMetricsPatchCall) doRequest(alt string) (*http.Response, error) {
  6166. var body io.Reader = nil
  6167. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  6168. if err != nil {
  6169. return nil, err
  6170. }
  6171. ctype := "application/json"
  6172. c.urlParams_.Set("alt", alt)
  6173. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  6174. urls += "?" + c.urlParams_.Encode()
  6175. req, _ := http.NewRequest("PATCH", urls, body)
  6176. googleapi.Expand(req.URL, map[string]string{
  6177. "accountId": c.accountId,
  6178. "webPropertyId": c.webPropertyId,
  6179. "customMetricId": c.customMetricId,
  6180. })
  6181. req.Header.Set("Content-Type", ctype)
  6182. req.Header.Set("User-Agent", c.s.userAgent())
  6183. if c.ctx_ != nil {
  6184. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6185. }
  6186. return c.s.client.Do(req)
  6187. }
  6188. // Do executes the "analytics.management.customMetrics.patch" call.
  6189. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  6190. // status code is an error. Response headers are in either
  6191. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  6192. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6193. // to check whether the returned error was because
  6194. // http.StatusNotModified was returned.
  6195. func (c *ManagementCustomMetricsPatchCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  6196. gensupport.SetOptions(c.urlParams_, opts...)
  6197. res, err := c.doRequest("json")
  6198. if res != nil && res.StatusCode == http.StatusNotModified {
  6199. if res.Body != nil {
  6200. res.Body.Close()
  6201. }
  6202. return nil, &googleapi.Error{
  6203. Code: res.StatusCode,
  6204. Header: res.Header,
  6205. }
  6206. }
  6207. if err != nil {
  6208. return nil, err
  6209. }
  6210. defer googleapi.CloseBody(res)
  6211. if err := googleapi.CheckResponse(res); err != nil {
  6212. return nil, err
  6213. }
  6214. ret := &CustomMetric{
  6215. ServerResponse: googleapi.ServerResponse{
  6216. Header: res.Header,
  6217. HTTPStatusCode: res.StatusCode,
  6218. },
  6219. }
  6220. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6221. return nil, err
  6222. }
  6223. return ret, nil
  6224. // {
  6225. // "description": "Updates an existing custom metric. This method supports patch semantics.",
  6226. // "httpMethod": "PATCH",
  6227. // "id": "analytics.management.customMetrics.patch",
  6228. // "parameterOrder": [
  6229. // "accountId",
  6230. // "webPropertyId",
  6231. // "customMetricId"
  6232. // ],
  6233. // "parameters": {
  6234. // "accountId": {
  6235. // "description": "Account ID for the custom metric to update.",
  6236. // "location": "path",
  6237. // "required": true,
  6238. // "type": "string"
  6239. // },
  6240. // "customMetricId": {
  6241. // "description": "Custom metric ID for the custom metric to update.",
  6242. // "location": "path",
  6243. // "required": true,
  6244. // "type": "string"
  6245. // },
  6246. // "ignoreCustomDataSourceLinks": {
  6247. // "default": "false",
  6248. // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.",
  6249. // "location": "query",
  6250. // "type": "boolean"
  6251. // },
  6252. // "webPropertyId": {
  6253. // "description": "Web property ID for the custom metric to update.",
  6254. // "location": "path",
  6255. // "required": true,
  6256. // "type": "string"
  6257. // }
  6258. // },
  6259. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  6260. // "request": {
  6261. // "$ref": "CustomMetric"
  6262. // },
  6263. // "response": {
  6264. // "$ref": "CustomMetric"
  6265. // },
  6266. // "scopes": [
  6267. // "https://www.googleapis.com/auth/analytics.edit"
  6268. // ]
  6269. // }
  6270. }
  6271. // method id "analytics.management.customMetrics.update":
  6272. type ManagementCustomMetricsUpdateCall struct {
  6273. s *Service
  6274. accountId string
  6275. webPropertyId string
  6276. customMetricId string
  6277. custommetric *CustomMetric
  6278. urlParams_ gensupport.URLParams
  6279. ctx_ context.Context
  6280. }
  6281. // Update: Updates an existing custom metric.
  6282. func (r *ManagementCustomMetricsService) Update(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsUpdateCall {
  6283. c := &ManagementCustomMetricsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6284. c.accountId = accountId
  6285. c.webPropertyId = webPropertyId
  6286. c.customMetricId = customMetricId
  6287. c.custommetric = custommetric
  6288. return c
  6289. }
  6290. // IgnoreCustomDataSourceLinks sets the optional parameter
  6291. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  6292. // warnings related to the custom metric being linked to a custom data
  6293. // source / data set.
  6294. func (c *ManagementCustomMetricsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsUpdateCall {
  6295. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  6296. return c
  6297. }
  6298. // Fields allows partial responses to be retrieved. See
  6299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6300. // for more information.
  6301. func (c *ManagementCustomMetricsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsUpdateCall {
  6302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6303. return c
  6304. }
  6305. // Context sets the context to be used in this call's Do method. Any
  6306. // pending HTTP request will be aborted if the provided context is
  6307. // canceled.
  6308. func (c *ManagementCustomMetricsUpdateCall) Context(ctx context.Context) *ManagementCustomMetricsUpdateCall {
  6309. c.ctx_ = ctx
  6310. return c
  6311. }
  6312. func (c *ManagementCustomMetricsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6313. var body io.Reader = nil
  6314. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  6315. if err != nil {
  6316. return nil, err
  6317. }
  6318. ctype := "application/json"
  6319. c.urlParams_.Set("alt", alt)
  6320. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  6321. urls += "?" + c.urlParams_.Encode()
  6322. req, _ := http.NewRequest("PUT", urls, body)
  6323. googleapi.Expand(req.URL, map[string]string{
  6324. "accountId": c.accountId,
  6325. "webPropertyId": c.webPropertyId,
  6326. "customMetricId": c.customMetricId,
  6327. })
  6328. req.Header.Set("Content-Type", ctype)
  6329. req.Header.Set("User-Agent", c.s.userAgent())
  6330. if c.ctx_ != nil {
  6331. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6332. }
  6333. return c.s.client.Do(req)
  6334. }
  6335. // Do executes the "analytics.management.customMetrics.update" call.
  6336. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  6337. // status code is an error. Response headers are in either
  6338. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  6339. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6340. // to check whether the returned error was because
  6341. // http.StatusNotModified was returned.
  6342. func (c *ManagementCustomMetricsUpdateCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  6343. gensupport.SetOptions(c.urlParams_, opts...)
  6344. res, err := c.doRequest("json")
  6345. if res != nil && res.StatusCode == http.StatusNotModified {
  6346. if res.Body != nil {
  6347. res.Body.Close()
  6348. }
  6349. return nil, &googleapi.Error{
  6350. Code: res.StatusCode,
  6351. Header: res.Header,
  6352. }
  6353. }
  6354. if err != nil {
  6355. return nil, err
  6356. }
  6357. defer googleapi.CloseBody(res)
  6358. if err := googleapi.CheckResponse(res); err != nil {
  6359. return nil, err
  6360. }
  6361. ret := &CustomMetric{
  6362. ServerResponse: googleapi.ServerResponse{
  6363. Header: res.Header,
  6364. HTTPStatusCode: res.StatusCode,
  6365. },
  6366. }
  6367. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6368. return nil, err
  6369. }
  6370. return ret, nil
  6371. // {
  6372. // "description": "Updates an existing custom metric.",
  6373. // "httpMethod": "PUT",
  6374. // "id": "analytics.management.customMetrics.update",
  6375. // "parameterOrder": [
  6376. // "accountId",
  6377. // "webPropertyId",
  6378. // "customMetricId"
  6379. // ],
  6380. // "parameters": {
  6381. // "accountId": {
  6382. // "description": "Account ID for the custom metric to update.",
  6383. // "location": "path",
  6384. // "required": true,
  6385. // "type": "string"
  6386. // },
  6387. // "customMetricId": {
  6388. // "description": "Custom metric ID for the custom metric to update.",
  6389. // "location": "path",
  6390. // "required": true,
  6391. // "type": "string"
  6392. // },
  6393. // "ignoreCustomDataSourceLinks": {
  6394. // "default": "false",
  6395. // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.",
  6396. // "location": "query",
  6397. // "type": "boolean"
  6398. // },
  6399. // "webPropertyId": {
  6400. // "description": "Web property ID for the custom metric to update.",
  6401. // "location": "path",
  6402. // "required": true,
  6403. // "type": "string"
  6404. // }
  6405. // },
  6406. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  6407. // "request": {
  6408. // "$ref": "CustomMetric"
  6409. // },
  6410. // "response": {
  6411. // "$ref": "CustomMetric"
  6412. // },
  6413. // "scopes": [
  6414. // "https://www.googleapis.com/auth/analytics.edit"
  6415. // ]
  6416. // }
  6417. }
  6418. // method id "analytics.management.experiments.delete":
  6419. type ManagementExperimentsDeleteCall struct {
  6420. s *Service
  6421. accountId string
  6422. webPropertyId string
  6423. profileId string
  6424. experimentId string
  6425. urlParams_ gensupport.URLParams
  6426. ctx_ context.Context
  6427. }
  6428. // Delete: Delete an experiment.
  6429. func (r *ManagementExperimentsService) Delete(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsDeleteCall {
  6430. c := &ManagementExperimentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6431. c.accountId = accountId
  6432. c.webPropertyId = webPropertyId
  6433. c.profileId = profileId
  6434. c.experimentId = experimentId
  6435. return c
  6436. }
  6437. // Fields allows partial responses to be retrieved. See
  6438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6439. // for more information.
  6440. func (c *ManagementExperimentsDeleteCall) Fields(s ...googleapi.Field) *ManagementExperimentsDeleteCall {
  6441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6442. return c
  6443. }
  6444. // Context sets the context to be used in this call's Do method. Any
  6445. // pending HTTP request will be aborted if the provided context is
  6446. // canceled.
  6447. func (c *ManagementExperimentsDeleteCall) Context(ctx context.Context) *ManagementExperimentsDeleteCall {
  6448. c.ctx_ = ctx
  6449. return c
  6450. }
  6451. func (c *ManagementExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6452. var body io.Reader = nil
  6453. c.urlParams_.Set("alt", alt)
  6454. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  6455. urls += "?" + c.urlParams_.Encode()
  6456. req, _ := http.NewRequest("DELETE", urls, body)
  6457. googleapi.Expand(req.URL, map[string]string{
  6458. "accountId": c.accountId,
  6459. "webPropertyId": c.webPropertyId,
  6460. "profileId": c.profileId,
  6461. "experimentId": c.experimentId,
  6462. })
  6463. req.Header.Set("User-Agent", c.s.userAgent())
  6464. if c.ctx_ != nil {
  6465. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6466. }
  6467. return c.s.client.Do(req)
  6468. }
  6469. // Do executes the "analytics.management.experiments.delete" call.
  6470. func (c *ManagementExperimentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  6471. gensupport.SetOptions(c.urlParams_, opts...)
  6472. res, err := c.doRequest("json")
  6473. if err != nil {
  6474. return err
  6475. }
  6476. defer googleapi.CloseBody(res)
  6477. if err := googleapi.CheckResponse(res); err != nil {
  6478. return err
  6479. }
  6480. return nil
  6481. // {
  6482. // "description": "Delete an experiment.",
  6483. // "httpMethod": "DELETE",
  6484. // "id": "analytics.management.experiments.delete",
  6485. // "parameterOrder": [
  6486. // "accountId",
  6487. // "webPropertyId",
  6488. // "profileId",
  6489. // "experimentId"
  6490. // ],
  6491. // "parameters": {
  6492. // "accountId": {
  6493. // "description": "Account ID to which the experiment belongs",
  6494. // "location": "path",
  6495. // "required": true,
  6496. // "type": "string"
  6497. // },
  6498. // "experimentId": {
  6499. // "description": "ID of the experiment to delete",
  6500. // "location": "path",
  6501. // "required": true,
  6502. // "type": "string"
  6503. // },
  6504. // "profileId": {
  6505. // "description": "View (Profile) ID to which the experiment belongs",
  6506. // "location": "path",
  6507. // "required": true,
  6508. // "type": "string"
  6509. // },
  6510. // "webPropertyId": {
  6511. // "description": "Web property ID to which the experiment belongs",
  6512. // "location": "path",
  6513. // "required": true,
  6514. // "type": "string"
  6515. // }
  6516. // },
  6517. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  6518. // "scopes": [
  6519. // "https://www.googleapis.com/auth/analytics",
  6520. // "https://www.googleapis.com/auth/analytics.edit"
  6521. // ]
  6522. // }
  6523. }
  6524. // method id "analytics.management.experiments.get":
  6525. type ManagementExperimentsGetCall struct {
  6526. s *Service
  6527. accountId string
  6528. webPropertyId string
  6529. profileId string
  6530. experimentId string
  6531. urlParams_ gensupport.URLParams
  6532. ifNoneMatch_ string
  6533. ctx_ context.Context
  6534. }
  6535. // Get: Returns an experiment to which the user has access.
  6536. func (r *ManagementExperimentsService) Get(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsGetCall {
  6537. c := &ManagementExperimentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6538. c.accountId = accountId
  6539. c.webPropertyId = webPropertyId
  6540. c.profileId = profileId
  6541. c.experimentId = experimentId
  6542. return c
  6543. }
  6544. // Fields allows partial responses to be retrieved. See
  6545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6546. // for more information.
  6547. func (c *ManagementExperimentsGetCall) Fields(s ...googleapi.Field) *ManagementExperimentsGetCall {
  6548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6549. return c
  6550. }
  6551. // IfNoneMatch sets the optional parameter which makes the operation
  6552. // fail if the object's ETag matches the given value. This is useful for
  6553. // getting updates only after the object has changed since the last
  6554. // request. Use googleapi.IsNotModified to check whether the response
  6555. // error from Do is the result of In-None-Match.
  6556. func (c *ManagementExperimentsGetCall) IfNoneMatch(entityTag string) *ManagementExperimentsGetCall {
  6557. c.ifNoneMatch_ = entityTag
  6558. return c
  6559. }
  6560. // Context sets the context to be used in this call's Do method. Any
  6561. // pending HTTP request will be aborted if the provided context is
  6562. // canceled.
  6563. func (c *ManagementExperimentsGetCall) Context(ctx context.Context) *ManagementExperimentsGetCall {
  6564. c.ctx_ = ctx
  6565. return c
  6566. }
  6567. func (c *ManagementExperimentsGetCall) doRequest(alt string) (*http.Response, error) {
  6568. var body io.Reader = nil
  6569. c.urlParams_.Set("alt", alt)
  6570. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  6571. urls += "?" + c.urlParams_.Encode()
  6572. req, _ := http.NewRequest("GET", urls, body)
  6573. googleapi.Expand(req.URL, map[string]string{
  6574. "accountId": c.accountId,
  6575. "webPropertyId": c.webPropertyId,
  6576. "profileId": c.profileId,
  6577. "experimentId": c.experimentId,
  6578. })
  6579. req.Header.Set("User-Agent", c.s.userAgent())
  6580. if c.ifNoneMatch_ != "" {
  6581. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6582. }
  6583. if c.ctx_ != nil {
  6584. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6585. }
  6586. return c.s.client.Do(req)
  6587. }
  6588. // Do executes the "analytics.management.experiments.get" call.
  6589. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  6590. // status code is an error. Response headers are in either
  6591. // *Experiment.ServerResponse.Header or (if a response was returned at
  6592. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6593. // to check whether the returned error was because
  6594. // http.StatusNotModified was returned.
  6595. func (c *ManagementExperimentsGetCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  6596. gensupport.SetOptions(c.urlParams_, opts...)
  6597. res, err := c.doRequest("json")
  6598. if res != nil && res.StatusCode == http.StatusNotModified {
  6599. if res.Body != nil {
  6600. res.Body.Close()
  6601. }
  6602. return nil, &googleapi.Error{
  6603. Code: res.StatusCode,
  6604. Header: res.Header,
  6605. }
  6606. }
  6607. if err != nil {
  6608. return nil, err
  6609. }
  6610. defer googleapi.CloseBody(res)
  6611. if err := googleapi.CheckResponse(res); err != nil {
  6612. return nil, err
  6613. }
  6614. ret := &Experiment{
  6615. ServerResponse: googleapi.ServerResponse{
  6616. Header: res.Header,
  6617. HTTPStatusCode: res.StatusCode,
  6618. },
  6619. }
  6620. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6621. return nil, err
  6622. }
  6623. return ret, nil
  6624. // {
  6625. // "description": "Returns an experiment to which the user has access.",
  6626. // "httpMethod": "GET",
  6627. // "id": "analytics.management.experiments.get",
  6628. // "parameterOrder": [
  6629. // "accountId",
  6630. // "webPropertyId",
  6631. // "profileId",
  6632. // "experimentId"
  6633. // ],
  6634. // "parameters": {
  6635. // "accountId": {
  6636. // "description": "Account ID to retrieve the experiment for.",
  6637. // "location": "path",
  6638. // "required": true,
  6639. // "type": "string"
  6640. // },
  6641. // "experimentId": {
  6642. // "description": "Experiment ID to retrieve the experiment for.",
  6643. // "location": "path",
  6644. // "required": true,
  6645. // "type": "string"
  6646. // },
  6647. // "profileId": {
  6648. // "description": "View (Profile) ID to retrieve the experiment for.",
  6649. // "location": "path",
  6650. // "required": true,
  6651. // "type": "string"
  6652. // },
  6653. // "webPropertyId": {
  6654. // "description": "Web property ID to retrieve the experiment for.",
  6655. // "location": "path",
  6656. // "required": true,
  6657. // "type": "string"
  6658. // }
  6659. // },
  6660. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  6661. // "response": {
  6662. // "$ref": "Experiment"
  6663. // },
  6664. // "scopes": [
  6665. // "https://www.googleapis.com/auth/analytics",
  6666. // "https://www.googleapis.com/auth/analytics.edit",
  6667. // "https://www.googleapis.com/auth/analytics.readonly"
  6668. // ]
  6669. // }
  6670. }
  6671. // method id "analytics.management.experiments.insert":
  6672. type ManagementExperimentsInsertCall struct {
  6673. s *Service
  6674. accountId string
  6675. webPropertyId string
  6676. profileId string
  6677. experiment *Experiment
  6678. urlParams_ gensupport.URLParams
  6679. ctx_ context.Context
  6680. }
  6681. // Insert: Create a new experiment.
  6682. func (r *ManagementExperimentsService) Insert(accountId string, webPropertyId string, profileId string, experiment *Experiment) *ManagementExperimentsInsertCall {
  6683. c := &ManagementExperimentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6684. c.accountId = accountId
  6685. c.webPropertyId = webPropertyId
  6686. c.profileId = profileId
  6687. c.experiment = experiment
  6688. return c
  6689. }
  6690. // Fields allows partial responses to be retrieved. See
  6691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6692. // for more information.
  6693. func (c *ManagementExperimentsInsertCall) Fields(s ...googleapi.Field) *ManagementExperimentsInsertCall {
  6694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6695. return c
  6696. }
  6697. // Context sets the context to be used in this call's Do method. Any
  6698. // pending HTTP request will be aborted if the provided context is
  6699. // canceled.
  6700. func (c *ManagementExperimentsInsertCall) Context(ctx context.Context) *ManagementExperimentsInsertCall {
  6701. c.ctx_ = ctx
  6702. return c
  6703. }
  6704. func (c *ManagementExperimentsInsertCall) doRequest(alt string) (*http.Response, error) {
  6705. var body io.Reader = nil
  6706. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  6707. if err != nil {
  6708. return nil, err
  6709. }
  6710. ctype := "application/json"
  6711. c.urlParams_.Set("alt", alt)
  6712. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments")
  6713. urls += "?" + c.urlParams_.Encode()
  6714. req, _ := http.NewRequest("POST", urls, body)
  6715. googleapi.Expand(req.URL, map[string]string{
  6716. "accountId": c.accountId,
  6717. "webPropertyId": c.webPropertyId,
  6718. "profileId": c.profileId,
  6719. })
  6720. req.Header.Set("Content-Type", ctype)
  6721. req.Header.Set("User-Agent", c.s.userAgent())
  6722. if c.ctx_ != nil {
  6723. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6724. }
  6725. return c.s.client.Do(req)
  6726. }
  6727. // Do executes the "analytics.management.experiments.insert" call.
  6728. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  6729. // status code is an error. Response headers are in either
  6730. // *Experiment.ServerResponse.Header or (if a response was returned at
  6731. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6732. // to check whether the returned error was because
  6733. // http.StatusNotModified was returned.
  6734. func (c *ManagementExperimentsInsertCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  6735. gensupport.SetOptions(c.urlParams_, opts...)
  6736. res, err := c.doRequest("json")
  6737. if res != nil && res.StatusCode == http.StatusNotModified {
  6738. if res.Body != nil {
  6739. res.Body.Close()
  6740. }
  6741. return nil, &googleapi.Error{
  6742. Code: res.StatusCode,
  6743. Header: res.Header,
  6744. }
  6745. }
  6746. if err != nil {
  6747. return nil, err
  6748. }
  6749. defer googleapi.CloseBody(res)
  6750. if err := googleapi.CheckResponse(res); err != nil {
  6751. return nil, err
  6752. }
  6753. ret := &Experiment{
  6754. ServerResponse: googleapi.ServerResponse{
  6755. Header: res.Header,
  6756. HTTPStatusCode: res.StatusCode,
  6757. },
  6758. }
  6759. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6760. return nil, err
  6761. }
  6762. return ret, nil
  6763. // {
  6764. // "description": "Create a new experiment.",
  6765. // "httpMethod": "POST",
  6766. // "id": "analytics.management.experiments.insert",
  6767. // "parameterOrder": [
  6768. // "accountId",
  6769. // "webPropertyId",
  6770. // "profileId"
  6771. // ],
  6772. // "parameters": {
  6773. // "accountId": {
  6774. // "description": "Account ID to create the experiment for.",
  6775. // "location": "path",
  6776. // "required": true,
  6777. // "type": "string"
  6778. // },
  6779. // "profileId": {
  6780. // "description": "View (Profile) ID to create the experiment for.",
  6781. // "location": "path",
  6782. // "required": true,
  6783. // "type": "string"
  6784. // },
  6785. // "webPropertyId": {
  6786. // "description": "Web property ID to create the experiment for.",
  6787. // "location": "path",
  6788. // "required": true,
  6789. // "type": "string"
  6790. // }
  6791. // },
  6792. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments",
  6793. // "request": {
  6794. // "$ref": "Experiment"
  6795. // },
  6796. // "response": {
  6797. // "$ref": "Experiment"
  6798. // },
  6799. // "scopes": [
  6800. // "https://www.googleapis.com/auth/analytics",
  6801. // "https://www.googleapis.com/auth/analytics.edit"
  6802. // ]
  6803. // }
  6804. }
  6805. // method id "analytics.management.experiments.list":
  6806. type ManagementExperimentsListCall struct {
  6807. s *Service
  6808. accountId string
  6809. webPropertyId string
  6810. profileId string
  6811. urlParams_ gensupport.URLParams
  6812. ifNoneMatch_ string
  6813. ctx_ context.Context
  6814. }
  6815. // List: Lists experiments to which the user has access.
  6816. func (r *ManagementExperimentsService) List(accountId string, webPropertyId string, profileId string) *ManagementExperimentsListCall {
  6817. c := &ManagementExperimentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6818. c.accountId = accountId
  6819. c.webPropertyId = webPropertyId
  6820. c.profileId = profileId
  6821. return c
  6822. }
  6823. // MaxResults sets the optional parameter "max-results": The maximum
  6824. // number of experiments to include in this response.
  6825. func (c *ManagementExperimentsListCall) MaxResults(maxResults int64) *ManagementExperimentsListCall {
  6826. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6827. return c
  6828. }
  6829. // StartIndex sets the optional parameter "start-index": An index of the
  6830. // first experiment to retrieve. Use this parameter as a pagination
  6831. // mechanism along with the max-results parameter.
  6832. func (c *ManagementExperimentsListCall) StartIndex(startIndex int64) *ManagementExperimentsListCall {
  6833. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6834. return c
  6835. }
  6836. // Fields allows partial responses to be retrieved. See
  6837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6838. // for more information.
  6839. func (c *ManagementExperimentsListCall) Fields(s ...googleapi.Field) *ManagementExperimentsListCall {
  6840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6841. return c
  6842. }
  6843. // IfNoneMatch sets the optional parameter which makes the operation
  6844. // fail if the object's ETag matches the given value. This is useful for
  6845. // getting updates only after the object has changed since the last
  6846. // request. Use googleapi.IsNotModified to check whether the response
  6847. // error from Do is the result of In-None-Match.
  6848. func (c *ManagementExperimentsListCall) IfNoneMatch(entityTag string) *ManagementExperimentsListCall {
  6849. c.ifNoneMatch_ = entityTag
  6850. return c
  6851. }
  6852. // Context sets the context to be used in this call's Do method. Any
  6853. // pending HTTP request will be aborted if the provided context is
  6854. // canceled.
  6855. func (c *ManagementExperimentsListCall) Context(ctx context.Context) *ManagementExperimentsListCall {
  6856. c.ctx_ = ctx
  6857. return c
  6858. }
  6859. func (c *ManagementExperimentsListCall) doRequest(alt string) (*http.Response, error) {
  6860. var body io.Reader = nil
  6861. c.urlParams_.Set("alt", alt)
  6862. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments")
  6863. urls += "?" + c.urlParams_.Encode()
  6864. req, _ := http.NewRequest("GET", urls, body)
  6865. googleapi.Expand(req.URL, map[string]string{
  6866. "accountId": c.accountId,
  6867. "webPropertyId": c.webPropertyId,
  6868. "profileId": c.profileId,
  6869. })
  6870. req.Header.Set("User-Agent", c.s.userAgent())
  6871. if c.ifNoneMatch_ != "" {
  6872. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6873. }
  6874. if c.ctx_ != nil {
  6875. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6876. }
  6877. return c.s.client.Do(req)
  6878. }
  6879. // Do executes the "analytics.management.experiments.list" call.
  6880. // Exactly one of *Experiments or error will be non-nil. Any non-2xx
  6881. // status code is an error. Response headers are in either
  6882. // *Experiments.ServerResponse.Header or (if a response was returned at
  6883. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6884. // to check whether the returned error was because
  6885. // http.StatusNotModified was returned.
  6886. func (c *ManagementExperimentsListCall) Do(opts ...googleapi.CallOption) (*Experiments, error) {
  6887. gensupport.SetOptions(c.urlParams_, opts...)
  6888. res, err := c.doRequest("json")
  6889. if res != nil && res.StatusCode == http.StatusNotModified {
  6890. if res.Body != nil {
  6891. res.Body.Close()
  6892. }
  6893. return nil, &googleapi.Error{
  6894. Code: res.StatusCode,
  6895. Header: res.Header,
  6896. }
  6897. }
  6898. if err != nil {
  6899. return nil, err
  6900. }
  6901. defer googleapi.CloseBody(res)
  6902. if err := googleapi.CheckResponse(res); err != nil {
  6903. return nil, err
  6904. }
  6905. ret := &Experiments{
  6906. ServerResponse: googleapi.ServerResponse{
  6907. Header: res.Header,
  6908. HTTPStatusCode: res.StatusCode,
  6909. },
  6910. }
  6911. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6912. return nil, err
  6913. }
  6914. return ret, nil
  6915. // {
  6916. // "description": "Lists experiments to which the user has access.",
  6917. // "httpMethod": "GET",
  6918. // "id": "analytics.management.experiments.list",
  6919. // "parameterOrder": [
  6920. // "accountId",
  6921. // "webPropertyId",
  6922. // "profileId"
  6923. // ],
  6924. // "parameters": {
  6925. // "accountId": {
  6926. // "description": "Account ID to retrieve experiments for.",
  6927. // "location": "path",
  6928. // "pattern": "\\d+",
  6929. // "required": true,
  6930. // "type": "string"
  6931. // },
  6932. // "max-results": {
  6933. // "description": "The maximum number of experiments to include in this response.",
  6934. // "format": "int32",
  6935. // "location": "query",
  6936. // "type": "integer"
  6937. // },
  6938. // "profileId": {
  6939. // "description": "View (Profile) ID to retrieve experiments for.",
  6940. // "location": "path",
  6941. // "pattern": "\\d+",
  6942. // "required": true,
  6943. // "type": "string"
  6944. // },
  6945. // "start-index": {
  6946. // "description": "An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  6947. // "format": "int32",
  6948. // "location": "query",
  6949. // "minimum": "1",
  6950. // "type": "integer"
  6951. // },
  6952. // "webPropertyId": {
  6953. // "description": "Web property ID to retrieve experiments for.",
  6954. // "location": "path",
  6955. // "pattern": "UA-(\\d+)-(\\d+)",
  6956. // "required": true,
  6957. // "type": "string"
  6958. // }
  6959. // },
  6960. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments",
  6961. // "response": {
  6962. // "$ref": "Experiments"
  6963. // },
  6964. // "scopes": [
  6965. // "https://www.googleapis.com/auth/analytics",
  6966. // "https://www.googleapis.com/auth/analytics.edit",
  6967. // "https://www.googleapis.com/auth/analytics.readonly"
  6968. // ]
  6969. // }
  6970. }
  6971. // method id "analytics.management.experiments.patch":
  6972. type ManagementExperimentsPatchCall struct {
  6973. s *Service
  6974. accountId string
  6975. webPropertyId string
  6976. profileId string
  6977. experimentId string
  6978. experiment *Experiment
  6979. urlParams_ gensupport.URLParams
  6980. ctx_ context.Context
  6981. }
  6982. // Patch: Update an existing experiment. This method supports patch
  6983. // semantics.
  6984. func (r *ManagementExperimentsService) Patch(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsPatchCall {
  6985. c := &ManagementExperimentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6986. c.accountId = accountId
  6987. c.webPropertyId = webPropertyId
  6988. c.profileId = profileId
  6989. c.experimentId = experimentId
  6990. c.experiment = experiment
  6991. return c
  6992. }
  6993. // Fields allows partial responses to be retrieved. See
  6994. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6995. // for more information.
  6996. func (c *ManagementExperimentsPatchCall) Fields(s ...googleapi.Field) *ManagementExperimentsPatchCall {
  6997. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6998. return c
  6999. }
  7000. // Context sets the context to be used in this call's Do method. Any
  7001. // pending HTTP request will be aborted if the provided context is
  7002. // canceled.
  7003. func (c *ManagementExperimentsPatchCall) Context(ctx context.Context) *ManagementExperimentsPatchCall {
  7004. c.ctx_ = ctx
  7005. return c
  7006. }
  7007. func (c *ManagementExperimentsPatchCall) doRequest(alt string) (*http.Response, error) {
  7008. var body io.Reader = nil
  7009. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  7010. if err != nil {
  7011. return nil, err
  7012. }
  7013. ctype := "application/json"
  7014. c.urlParams_.Set("alt", alt)
  7015. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  7016. urls += "?" + c.urlParams_.Encode()
  7017. req, _ := http.NewRequest("PATCH", urls, body)
  7018. googleapi.Expand(req.URL, map[string]string{
  7019. "accountId": c.accountId,
  7020. "webPropertyId": c.webPropertyId,
  7021. "profileId": c.profileId,
  7022. "experimentId": c.experimentId,
  7023. })
  7024. req.Header.Set("Content-Type", ctype)
  7025. req.Header.Set("User-Agent", c.s.userAgent())
  7026. if c.ctx_ != nil {
  7027. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7028. }
  7029. return c.s.client.Do(req)
  7030. }
  7031. // Do executes the "analytics.management.experiments.patch" call.
  7032. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  7033. // status code is an error. Response headers are in either
  7034. // *Experiment.ServerResponse.Header or (if a response was returned at
  7035. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7036. // to check whether the returned error was because
  7037. // http.StatusNotModified was returned.
  7038. func (c *ManagementExperimentsPatchCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  7039. gensupport.SetOptions(c.urlParams_, opts...)
  7040. res, err := c.doRequest("json")
  7041. if res != nil && res.StatusCode == http.StatusNotModified {
  7042. if res.Body != nil {
  7043. res.Body.Close()
  7044. }
  7045. return nil, &googleapi.Error{
  7046. Code: res.StatusCode,
  7047. Header: res.Header,
  7048. }
  7049. }
  7050. if err != nil {
  7051. return nil, err
  7052. }
  7053. defer googleapi.CloseBody(res)
  7054. if err := googleapi.CheckResponse(res); err != nil {
  7055. return nil, err
  7056. }
  7057. ret := &Experiment{
  7058. ServerResponse: googleapi.ServerResponse{
  7059. Header: res.Header,
  7060. HTTPStatusCode: res.StatusCode,
  7061. },
  7062. }
  7063. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7064. return nil, err
  7065. }
  7066. return ret, nil
  7067. // {
  7068. // "description": "Update an existing experiment. This method supports patch semantics.",
  7069. // "httpMethod": "PATCH",
  7070. // "id": "analytics.management.experiments.patch",
  7071. // "parameterOrder": [
  7072. // "accountId",
  7073. // "webPropertyId",
  7074. // "profileId",
  7075. // "experimentId"
  7076. // ],
  7077. // "parameters": {
  7078. // "accountId": {
  7079. // "description": "Account ID of the experiment to update.",
  7080. // "location": "path",
  7081. // "required": true,
  7082. // "type": "string"
  7083. // },
  7084. // "experimentId": {
  7085. // "description": "Experiment ID of the experiment to update.",
  7086. // "location": "path",
  7087. // "required": true,
  7088. // "type": "string"
  7089. // },
  7090. // "profileId": {
  7091. // "description": "View (Profile) ID of the experiment to update.",
  7092. // "location": "path",
  7093. // "required": true,
  7094. // "type": "string"
  7095. // },
  7096. // "webPropertyId": {
  7097. // "description": "Web property ID of the experiment to update.",
  7098. // "location": "path",
  7099. // "required": true,
  7100. // "type": "string"
  7101. // }
  7102. // },
  7103. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  7104. // "request": {
  7105. // "$ref": "Experiment"
  7106. // },
  7107. // "response": {
  7108. // "$ref": "Experiment"
  7109. // },
  7110. // "scopes": [
  7111. // "https://www.googleapis.com/auth/analytics",
  7112. // "https://www.googleapis.com/auth/analytics.edit"
  7113. // ]
  7114. // }
  7115. }
  7116. // method id "analytics.management.experiments.update":
  7117. type ManagementExperimentsUpdateCall struct {
  7118. s *Service
  7119. accountId string
  7120. webPropertyId string
  7121. profileId string
  7122. experimentId string
  7123. experiment *Experiment
  7124. urlParams_ gensupport.URLParams
  7125. ctx_ context.Context
  7126. }
  7127. // Update: Update an existing experiment.
  7128. func (r *ManagementExperimentsService) Update(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsUpdateCall {
  7129. c := &ManagementExperimentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7130. c.accountId = accountId
  7131. c.webPropertyId = webPropertyId
  7132. c.profileId = profileId
  7133. c.experimentId = experimentId
  7134. c.experiment = experiment
  7135. return c
  7136. }
  7137. // Fields allows partial responses to be retrieved. See
  7138. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7139. // for more information.
  7140. func (c *ManagementExperimentsUpdateCall) Fields(s ...googleapi.Field) *ManagementExperimentsUpdateCall {
  7141. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7142. return c
  7143. }
  7144. // Context sets the context to be used in this call's Do method. Any
  7145. // pending HTTP request will be aborted if the provided context is
  7146. // canceled.
  7147. func (c *ManagementExperimentsUpdateCall) Context(ctx context.Context) *ManagementExperimentsUpdateCall {
  7148. c.ctx_ = ctx
  7149. return c
  7150. }
  7151. func (c *ManagementExperimentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7152. var body io.Reader = nil
  7153. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  7154. if err != nil {
  7155. return nil, err
  7156. }
  7157. ctype := "application/json"
  7158. c.urlParams_.Set("alt", alt)
  7159. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  7160. urls += "?" + c.urlParams_.Encode()
  7161. req, _ := http.NewRequest("PUT", urls, body)
  7162. googleapi.Expand(req.URL, map[string]string{
  7163. "accountId": c.accountId,
  7164. "webPropertyId": c.webPropertyId,
  7165. "profileId": c.profileId,
  7166. "experimentId": c.experimentId,
  7167. })
  7168. req.Header.Set("Content-Type", ctype)
  7169. req.Header.Set("User-Agent", c.s.userAgent())
  7170. if c.ctx_ != nil {
  7171. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7172. }
  7173. return c.s.client.Do(req)
  7174. }
  7175. // Do executes the "analytics.management.experiments.update" call.
  7176. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  7177. // status code is an error. Response headers are in either
  7178. // *Experiment.ServerResponse.Header or (if a response was returned at
  7179. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7180. // to check whether the returned error was because
  7181. // http.StatusNotModified was returned.
  7182. func (c *ManagementExperimentsUpdateCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  7183. gensupport.SetOptions(c.urlParams_, opts...)
  7184. res, err := c.doRequest("json")
  7185. if res != nil && res.StatusCode == http.StatusNotModified {
  7186. if res.Body != nil {
  7187. res.Body.Close()
  7188. }
  7189. return nil, &googleapi.Error{
  7190. Code: res.StatusCode,
  7191. Header: res.Header,
  7192. }
  7193. }
  7194. if err != nil {
  7195. return nil, err
  7196. }
  7197. defer googleapi.CloseBody(res)
  7198. if err := googleapi.CheckResponse(res); err != nil {
  7199. return nil, err
  7200. }
  7201. ret := &Experiment{
  7202. ServerResponse: googleapi.ServerResponse{
  7203. Header: res.Header,
  7204. HTTPStatusCode: res.StatusCode,
  7205. },
  7206. }
  7207. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7208. return nil, err
  7209. }
  7210. return ret, nil
  7211. // {
  7212. // "description": "Update an existing experiment.",
  7213. // "httpMethod": "PUT",
  7214. // "id": "analytics.management.experiments.update",
  7215. // "parameterOrder": [
  7216. // "accountId",
  7217. // "webPropertyId",
  7218. // "profileId",
  7219. // "experimentId"
  7220. // ],
  7221. // "parameters": {
  7222. // "accountId": {
  7223. // "description": "Account ID of the experiment to update.",
  7224. // "location": "path",
  7225. // "required": true,
  7226. // "type": "string"
  7227. // },
  7228. // "experimentId": {
  7229. // "description": "Experiment ID of the experiment to update.",
  7230. // "location": "path",
  7231. // "required": true,
  7232. // "type": "string"
  7233. // },
  7234. // "profileId": {
  7235. // "description": "View (Profile) ID of the experiment to update.",
  7236. // "location": "path",
  7237. // "required": true,
  7238. // "type": "string"
  7239. // },
  7240. // "webPropertyId": {
  7241. // "description": "Web property ID of the experiment to update.",
  7242. // "location": "path",
  7243. // "required": true,
  7244. // "type": "string"
  7245. // }
  7246. // },
  7247. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  7248. // "request": {
  7249. // "$ref": "Experiment"
  7250. // },
  7251. // "response": {
  7252. // "$ref": "Experiment"
  7253. // },
  7254. // "scopes": [
  7255. // "https://www.googleapis.com/auth/analytics",
  7256. // "https://www.googleapis.com/auth/analytics.edit"
  7257. // ]
  7258. // }
  7259. }
  7260. // method id "analytics.management.filters.delete":
  7261. type ManagementFiltersDeleteCall struct {
  7262. s *Service
  7263. accountId string
  7264. filterId string
  7265. urlParams_ gensupport.URLParams
  7266. ctx_ context.Context
  7267. }
  7268. // Delete: Delete a filter.
  7269. func (r *ManagementFiltersService) Delete(accountId string, filterId string) *ManagementFiltersDeleteCall {
  7270. c := &ManagementFiltersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7271. c.accountId = accountId
  7272. c.filterId = filterId
  7273. return c
  7274. }
  7275. // Fields allows partial responses to be retrieved. See
  7276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7277. // for more information.
  7278. func (c *ManagementFiltersDeleteCall) Fields(s ...googleapi.Field) *ManagementFiltersDeleteCall {
  7279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7280. return c
  7281. }
  7282. // Context sets the context to be used in this call's Do method. Any
  7283. // pending HTTP request will be aborted if the provided context is
  7284. // canceled.
  7285. func (c *ManagementFiltersDeleteCall) Context(ctx context.Context) *ManagementFiltersDeleteCall {
  7286. c.ctx_ = ctx
  7287. return c
  7288. }
  7289. func (c *ManagementFiltersDeleteCall) doRequest(alt string) (*http.Response, error) {
  7290. var body io.Reader = nil
  7291. c.urlParams_.Set("alt", alt)
  7292. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  7293. urls += "?" + c.urlParams_.Encode()
  7294. req, _ := http.NewRequest("DELETE", urls, body)
  7295. googleapi.Expand(req.URL, map[string]string{
  7296. "accountId": c.accountId,
  7297. "filterId": c.filterId,
  7298. })
  7299. req.Header.Set("User-Agent", c.s.userAgent())
  7300. if c.ctx_ != nil {
  7301. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7302. }
  7303. return c.s.client.Do(req)
  7304. }
  7305. // Do executes the "analytics.management.filters.delete" call.
  7306. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  7307. // code is an error. Response headers are in either
  7308. // *Filter.ServerResponse.Header or (if a response was returned at all)
  7309. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7310. // check whether the returned error was because http.StatusNotModified
  7311. // was returned.
  7312. func (c *ManagementFiltersDeleteCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  7313. gensupport.SetOptions(c.urlParams_, opts...)
  7314. res, err := c.doRequest("json")
  7315. if res != nil && res.StatusCode == http.StatusNotModified {
  7316. if res.Body != nil {
  7317. res.Body.Close()
  7318. }
  7319. return nil, &googleapi.Error{
  7320. Code: res.StatusCode,
  7321. Header: res.Header,
  7322. }
  7323. }
  7324. if err != nil {
  7325. return nil, err
  7326. }
  7327. defer googleapi.CloseBody(res)
  7328. if err := googleapi.CheckResponse(res); err != nil {
  7329. return nil, err
  7330. }
  7331. ret := &Filter{
  7332. ServerResponse: googleapi.ServerResponse{
  7333. Header: res.Header,
  7334. HTTPStatusCode: res.StatusCode,
  7335. },
  7336. }
  7337. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7338. return nil, err
  7339. }
  7340. return ret, nil
  7341. // {
  7342. // "description": "Delete a filter.",
  7343. // "httpMethod": "DELETE",
  7344. // "id": "analytics.management.filters.delete",
  7345. // "parameterOrder": [
  7346. // "accountId",
  7347. // "filterId"
  7348. // ],
  7349. // "parameters": {
  7350. // "accountId": {
  7351. // "description": "Account ID to delete the filter for.",
  7352. // "location": "path",
  7353. // "required": true,
  7354. // "type": "string"
  7355. // },
  7356. // "filterId": {
  7357. // "description": "ID of the filter to be deleted.",
  7358. // "location": "path",
  7359. // "required": true,
  7360. // "type": "string"
  7361. // }
  7362. // },
  7363. // "path": "management/accounts/{accountId}/filters/{filterId}",
  7364. // "response": {
  7365. // "$ref": "Filter"
  7366. // },
  7367. // "scopes": [
  7368. // "https://www.googleapis.com/auth/analytics.edit"
  7369. // ]
  7370. // }
  7371. }
  7372. // method id "analytics.management.filters.get":
  7373. type ManagementFiltersGetCall struct {
  7374. s *Service
  7375. accountId string
  7376. filterId string
  7377. urlParams_ gensupport.URLParams
  7378. ifNoneMatch_ string
  7379. ctx_ context.Context
  7380. }
  7381. // Get: Returns a filters to which the user has access.
  7382. func (r *ManagementFiltersService) Get(accountId string, filterId string) *ManagementFiltersGetCall {
  7383. c := &ManagementFiltersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7384. c.accountId = accountId
  7385. c.filterId = filterId
  7386. return c
  7387. }
  7388. // Fields allows partial responses to be retrieved. See
  7389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7390. // for more information.
  7391. func (c *ManagementFiltersGetCall) Fields(s ...googleapi.Field) *ManagementFiltersGetCall {
  7392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7393. return c
  7394. }
  7395. // IfNoneMatch sets the optional parameter which makes the operation
  7396. // fail if the object's ETag matches the given value. This is useful for
  7397. // getting updates only after the object has changed since the last
  7398. // request. Use googleapi.IsNotModified to check whether the response
  7399. // error from Do is the result of In-None-Match.
  7400. func (c *ManagementFiltersGetCall) IfNoneMatch(entityTag string) *ManagementFiltersGetCall {
  7401. c.ifNoneMatch_ = entityTag
  7402. return c
  7403. }
  7404. // Context sets the context to be used in this call's Do method. Any
  7405. // pending HTTP request will be aborted if the provided context is
  7406. // canceled.
  7407. func (c *ManagementFiltersGetCall) Context(ctx context.Context) *ManagementFiltersGetCall {
  7408. c.ctx_ = ctx
  7409. return c
  7410. }
  7411. func (c *ManagementFiltersGetCall) doRequest(alt string) (*http.Response, error) {
  7412. var body io.Reader = nil
  7413. c.urlParams_.Set("alt", alt)
  7414. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  7415. urls += "?" + c.urlParams_.Encode()
  7416. req, _ := http.NewRequest("GET", urls, body)
  7417. googleapi.Expand(req.URL, map[string]string{
  7418. "accountId": c.accountId,
  7419. "filterId": c.filterId,
  7420. })
  7421. req.Header.Set("User-Agent", c.s.userAgent())
  7422. if c.ifNoneMatch_ != "" {
  7423. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7424. }
  7425. if c.ctx_ != nil {
  7426. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7427. }
  7428. return c.s.client.Do(req)
  7429. }
  7430. // Do executes the "analytics.management.filters.get" call.
  7431. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  7432. // code is an error. Response headers are in either
  7433. // *Filter.ServerResponse.Header or (if a response was returned at all)
  7434. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7435. // check whether the returned error was because http.StatusNotModified
  7436. // was returned.
  7437. func (c *ManagementFiltersGetCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  7438. gensupport.SetOptions(c.urlParams_, opts...)
  7439. res, err := c.doRequest("json")
  7440. if res != nil && res.StatusCode == http.StatusNotModified {
  7441. if res.Body != nil {
  7442. res.Body.Close()
  7443. }
  7444. return nil, &googleapi.Error{
  7445. Code: res.StatusCode,
  7446. Header: res.Header,
  7447. }
  7448. }
  7449. if err != nil {
  7450. return nil, err
  7451. }
  7452. defer googleapi.CloseBody(res)
  7453. if err := googleapi.CheckResponse(res); err != nil {
  7454. return nil, err
  7455. }
  7456. ret := &Filter{
  7457. ServerResponse: googleapi.ServerResponse{
  7458. Header: res.Header,
  7459. HTTPStatusCode: res.StatusCode,
  7460. },
  7461. }
  7462. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7463. return nil, err
  7464. }
  7465. return ret, nil
  7466. // {
  7467. // "description": "Returns a filters to which the user has access.",
  7468. // "httpMethod": "GET",
  7469. // "id": "analytics.management.filters.get",
  7470. // "parameterOrder": [
  7471. // "accountId",
  7472. // "filterId"
  7473. // ],
  7474. // "parameters": {
  7475. // "accountId": {
  7476. // "description": "Account ID to retrieve filters for.",
  7477. // "location": "path",
  7478. // "required": true,
  7479. // "type": "string"
  7480. // },
  7481. // "filterId": {
  7482. // "description": "Filter ID to retrieve filters for.",
  7483. // "location": "path",
  7484. // "required": true,
  7485. // "type": "string"
  7486. // }
  7487. // },
  7488. // "path": "management/accounts/{accountId}/filters/{filterId}",
  7489. // "response": {
  7490. // "$ref": "Filter"
  7491. // },
  7492. // "scopes": [
  7493. // "https://www.googleapis.com/auth/analytics.edit",
  7494. // "https://www.googleapis.com/auth/analytics.readonly"
  7495. // ]
  7496. // }
  7497. }
  7498. // method id "analytics.management.filters.insert":
  7499. type ManagementFiltersInsertCall struct {
  7500. s *Service
  7501. accountId string
  7502. filter *Filter
  7503. urlParams_ gensupport.URLParams
  7504. ctx_ context.Context
  7505. }
  7506. // Insert: Create a new filter.
  7507. func (r *ManagementFiltersService) Insert(accountId string, filter *Filter) *ManagementFiltersInsertCall {
  7508. c := &ManagementFiltersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7509. c.accountId = accountId
  7510. c.filter = filter
  7511. return c
  7512. }
  7513. // Fields allows partial responses to be retrieved. See
  7514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7515. // for more information.
  7516. func (c *ManagementFiltersInsertCall) Fields(s ...googleapi.Field) *ManagementFiltersInsertCall {
  7517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7518. return c
  7519. }
  7520. // Context sets the context to be used in this call's Do method. Any
  7521. // pending HTTP request will be aborted if the provided context is
  7522. // canceled.
  7523. func (c *ManagementFiltersInsertCall) Context(ctx context.Context) *ManagementFiltersInsertCall {
  7524. c.ctx_ = ctx
  7525. return c
  7526. }
  7527. func (c *ManagementFiltersInsertCall) doRequest(alt string) (*http.Response, error) {
  7528. var body io.Reader = nil
  7529. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  7530. if err != nil {
  7531. return nil, err
  7532. }
  7533. ctype := "application/json"
  7534. c.urlParams_.Set("alt", alt)
  7535. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters")
  7536. urls += "?" + c.urlParams_.Encode()
  7537. req, _ := http.NewRequest("POST", urls, body)
  7538. googleapi.Expand(req.URL, map[string]string{
  7539. "accountId": c.accountId,
  7540. })
  7541. req.Header.Set("Content-Type", ctype)
  7542. req.Header.Set("User-Agent", c.s.userAgent())
  7543. if c.ctx_ != nil {
  7544. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7545. }
  7546. return c.s.client.Do(req)
  7547. }
  7548. // Do executes the "analytics.management.filters.insert" call.
  7549. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  7550. // code is an error. Response headers are in either
  7551. // *Filter.ServerResponse.Header or (if a response was returned at all)
  7552. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7553. // check whether the returned error was because http.StatusNotModified
  7554. // was returned.
  7555. func (c *ManagementFiltersInsertCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  7556. gensupport.SetOptions(c.urlParams_, opts...)
  7557. res, err := c.doRequest("json")
  7558. if res != nil && res.StatusCode == http.StatusNotModified {
  7559. if res.Body != nil {
  7560. res.Body.Close()
  7561. }
  7562. return nil, &googleapi.Error{
  7563. Code: res.StatusCode,
  7564. Header: res.Header,
  7565. }
  7566. }
  7567. if err != nil {
  7568. return nil, err
  7569. }
  7570. defer googleapi.CloseBody(res)
  7571. if err := googleapi.CheckResponse(res); err != nil {
  7572. return nil, err
  7573. }
  7574. ret := &Filter{
  7575. ServerResponse: googleapi.ServerResponse{
  7576. Header: res.Header,
  7577. HTTPStatusCode: res.StatusCode,
  7578. },
  7579. }
  7580. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7581. return nil, err
  7582. }
  7583. return ret, nil
  7584. // {
  7585. // "description": "Create a new filter.",
  7586. // "httpMethod": "POST",
  7587. // "id": "analytics.management.filters.insert",
  7588. // "parameterOrder": [
  7589. // "accountId"
  7590. // ],
  7591. // "parameters": {
  7592. // "accountId": {
  7593. // "description": "Account ID to create filter for.",
  7594. // "location": "path",
  7595. // "required": true,
  7596. // "type": "string"
  7597. // }
  7598. // },
  7599. // "path": "management/accounts/{accountId}/filters",
  7600. // "request": {
  7601. // "$ref": "Filter"
  7602. // },
  7603. // "response": {
  7604. // "$ref": "Filter"
  7605. // },
  7606. // "scopes": [
  7607. // "https://www.googleapis.com/auth/analytics.edit"
  7608. // ]
  7609. // }
  7610. }
  7611. // method id "analytics.management.filters.list":
  7612. type ManagementFiltersListCall struct {
  7613. s *Service
  7614. accountId string
  7615. urlParams_ gensupport.URLParams
  7616. ifNoneMatch_ string
  7617. ctx_ context.Context
  7618. }
  7619. // List: Lists all filters for an account
  7620. func (r *ManagementFiltersService) List(accountId string) *ManagementFiltersListCall {
  7621. c := &ManagementFiltersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7622. c.accountId = accountId
  7623. return c
  7624. }
  7625. // MaxResults sets the optional parameter "max-results": The maximum
  7626. // number of filters to include in this response.
  7627. func (c *ManagementFiltersListCall) MaxResults(maxResults int64) *ManagementFiltersListCall {
  7628. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  7629. return c
  7630. }
  7631. // StartIndex sets the optional parameter "start-index": An index of the
  7632. // first entity to retrieve. Use this parameter as a pagination
  7633. // mechanism along with the max-results parameter.
  7634. func (c *ManagementFiltersListCall) StartIndex(startIndex int64) *ManagementFiltersListCall {
  7635. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  7636. return c
  7637. }
  7638. // Fields allows partial responses to be retrieved. See
  7639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7640. // for more information.
  7641. func (c *ManagementFiltersListCall) Fields(s ...googleapi.Field) *ManagementFiltersListCall {
  7642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7643. return c
  7644. }
  7645. // IfNoneMatch sets the optional parameter which makes the operation
  7646. // fail if the object's ETag matches the given value. This is useful for
  7647. // getting updates only after the object has changed since the last
  7648. // request. Use googleapi.IsNotModified to check whether the response
  7649. // error from Do is the result of In-None-Match.
  7650. func (c *ManagementFiltersListCall) IfNoneMatch(entityTag string) *ManagementFiltersListCall {
  7651. c.ifNoneMatch_ = entityTag
  7652. return c
  7653. }
  7654. // Context sets the context to be used in this call's Do method. Any
  7655. // pending HTTP request will be aborted if the provided context is
  7656. // canceled.
  7657. func (c *ManagementFiltersListCall) Context(ctx context.Context) *ManagementFiltersListCall {
  7658. c.ctx_ = ctx
  7659. return c
  7660. }
  7661. func (c *ManagementFiltersListCall) doRequest(alt string) (*http.Response, error) {
  7662. var body io.Reader = nil
  7663. c.urlParams_.Set("alt", alt)
  7664. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters")
  7665. urls += "?" + c.urlParams_.Encode()
  7666. req, _ := http.NewRequest("GET", urls, body)
  7667. googleapi.Expand(req.URL, map[string]string{
  7668. "accountId": c.accountId,
  7669. })
  7670. req.Header.Set("User-Agent", c.s.userAgent())
  7671. if c.ifNoneMatch_ != "" {
  7672. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7673. }
  7674. if c.ctx_ != nil {
  7675. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7676. }
  7677. return c.s.client.Do(req)
  7678. }
  7679. // Do executes the "analytics.management.filters.list" call.
  7680. // Exactly one of *Filters or error will be non-nil. Any non-2xx status
  7681. // code is an error. Response headers are in either
  7682. // *Filters.ServerResponse.Header or (if a response was returned at all)
  7683. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7684. // check whether the returned error was because http.StatusNotModified
  7685. // was returned.
  7686. func (c *ManagementFiltersListCall) Do(opts ...googleapi.CallOption) (*Filters, error) {
  7687. gensupport.SetOptions(c.urlParams_, opts...)
  7688. res, err := c.doRequest("json")
  7689. if res != nil && res.StatusCode == http.StatusNotModified {
  7690. if res.Body != nil {
  7691. res.Body.Close()
  7692. }
  7693. return nil, &googleapi.Error{
  7694. Code: res.StatusCode,
  7695. Header: res.Header,
  7696. }
  7697. }
  7698. if err != nil {
  7699. return nil, err
  7700. }
  7701. defer googleapi.CloseBody(res)
  7702. if err := googleapi.CheckResponse(res); err != nil {
  7703. return nil, err
  7704. }
  7705. ret := &Filters{
  7706. ServerResponse: googleapi.ServerResponse{
  7707. Header: res.Header,
  7708. HTTPStatusCode: res.StatusCode,
  7709. },
  7710. }
  7711. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7712. return nil, err
  7713. }
  7714. return ret, nil
  7715. // {
  7716. // "description": "Lists all filters for an account",
  7717. // "httpMethod": "GET",
  7718. // "id": "analytics.management.filters.list",
  7719. // "parameterOrder": [
  7720. // "accountId"
  7721. // ],
  7722. // "parameters": {
  7723. // "accountId": {
  7724. // "description": "Account ID to retrieve filters for.",
  7725. // "location": "path",
  7726. // "pattern": "\\d+",
  7727. // "required": true,
  7728. // "type": "string"
  7729. // },
  7730. // "max-results": {
  7731. // "description": "The maximum number of filters to include in this response.",
  7732. // "format": "int32",
  7733. // "location": "query",
  7734. // "type": "integer"
  7735. // },
  7736. // "start-index": {
  7737. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  7738. // "format": "int32",
  7739. // "location": "query",
  7740. // "minimum": "1",
  7741. // "type": "integer"
  7742. // }
  7743. // },
  7744. // "path": "management/accounts/{accountId}/filters",
  7745. // "response": {
  7746. // "$ref": "Filters"
  7747. // },
  7748. // "scopes": [
  7749. // "https://www.googleapis.com/auth/analytics.edit",
  7750. // "https://www.googleapis.com/auth/analytics.readonly"
  7751. // ]
  7752. // }
  7753. }
  7754. // method id "analytics.management.filters.patch":
  7755. type ManagementFiltersPatchCall struct {
  7756. s *Service
  7757. accountId string
  7758. filterId string
  7759. filter *Filter
  7760. urlParams_ gensupport.URLParams
  7761. ctx_ context.Context
  7762. }
  7763. // Patch: Updates an existing filter. This method supports patch
  7764. // semantics.
  7765. func (r *ManagementFiltersService) Patch(accountId string, filterId string, filter *Filter) *ManagementFiltersPatchCall {
  7766. c := &ManagementFiltersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7767. c.accountId = accountId
  7768. c.filterId = filterId
  7769. c.filter = filter
  7770. return c
  7771. }
  7772. // Fields allows partial responses to be retrieved. See
  7773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7774. // for more information.
  7775. func (c *ManagementFiltersPatchCall) Fields(s ...googleapi.Field) *ManagementFiltersPatchCall {
  7776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7777. return c
  7778. }
  7779. // Context sets the context to be used in this call's Do method. Any
  7780. // pending HTTP request will be aborted if the provided context is
  7781. // canceled.
  7782. func (c *ManagementFiltersPatchCall) Context(ctx context.Context) *ManagementFiltersPatchCall {
  7783. c.ctx_ = ctx
  7784. return c
  7785. }
  7786. func (c *ManagementFiltersPatchCall) doRequest(alt string) (*http.Response, error) {
  7787. var body io.Reader = nil
  7788. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  7789. if err != nil {
  7790. return nil, err
  7791. }
  7792. ctype := "application/json"
  7793. c.urlParams_.Set("alt", alt)
  7794. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  7795. urls += "?" + c.urlParams_.Encode()
  7796. req, _ := http.NewRequest("PATCH", urls, body)
  7797. googleapi.Expand(req.URL, map[string]string{
  7798. "accountId": c.accountId,
  7799. "filterId": c.filterId,
  7800. })
  7801. req.Header.Set("Content-Type", ctype)
  7802. req.Header.Set("User-Agent", c.s.userAgent())
  7803. if c.ctx_ != nil {
  7804. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7805. }
  7806. return c.s.client.Do(req)
  7807. }
  7808. // Do executes the "analytics.management.filters.patch" call.
  7809. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  7810. // code is an error. Response headers are in either
  7811. // *Filter.ServerResponse.Header or (if a response was returned at all)
  7812. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7813. // check whether the returned error was because http.StatusNotModified
  7814. // was returned.
  7815. func (c *ManagementFiltersPatchCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  7816. gensupport.SetOptions(c.urlParams_, opts...)
  7817. res, err := c.doRequest("json")
  7818. if res != nil && res.StatusCode == http.StatusNotModified {
  7819. if res.Body != nil {
  7820. res.Body.Close()
  7821. }
  7822. return nil, &googleapi.Error{
  7823. Code: res.StatusCode,
  7824. Header: res.Header,
  7825. }
  7826. }
  7827. if err != nil {
  7828. return nil, err
  7829. }
  7830. defer googleapi.CloseBody(res)
  7831. if err := googleapi.CheckResponse(res); err != nil {
  7832. return nil, err
  7833. }
  7834. ret := &Filter{
  7835. ServerResponse: googleapi.ServerResponse{
  7836. Header: res.Header,
  7837. HTTPStatusCode: res.StatusCode,
  7838. },
  7839. }
  7840. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7841. return nil, err
  7842. }
  7843. return ret, nil
  7844. // {
  7845. // "description": "Updates an existing filter. This method supports patch semantics.",
  7846. // "httpMethod": "PATCH",
  7847. // "id": "analytics.management.filters.patch",
  7848. // "parameterOrder": [
  7849. // "accountId",
  7850. // "filterId"
  7851. // ],
  7852. // "parameters": {
  7853. // "accountId": {
  7854. // "description": "Account ID to which the filter belongs.",
  7855. // "location": "path",
  7856. // "required": true,
  7857. // "type": "string"
  7858. // },
  7859. // "filterId": {
  7860. // "description": "ID of the filter to be updated.",
  7861. // "location": "path",
  7862. // "required": true,
  7863. // "type": "string"
  7864. // }
  7865. // },
  7866. // "path": "management/accounts/{accountId}/filters/{filterId}",
  7867. // "request": {
  7868. // "$ref": "Filter"
  7869. // },
  7870. // "response": {
  7871. // "$ref": "Filter"
  7872. // },
  7873. // "scopes": [
  7874. // "https://www.googleapis.com/auth/analytics.edit"
  7875. // ]
  7876. // }
  7877. }
  7878. // method id "analytics.management.filters.update":
  7879. type ManagementFiltersUpdateCall struct {
  7880. s *Service
  7881. accountId string
  7882. filterId string
  7883. filter *Filter
  7884. urlParams_ gensupport.URLParams
  7885. ctx_ context.Context
  7886. }
  7887. // Update: Updates an existing filter.
  7888. func (r *ManagementFiltersService) Update(accountId string, filterId string, filter *Filter) *ManagementFiltersUpdateCall {
  7889. c := &ManagementFiltersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7890. c.accountId = accountId
  7891. c.filterId = filterId
  7892. c.filter = filter
  7893. return c
  7894. }
  7895. // Fields allows partial responses to be retrieved. See
  7896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7897. // for more information.
  7898. func (c *ManagementFiltersUpdateCall) Fields(s ...googleapi.Field) *ManagementFiltersUpdateCall {
  7899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7900. return c
  7901. }
  7902. // Context sets the context to be used in this call's Do method. Any
  7903. // pending HTTP request will be aborted if the provided context is
  7904. // canceled.
  7905. func (c *ManagementFiltersUpdateCall) Context(ctx context.Context) *ManagementFiltersUpdateCall {
  7906. c.ctx_ = ctx
  7907. return c
  7908. }
  7909. func (c *ManagementFiltersUpdateCall) doRequest(alt string) (*http.Response, error) {
  7910. var body io.Reader = nil
  7911. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  7912. if err != nil {
  7913. return nil, err
  7914. }
  7915. ctype := "application/json"
  7916. c.urlParams_.Set("alt", alt)
  7917. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  7918. urls += "?" + c.urlParams_.Encode()
  7919. req, _ := http.NewRequest("PUT", urls, body)
  7920. googleapi.Expand(req.URL, map[string]string{
  7921. "accountId": c.accountId,
  7922. "filterId": c.filterId,
  7923. })
  7924. req.Header.Set("Content-Type", ctype)
  7925. req.Header.Set("User-Agent", c.s.userAgent())
  7926. if c.ctx_ != nil {
  7927. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7928. }
  7929. return c.s.client.Do(req)
  7930. }
  7931. // Do executes the "analytics.management.filters.update" call.
  7932. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  7933. // code is an error. Response headers are in either
  7934. // *Filter.ServerResponse.Header or (if a response was returned at all)
  7935. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7936. // check whether the returned error was because http.StatusNotModified
  7937. // was returned.
  7938. func (c *ManagementFiltersUpdateCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  7939. gensupport.SetOptions(c.urlParams_, opts...)
  7940. res, err := c.doRequest("json")
  7941. if res != nil && res.StatusCode == http.StatusNotModified {
  7942. if res.Body != nil {
  7943. res.Body.Close()
  7944. }
  7945. return nil, &googleapi.Error{
  7946. Code: res.StatusCode,
  7947. Header: res.Header,
  7948. }
  7949. }
  7950. if err != nil {
  7951. return nil, err
  7952. }
  7953. defer googleapi.CloseBody(res)
  7954. if err := googleapi.CheckResponse(res); err != nil {
  7955. return nil, err
  7956. }
  7957. ret := &Filter{
  7958. ServerResponse: googleapi.ServerResponse{
  7959. Header: res.Header,
  7960. HTTPStatusCode: res.StatusCode,
  7961. },
  7962. }
  7963. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7964. return nil, err
  7965. }
  7966. return ret, nil
  7967. // {
  7968. // "description": "Updates an existing filter.",
  7969. // "httpMethod": "PUT",
  7970. // "id": "analytics.management.filters.update",
  7971. // "parameterOrder": [
  7972. // "accountId",
  7973. // "filterId"
  7974. // ],
  7975. // "parameters": {
  7976. // "accountId": {
  7977. // "description": "Account ID to which the filter belongs.",
  7978. // "location": "path",
  7979. // "required": true,
  7980. // "type": "string"
  7981. // },
  7982. // "filterId": {
  7983. // "description": "ID of the filter to be updated.",
  7984. // "location": "path",
  7985. // "required": true,
  7986. // "type": "string"
  7987. // }
  7988. // },
  7989. // "path": "management/accounts/{accountId}/filters/{filterId}",
  7990. // "request": {
  7991. // "$ref": "Filter"
  7992. // },
  7993. // "response": {
  7994. // "$ref": "Filter"
  7995. // },
  7996. // "scopes": [
  7997. // "https://www.googleapis.com/auth/analytics.edit"
  7998. // ]
  7999. // }
  8000. }
  8001. // method id "analytics.management.goals.get":
  8002. type ManagementGoalsGetCall struct {
  8003. s *Service
  8004. accountId string
  8005. webPropertyId string
  8006. profileId string
  8007. goalId string
  8008. urlParams_ gensupport.URLParams
  8009. ifNoneMatch_ string
  8010. ctx_ context.Context
  8011. }
  8012. // Get: Gets a goal to which the user has access.
  8013. func (r *ManagementGoalsService) Get(accountId string, webPropertyId string, profileId string, goalId string) *ManagementGoalsGetCall {
  8014. c := &ManagementGoalsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8015. c.accountId = accountId
  8016. c.webPropertyId = webPropertyId
  8017. c.profileId = profileId
  8018. c.goalId = goalId
  8019. return c
  8020. }
  8021. // Fields allows partial responses to be retrieved. See
  8022. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8023. // for more information.
  8024. func (c *ManagementGoalsGetCall) Fields(s ...googleapi.Field) *ManagementGoalsGetCall {
  8025. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8026. return c
  8027. }
  8028. // IfNoneMatch sets the optional parameter which makes the operation
  8029. // fail if the object's ETag matches the given value. This is useful for
  8030. // getting updates only after the object has changed since the last
  8031. // request. Use googleapi.IsNotModified to check whether the response
  8032. // error from Do is the result of In-None-Match.
  8033. func (c *ManagementGoalsGetCall) IfNoneMatch(entityTag string) *ManagementGoalsGetCall {
  8034. c.ifNoneMatch_ = entityTag
  8035. return c
  8036. }
  8037. // Context sets the context to be used in this call's Do method. Any
  8038. // pending HTTP request will be aborted if the provided context is
  8039. // canceled.
  8040. func (c *ManagementGoalsGetCall) Context(ctx context.Context) *ManagementGoalsGetCall {
  8041. c.ctx_ = ctx
  8042. return c
  8043. }
  8044. func (c *ManagementGoalsGetCall) doRequest(alt string) (*http.Response, error) {
  8045. var body io.Reader = nil
  8046. c.urlParams_.Set("alt", alt)
  8047. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  8048. urls += "?" + c.urlParams_.Encode()
  8049. req, _ := http.NewRequest("GET", urls, body)
  8050. googleapi.Expand(req.URL, map[string]string{
  8051. "accountId": c.accountId,
  8052. "webPropertyId": c.webPropertyId,
  8053. "profileId": c.profileId,
  8054. "goalId": c.goalId,
  8055. })
  8056. req.Header.Set("User-Agent", c.s.userAgent())
  8057. if c.ifNoneMatch_ != "" {
  8058. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8059. }
  8060. if c.ctx_ != nil {
  8061. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8062. }
  8063. return c.s.client.Do(req)
  8064. }
  8065. // Do executes the "analytics.management.goals.get" call.
  8066. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  8067. // code is an error. Response headers are in either
  8068. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  8069. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8070. // whether the returned error was because http.StatusNotModified was
  8071. // returned.
  8072. func (c *ManagementGoalsGetCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  8073. gensupport.SetOptions(c.urlParams_, opts...)
  8074. res, err := c.doRequest("json")
  8075. if res != nil && res.StatusCode == http.StatusNotModified {
  8076. if res.Body != nil {
  8077. res.Body.Close()
  8078. }
  8079. return nil, &googleapi.Error{
  8080. Code: res.StatusCode,
  8081. Header: res.Header,
  8082. }
  8083. }
  8084. if err != nil {
  8085. return nil, err
  8086. }
  8087. defer googleapi.CloseBody(res)
  8088. if err := googleapi.CheckResponse(res); err != nil {
  8089. return nil, err
  8090. }
  8091. ret := &Goal{
  8092. ServerResponse: googleapi.ServerResponse{
  8093. Header: res.Header,
  8094. HTTPStatusCode: res.StatusCode,
  8095. },
  8096. }
  8097. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8098. return nil, err
  8099. }
  8100. return ret, nil
  8101. // {
  8102. // "description": "Gets a goal to which the user has access.",
  8103. // "httpMethod": "GET",
  8104. // "id": "analytics.management.goals.get",
  8105. // "parameterOrder": [
  8106. // "accountId",
  8107. // "webPropertyId",
  8108. // "profileId",
  8109. // "goalId"
  8110. // ],
  8111. // "parameters": {
  8112. // "accountId": {
  8113. // "description": "Account ID to retrieve the goal for.",
  8114. // "location": "path",
  8115. // "required": true,
  8116. // "type": "string"
  8117. // },
  8118. // "goalId": {
  8119. // "description": "Goal ID to retrieve the goal for.",
  8120. // "location": "path",
  8121. // "required": true,
  8122. // "type": "string"
  8123. // },
  8124. // "profileId": {
  8125. // "description": "View (Profile) ID to retrieve the goal for.",
  8126. // "location": "path",
  8127. // "required": true,
  8128. // "type": "string"
  8129. // },
  8130. // "webPropertyId": {
  8131. // "description": "Web property ID to retrieve the goal for.",
  8132. // "location": "path",
  8133. // "required": true,
  8134. // "type": "string"
  8135. // }
  8136. // },
  8137. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  8138. // "response": {
  8139. // "$ref": "Goal"
  8140. // },
  8141. // "scopes": [
  8142. // "https://www.googleapis.com/auth/analytics.edit",
  8143. // "https://www.googleapis.com/auth/analytics.readonly"
  8144. // ]
  8145. // }
  8146. }
  8147. // method id "analytics.management.goals.insert":
  8148. type ManagementGoalsInsertCall struct {
  8149. s *Service
  8150. accountId string
  8151. webPropertyId string
  8152. profileId string
  8153. goal *Goal
  8154. urlParams_ gensupport.URLParams
  8155. ctx_ context.Context
  8156. }
  8157. // Insert: Create a new goal.
  8158. func (r *ManagementGoalsService) Insert(accountId string, webPropertyId string, profileId string, goal *Goal) *ManagementGoalsInsertCall {
  8159. c := &ManagementGoalsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8160. c.accountId = accountId
  8161. c.webPropertyId = webPropertyId
  8162. c.profileId = profileId
  8163. c.goal = goal
  8164. return c
  8165. }
  8166. // Fields allows partial responses to be retrieved. See
  8167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8168. // for more information.
  8169. func (c *ManagementGoalsInsertCall) Fields(s ...googleapi.Field) *ManagementGoalsInsertCall {
  8170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8171. return c
  8172. }
  8173. // Context sets the context to be used in this call's Do method. Any
  8174. // pending HTTP request will be aborted if the provided context is
  8175. // canceled.
  8176. func (c *ManagementGoalsInsertCall) Context(ctx context.Context) *ManagementGoalsInsertCall {
  8177. c.ctx_ = ctx
  8178. return c
  8179. }
  8180. func (c *ManagementGoalsInsertCall) doRequest(alt string) (*http.Response, error) {
  8181. var body io.Reader = nil
  8182. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  8183. if err != nil {
  8184. return nil, err
  8185. }
  8186. ctype := "application/json"
  8187. c.urlParams_.Set("alt", alt)
  8188. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals")
  8189. urls += "?" + c.urlParams_.Encode()
  8190. req, _ := http.NewRequest("POST", urls, body)
  8191. googleapi.Expand(req.URL, map[string]string{
  8192. "accountId": c.accountId,
  8193. "webPropertyId": c.webPropertyId,
  8194. "profileId": c.profileId,
  8195. })
  8196. req.Header.Set("Content-Type", ctype)
  8197. req.Header.Set("User-Agent", c.s.userAgent())
  8198. if c.ctx_ != nil {
  8199. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8200. }
  8201. return c.s.client.Do(req)
  8202. }
  8203. // Do executes the "analytics.management.goals.insert" call.
  8204. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  8205. // code is an error. Response headers are in either
  8206. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  8207. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8208. // whether the returned error was because http.StatusNotModified was
  8209. // returned.
  8210. func (c *ManagementGoalsInsertCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  8211. gensupport.SetOptions(c.urlParams_, opts...)
  8212. res, err := c.doRequest("json")
  8213. if res != nil && res.StatusCode == http.StatusNotModified {
  8214. if res.Body != nil {
  8215. res.Body.Close()
  8216. }
  8217. return nil, &googleapi.Error{
  8218. Code: res.StatusCode,
  8219. Header: res.Header,
  8220. }
  8221. }
  8222. if err != nil {
  8223. return nil, err
  8224. }
  8225. defer googleapi.CloseBody(res)
  8226. if err := googleapi.CheckResponse(res); err != nil {
  8227. return nil, err
  8228. }
  8229. ret := &Goal{
  8230. ServerResponse: googleapi.ServerResponse{
  8231. Header: res.Header,
  8232. HTTPStatusCode: res.StatusCode,
  8233. },
  8234. }
  8235. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8236. return nil, err
  8237. }
  8238. return ret, nil
  8239. // {
  8240. // "description": "Create a new goal.",
  8241. // "httpMethod": "POST",
  8242. // "id": "analytics.management.goals.insert",
  8243. // "parameterOrder": [
  8244. // "accountId",
  8245. // "webPropertyId",
  8246. // "profileId"
  8247. // ],
  8248. // "parameters": {
  8249. // "accountId": {
  8250. // "description": "Account ID to create the goal for.",
  8251. // "location": "path",
  8252. // "required": true,
  8253. // "type": "string"
  8254. // },
  8255. // "profileId": {
  8256. // "description": "View (Profile) ID to create the goal for.",
  8257. // "location": "path",
  8258. // "required": true,
  8259. // "type": "string"
  8260. // },
  8261. // "webPropertyId": {
  8262. // "description": "Web property ID to create the goal for.",
  8263. // "location": "path",
  8264. // "required": true,
  8265. // "type": "string"
  8266. // }
  8267. // },
  8268. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
  8269. // "request": {
  8270. // "$ref": "Goal"
  8271. // },
  8272. // "response": {
  8273. // "$ref": "Goal"
  8274. // },
  8275. // "scopes": [
  8276. // "https://www.googleapis.com/auth/analytics.edit"
  8277. // ]
  8278. // }
  8279. }
  8280. // method id "analytics.management.goals.list":
  8281. type ManagementGoalsListCall struct {
  8282. s *Service
  8283. accountId string
  8284. webPropertyId string
  8285. profileId string
  8286. urlParams_ gensupport.URLParams
  8287. ifNoneMatch_ string
  8288. ctx_ context.Context
  8289. }
  8290. // List: Lists goals to which the user has access.
  8291. func (r *ManagementGoalsService) List(accountId string, webPropertyId string, profileId string) *ManagementGoalsListCall {
  8292. c := &ManagementGoalsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8293. c.accountId = accountId
  8294. c.webPropertyId = webPropertyId
  8295. c.profileId = profileId
  8296. return c
  8297. }
  8298. // MaxResults sets the optional parameter "max-results": The maximum
  8299. // number of goals to include in this response.
  8300. func (c *ManagementGoalsListCall) MaxResults(maxResults int64) *ManagementGoalsListCall {
  8301. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  8302. return c
  8303. }
  8304. // StartIndex sets the optional parameter "start-index": An index of the
  8305. // first goal to retrieve. Use this parameter as a pagination mechanism
  8306. // along with the max-results parameter.
  8307. func (c *ManagementGoalsListCall) StartIndex(startIndex int64) *ManagementGoalsListCall {
  8308. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  8309. return c
  8310. }
  8311. // Fields allows partial responses to be retrieved. See
  8312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8313. // for more information.
  8314. func (c *ManagementGoalsListCall) Fields(s ...googleapi.Field) *ManagementGoalsListCall {
  8315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8316. return c
  8317. }
  8318. // IfNoneMatch sets the optional parameter which makes the operation
  8319. // fail if the object's ETag matches the given value. This is useful for
  8320. // getting updates only after the object has changed since the last
  8321. // request. Use googleapi.IsNotModified to check whether the response
  8322. // error from Do is the result of In-None-Match.
  8323. func (c *ManagementGoalsListCall) IfNoneMatch(entityTag string) *ManagementGoalsListCall {
  8324. c.ifNoneMatch_ = entityTag
  8325. return c
  8326. }
  8327. // Context sets the context to be used in this call's Do method. Any
  8328. // pending HTTP request will be aborted if the provided context is
  8329. // canceled.
  8330. func (c *ManagementGoalsListCall) Context(ctx context.Context) *ManagementGoalsListCall {
  8331. c.ctx_ = ctx
  8332. return c
  8333. }
  8334. func (c *ManagementGoalsListCall) doRequest(alt string) (*http.Response, error) {
  8335. var body io.Reader = nil
  8336. c.urlParams_.Set("alt", alt)
  8337. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals")
  8338. urls += "?" + c.urlParams_.Encode()
  8339. req, _ := http.NewRequest("GET", urls, body)
  8340. googleapi.Expand(req.URL, map[string]string{
  8341. "accountId": c.accountId,
  8342. "webPropertyId": c.webPropertyId,
  8343. "profileId": c.profileId,
  8344. })
  8345. req.Header.Set("User-Agent", c.s.userAgent())
  8346. if c.ifNoneMatch_ != "" {
  8347. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8348. }
  8349. if c.ctx_ != nil {
  8350. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8351. }
  8352. return c.s.client.Do(req)
  8353. }
  8354. // Do executes the "analytics.management.goals.list" call.
  8355. // Exactly one of *Goals or error will be non-nil. Any non-2xx status
  8356. // code is an error. Response headers are in either
  8357. // *Goals.ServerResponse.Header or (if a response was returned at all)
  8358. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8359. // check whether the returned error was because http.StatusNotModified
  8360. // was returned.
  8361. func (c *ManagementGoalsListCall) Do(opts ...googleapi.CallOption) (*Goals, error) {
  8362. gensupport.SetOptions(c.urlParams_, opts...)
  8363. res, err := c.doRequest("json")
  8364. if res != nil && res.StatusCode == http.StatusNotModified {
  8365. if res.Body != nil {
  8366. res.Body.Close()
  8367. }
  8368. return nil, &googleapi.Error{
  8369. Code: res.StatusCode,
  8370. Header: res.Header,
  8371. }
  8372. }
  8373. if err != nil {
  8374. return nil, err
  8375. }
  8376. defer googleapi.CloseBody(res)
  8377. if err := googleapi.CheckResponse(res); err != nil {
  8378. return nil, err
  8379. }
  8380. ret := &Goals{
  8381. ServerResponse: googleapi.ServerResponse{
  8382. Header: res.Header,
  8383. HTTPStatusCode: res.StatusCode,
  8384. },
  8385. }
  8386. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8387. return nil, err
  8388. }
  8389. return ret, nil
  8390. // {
  8391. // "description": "Lists goals to which the user has access.",
  8392. // "httpMethod": "GET",
  8393. // "id": "analytics.management.goals.list",
  8394. // "parameterOrder": [
  8395. // "accountId",
  8396. // "webPropertyId",
  8397. // "profileId"
  8398. // ],
  8399. // "parameters": {
  8400. // "accountId": {
  8401. // "description": "Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.",
  8402. // "location": "path",
  8403. // "required": true,
  8404. // "type": "string"
  8405. // },
  8406. // "max-results": {
  8407. // "description": "The maximum number of goals to include in this response.",
  8408. // "format": "int32",
  8409. // "location": "query",
  8410. // "type": "integer"
  8411. // },
  8412. // "profileId": {
  8413. // "description": "View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to.",
  8414. // "location": "path",
  8415. // "required": true,
  8416. // "type": "string"
  8417. // },
  8418. // "start-index": {
  8419. // "description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  8420. // "format": "int32",
  8421. // "location": "query",
  8422. // "minimum": "1",
  8423. // "type": "integer"
  8424. // },
  8425. // "webPropertyId": {
  8426. // "description": "Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.",
  8427. // "location": "path",
  8428. // "required": true,
  8429. // "type": "string"
  8430. // }
  8431. // },
  8432. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
  8433. // "response": {
  8434. // "$ref": "Goals"
  8435. // },
  8436. // "scopes": [
  8437. // "https://www.googleapis.com/auth/analytics",
  8438. // "https://www.googleapis.com/auth/analytics.edit",
  8439. // "https://www.googleapis.com/auth/analytics.readonly"
  8440. // ]
  8441. // }
  8442. }
  8443. // method id "analytics.management.goals.patch":
  8444. type ManagementGoalsPatchCall struct {
  8445. s *Service
  8446. accountId string
  8447. webPropertyId string
  8448. profileId string
  8449. goalId string
  8450. goal *Goal
  8451. urlParams_ gensupport.URLParams
  8452. ctx_ context.Context
  8453. }
  8454. // Patch: Updates an existing view (profile). This method supports patch
  8455. // semantics.
  8456. func (r *ManagementGoalsService) Patch(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsPatchCall {
  8457. c := &ManagementGoalsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8458. c.accountId = accountId
  8459. c.webPropertyId = webPropertyId
  8460. c.profileId = profileId
  8461. c.goalId = goalId
  8462. c.goal = goal
  8463. return c
  8464. }
  8465. // Fields allows partial responses to be retrieved. See
  8466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8467. // for more information.
  8468. func (c *ManagementGoalsPatchCall) Fields(s ...googleapi.Field) *ManagementGoalsPatchCall {
  8469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8470. return c
  8471. }
  8472. // Context sets the context to be used in this call's Do method. Any
  8473. // pending HTTP request will be aborted if the provided context is
  8474. // canceled.
  8475. func (c *ManagementGoalsPatchCall) Context(ctx context.Context) *ManagementGoalsPatchCall {
  8476. c.ctx_ = ctx
  8477. return c
  8478. }
  8479. func (c *ManagementGoalsPatchCall) doRequest(alt string) (*http.Response, error) {
  8480. var body io.Reader = nil
  8481. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  8482. if err != nil {
  8483. return nil, err
  8484. }
  8485. ctype := "application/json"
  8486. c.urlParams_.Set("alt", alt)
  8487. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  8488. urls += "?" + c.urlParams_.Encode()
  8489. req, _ := http.NewRequest("PATCH", urls, body)
  8490. googleapi.Expand(req.URL, map[string]string{
  8491. "accountId": c.accountId,
  8492. "webPropertyId": c.webPropertyId,
  8493. "profileId": c.profileId,
  8494. "goalId": c.goalId,
  8495. })
  8496. req.Header.Set("Content-Type", ctype)
  8497. req.Header.Set("User-Agent", c.s.userAgent())
  8498. if c.ctx_ != nil {
  8499. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8500. }
  8501. return c.s.client.Do(req)
  8502. }
  8503. // Do executes the "analytics.management.goals.patch" call.
  8504. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  8505. // code is an error. Response headers are in either
  8506. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  8507. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8508. // whether the returned error was because http.StatusNotModified was
  8509. // returned.
  8510. func (c *ManagementGoalsPatchCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  8511. gensupport.SetOptions(c.urlParams_, opts...)
  8512. res, err := c.doRequest("json")
  8513. if res != nil && res.StatusCode == http.StatusNotModified {
  8514. if res.Body != nil {
  8515. res.Body.Close()
  8516. }
  8517. return nil, &googleapi.Error{
  8518. Code: res.StatusCode,
  8519. Header: res.Header,
  8520. }
  8521. }
  8522. if err != nil {
  8523. return nil, err
  8524. }
  8525. defer googleapi.CloseBody(res)
  8526. if err := googleapi.CheckResponse(res); err != nil {
  8527. return nil, err
  8528. }
  8529. ret := &Goal{
  8530. ServerResponse: googleapi.ServerResponse{
  8531. Header: res.Header,
  8532. HTTPStatusCode: res.StatusCode,
  8533. },
  8534. }
  8535. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8536. return nil, err
  8537. }
  8538. return ret, nil
  8539. // {
  8540. // "description": "Updates an existing view (profile). This method supports patch semantics.",
  8541. // "httpMethod": "PATCH",
  8542. // "id": "analytics.management.goals.patch",
  8543. // "parameterOrder": [
  8544. // "accountId",
  8545. // "webPropertyId",
  8546. // "profileId",
  8547. // "goalId"
  8548. // ],
  8549. // "parameters": {
  8550. // "accountId": {
  8551. // "description": "Account ID to update the goal.",
  8552. // "location": "path",
  8553. // "required": true,
  8554. // "type": "string"
  8555. // },
  8556. // "goalId": {
  8557. // "description": "Index of the goal to be updated.",
  8558. // "location": "path",
  8559. // "required": true,
  8560. // "type": "string"
  8561. // },
  8562. // "profileId": {
  8563. // "description": "View (Profile) ID to update the goal.",
  8564. // "location": "path",
  8565. // "required": true,
  8566. // "type": "string"
  8567. // },
  8568. // "webPropertyId": {
  8569. // "description": "Web property ID to update the goal.",
  8570. // "location": "path",
  8571. // "required": true,
  8572. // "type": "string"
  8573. // }
  8574. // },
  8575. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  8576. // "request": {
  8577. // "$ref": "Goal"
  8578. // },
  8579. // "response": {
  8580. // "$ref": "Goal"
  8581. // },
  8582. // "scopes": [
  8583. // "https://www.googleapis.com/auth/analytics.edit"
  8584. // ]
  8585. // }
  8586. }
  8587. // method id "analytics.management.goals.update":
  8588. type ManagementGoalsUpdateCall struct {
  8589. s *Service
  8590. accountId string
  8591. webPropertyId string
  8592. profileId string
  8593. goalId string
  8594. goal *Goal
  8595. urlParams_ gensupport.URLParams
  8596. ctx_ context.Context
  8597. }
  8598. // Update: Updates an existing view (profile).
  8599. func (r *ManagementGoalsService) Update(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsUpdateCall {
  8600. c := &ManagementGoalsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8601. c.accountId = accountId
  8602. c.webPropertyId = webPropertyId
  8603. c.profileId = profileId
  8604. c.goalId = goalId
  8605. c.goal = goal
  8606. return c
  8607. }
  8608. // Fields allows partial responses to be retrieved. See
  8609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8610. // for more information.
  8611. func (c *ManagementGoalsUpdateCall) Fields(s ...googleapi.Field) *ManagementGoalsUpdateCall {
  8612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8613. return c
  8614. }
  8615. // Context sets the context to be used in this call's Do method. Any
  8616. // pending HTTP request will be aborted if the provided context is
  8617. // canceled.
  8618. func (c *ManagementGoalsUpdateCall) Context(ctx context.Context) *ManagementGoalsUpdateCall {
  8619. c.ctx_ = ctx
  8620. return c
  8621. }
  8622. func (c *ManagementGoalsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8623. var body io.Reader = nil
  8624. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  8625. if err != nil {
  8626. return nil, err
  8627. }
  8628. ctype := "application/json"
  8629. c.urlParams_.Set("alt", alt)
  8630. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  8631. urls += "?" + c.urlParams_.Encode()
  8632. req, _ := http.NewRequest("PUT", urls, body)
  8633. googleapi.Expand(req.URL, map[string]string{
  8634. "accountId": c.accountId,
  8635. "webPropertyId": c.webPropertyId,
  8636. "profileId": c.profileId,
  8637. "goalId": c.goalId,
  8638. })
  8639. req.Header.Set("Content-Type", ctype)
  8640. req.Header.Set("User-Agent", c.s.userAgent())
  8641. if c.ctx_ != nil {
  8642. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8643. }
  8644. return c.s.client.Do(req)
  8645. }
  8646. // Do executes the "analytics.management.goals.update" call.
  8647. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  8648. // code is an error. Response headers are in either
  8649. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  8650. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8651. // whether the returned error was because http.StatusNotModified was
  8652. // returned.
  8653. func (c *ManagementGoalsUpdateCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  8654. gensupport.SetOptions(c.urlParams_, opts...)
  8655. res, err := c.doRequest("json")
  8656. if res != nil && res.StatusCode == http.StatusNotModified {
  8657. if res.Body != nil {
  8658. res.Body.Close()
  8659. }
  8660. return nil, &googleapi.Error{
  8661. Code: res.StatusCode,
  8662. Header: res.Header,
  8663. }
  8664. }
  8665. if err != nil {
  8666. return nil, err
  8667. }
  8668. defer googleapi.CloseBody(res)
  8669. if err := googleapi.CheckResponse(res); err != nil {
  8670. return nil, err
  8671. }
  8672. ret := &Goal{
  8673. ServerResponse: googleapi.ServerResponse{
  8674. Header: res.Header,
  8675. HTTPStatusCode: res.StatusCode,
  8676. },
  8677. }
  8678. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8679. return nil, err
  8680. }
  8681. return ret, nil
  8682. // {
  8683. // "description": "Updates an existing view (profile).",
  8684. // "httpMethod": "PUT",
  8685. // "id": "analytics.management.goals.update",
  8686. // "parameterOrder": [
  8687. // "accountId",
  8688. // "webPropertyId",
  8689. // "profileId",
  8690. // "goalId"
  8691. // ],
  8692. // "parameters": {
  8693. // "accountId": {
  8694. // "description": "Account ID to update the goal.",
  8695. // "location": "path",
  8696. // "required": true,
  8697. // "type": "string"
  8698. // },
  8699. // "goalId": {
  8700. // "description": "Index of the goal to be updated.",
  8701. // "location": "path",
  8702. // "required": true,
  8703. // "type": "string"
  8704. // },
  8705. // "profileId": {
  8706. // "description": "View (Profile) ID to update the goal.",
  8707. // "location": "path",
  8708. // "required": true,
  8709. // "type": "string"
  8710. // },
  8711. // "webPropertyId": {
  8712. // "description": "Web property ID to update the goal.",
  8713. // "location": "path",
  8714. // "required": true,
  8715. // "type": "string"
  8716. // }
  8717. // },
  8718. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  8719. // "request": {
  8720. // "$ref": "Goal"
  8721. // },
  8722. // "response": {
  8723. // "$ref": "Goal"
  8724. // },
  8725. // "scopes": [
  8726. // "https://www.googleapis.com/auth/analytics.edit"
  8727. // ]
  8728. // }
  8729. }
  8730. // method id "analytics.management.profileFilterLinks.delete":
  8731. type ManagementProfileFilterLinksDeleteCall struct {
  8732. s *Service
  8733. accountId string
  8734. webPropertyId string
  8735. profileId string
  8736. linkId string
  8737. urlParams_ gensupport.URLParams
  8738. ctx_ context.Context
  8739. }
  8740. // Delete: Delete a profile filter link.
  8741. func (r *ManagementProfileFilterLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksDeleteCall {
  8742. c := &ManagementProfileFilterLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8743. c.accountId = accountId
  8744. c.webPropertyId = webPropertyId
  8745. c.profileId = profileId
  8746. c.linkId = linkId
  8747. return c
  8748. }
  8749. // Fields allows partial responses to be retrieved. See
  8750. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8751. // for more information.
  8752. func (c *ManagementProfileFilterLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksDeleteCall {
  8753. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8754. return c
  8755. }
  8756. // Context sets the context to be used in this call's Do method. Any
  8757. // pending HTTP request will be aborted if the provided context is
  8758. // canceled.
  8759. func (c *ManagementProfileFilterLinksDeleteCall) Context(ctx context.Context) *ManagementProfileFilterLinksDeleteCall {
  8760. c.ctx_ = ctx
  8761. return c
  8762. }
  8763. func (c *ManagementProfileFilterLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  8764. var body io.Reader = nil
  8765. c.urlParams_.Set("alt", alt)
  8766. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  8767. urls += "?" + c.urlParams_.Encode()
  8768. req, _ := http.NewRequest("DELETE", urls, body)
  8769. googleapi.Expand(req.URL, map[string]string{
  8770. "accountId": c.accountId,
  8771. "webPropertyId": c.webPropertyId,
  8772. "profileId": c.profileId,
  8773. "linkId": c.linkId,
  8774. })
  8775. req.Header.Set("User-Agent", c.s.userAgent())
  8776. if c.ctx_ != nil {
  8777. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8778. }
  8779. return c.s.client.Do(req)
  8780. }
  8781. // Do executes the "analytics.management.profileFilterLinks.delete" call.
  8782. func (c *ManagementProfileFilterLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  8783. gensupport.SetOptions(c.urlParams_, opts...)
  8784. res, err := c.doRequest("json")
  8785. if err != nil {
  8786. return err
  8787. }
  8788. defer googleapi.CloseBody(res)
  8789. if err := googleapi.CheckResponse(res); err != nil {
  8790. return err
  8791. }
  8792. return nil
  8793. // {
  8794. // "description": "Delete a profile filter link.",
  8795. // "httpMethod": "DELETE",
  8796. // "id": "analytics.management.profileFilterLinks.delete",
  8797. // "parameterOrder": [
  8798. // "accountId",
  8799. // "webPropertyId",
  8800. // "profileId",
  8801. // "linkId"
  8802. // ],
  8803. // "parameters": {
  8804. // "accountId": {
  8805. // "description": "Account ID to which the profile filter link belongs.",
  8806. // "location": "path",
  8807. // "pattern": "\\d+",
  8808. // "required": true,
  8809. // "type": "string"
  8810. // },
  8811. // "linkId": {
  8812. // "description": "ID of the profile filter link to delete.",
  8813. // "location": "path",
  8814. // "pattern": "\\d+:\\d+",
  8815. // "required": true,
  8816. // "type": "string"
  8817. // },
  8818. // "profileId": {
  8819. // "description": "Profile ID to which the filter link belongs.",
  8820. // "location": "path",
  8821. // "pattern": "\\d+",
  8822. // "required": true,
  8823. // "type": "string"
  8824. // },
  8825. // "webPropertyId": {
  8826. // "description": "Web property Id to which the profile filter link belongs.",
  8827. // "location": "path",
  8828. // "pattern": "UA-(\\d+)-(\\d+)",
  8829. // "required": true,
  8830. // "type": "string"
  8831. // }
  8832. // },
  8833. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  8834. // "scopes": [
  8835. // "https://www.googleapis.com/auth/analytics.edit"
  8836. // ]
  8837. // }
  8838. }
  8839. // method id "analytics.management.profileFilterLinks.get":
  8840. type ManagementProfileFilterLinksGetCall struct {
  8841. s *Service
  8842. accountId string
  8843. webPropertyId string
  8844. profileId string
  8845. linkId string
  8846. urlParams_ gensupport.URLParams
  8847. ifNoneMatch_ string
  8848. ctx_ context.Context
  8849. }
  8850. // Get: Returns a single profile filter link.
  8851. func (r *ManagementProfileFilterLinksService) Get(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksGetCall {
  8852. c := &ManagementProfileFilterLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8853. c.accountId = accountId
  8854. c.webPropertyId = webPropertyId
  8855. c.profileId = profileId
  8856. c.linkId = linkId
  8857. return c
  8858. }
  8859. // Fields allows partial responses to be retrieved. See
  8860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8861. // for more information.
  8862. func (c *ManagementProfileFilterLinksGetCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksGetCall {
  8863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8864. return c
  8865. }
  8866. // IfNoneMatch sets the optional parameter which makes the operation
  8867. // fail if the object's ETag matches the given value. This is useful for
  8868. // getting updates only after the object has changed since the last
  8869. // request. Use googleapi.IsNotModified to check whether the response
  8870. // error from Do is the result of In-None-Match.
  8871. func (c *ManagementProfileFilterLinksGetCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksGetCall {
  8872. c.ifNoneMatch_ = entityTag
  8873. return c
  8874. }
  8875. // Context sets the context to be used in this call's Do method. Any
  8876. // pending HTTP request will be aborted if the provided context is
  8877. // canceled.
  8878. func (c *ManagementProfileFilterLinksGetCall) Context(ctx context.Context) *ManagementProfileFilterLinksGetCall {
  8879. c.ctx_ = ctx
  8880. return c
  8881. }
  8882. func (c *ManagementProfileFilterLinksGetCall) doRequest(alt string) (*http.Response, error) {
  8883. var body io.Reader = nil
  8884. c.urlParams_.Set("alt", alt)
  8885. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  8886. urls += "?" + c.urlParams_.Encode()
  8887. req, _ := http.NewRequest("GET", urls, body)
  8888. googleapi.Expand(req.URL, map[string]string{
  8889. "accountId": c.accountId,
  8890. "webPropertyId": c.webPropertyId,
  8891. "profileId": c.profileId,
  8892. "linkId": c.linkId,
  8893. })
  8894. req.Header.Set("User-Agent", c.s.userAgent())
  8895. if c.ifNoneMatch_ != "" {
  8896. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8897. }
  8898. if c.ctx_ != nil {
  8899. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8900. }
  8901. return c.s.client.Do(req)
  8902. }
  8903. // Do executes the "analytics.management.profileFilterLinks.get" call.
  8904. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  8905. // non-2xx status code is an error. Response headers are in either
  8906. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  8907. // returned at all) in error.(*googleapi.Error).Header. Use
  8908. // googleapi.IsNotModified to check whether the returned error was
  8909. // because http.StatusNotModified was returned.
  8910. func (c *ManagementProfileFilterLinksGetCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  8911. gensupport.SetOptions(c.urlParams_, opts...)
  8912. res, err := c.doRequest("json")
  8913. if res != nil && res.StatusCode == http.StatusNotModified {
  8914. if res.Body != nil {
  8915. res.Body.Close()
  8916. }
  8917. return nil, &googleapi.Error{
  8918. Code: res.StatusCode,
  8919. Header: res.Header,
  8920. }
  8921. }
  8922. if err != nil {
  8923. return nil, err
  8924. }
  8925. defer googleapi.CloseBody(res)
  8926. if err := googleapi.CheckResponse(res); err != nil {
  8927. return nil, err
  8928. }
  8929. ret := &ProfileFilterLink{
  8930. ServerResponse: googleapi.ServerResponse{
  8931. Header: res.Header,
  8932. HTTPStatusCode: res.StatusCode,
  8933. },
  8934. }
  8935. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8936. return nil, err
  8937. }
  8938. return ret, nil
  8939. // {
  8940. // "description": "Returns a single profile filter link.",
  8941. // "httpMethod": "GET",
  8942. // "id": "analytics.management.profileFilterLinks.get",
  8943. // "parameterOrder": [
  8944. // "accountId",
  8945. // "webPropertyId",
  8946. // "profileId",
  8947. // "linkId"
  8948. // ],
  8949. // "parameters": {
  8950. // "accountId": {
  8951. // "description": "Account ID to retrieve profile filter link for.",
  8952. // "location": "path",
  8953. // "pattern": "\\d+",
  8954. // "required": true,
  8955. // "type": "string"
  8956. // },
  8957. // "linkId": {
  8958. // "description": "ID of the profile filter link.",
  8959. // "location": "path",
  8960. // "pattern": "\\d+:\\d+",
  8961. // "required": true,
  8962. // "type": "string"
  8963. // },
  8964. // "profileId": {
  8965. // "description": "Profile ID to retrieve filter link for.",
  8966. // "location": "path",
  8967. // "pattern": "\\d+",
  8968. // "required": true,
  8969. // "type": "string"
  8970. // },
  8971. // "webPropertyId": {
  8972. // "description": "Web property Id to retrieve profile filter link for.",
  8973. // "location": "path",
  8974. // "pattern": "UA-(\\d+)-(\\d+)",
  8975. // "required": true,
  8976. // "type": "string"
  8977. // }
  8978. // },
  8979. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  8980. // "response": {
  8981. // "$ref": "ProfileFilterLink"
  8982. // },
  8983. // "scopes": [
  8984. // "https://www.googleapis.com/auth/analytics.edit",
  8985. // "https://www.googleapis.com/auth/analytics.readonly"
  8986. // ]
  8987. // }
  8988. }
  8989. // method id "analytics.management.profileFilterLinks.insert":
  8990. type ManagementProfileFilterLinksInsertCall struct {
  8991. s *Service
  8992. accountId string
  8993. webPropertyId string
  8994. profileId string
  8995. profilefilterlink *ProfileFilterLink
  8996. urlParams_ gensupport.URLParams
  8997. ctx_ context.Context
  8998. }
  8999. // Insert: Create a new profile filter link.
  9000. func (r *ManagementProfileFilterLinksService) Insert(accountId string, webPropertyId string, profileId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksInsertCall {
  9001. c := &ManagementProfileFilterLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9002. c.accountId = accountId
  9003. c.webPropertyId = webPropertyId
  9004. c.profileId = profileId
  9005. c.profilefilterlink = profilefilterlink
  9006. return c
  9007. }
  9008. // Fields allows partial responses to be retrieved. See
  9009. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9010. // for more information.
  9011. func (c *ManagementProfileFilterLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksInsertCall {
  9012. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9013. return c
  9014. }
  9015. // Context sets the context to be used in this call's Do method. Any
  9016. // pending HTTP request will be aborted if the provided context is
  9017. // canceled.
  9018. func (c *ManagementProfileFilterLinksInsertCall) Context(ctx context.Context) *ManagementProfileFilterLinksInsertCall {
  9019. c.ctx_ = ctx
  9020. return c
  9021. }
  9022. func (c *ManagementProfileFilterLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  9023. var body io.Reader = nil
  9024. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  9025. if err != nil {
  9026. return nil, err
  9027. }
  9028. ctype := "application/json"
  9029. c.urlParams_.Set("alt", alt)
  9030. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks")
  9031. urls += "?" + c.urlParams_.Encode()
  9032. req, _ := http.NewRequest("POST", urls, body)
  9033. googleapi.Expand(req.URL, map[string]string{
  9034. "accountId": c.accountId,
  9035. "webPropertyId": c.webPropertyId,
  9036. "profileId": c.profileId,
  9037. })
  9038. req.Header.Set("Content-Type", ctype)
  9039. req.Header.Set("User-Agent", c.s.userAgent())
  9040. if c.ctx_ != nil {
  9041. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9042. }
  9043. return c.s.client.Do(req)
  9044. }
  9045. // Do executes the "analytics.management.profileFilterLinks.insert" call.
  9046. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  9047. // non-2xx status code is an error. Response headers are in either
  9048. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  9049. // returned at all) in error.(*googleapi.Error).Header. Use
  9050. // googleapi.IsNotModified to check whether the returned error was
  9051. // because http.StatusNotModified was returned.
  9052. func (c *ManagementProfileFilterLinksInsertCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  9053. gensupport.SetOptions(c.urlParams_, opts...)
  9054. res, err := c.doRequest("json")
  9055. if res != nil && res.StatusCode == http.StatusNotModified {
  9056. if res.Body != nil {
  9057. res.Body.Close()
  9058. }
  9059. return nil, &googleapi.Error{
  9060. Code: res.StatusCode,
  9061. Header: res.Header,
  9062. }
  9063. }
  9064. if err != nil {
  9065. return nil, err
  9066. }
  9067. defer googleapi.CloseBody(res)
  9068. if err := googleapi.CheckResponse(res); err != nil {
  9069. return nil, err
  9070. }
  9071. ret := &ProfileFilterLink{
  9072. ServerResponse: googleapi.ServerResponse{
  9073. Header: res.Header,
  9074. HTTPStatusCode: res.StatusCode,
  9075. },
  9076. }
  9077. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9078. return nil, err
  9079. }
  9080. return ret, nil
  9081. // {
  9082. // "description": "Create a new profile filter link.",
  9083. // "httpMethod": "POST",
  9084. // "id": "analytics.management.profileFilterLinks.insert",
  9085. // "parameterOrder": [
  9086. // "accountId",
  9087. // "webPropertyId",
  9088. // "profileId"
  9089. // ],
  9090. // "parameters": {
  9091. // "accountId": {
  9092. // "description": "Account ID to create profile filter link for.",
  9093. // "location": "path",
  9094. // "pattern": "\\d+",
  9095. // "required": true,
  9096. // "type": "string"
  9097. // },
  9098. // "profileId": {
  9099. // "description": "Profile ID to create filter link for.",
  9100. // "location": "path",
  9101. // "pattern": "\\d+",
  9102. // "required": true,
  9103. // "type": "string"
  9104. // },
  9105. // "webPropertyId": {
  9106. // "description": "Web property Id to create profile filter link for.",
  9107. // "location": "path",
  9108. // "pattern": "UA-(\\d+)-(\\d+)",
  9109. // "required": true,
  9110. // "type": "string"
  9111. // }
  9112. // },
  9113. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks",
  9114. // "request": {
  9115. // "$ref": "ProfileFilterLink"
  9116. // },
  9117. // "response": {
  9118. // "$ref": "ProfileFilterLink"
  9119. // },
  9120. // "scopes": [
  9121. // "https://www.googleapis.com/auth/analytics.edit"
  9122. // ]
  9123. // }
  9124. }
  9125. // method id "analytics.management.profileFilterLinks.list":
  9126. type ManagementProfileFilterLinksListCall struct {
  9127. s *Service
  9128. accountId string
  9129. webPropertyId string
  9130. profileId string
  9131. urlParams_ gensupport.URLParams
  9132. ifNoneMatch_ string
  9133. ctx_ context.Context
  9134. }
  9135. // List: Lists all profile filter links for a profile.
  9136. func (r *ManagementProfileFilterLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileFilterLinksListCall {
  9137. c := &ManagementProfileFilterLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9138. c.accountId = accountId
  9139. c.webPropertyId = webPropertyId
  9140. c.profileId = profileId
  9141. return c
  9142. }
  9143. // MaxResults sets the optional parameter "max-results": The maximum
  9144. // number of profile filter links to include in this response.
  9145. func (c *ManagementProfileFilterLinksListCall) MaxResults(maxResults int64) *ManagementProfileFilterLinksListCall {
  9146. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  9147. return c
  9148. }
  9149. // StartIndex sets the optional parameter "start-index": An index of the
  9150. // first entity to retrieve. Use this parameter as a pagination
  9151. // mechanism along with the max-results parameter.
  9152. func (c *ManagementProfileFilterLinksListCall) StartIndex(startIndex int64) *ManagementProfileFilterLinksListCall {
  9153. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  9154. return c
  9155. }
  9156. // Fields allows partial responses to be retrieved. See
  9157. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9158. // for more information.
  9159. func (c *ManagementProfileFilterLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksListCall {
  9160. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9161. return c
  9162. }
  9163. // IfNoneMatch sets the optional parameter which makes the operation
  9164. // fail if the object's ETag matches the given value. This is useful for
  9165. // getting updates only after the object has changed since the last
  9166. // request. Use googleapi.IsNotModified to check whether the response
  9167. // error from Do is the result of In-None-Match.
  9168. func (c *ManagementProfileFilterLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksListCall {
  9169. c.ifNoneMatch_ = entityTag
  9170. return c
  9171. }
  9172. // Context sets the context to be used in this call's Do method. Any
  9173. // pending HTTP request will be aborted if the provided context is
  9174. // canceled.
  9175. func (c *ManagementProfileFilterLinksListCall) Context(ctx context.Context) *ManagementProfileFilterLinksListCall {
  9176. c.ctx_ = ctx
  9177. return c
  9178. }
  9179. func (c *ManagementProfileFilterLinksListCall) doRequest(alt string) (*http.Response, error) {
  9180. var body io.Reader = nil
  9181. c.urlParams_.Set("alt", alt)
  9182. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks")
  9183. urls += "?" + c.urlParams_.Encode()
  9184. req, _ := http.NewRequest("GET", urls, body)
  9185. googleapi.Expand(req.URL, map[string]string{
  9186. "accountId": c.accountId,
  9187. "webPropertyId": c.webPropertyId,
  9188. "profileId": c.profileId,
  9189. })
  9190. req.Header.Set("User-Agent", c.s.userAgent())
  9191. if c.ifNoneMatch_ != "" {
  9192. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9193. }
  9194. if c.ctx_ != nil {
  9195. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9196. }
  9197. return c.s.client.Do(req)
  9198. }
  9199. // Do executes the "analytics.management.profileFilterLinks.list" call.
  9200. // Exactly one of *ProfileFilterLinks or error will be non-nil. Any
  9201. // non-2xx status code is an error. Response headers are in either
  9202. // *ProfileFilterLinks.ServerResponse.Header or (if a response was
  9203. // returned at all) in error.(*googleapi.Error).Header. Use
  9204. // googleapi.IsNotModified to check whether the returned error was
  9205. // because http.StatusNotModified was returned.
  9206. func (c *ManagementProfileFilterLinksListCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLinks, error) {
  9207. gensupport.SetOptions(c.urlParams_, opts...)
  9208. res, err := c.doRequest("json")
  9209. if res != nil && res.StatusCode == http.StatusNotModified {
  9210. if res.Body != nil {
  9211. res.Body.Close()
  9212. }
  9213. return nil, &googleapi.Error{
  9214. Code: res.StatusCode,
  9215. Header: res.Header,
  9216. }
  9217. }
  9218. if err != nil {
  9219. return nil, err
  9220. }
  9221. defer googleapi.CloseBody(res)
  9222. if err := googleapi.CheckResponse(res); err != nil {
  9223. return nil, err
  9224. }
  9225. ret := &ProfileFilterLinks{
  9226. ServerResponse: googleapi.ServerResponse{
  9227. Header: res.Header,
  9228. HTTPStatusCode: res.StatusCode,
  9229. },
  9230. }
  9231. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9232. return nil, err
  9233. }
  9234. return ret, nil
  9235. // {
  9236. // "description": "Lists all profile filter links for a profile.",
  9237. // "httpMethod": "GET",
  9238. // "id": "analytics.management.profileFilterLinks.list",
  9239. // "parameterOrder": [
  9240. // "accountId",
  9241. // "webPropertyId",
  9242. // "profileId"
  9243. // ],
  9244. // "parameters": {
  9245. // "accountId": {
  9246. // "description": "Account ID to retrieve profile filter links for.",
  9247. // "location": "path",
  9248. // "pattern": "\\d+",
  9249. // "required": true,
  9250. // "type": "string"
  9251. // },
  9252. // "max-results": {
  9253. // "description": "The maximum number of profile filter links to include in this response.",
  9254. // "format": "int32",
  9255. // "location": "query",
  9256. // "type": "integer"
  9257. // },
  9258. // "profileId": {
  9259. // "description": "Profile ID to retrieve filter links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to.",
  9260. // "location": "path",
  9261. // "required": true,
  9262. // "type": "string"
  9263. // },
  9264. // "start-index": {
  9265. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  9266. // "format": "int32",
  9267. // "location": "query",
  9268. // "minimum": "1",
  9269. // "type": "integer"
  9270. // },
  9271. // "webPropertyId": {
  9272. // "description": "Web property Id for profile filter links for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.",
  9273. // "location": "path",
  9274. // "required": true,
  9275. // "type": "string"
  9276. // }
  9277. // },
  9278. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks",
  9279. // "response": {
  9280. // "$ref": "ProfileFilterLinks"
  9281. // },
  9282. // "scopes": [
  9283. // "https://www.googleapis.com/auth/analytics.edit",
  9284. // "https://www.googleapis.com/auth/analytics.readonly"
  9285. // ]
  9286. // }
  9287. }
  9288. // method id "analytics.management.profileFilterLinks.patch":
  9289. type ManagementProfileFilterLinksPatchCall struct {
  9290. s *Service
  9291. accountId string
  9292. webPropertyId string
  9293. profileId string
  9294. linkId string
  9295. profilefilterlink *ProfileFilterLink
  9296. urlParams_ gensupport.URLParams
  9297. ctx_ context.Context
  9298. }
  9299. // Patch: Update an existing profile filter link. This method supports
  9300. // patch semantics.
  9301. func (r *ManagementProfileFilterLinksService) Patch(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksPatchCall {
  9302. c := &ManagementProfileFilterLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9303. c.accountId = accountId
  9304. c.webPropertyId = webPropertyId
  9305. c.profileId = profileId
  9306. c.linkId = linkId
  9307. c.profilefilterlink = profilefilterlink
  9308. return c
  9309. }
  9310. // Fields allows partial responses to be retrieved. See
  9311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9312. // for more information.
  9313. func (c *ManagementProfileFilterLinksPatchCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksPatchCall {
  9314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9315. return c
  9316. }
  9317. // Context sets the context to be used in this call's Do method. Any
  9318. // pending HTTP request will be aborted if the provided context is
  9319. // canceled.
  9320. func (c *ManagementProfileFilterLinksPatchCall) Context(ctx context.Context) *ManagementProfileFilterLinksPatchCall {
  9321. c.ctx_ = ctx
  9322. return c
  9323. }
  9324. func (c *ManagementProfileFilterLinksPatchCall) doRequest(alt string) (*http.Response, error) {
  9325. var body io.Reader = nil
  9326. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  9327. if err != nil {
  9328. return nil, err
  9329. }
  9330. ctype := "application/json"
  9331. c.urlParams_.Set("alt", alt)
  9332. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  9333. urls += "?" + c.urlParams_.Encode()
  9334. req, _ := http.NewRequest("PATCH", urls, body)
  9335. googleapi.Expand(req.URL, map[string]string{
  9336. "accountId": c.accountId,
  9337. "webPropertyId": c.webPropertyId,
  9338. "profileId": c.profileId,
  9339. "linkId": c.linkId,
  9340. })
  9341. req.Header.Set("Content-Type", ctype)
  9342. req.Header.Set("User-Agent", c.s.userAgent())
  9343. if c.ctx_ != nil {
  9344. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9345. }
  9346. return c.s.client.Do(req)
  9347. }
  9348. // Do executes the "analytics.management.profileFilterLinks.patch" call.
  9349. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  9350. // non-2xx status code is an error. Response headers are in either
  9351. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  9352. // returned at all) in error.(*googleapi.Error).Header. Use
  9353. // googleapi.IsNotModified to check whether the returned error was
  9354. // because http.StatusNotModified was returned.
  9355. func (c *ManagementProfileFilterLinksPatchCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  9356. gensupport.SetOptions(c.urlParams_, opts...)
  9357. res, err := c.doRequest("json")
  9358. if res != nil && res.StatusCode == http.StatusNotModified {
  9359. if res.Body != nil {
  9360. res.Body.Close()
  9361. }
  9362. return nil, &googleapi.Error{
  9363. Code: res.StatusCode,
  9364. Header: res.Header,
  9365. }
  9366. }
  9367. if err != nil {
  9368. return nil, err
  9369. }
  9370. defer googleapi.CloseBody(res)
  9371. if err := googleapi.CheckResponse(res); err != nil {
  9372. return nil, err
  9373. }
  9374. ret := &ProfileFilterLink{
  9375. ServerResponse: googleapi.ServerResponse{
  9376. Header: res.Header,
  9377. HTTPStatusCode: res.StatusCode,
  9378. },
  9379. }
  9380. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9381. return nil, err
  9382. }
  9383. return ret, nil
  9384. // {
  9385. // "description": "Update an existing profile filter link. This method supports patch semantics.",
  9386. // "httpMethod": "PATCH",
  9387. // "id": "analytics.management.profileFilterLinks.patch",
  9388. // "parameterOrder": [
  9389. // "accountId",
  9390. // "webPropertyId",
  9391. // "profileId",
  9392. // "linkId"
  9393. // ],
  9394. // "parameters": {
  9395. // "accountId": {
  9396. // "description": "Account ID to which profile filter link belongs.",
  9397. // "location": "path",
  9398. // "pattern": "\\d+",
  9399. // "required": true,
  9400. // "type": "string"
  9401. // },
  9402. // "linkId": {
  9403. // "description": "ID of the profile filter link to be updated.",
  9404. // "location": "path",
  9405. // "pattern": "\\d+:\\d+",
  9406. // "required": true,
  9407. // "type": "string"
  9408. // },
  9409. // "profileId": {
  9410. // "description": "Profile ID to which filter link belongs",
  9411. // "location": "path",
  9412. // "pattern": "\\d+",
  9413. // "required": true,
  9414. // "type": "string"
  9415. // },
  9416. // "webPropertyId": {
  9417. // "description": "Web property Id to which profile filter link belongs",
  9418. // "location": "path",
  9419. // "pattern": "UA-(\\d+)-(\\d+)",
  9420. // "required": true,
  9421. // "type": "string"
  9422. // }
  9423. // },
  9424. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  9425. // "request": {
  9426. // "$ref": "ProfileFilterLink"
  9427. // },
  9428. // "response": {
  9429. // "$ref": "ProfileFilterLink"
  9430. // },
  9431. // "scopes": [
  9432. // "https://www.googleapis.com/auth/analytics.edit"
  9433. // ]
  9434. // }
  9435. }
  9436. // method id "analytics.management.profileFilterLinks.update":
  9437. type ManagementProfileFilterLinksUpdateCall struct {
  9438. s *Service
  9439. accountId string
  9440. webPropertyId string
  9441. profileId string
  9442. linkId string
  9443. profilefilterlink *ProfileFilterLink
  9444. urlParams_ gensupport.URLParams
  9445. ctx_ context.Context
  9446. }
  9447. // Update: Update an existing profile filter link.
  9448. func (r *ManagementProfileFilterLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksUpdateCall {
  9449. c := &ManagementProfileFilterLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9450. c.accountId = accountId
  9451. c.webPropertyId = webPropertyId
  9452. c.profileId = profileId
  9453. c.linkId = linkId
  9454. c.profilefilterlink = profilefilterlink
  9455. return c
  9456. }
  9457. // Fields allows partial responses to be retrieved. See
  9458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9459. // for more information.
  9460. func (c *ManagementProfileFilterLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksUpdateCall {
  9461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9462. return c
  9463. }
  9464. // Context sets the context to be used in this call's Do method. Any
  9465. // pending HTTP request will be aborted if the provided context is
  9466. // canceled.
  9467. func (c *ManagementProfileFilterLinksUpdateCall) Context(ctx context.Context) *ManagementProfileFilterLinksUpdateCall {
  9468. c.ctx_ = ctx
  9469. return c
  9470. }
  9471. func (c *ManagementProfileFilterLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  9472. var body io.Reader = nil
  9473. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  9474. if err != nil {
  9475. return nil, err
  9476. }
  9477. ctype := "application/json"
  9478. c.urlParams_.Set("alt", alt)
  9479. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  9480. urls += "?" + c.urlParams_.Encode()
  9481. req, _ := http.NewRequest("PUT", urls, body)
  9482. googleapi.Expand(req.URL, map[string]string{
  9483. "accountId": c.accountId,
  9484. "webPropertyId": c.webPropertyId,
  9485. "profileId": c.profileId,
  9486. "linkId": c.linkId,
  9487. })
  9488. req.Header.Set("Content-Type", ctype)
  9489. req.Header.Set("User-Agent", c.s.userAgent())
  9490. if c.ctx_ != nil {
  9491. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9492. }
  9493. return c.s.client.Do(req)
  9494. }
  9495. // Do executes the "analytics.management.profileFilterLinks.update" call.
  9496. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  9497. // non-2xx status code is an error. Response headers are in either
  9498. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  9499. // returned at all) in error.(*googleapi.Error).Header. Use
  9500. // googleapi.IsNotModified to check whether the returned error was
  9501. // because http.StatusNotModified was returned.
  9502. func (c *ManagementProfileFilterLinksUpdateCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  9503. gensupport.SetOptions(c.urlParams_, opts...)
  9504. res, err := c.doRequest("json")
  9505. if res != nil && res.StatusCode == http.StatusNotModified {
  9506. if res.Body != nil {
  9507. res.Body.Close()
  9508. }
  9509. return nil, &googleapi.Error{
  9510. Code: res.StatusCode,
  9511. Header: res.Header,
  9512. }
  9513. }
  9514. if err != nil {
  9515. return nil, err
  9516. }
  9517. defer googleapi.CloseBody(res)
  9518. if err := googleapi.CheckResponse(res); err != nil {
  9519. return nil, err
  9520. }
  9521. ret := &ProfileFilterLink{
  9522. ServerResponse: googleapi.ServerResponse{
  9523. Header: res.Header,
  9524. HTTPStatusCode: res.StatusCode,
  9525. },
  9526. }
  9527. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9528. return nil, err
  9529. }
  9530. return ret, nil
  9531. // {
  9532. // "description": "Update an existing profile filter link.",
  9533. // "httpMethod": "PUT",
  9534. // "id": "analytics.management.profileFilterLinks.update",
  9535. // "parameterOrder": [
  9536. // "accountId",
  9537. // "webPropertyId",
  9538. // "profileId",
  9539. // "linkId"
  9540. // ],
  9541. // "parameters": {
  9542. // "accountId": {
  9543. // "description": "Account ID to which profile filter link belongs.",
  9544. // "location": "path",
  9545. // "pattern": "\\d+",
  9546. // "required": true,
  9547. // "type": "string"
  9548. // },
  9549. // "linkId": {
  9550. // "description": "ID of the profile filter link to be updated.",
  9551. // "location": "path",
  9552. // "pattern": "\\d+:\\d+",
  9553. // "required": true,
  9554. // "type": "string"
  9555. // },
  9556. // "profileId": {
  9557. // "description": "Profile ID to which filter link belongs",
  9558. // "location": "path",
  9559. // "pattern": "\\d+",
  9560. // "required": true,
  9561. // "type": "string"
  9562. // },
  9563. // "webPropertyId": {
  9564. // "description": "Web property Id to which profile filter link belongs",
  9565. // "location": "path",
  9566. // "pattern": "UA-(\\d+)-(\\d+)",
  9567. // "required": true,
  9568. // "type": "string"
  9569. // }
  9570. // },
  9571. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  9572. // "request": {
  9573. // "$ref": "ProfileFilterLink"
  9574. // },
  9575. // "response": {
  9576. // "$ref": "ProfileFilterLink"
  9577. // },
  9578. // "scopes": [
  9579. // "https://www.googleapis.com/auth/analytics.edit"
  9580. // ]
  9581. // }
  9582. }
  9583. // method id "analytics.management.profileUserLinks.delete":
  9584. type ManagementProfileUserLinksDeleteCall struct {
  9585. s *Service
  9586. accountId string
  9587. webPropertyId string
  9588. profileId string
  9589. linkId string
  9590. urlParams_ gensupport.URLParams
  9591. ctx_ context.Context
  9592. }
  9593. // Delete: Removes a user from the given view (profile).
  9594. func (r *ManagementProfileUserLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileUserLinksDeleteCall {
  9595. c := &ManagementProfileUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9596. c.accountId = accountId
  9597. c.webPropertyId = webPropertyId
  9598. c.profileId = profileId
  9599. c.linkId = linkId
  9600. return c
  9601. }
  9602. // Fields allows partial responses to be retrieved. See
  9603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9604. // for more information.
  9605. func (c *ManagementProfileUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksDeleteCall {
  9606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9607. return c
  9608. }
  9609. // Context sets the context to be used in this call's Do method. Any
  9610. // pending HTTP request will be aborted if the provided context is
  9611. // canceled.
  9612. func (c *ManagementProfileUserLinksDeleteCall) Context(ctx context.Context) *ManagementProfileUserLinksDeleteCall {
  9613. c.ctx_ = ctx
  9614. return c
  9615. }
  9616. func (c *ManagementProfileUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  9617. var body io.Reader = nil
  9618. c.urlParams_.Set("alt", alt)
  9619. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}")
  9620. urls += "?" + c.urlParams_.Encode()
  9621. req, _ := http.NewRequest("DELETE", urls, body)
  9622. googleapi.Expand(req.URL, map[string]string{
  9623. "accountId": c.accountId,
  9624. "webPropertyId": c.webPropertyId,
  9625. "profileId": c.profileId,
  9626. "linkId": c.linkId,
  9627. })
  9628. req.Header.Set("User-Agent", c.s.userAgent())
  9629. if c.ctx_ != nil {
  9630. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9631. }
  9632. return c.s.client.Do(req)
  9633. }
  9634. // Do executes the "analytics.management.profileUserLinks.delete" call.
  9635. func (c *ManagementProfileUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  9636. gensupport.SetOptions(c.urlParams_, opts...)
  9637. res, err := c.doRequest("json")
  9638. if err != nil {
  9639. return err
  9640. }
  9641. defer googleapi.CloseBody(res)
  9642. if err := googleapi.CheckResponse(res); err != nil {
  9643. return err
  9644. }
  9645. return nil
  9646. // {
  9647. // "description": "Removes a user from the given view (profile).",
  9648. // "httpMethod": "DELETE",
  9649. // "id": "analytics.management.profileUserLinks.delete",
  9650. // "parameterOrder": [
  9651. // "accountId",
  9652. // "webPropertyId",
  9653. // "profileId",
  9654. // "linkId"
  9655. // ],
  9656. // "parameters": {
  9657. // "accountId": {
  9658. // "description": "Account ID to delete the user link for.",
  9659. // "location": "path",
  9660. // "required": true,
  9661. // "type": "string"
  9662. // },
  9663. // "linkId": {
  9664. // "description": "Link ID to delete the user link for.",
  9665. // "location": "path",
  9666. // "required": true,
  9667. // "type": "string"
  9668. // },
  9669. // "profileId": {
  9670. // "description": "View (Profile) ID to delete the user link for.",
  9671. // "location": "path",
  9672. // "required": true,
  9673. // "type": "string"
  9674. // },
  9675. // "webPropertyId": {
  9676. // "description": "Web Property ID to delete the user link for.",
  9677. // "location": "path",
  9678. // "required": true,
  9679. // "type": "string"
  9680. // }
  9681. // },
  9682. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}",
  9683. // "scopes": [
  9684. // "https://www.googleapis.com/auth/analytics.manage.users"
  9685. // ]
  9686. // }
  9687. }
  9688. // method id "analytics.management.profileUserLinks.insert":
  9689. type ManagementProfileUserLinksInsertCall struct {
  9690. s *Service
  9691. accountId string
  9692. webPropertyId string
  9693. profileId string
  9694. entityuserlink *EntityUserLink
  9695. urlParams_ gensupport.URLParams
  9696. ctx_ context.Context
  9697. }
  9698. // Insert: Adds a new user to the given view (profile).
  9699. func (r *ManagementProfileUserLinksService) Insert(accountId string, webPropertyId string, profileId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksInsertCall {
  9700. c := &ManagementProfileUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9701. c.accountId = accountId
  9702. c.webPropertyId = webPropertyId
  9703. c.profileId = profileId
  9704. c.entityuserlink = entityuserlink
  9705. return c
  9706. }
  9707. // Fields allows partial responses to be retrieved. See
  9708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9709. // for more information.
  9710. func (c *ManagementProfileUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksInsertCall {
  9711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9712. return c
  9713. }
  9714. // Context sets the context to be used in this call's Do method. Any
  9715. // pending HTTP request will be aborted if the provided context is
  9716. // canceled.
  9717. func (c *ManagementProfileUserLinksInsertCall) Context(ctx context.Context) *ManagementProfileUserLinksInsertCall {
  9718. c.ctx_ = ctx
  9719. return c
  9720. }
  9721. func (c *ManagementProfileUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  9722. var body io.Reader = nil
  9723. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  9724. if err != nil {
  9725. return nil, err
  9726. }
  9727. ctype := "application/json"
  9728. c.urlParams_.Set("alt", alt)
  9729. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks")
  9730. urls += "?" + c.urlParams_.Encode()
  9731. req, _ := http.NewRequest("POST", urls, body)
  9732. googleapi.Expand(req.URL, map[string]string{
  9733. "accountId": c.accountId,
  9734. "webPropertyId": c.webPropertyId,
  9735. "profileId": c.profileId,
  9736. })
  9737. req.Header.Set("Content-Type", ctype)
  9738. req.Header.Set("User-Agent", c.s.userAgent())
  9739. if c.ctx_ != nil {
  9740. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9741. }
  9742. return c.s.client.Do(req)
  9743. }
  9744. // Do executes the "analytics.management.profileUserLinks.insert" call.
  9745. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  9746. // status code is an error. Response headers are in either
  9747. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  9748. // at all) in error.(*googleapi.Error).Header. Use
  9749. // googleapi.IsNotModified to check whether the returned error was
  9750. // because http.StatusNotModified was returned.
  9751. func (c *ManagementProfileUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  9752. gensupport.SetOptions(c.urlParams_, opts...)
  9753. res, err := c.doRequest("json")
  9754. if res != nil && res.StatusCode == http.StatusNotModified {
  9755. if res.Body != nil {
  9756. res.Body.Close()
  9757. }
  9758. return nil, &googleapi.Error{
  9759. Code: res.StatusCode,
  9760. Header: res.Header,
  9761. }
  9762. }
  9763. if err != nil {
  9764. return nil, err
  9765. }
  9766. defer googleapi.CloseBody(res)
  9767. if err := googleapi.CheckResponse(res); err != nil {
  9768. return nil, err
  9769. }
  9770. ret := &EntityUserLink{
  9771. ServerResponse: googleapi.ServerResponse{
  9772. Header: res.Header,
  9773. HTTPStatusCode: res.StatusCode,
  9774. },
  9775. }
  9776. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9777. return nil, err
  9778. }
  9779. return ret, nil
  9780. // {
  9781. // "description": "Adds a new user to the given view (profile).",
  9782. // "httpMethod": "POST",
  9783. // "id": "analytics.management.profileUserLinks.insert",
  9784. // "parameterOrder": [
  9785. // "accountId",
  9786. // "webPropertyId",
  9787. // "profileId"
  9788. // ],
  9789. // "parameters": {
  9790. // "accountId": {
  9791. // "description": "Account ID to create the user link for.",
  9792. // "location": "path",
  9793. // "required": true,
  9794. // "type": "string"
  9795. // },
  9796. // "profileId": {
  9797. // "description": "View (Profile) ID to create the user link for.",
  9798. // "location": "path",
  9799. // "required": true,
  9800. // "type": "string"
  9801. // },
  9802. // "webPropertyId": {
  9803. // "description": "Web Property ID to create the user link for.",
  9804. // "location": "path",
  9805. // "required": true,
  9806. // "type": "string"
  9807. // }
  9808. // },
  9809. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks",
  9810. // "request": {
  9811. // "$ref": "EntityUserLink"
  9812. // },
  9813. // "response": {
  9814. // "$ref": "EntityUserLink"
  9815. // },
  9816. // "scopes": [
  9817. // "https://www.googleapis.com/auth/analytics.manage.users"
  9818. // ]
  9819. // }
  9820. }
  9821. // method id "analytics.management.profileUserLinks.list":
  9822. type ManagementProfileUserLinksListCall struct {
  9823. s *Service
  9824. accountId string
  9825. webPropertyId string
  9826. profileId string
  9827. urlParams_ gensupport.URLParams
  9828. ifNoneMatch_ string
  9829. ctx_ context.Context
  9830. }
  9831. // List: Lists profile-user links for a given view (profile).
  9832. func (r *ManagementProfileUserLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileUserLinksListCall {
  9833. c := &ManagementProfileUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9834. c.accountId = accountId
  9835. c.webPropertyId = webPropertyId
  9836. c.profileId = profileId
  9837. return c
  9838. }
  9839. // MaxResults sets the optional parameter "max-results": The maximum
  9840. // number of profile-user links to include in this response.
  9841. func (c *ManagementProfileUserLinksListCall) MaxResults(maxResults int64) *ManagementProfileUserLinksListCall {
  9842. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  9843. return c
  9844. }
  9845. // StartIndex sets the optional parameter "start-index": An index of the
  9846. // first profile-user link to retrieve. Use this parameter as a
  9847. // pagination mechanism along with the max-results parameter.
  9848. func (c *ManagementProfileUserLinksListCall) StartIndex(startIndex int64) *ManagementProfileUserLinksListCall {
  9849. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  9850. return c
  9851. }
  9852. // Fields allows partial responses to be retrieved. See
  9853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9854. // for more information.
  9855. func (c *ManagementProfileUserLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksListCall {
  9856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9857. return c
  9858. }
  9859. // IfNoneMatch sets the optional parameter which makes the operation
  9860. // fail if the object's ETag matches the given value. This is useful for
  9861. // getting updates only after the object has changed since the last
  9862. // request. Use googleapi.IsNotModified to check whether the response
  9863. // error from Do is the result of In-None-Match.
  9864. func (c *ManagementProfileUserLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileUserLinksListCall {
  9865. c.ifNoneMatch_ = entityTag
  9866. return c
  9867. }
  9868. // Context sets the context to be used in this call's Do method. Any
  9869. // pending HTTP request will be aborted if the provided context is
  9870. // canceled.
  9871. func (c *ManagementProfileUserLinksListCall) Context(ctx context.Context) *ManagementProfileUserLinksListCall {
  9872. c.ctx_ = ctx
  9873. return c
  9874. }
  9875. func (c *ManagementProfileUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  9876. var body io.Reader = nil
  9877. c.urlParams_.Set("alt", alt)
  9878. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks")
  9879. urls += "?" + c.urlParams_.Encode()
  9880. req, _ := http.NewRequest("GET", urls, body)
  9881. googleapi.Expand(req.URL, map[string]string{
  9882. "accountId": c.accountId,
  9883. "webPropertyId": c.webPropertyId,
  9884. "profileId": c.profileId,
  9885. })
  9886. req.Header.Set("User-Agent", c.s.userAgent())
  9887. if c.ifNoneMatch_ != "" {
  9888. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9889. }
  9890. if c.ctx_ != nil {
  9891. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9892. }
  9893. return c.s.client.Do(req)
  9894. }
  9895. // Do executes the "analytics.management.profileUserLinks.list" call.
  9896. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  9897. // status code is an error. Response headers are in either
  9898. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  9899. // at all) in error.(*googleapi.Error).Header. Use
  9900. // googleapi.IsNotModified to check whether the returned error was
  9901. // because http.StatusNotModified was returned.
  9902. func (c *ManagementProfileUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  9903. gensupport.SetOptions(c.urlParams_, opts...)
  9904. res, err := c.doRequest("json")
  9905. if res != nil && res.StatusCode == http.StatusNotModified {
  9906. if res.Body != nil {
  9907. res.Body.Close()
  9908. }
  9909. return nil, &googleapi.Error{
  9910. Code: res.StatusCode,
  9911. Header: res.Header,
  9912. }
  9913. }
  9914. if err != nil {
  9915. return nil, err
  9916. }
  9917. defer googleapi.CloseBody(res)
  9918. if err := googleapi.CheckResponse(res); err != nil {
  9919. return nil, err
  9920. }
  9921. ret := &EntityUserLinks{
  9922. ServerResponse: googleapi.ServerResponse{
  9923. Header: res.Header,
  9924. HTTPStatusCode: res.StatusCode,
  9925. },
  9926. }
  9927. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9928. return nil, err
  9929. }
  9930. return ret, nil
  9931. // {
  9932. // "description": "Lists profile-user links for a given view (profile).",
  9933. // "httpMethod": "GET",
  9934. // "id": "analytics.management.profileUserLinks.list",
  9935. // "parameterOrder": [
  9936. // "accountId",
  9937. // "webPropertyId",
  9938. // "profileId"
  9939. // ],
  9940. // "parameters": {
  9941. // "accountId": {
  9942. // "description": "Account ID which the given view (profile) belongs to.",
  9943. // "location": "path",
  9944. // "required": true,
  9945. // "type": "string"
  9946. // },
  9947. // "max-results": {
  9948. // "description": "The maximum number of profile-user links to include in this response.",
  9949. // "format": "int32",
  9950. // "location": "query",
  9951. // "type": "integer"
  9952. // },
  9953. // "profileId": {
  9954. // "description": "View (Profile) ID to retrieve the profile-user links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to.",
  9955. // "location": "path",
  9956. // "required": true,
  9957. // "type": "string"
  9958. // },
  9959. // "start-index": {
  9960. // "description": "An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  9961. // "format": "int32",
  9962. // "location": "query",
  9963. // "minimum": "1",
  9964. // "type": "integer"
  9965. // },
  9966. // "webPropertyId": {
  9967. // "description": "Web Property ID which the given view (profile) belongs to. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.",
  9968. // "location": "path",
  9969. // "required": true,
  9970. // "type": "string"
  9971. // }
  9972. // },
  9973. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks",
  9974. // "response": {
  9975. // "$ref": "EntityUserLinks"
  9976. // },
  9977. // "scopes": [
  9978. // "https://www.googleapis.com/auth/analytics.manage.users",
  9979. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  9980. // ]
  9981. // }
  9982. }
  9983. // method id "analytics.management.profileUserLinks.update":
  9984. type ManagementProfileUserLinksUpdateCall struct {
  9985. s *Service
  9986. accountId string
  9987. webPropertyId string
  9988. profileId string
  9989. linkId string
  9990. entityuserlink *EntityUserLink
  9991. urlParams_ gensupport.URLParams
  9992. ctx_ context.Context
  9993. }
  9994. // Update: Updates permissions for an existing user on the given view
  9995. // (profile).
  9996. func (r *ManagementProfileUserLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksUpdateCall {
  9997. c := &ManagementProfileUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9998. c.accountId = accountId
  9999. c.webPropertyId = webPropertyId
  10000. c.profileId = profileId
  10001. c.linkId = linkId
  10002. c.entityuserlink = entityuserlink
  10003. return c
  10004. }
  10005. // Fields allows partial responses to be retrieved. See
  10006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10007. // for more information.
  10008. func (c *ManagementProfileUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksUpdateCall {
  10009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10010. return c
  10011. }
  10012. // Context sets the context to be used in this call's Do method. Any
  10013. // pending HTTP request will be aborted if the provided context is
  10014. // canceled.
  10015. func (c *ManagementProfileUserLinksUpdateCall) Context(ctx context.Context) *ManagementProfileUserLinksUpdateCall {
  10016. c.ctx_ = ctx
  10017. return c
  10018. }
  10019. func (c *ManagementProfileUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  10020. var body io.Reader = nil
  10021. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  10022. if err != nil {
  10023. return nil, err
  10024. }
  10025. ctype := "application/json"
  10026. c.urlParams_.Set("alt", alt)
  10027. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}")
  10028. urls += "?" + c.urlParams_.Encode()
  10029. req, _ := http.NewRequest("PUT", urls, body)
  10030. googleapi.Expand(req.URL, map[string]string{
  10031. "accountId": c.accountId,
  10032. "webPropertyId": c.webPropertyId,
  10033. "profileId": c.profileId,
  10034. "linkId": c.linkId,
  10035. })
  10036. req.Header.Set("Content-Type", ctype)
  10037. req.Header.Set("User-Agent", c.s.userAgent())
  10038. if c.ctx_ != nil {
  10039. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10040. }
  10041. return c.s.client.Do(req)
  10042. }
  10043. // Do executes the "analytics.management.profileUserLinks.update" call.
  10044. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  10045. // status code is an error. Response headers are in either
  10046. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  10047. // at all) in error.(*googleapi.Error).Header. Use
  10048. // googleapi.IsNotModified to check whether the returned error was
  10049. // because http.StatusNotModified was returned.
  10050. func (c *ManagementProfileUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  10051. gensupport.SetOptions(c.urlParams_, opts...)
  10052. res, err := c.doRequest("json")
  10053. if res != nil && res.StatusCode == http.StatusNotModified {
  10054. if res.Body != nil {
  10055. res.Body.Close()
  10056. }
  10057. return nil, &googleapi.Error{
  10058. Code: res.StatusCode,
  10059. Header: res.Header,
  10060. }
  10061. }
  10062. if err != nil {
  10063. return nil, err
  10064. }
  10065. defer googleapi.CloseBody(res)
  10066. if err := googleapi.CheckResponse(res); err != nil {
  10067. return nil, err
  10068. }
  10069. ret := &EntityUserLink{
  10070. ServerResponse: googleapi.ServerResponse{
  10071. Header: res.Header,
  10072. HTTPStatusCode: res.StatusCode,
  10073. },
  10074. }
  10075. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10076. return nil, err
  10077. }
  10078. return ret, nil
  10079. // {
  10080. // "description": "Updates permissions for an existing user on the given view (profile).",
  10081. // "httpMethod": "PUT",
  10082. // "id": "analytics.management.profileUserLinks.update",
  10083. // "parameterOrder": [
  10084. // "accountId",
  10085. // "webPropertyId",
  10086. // "profileId",
  10087. // "linkId"
  10088. // ],
  10089. // "parameters": {
  10090. // "accountId": {
  10091. // "description": "Account ID to update the user link for.",
  10092. // "location": "path",
  10093. // "required": true,
  10094. // "type": "string"
  10095. // },
  10096. // "linkId": {
  10097. // "description": "Link ID to update the user link for.",
  10098. // "location": "path",
  10099. // "required": true,
  10100. // "type": "string"
  10101. // },
  10102. // "profileId": {
  10103. // "description": "View (Profile ID) to update the user link for.",
  10104. // "location": "path",
  10105. // "required": true,
  10106. // "type": "string"
  10107. // },
  10108. // "webPropertyId": {
  10109. // "description": "Web Property ID to update the user link for.",
  10110. // "location": "path",
  10111. // "required": true,
  10112. // "type": "string"
  10113. // }
  10114. // },
  10115. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}",
  10116. // "request": {
  10117. // "$ref": "EntityUserLink"
  10118. // },
  10119. // "response": {
  10120. // "$ref": "EntityUserLink"
  10121. // },
  10122. // "scopes": [
  10123. // "https://www.googleapis.com/auth/analytics.manage.users"
  10124. // ]
  10125. // }
  10126. }
  10127. // method id "analytics.management.profiles.delete":
  10128. type ManagementProfilesDeleteCall struct {
  10129. s *Service
  10130. accountId string
  10131. webPropertyId string
  10132. profileId string
  10133. urlParams_ gensupport.URLParams
  10134. ctx_ context.Context
  10135. }
  10136. // Delete: Deletes a view (profile).
  10137. func (r *ManagementProfilesService) Delete(accountId string, webPropertyId string, profileId string) *ManagementProfilesDeleteCall {
  10138. c := &ManagementProfilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10139. c.accountId = accountId
  10140. c.webPropertyId = webPropertyId
  10141. c.profileId = profileId
  10142. return c
  10143. }
  10144. // Fields allows partial responses to be retrieved. See
  10145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10146. // for more information.
  10147. func (c *ManagementProfilesDeleteCall) Fields(s ...googleapi.Field) *ManagementProfilesDeleteCall {
  10148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10149. return c
  10150. }
  10151. // Context sets the context to be used in this call's Do method. Any
  10152. // pending HTTP request will be aborted if the provided context is
  10153. // canceled.
  10154. func (c *ManagementProfilesDeleteCall) Context(ctx context.Context) *ManagementProfilesDeleteCall {
  10155. c.ctx_ = ctx
  10156. return c
  10157. }
  10158. func (c *ManagementProfilesDeleteCall) doRequest(alt string) (*http.Response, error) {
  10159. var body io.Reader = nil
  10160. c.urlParams_.Set("alt", alt)
  10161. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  10162. urls += "?" + c.urlParams_.Encode()
  10163. req, _ := http.NewRequest("DELETE", urls, body)
  10164. googleapi.Expand(req.URL, map[string]string{
  10165. "accountId": c.accountId,
  10166. "webPropertyId": c.webPropertyId,
  10167. "profileId": c.profileId,
  10168. })
  10169. req.Header.Set("User-Agent", c.s.userAgent())
  10170. if c.ctx_ != nil {
  10171. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10172. }
  10173. return c.s.client.Do(req)
  10174. }
  10175. // Do executes the "analytics.management.profiles.delete" call.
  10176. func (c *ManagementProfilesDeleteCall) Do(opts ...googleapi.CallOption) error {
  10177. gensupport.SetOptions(c.urlParams_, opts...)
  10178. res, err := c.doRequest("json")
  10179. if err != nil {
  10180. return err
  10181. }
  10182. defer googleapi.CloseBody(res)
  10183. if err := googleapi.CheckResponse(res); err != nil {
  10184. return err
  10185. }
  10186. return nil
  10187. // {
  10188. // "description": "Deletes a view (profile).",
  10189. // "httpMethod": "DELETE",
  10190. // "id": "analytics.management.profiles.delete",
  10191. // "parameterOrder": [
  10192. // "accountId",
  10193. // "webPropertyId",
  10194. // "profileId"
  10195. // ],
  10196. // "parameters": {
  10197. // "accountId": {
  10198. // "description": "Account ID to delete the view (profile) for.",
  10199. // "location": "path",
  10200. // "required": true,
  10201. // "type": "string"
  10202. // },
  10203. // "profileId": {
  10204. // "description": "ID of the view (profile) to be deleted.",
  10205. // "location": "path",
  10206. // "required": true,
  10207. // "type": "string"
  10208. // },
  10209. // "webPropertyId": {
  10210. // "description": "Web property ID to delete the view (profile) for.",
  10211. // "location": "path",
  10212. // "required": true,
  10213. // "type": "string"
  10214. // }
  10215. // },
  10216. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  10217. // "scopes": [
  10218. // "https://www.googleapis.com/auth/analytics.edit"
  10219. // ]
  10220. // }
  10221. }
  10222. // method id "analytics.management.profiles.get":
  10223. type ManagementProfilesGetCall struct {
  10224. s *Service
  10225. accountId string
  10226. webPropertyId string
  10227. profileId string
  10228. urlParams_ gensupport.URLParams
  10229. ifNoneMatch_ string
  10230. ctx_ context.Context
  10231. }
  10232. // Get: Gets a view (profile) to which the user has access.
  10233. func (r *ManagementProfilesService) Get(accountId string, webPropertyId string, profileId string) *ManagementProfilesGetCall {
  10234. c := &ManagementProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10235. c.accountId = accountId
  10236. c.webPropertyId = webPropertyId
  10237. c.profileId = profileId
  10238. return c
  10239. }
  10240. // Fields allows partial responses to be retrieved. See
  10241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10242. // for more information.
  10243. func (c *ManagementProfilesGetCall) Fields(s ...googleapi.Field) *ManagementProfilesGetCall {
  10244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10245. return c
  10246. }
  10247. // IfNoneMatch sets the optional parameter which makes the operation
  10248. // fail if the object's ETag matches the given value. This is useful for
  10249. // getting updates only after the object has changed since the last
  10250. // request. Use googleapi.IsNotModified to check whether the response
  10251. // error from Do is the result of In-None-Match.
  10252. func (c *ManagementProfilesGetCall) IfNoneMatch(entityTag string) *ManagementProfilesGetCall {
  10253. c.ifNoneMatch_ = entityTag
  10254. return c
  10255. }
  10256. // Context sets the context to be used in this call's Do method. Any
  10257. // pending HTTP request will be aborted if the provided context is
  10258. // canceled.
  10259. func (c *ManagementProfilesGetCall) Context(ctx context.Context) *ManagementProfilesGetCall {
  10260. c.ctx_ = ctx
  10261. return c
  10262. }
  10263. func (c *ManagementProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  10264. var body io.Reader = nil
  10265. c.urlParams_.Set("alt", alt)
  10266. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  10267. urls += "?" + c.urlParams_.Encode()
  10268. req, _ := http.NewRequest("GET", urls, body)
  10269. googleapi.Expand(req.URL, map[string]string{
  10270. "accountId": c.accountId,
  10271. "webPropertyId": c.webPropertyId,
  10272. "profileId": c.profileId,
  10273. })
  10274. req.Header.Set("User-Agent", c.s.userAgent())
  10275. if c.ifNoneMatch_ != "" {
  10276. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10277. }
  10278. if c.ctx_ != nil {
  10279. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10280. }
  10281. return c.s.client.Do(req)
  10282. }
  10283. // Do executes the "analytics.management.profiles.get" call.
  10284. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  10285. // code is an error. Response headers are in either
  10286. // *Profile.ServerResponse.Header or (if a response was returned at all)
  10287. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10288. // check whether the returned error was because http.StatusNotModified
  10289. // was returned.
  10290. func (c *ManagementProfilesGetCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  10291. gensupport.SetOptions(c.urlParams_, opts...)
  10292. res, err := c.doRequest("json")
  10293. if res != nil && res.StatusCode == http.StatusNotModified {
  10294. if res.Body != nil {
  10295. res.Body.Close()
  10296. }
  10297. return nil, &googleapi.Error{
  10298. Code: res.StatusCode,
  10299. Header: res.Header,
  10300. }
  10301. }
  10302. if err != nil {
  10303. return nil, err
  10304. }
  10305. defer googleapi.CloseBody(res)
  10306. if err := googleapi.CheckResponse(res); err != nil {
  10307. return nil, err
  10308. }
  10309. ret := &Profile{
  10310. ServerResponse: googleapi.ServerResponse{
  10311. Header: res.Header,
  10312. HTTPStatusCode: res.StatusCode,
  10313. },
  10314. }
  10315. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10316. return nil, err
  10317. }
  10318. return ret, nil
  10319. // {
  10320. // "description": "Gets a view (profile) to which the user has access.",
  10321. // "httpMethod": "GET",
  10322. // "id": "analytics.management.profiles.get",
  10323. // "parameterOrder": [
  10324. // "accountId",
  10325. // "webPropertyId",
  10326. // "profileId"
  10327. // ],
  10328. // "parameters": {
  10329. // "accountId": {
  10330. // "description": "Account ID to retrieve the goal for.",
  10331. // "location": "path",
  10332. // "pattern": "[0-9]+",
  10333. // "required": true,
  10334. // "type": "string"
  10335. // },
  10336. // "profileId": {
  10337. // "description": "View (Profile) ID to retrieve the goal for.",
  10338. // "location": "path",
  10339. // "pattern": "[0-9]+",
  10340. // "required": true,
  10341. // "type": "string"
  10342. // },
  10343. // "webPropertyId": {
  10344. // "description": "Web property ID to retrieve the goal for.",
  10345. // "location": "path",
  10346. // "pattern": "UA-[0-9]+-[0-9]+",
  10347. // "required": true,
  10348. // "type": "string"
  10349. // }
  10350. // },
  10351. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  10352. // "response": {
  10353. // "$ref": "Profile"
  10354. // },
  10355. // "scopes": [
  10356. // "https://www.googleapis.com/auth/analytics.edit",
  10357. // "https://www.googleapis.com/auth/analytics.readonly"
  10358. // ]
  10359. // }
  10360. }
  10361. // method id "analytics.management.profiles.insert":
  10362. type ManagementProfilesInsertCall struct {
  10363. s *Service
  10364. accountId string
  10365. webPropertyId string
  10366. profile *Profile
  10367. urlParams_ gensupport.URLParams
  10368. ctx_ context.Context
  10369. }
  10370. // Insert: Create a new view (profile).
  10371. func (r *ManagementProfilesService) Insert(accountId string, webPropertyId string, profile *Profile) *ManagementProfilesInsertCall {
  10372. c := &ManagementProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10373. c.accountId = accountId
  10374. c.webPropertyId = webPropertyId
  10375. c.profile = profile
  10376. return c
  10377. }
  10378. // Fields allows partial responses to be retrieved. See
  10379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10380. // for more information.
  10381. func (c *ManagementProfilesInsertCall) Fields(s ...googleapi.Field) *ManagementProfilesInsertCall {
  10382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10383. return c
  10384. }
  10385. // Context sets the context to be used in this call's Do method. Any
  10386. // pending HTTP request will be aborted if the provided context is
  10387. // canceled.
  10388. func (c *ManagementProfilesInsertCall) Context(ctx context.Context) *ManagementProfilesInsertCall {
  10389. c.ctx_ = ctx
  10390. return c
  10391. }
  10392. func (c *ManagementProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  10393. var body io.Reader = nil
  10394. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  10395. if err != nil {
  10396. return nil, err
  10397. }
  10398. ctype := "application/json"
  10399. c.urlParams_.Set("alt", alt)
  10400. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles")
  10401. urls += "?" + c.urlParams_.Encode()
  10402. req, _ := http.NewRequest("POST", urls, body)
  10403. googleapi.Expand(req.URL, map[string]string{
  10404. "accountId": c.accountId,
  10405. "webPropertyId": c.webPropertyId,
  10406. })
  10407. req.Header.Set("Content-Type", ctype)
  10408. req.Header.Set("User-Agent", c.s.userAgent())
  10409. if c.ctx_ != nil {
  10410. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10411. }
  10412. return c.s.client.Do(req)
  10413. }
  10414. // Do executes the "analytics.management.profiles.insert" call.
  10415. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  10416. // code is an error. Response headers are in either
  10417. // *Profile.ServerResponse.Header or (if a response was returned at all)
  10418. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10419. // check whether the returned error was because http.StatusNotModified
  10420. // was returned.
  10421. func (c *ManagementProfilesInsertCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  10422. gensupport.SetOptions(c.urlParams_, opts...)
  10423. res, err := c.doRequest("json")
  10424. if res != nil && res.StatusCode == http.StatusNotModified {
  10425. if res.Body != nil {
  10426. res.Body.Close()
  10427. }
  10428. return nil, &googleapi.Error{
  10429. Code: res.StatusCode,
  10430. Header: res.Header,
  10431. }
  10432. }
  10433. if err != nil {
  10434. return nil, err
  10435. }
  10436. defer googleapi.CloseBody(res)
  10437. if err := googleapi.CheckResponse(res); err != nil {
  10438. return nil, err
  10439. }
  10440. ret := &Profile{
  10441. ServerResponse: googleapi.ServerResponse{
  10442. Header: res.Header,
  10443. HTTPStatusCode: res.StatusCode,
  10444. },
  10445. }
  10446. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10447. return nil, err
  10448. }
  10449. return ret, nil
  10450. // {
  10451. // "description": "Create a new view (profile).",
  10452. // "httpMethod": "POST",
  10453. // "id": "analytics.management.profiles.insert",
  10454. // "parameterOrder": [
  10455. // "accountId",
  10456. // "webPropertyId"
  10457. // ],
  10458. // "parameters": {
  10459. // "accountId": {
  10460. // "description": "Account ID to create the view (profile) for.",
  10461. // "location": "path",
  10462. // "required": true,
  10463. // "type": "string"
  10464. // },
  10465. // "webPropertyId": {
  10466. // "description": "Web property ID to create the view (profile) for.",
  10467. // "location": "path",
  10468. // "required": true,
  10469. // "type": "string"
  10470. // }
  10471. // },
  10472. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles",
  10473. // "request": {
  10474. // "$ref": "Profile"
  10475. // },
  10476. // "response": {
  10477. // "$ref": "Profile"
  10478. // },
  10479. // "scopes": [
  10480. // "https://www.googleapis.com/auth/analytics.edit"
  10481. // ]
  10482. // }
  10483. }
  10484. // method id "analytics.management.profiles.list":
  10485. type ManagementProfilesListCall struct {
  10486. s *Service
  10487. accountId string
  10488. webPropertyId string
  10489. urlParams_ gensupport.URLParams
  10490. ifNoneMatch_ string
  10491. ctx_ context.Context
  10492. }
  10493. // List: Lists views (profiles) to which the user has access.
  10494. func (r *ManagementProfilesService) List(accountId string, webPropertyId string) *ManagementProfilesListCall {
  10495. c := &ManagementProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10496. c.accountId = accountId
  10497. c.webPropertyId = webPropertyId
  10498. return c
  10499. }
  10500. // MaxResults sets the optional parameter "max-results": The maximum
  10501. // number of views (profiles) to include in this response.
  10502. func (c *ManagementProfilesListCall) MaxResults(maxResults int64) *ManagementProfilesListCall {
  10503. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  10504. return c
  10505. }
  10506. // StartIndex sets the optional parameter "start-index": An index of the
  10507. // first entity to retrieve. Use this parameter as a pagination
  10508. // mechanism along with the max-results parameter.
  10509. func (c *ManagementProfilesListCall) StartIndex(startIndex int64) *ManagementProfilesListCall {
  10510. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  10511. return c
  10512. }
  10513. // Fields allows partial responses to be retrieved. See
  10514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10515. // for more information.
  10516. func (c *ManagementProfilesListCall) Fields(s ...googleapi.Field) *ManagementProfilesListCall {
  10517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10518. return c
  10519. }
  10520. // IfNoneMatch sets the optional parameter which makes the operation
  10521. // fail if the object's ETag matches the given value. This is useful for
  10522. // getting updates only after the object has changed since the last
  10523. // request. Use googleapi.IsNotModified to check whether the response
  10524. // error from Do is the result of In-None-Match.
  10525. func (c *ManagementProfilesListCall) IfNoneMatch(entityTag string) *ManagementProfilesListCall {
  10526. c.ifNoneMatch_ = entityTag
  10527. return c
  10528. }
  10529. // Context sets the context to be used in this call's Do method. Any
  10530. // pending HTTP request will be aborted if the provided context is
  10531. // canceled.
  10532. func (c *ManagementProfilesListCall) Context(ctx context.Context) *ManagementProfilesListCall {
  10533. c.ctx_ = ctx
  10534. return c
  10535. }
  10536. func (c *ManagementProfilesListCall) doRequest(alt string) (*http.Response, error) {
  10537. var body io.Reader = nil
  10538. c.urlParams_.Set("alt", alt)
  10539. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles")
  10540. urls += "?" + c.urlParams_.Encode()
  10541. req, _ := http.NewRequest("GET", urls, body)
  10542. googleapi.Expand(req.URL, map[string]string{
  10543. "accountId": c.accountId,
  10544. "webPropertyId": c.webPropertyId,
  10545. })
  10546. req.Header.Set("User-Agent", c.s.userAgent())
  10547. if c.ifNoneMatch_ != "" {
  10548. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10549. }
  10550. if c.ctx_ != nil {
  10551. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10552. }
  10553. return c.s.client.Do(req)
  10554. }
  10555. // Do executes the "analytics.management.profiles.list" call.
  10556. // Exactly one of *Profiles or error will be non-nil. Any non-2xx status
  10557. // code is an error. Response headers are in either
  10558. // *Profiles.ServerResponse.Header or (if a response was returned at
  10559. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10560. // to check whether the returned error was because
  10561. // http.StatusNotModified was returned.
  10562. func (c *ManagementProfilesListCall) Do(opts ...googleapi.CallOption) (*Profiles, error) {
  10563. gensupport.SetOptions(c.urlParams_, opts...)
  10564. res, err := c.doRequest("json")
  10565. if res != nil && res.StatusCode == http.StatusNotModified {
  10566. if res.Body != nil {
  10567. res.Body.Close()
  10568. }
  10569. return nil, &googleapi.Error{
  10570. Code: res.StatusCode,
  10571. Header: res.Header,
  10572. }
  10573. }
  10574. if err != nil {
  10575. return nil, err
  10576. }
  10577. defer googleapi.CloseBody(res)
  10578. if err := googleapi.CheckResponse(res); err != nil {
  10579. return nil, err
  10580. }
  10581. ret := &Profiles{
  10582. ServerResponse: googleapi.ServerResponse{
  10583. Header: res.Header,
  10584. HTTPStatusCode: res.StatusCode,
  10585. },
  10586. }
  10587. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10588. return nil, err
  10589. }
  10590. return ret, nil
  10591. // {
  10592. // "description": "Lists views (profiles) to which the user has access.",
  10593. // "httpMethod": "GET",
  10594. // "id": "analytics.management.profiles.list",
  10595. // "parameterOrder": [
  10596. // "accountId",
  10597. // "webPropertyId"
  10598. // ],
  10599. // "parameters": {
  10600. // "accountId": {
  10601. // "description": "Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access.",
  10602. // "location": "path",
  10603. // "required": true,
  10604. // "type": "string"
  10605. // },
  10606. // "max-results": {
  10607. // "description": "The maximum number of views (profiles) to include in this response.",
  10608. // "format": "int32",
  10609. // "location": "query",
  10610. // "type": "integer"
  10611. // },
  10612. // "start-index": {
  10613. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  10614. // "format": "int32",
  10615. // "location": "query",
  10616. // "minimum": "1",
  10617. // "type": "integer"
  10618. // },
  10619. // "webPropertyId": {
  10620. // "description": "Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access.",
  10621. // "location": "path",
  10622. // "required": true,
  10623. // "type": "string"
  10624. // }
  10625. // },
  10626. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles",
  10627. // "response": {
  10628. // "$ref": "Profiles"
  10629. // },
  10630. // "scopes": [
  10631. // "https://www.googleapis.com/auth/analytics",
  10632. // "https://www.googleapis.com/auth/analytics.edit",
  10633. // "https://www.googleapis.com/auth/analytics.readonly"
  10634. // ]
  10635. // }
  10636. }
  10637. // method id "analytics.management.profiles.patch":
  10638. type ManagementProfilesPatchCall struct {
  10639. s *Service
  10640. accountId string
  10641. webPropertyId string
  10642. profileId string
  10643. profile *Profile
  10644. urlParams_ gensupport.URLParams
  10645. ctx_ context.Context
  10646. }
  10647. // Patch: Updates an existing view (profile). This method supports patch
  10648. // semantics.
  10649. func (r *ManagementProfilesService) Patch(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesPatchCall {
  10650. c := &ManagementProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10651. c.accountId = accountId
  10652. c.webPropertyId = webPropertyId
  10653. c.profileId = profileId
  10654. c.profile = profile
  10655. return c
  10656. }
  10657. // Fields allows partial responses to be retrieved. See
  10658. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10659. // for more information.
  10660. func (c *ManagementProfilesPatchCall) Fields(s ...googleapi.Field) *ManagementProfilesPatchCall {
  10661. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10662. return c
  10663. }
  10664. // Context sets the context to be used in this call's Do method. Any
  10665. // pending HTTP request will be aborted if the provided context is
  10666. // canceled.
  10667. func (c *ManagementProfilesPatchCall) Context(ctx context.Context) *ManagementProfilesPatchCall {
  10668. c.ctx_ = ctx
  10669. return c
  10670. }
  10671. func (c *ManagementProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  10672. var body io.Reader = nil
  10673. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  10674. if err != nil {
  10675. return nil, err
  10676. }
  10677. ctype := "application/json"
  10678. c.urlParams_.Set("alt", alt)
  10679. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  10680. urls += "?" + c.urlParams_.Encode()
  10681. req, _ := http.NewRequest("PATCH", urls, body)
  10682. googleapi.Expand(req.URL, map[string]string{
  10683. "accountId": c.accountId,
  10684. "webPropertyId": c.webPropertyId,
  10685. "profileId": c.profileId,
  10686. })
  10687. req.Header.Set("Content-Type", ctype)
  10688. req.Header.Set("User-Agent", c.s.userAgent())
  10689. if c.ctx_ != nil {
  10690. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10691. }
  10692. return c.s.client.Do(req)
  10693. }
  10694. // Do executes the "analytics.management.profiles.patch" call.
  10695. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  10696. // code is an error. Response headers are in either
  10697. // *Profile.ServerResponse.Header or (if a response was returned at all)
  10698. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10699. // check whether the returned error was because http.StatusNotModified
  10700. // was returned.
  10701. func (c *ManagementProfilesPatchCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  10702. gensupport.SetOptions(c.urlParams_, opts...)
  10703. res, err := c.doRequest("json")
  10704. if res != nil && res.StatusCode == http.StatusNotModified {
  10705. if res.Body != nil {
  10706. res.Body.Close()
  10707. }
  10708. return nil, &googleapi.Error{
  10709. Code: res.StatusCode,
  10710. Header: res.Header,
  10711. }
  10712. }
  10713. if err != nil {
  10714. return nil, err
  10715. }
  10716. defer googleapi.CloseBody(res)
  10717. if err := googleapi.CheckResponse(res); err != nil {
  10718. return nil, err
  10719. }
  10720. ret := &Profile{
  10721. ServerResponse: googleapi.ServerResponse{
  10722. Header: res.Header,
  10723. HTTPStatusCode: res.StatusCode,
  10724. },
  10725. }
  10726. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10727. return nil, err
  10728. }
  10729. return ret, nil
  10730. // {
  10731. // "description": "Updates an existing view (profile). This method supports patch semantics.",
  10732. // "httpMethod": "PATCH",
  10733. // "id": "analytics.management.profiles.patch",
  10734. // "parameterOrder": [
  10735. // "accountId",
  10736. // "webPropertyId",
  10737. // "profileId"
  10738. // ],
  10739. // "parameters": {
  10740. // "accountId": {
  10741. // "description": "Account ID to which the view (profile) belongs",
  10742. // "location": "path",
  10743. // "required": true,
  10744. // "type": "string"
  10745. // },
  10746. // "profileId": {
  10747. // "description": "ID of the view (profile) to be updated.",
  10748. // "location": "path",
  10749. // "required": true,
  10750. // "type": "string"
  10751. // },
  10752. // "webPropertyId": {
  10753. // "description": "Web property ID to which the view (profile) belongs",
  10754. // "location": "path",
  10755. // "required": true,
  10756. // "type": "string"
  10757. // }
  10758. // },
  10759. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  10760. // "request": {
  10761. // "$ref": "Profile"
  10762. // },
  10763. // "response": {
  10764. // "$ref": "Profile"
  10765. // },
  10766. // "scopes": [
  10767. // "https://www.googleapis.com/auth/analytics.edit"
  10768. // ]
  10769. // }
  10770. }
  10771. // method id "analytics.management.profiles.update":
  10772. type ManagementProfilesUpdateCall struct {
  10773. s *Service
  10774. accountId string
  10775. webPropertyId string
  10776. profileId string
  10777. profile *Profile
  10778. urlParams_ gensupport.URLParams
  10779. ctx_ context.Context
  10780. }
  10781. // Update: Updates an existing view (profile).
  10782. func (r *ManagementProfilesService) Update(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesUpdateCall {
  10783. c := &ManagementProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10784. c.accountId = accountId
  10785. c.webPropertyId = webPropertyId
  10786. c.profileId = profileId
  10787. c.profile = profile
  10788. return c
  10789. }
  10790. // Fields allows partial responses to be retrieved. See
  10791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10792. // for more information.
  10793. func (c *ManagementProfilesUpdateCall) Fields(s ...googleapi.Field) *ManagementProfilesUpdateCall {
  10794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10795. return c
  10796. }
  10797. // Context sets the context to be used in this call's Do method. Any
  10798. // pending HTTP request will be aborted if the provided context is
  10799. // canceled.
  10800. func (c *ManagementProfilesUpdateCall) Context(ctx context.Context) *ManagementProfilesUpdateCall {
  10801. c.ctx_ = ctx
  10802. return c
  10803. }
  10804. func (c *ManagementProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  10805. var body io.Reader = nil
  10806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  10807. if err != nil {
  10808. return nil, err
  10809. }
  10810. ctype := "application/json"
  10811. c.urlParams_.Set("alt", alt)
  10812. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  10813. urls += "?" + c.urlParams_.Encode()
  10814. req, _ := http.NewRequest("PUT", urls, body)
  10815. googleapi.Expand(req.URL, map[string]string{
  10816. "accountId": c.accountId,
  10817. "webPropertyId": c.webPropertyId,
  10818. "profileId": c.profileId,
  10819. })
  10820. req.Header.Set("Content-Type", ctype)
  10821. req.Header.Set("User-Agent", c.s.userAgent())
  10822. if c.ctx_ != nil {
  10823. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10824. }
  10825. return c.s.client.Do(req)
  10826. }
  10827. // Do executes the "analytics.management.profiles.update" call.
  10828. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  10829. // code is an error. Response headers are in either
  10830. // *Profile.ServerResponse.Header or (if a response was returned at all)
  10831. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10832. // check whether the returned error was because http.StatusNotModified
  10833. // was returned.
  10834. func (c *ManagementProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  10835. gensupport.SetOptions(c.urlParams_, opts...)
  10836. res, err := c.doRequest("json")
  10837. if res != nil && res.StatusCode == http.StatusNotModified {
  10838. if res.Body != nil {
  10839. res.Body.Close()
  10840. }
  10841. return nil, &googleapi.Error{
  10842. Code: res.StatusCode,
  10843. Header: res.Header,
  10844. }
  10845. }
  10846. if err != nil {
  10847. return nil, err
  10848. }
  10849. defer googleapi.CloseBody(res)
  10850. if err := googleapi.CheckResponse(res); err != nil {
  10851. return nil, err
  10852. }
  10853. ret := &Profile{
  10854. ServerResponse: googleapi.ServerResponse{
  10855. Header: res.Header,
  10856. HTTPStatusCode: res.StatusCode,
  10857. },
  10858. }
  10859. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10860. return nil, err
  10861. }
  10862. return ret, nil
  10863. // {
  10864. // "description": "Updates an existing view (profile).",
  10865. // "httpMethod": "PUT",
  10866. // "id": "analytics.management.profiles.update",
  10867. // "parameterOrder": [
  10868. // "accountId",
  10869. // "webPropertyId",
  10870. // "profileId"
  10871. // ],
  10872. // "parameters": {
  10873. // "accountId": {
  10874. // "description": "Account ID to which the view (profile) belongs",
  10875. // "location": "path",
  10876. // "required": true,
  10877. // "type": "string"
  10878. // },
  10879. // "profileId": {
  10880. // "description": "ID of the view (profile) to be updated.",
  10881. // "location": "path",
  10882. // "required": true,
  10883. // "type": "string"
  10884. // },
  10885. // "webPropertyId": {
  10886. // "description": "Web property ID to which the view (profile) belongs",
  10887. // "location": "path",
  10888. // "required": true,
  10889. // "type": "string"
  10890. // }
  10891. // },
  10892. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  10893. // "request": {
  10894. // "$ref": "Profile"
  10895. // },
  10896. // "response": {
  10897. // "$ref": "Profile"
  10898. // },
  10899. // "scopes": [
  10900. // "https://www.googleapis.com/auth/analytics.edit"
  10901. // ]
  10902. // }
  10903. }
  10904. // method id "analytics.management.segments.list":
  10905. type ManagementSegmentsListCall struct {
  10906. s *Service
  10907. urlParams_ gensupport.URLParams
  10908. ifNoneMatch_ string
  10909. ctx_ context.Context
  10910. }
  10911. // List: Lists segments to which the user has access.
  10912. func (r *ManagementSegmentsService) List() *ManagementSegmentsListCall {
  10913. c := &ManagementSegmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10914. return c
  10915. }
  10916. // MaxResults sets the optional parameter "max-results": The maximum
  10917. // number of segments to include in this response.
  10918. func (c *ManagementSegmentsListCall) MaxResults(maxResults int64) *ManagementSegmentsListCall {
  10919. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  10920. return c
  10921. }
  10922. // StartIndex sets the optional parameter "start-index": An index of the
  10923. // first segment to retrieve. Use this parameter as a pagination
  10924. // mechanism along with the max-results parameter.
  10925. func (c *ManagementSegmentsListCall) StartIndex(startIndex int64) *ManagementSegmentsListCall {
  10926. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  10927. return c
  10928. }
  10929. // Fields allows partial responses to be retrieved. See
  10930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10931. // for more information.
  10932. func (c *ManagementSegmentsListCall) Fields(s ...googleapi.Field) *ManagementSegmentsListCall {
  10933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10934. return c
  10935. }
  10936. // IfNoneMatch sets the optional parameter which makes the operation
  10937. // fail if the object's ETag matches the given value. This is useful for
  10938. // getting updates only after the object has changed since the last
  10939. // request. Use googleapi.IsNotModified to check whether the response
  10940. // error from Do is the result of In-None-Match.
  10941. func (c *ManagementSegmentsListCall) IfNoneMatch(entityTag string) *ManagementSegmentsListCall {
  10942. c.ifNoneMatch_ = entityTag
  10943. return c
  10944. }
  10945. // Context sets the context to be used in this call's Do method. Any
  10946. // pending HTTP request will be aborted if the provided context is
  10947. // canceled.
  10948. func (c *ManagementSegmentsListCall) Context(ctx context.Context) *ManagementSegmentsListCall {
  10949. c.ctx_ = ctx
  10950. return c
  10951. }
  10952. func (c *ManagementSegmentsListCall) doRequest(alt string) (*http.Response, error) {
  10953. var body io.Reader = nil
  10954. c.urlParams_.Set("alt", alt)
  10955. urls := googleapi.ResolveRelative(c.s.BasePath, "management/segments")
  10956. urls += "?" + c.urlParams_.Encode()
  10957. req, _ := http.NewRequest("GET", urls, body)
  10958. googleapi.SetOpaque(req.URL)
  10959. req.Header.Set("User-Agent", c.s.userAgent())
  10960. if c.ifNoneMatch_ != "" {
  10961. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10962. }
  10963. if c.ctx_ != nil {
  10964. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10965. }
  10966. return c.s.client.Do(req)
  10967. }
  10968. // Do executes the "analytics.management.segments.list" call.
  10969. // Exactly one of *Segments or error will be non-nil. Any non-2xx status
  10970. // code is an error. Response headers are in either
  10971. // *Segments.ServerResponse.Header or (if a response was returned at
  10972. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10973. // to check whether the returned error was because
  10974. // http.StatusNotModified was returned.
  10975. func (c *ManagementSegmentsListCall) Do(opts ...googleapi.CallOption) (*Segments, error) {
  10976. gensupport.SetOptions(c.urlParams_, opts...)
  10977. res, err := c.doRequest("json")
  10978. if res != nil && res.StatusCode == http.StatusNotModified {
  10979. if res.Body != nil {
  10980. res.Body.Close()
  10981. }
  10982. return nil, &googleapi.Error{
  10983. Code: res.StatusCode,
  10984. Header: res.Header,
  10985. }
  10986. }
  10987. if err != nil {
  10988. return nil, err
  10989. }
  10990. defer googleapi.CloseBody(res)
  10991. if err := googleapi.CheckResponse(res); err != nil {
  10992. return nil, err
  10993. }
  10994. ret := &Segments{
  10995. ServerResponse: googleapi.ServerResponse{
  10996. Header: res.Header,
  10997. HTTPStatusCode: res.StatusCode,
  10998. },
  10999. }
  11000. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11001. return nil, err
  11002. }
  11003. return ret, nil
  11004. // {
  11005. // "description": "Lists segments to which the user has access.",
  11006. // "httpMethod": "GET",
  11007. // "id": "analytics.management.segments.list",
  11008. // "parameters": {
  11009. // "max-results": {
  11010. // "description": "The maximum number of segments to include in this response.",
  11011. // "format": "int32",
  11012. // "location": "query",
  11013. // "type": "integer"
  11014. // },
  11015. // "start-index": {
  11016. // "description": "An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  11017. // "format": "int32",
  11018. // "location": "query",
  11019. // "minimum": "1",
  11020. // "type": "integer"
  11021. // }
  11022. // },
  11023. // "path": "management/segments",
  11024. // "response": {
  11025. // "$ref": "Segments"
  11026. // },
  11027. // "scopes": [
  11028. // "https://www.googleapis.com/auth/analytics",
  11029. // "https://www.googleapis.com/auth/analytics.edit",
  11030. // "https://www.googleapis.com/auth/analytics.readonly"
  11031. // ]
  11032. // }
  11033. }
  11034. // method id "analytics.management.unsampledReports.delete":
  11035. type ManagementUnsampledReportsDeleteCall struct {
  11036. s *Service
  11037. accountId string
  11038. webPropertyId string
  11039. profileId string
  11040. unsampledReportId string
  11041. urlParams_ gensupport.URLParams
  11042. ctx_ context.Context
  11043. }
  11044. // Delete: Deletes an unsampled report.
  11045. func (r *ManagementUnsampledReportsService) Delete(accountId string, webPropertyId string, profileId string, unsampledReportId string) *ManagementUnsampledReportsDeleteCall {
  11046. c := &ManagementUnsampledReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11047. c.accountId = accountId
  11048. c.webPropertyId = webPropertyId
  11049. c.profileId = profileId
  11050. c.unsampledReportId = unsampledReportId
  11051. return c
  11052. }
  11053. // Fields allows partial responses to be retrieved. See
  11054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11055. // for more information.
  11056. func (c *ManagementUnsampledReportsDeleteCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsDeleteCall {
  11057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11058. return c
  11059. }
  11060. // Context sets the context to be used in this call's Do method. Any
  11061. // pending HTTP request will be aborted if the provided context is
  11062. // canceled.
  11063. func (c *ManagementUnsampledReportsDeleteCall) Context(ctx context.Context) *ManagementUnsampledReportsDeleteCall {
  11064. c.ctx_ = ctx
  11065. return c
  11066. }
  11067. func (c *ManagementUnsampledReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  11068. var body io.Reader = nil
  11069. c.urlParams_.Set("alt", alt)
  11070. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}")
  11071. urls += "?" + c.urlParams_.Encode()
  11072. req, _ := http.NewRequest("DELETE", urls, body)
  11073. googleapi.Expand(req.URL, map[string]string{
  11074. "accountId": c.accountId,
  11075. "webPropertyId": c.webPropertyId,
  11076. "profileId": c.profileId,
  11077. "unsampledReportId": c.unsampledReportId,
  11078. })
  11079. req.Header.Set("User-Agent", c.s.userAgent())
  11080. if c.ctx_ != nil {
  11081. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11082. }
  11083. return c.s.client.Do(req)
  11084. }
  11085. // Do executes the "analytics.management.unsampledReports.delete" call.
  11086. func (c *ManagementUnsampledReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  11087. gensupport.SetOptions(c.urlParams_, opts...)
  11088. res, err := c.doRequest("json")
  11089. if err != nil {
  11090. return err
  11091. }
  11092. defer googleapi.CloseBody(res)
  11093. if err := googleapi.CheckResponse(res); err != nil {
  11094. return err
  11095. }
  11096. return nil
  11097. // {
  11098. // "description": "Deletes an unsampled report.",
  11099. // "httpMethod": "DELETE",
  11100. // "id": "analytics.management.unsampledReports.delete",
  11101. // "parameterOrder": [
  11102. // "accountId",
  11103. // "webPropertyId",
  11104. // "profileId",
  11105. // "unsampledReportId"
  11106. // ],
  11107. // "parameters": {
  11108. // "accountId": {
  11109. // "description": "Account ID to delete the unsampled report for.",
  11110. // "location": "path",
  11111. // "required": true,
  11112. // "type": "string"
  11113. // },
  11114. // "profileId": {
  11115. // "description": "View (Profile) ID to delete the unsampled report for.",
  11116. // "location": "path",
  11117. // "required": true,
  11118. // "type": "string"
  11119. // },
  11120. // "unsampledReportId": {
  11121. // "description": "ID of the unsampled report to be deleted.",
  11122. // "location": "path",
  11123. // "required": true,
  11124. // "type": "string"
  11125. // },
  11126. // "webPropertyId": {
  11127. // "description": "Web property ID to delete the unsampled reports for.",
  11128. // "location": "path",
  11129. // "required": true,
  11130. // "type": "string"
  11131. // }
  11132. // },
  11133. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}",
  11134. // "scopes": [
  11135. // "https://www.googleapis.com/auth/analytics.edit"
  11136. // ]
  11137. // }
  11138. }
  11139. // method id "analytics.management.unsampledReports.get":
  11140. type ManagementUnsampledReportsGetCall struct {
  11141. s *Service
  11142. accountId string
  11143. webPropertyId string
  11144. profileId string
  11145. unsampledReportId string
  11146. urlParams_ gensupport.URLParams
  11147. ifNoneMatch_ string
  11148. ctx_ context.Context
  11149. }
  11150. // Get: Returns a single unsampled report.
  11151. func (r *ManagementUnsampledReportsService) Get(accountId string, webPropertyId string, profileId string, unsampledReportId string) *ManagementUnsampledReportsGetCall {
  11152. c := &ManagementUnsampledReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11153. c.accountId = accountId
  11154. c.webPropertyId = webPropertyId
  11155. c.profileId = profileId
  11156. c.unsampledReportId = unsampledReportId
  11157. return c
  11158. }
  11159. // Fields allows partial responses to be retrieved. See
  11160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11161. // for more information.
  11162. func (c *ManagementUnsampledReportsGetCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsGetCall {
  11163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11164. return c
  11165. }
  11166. // IfNoneMatch sets the optional parameter which makes the operation
  11167. // fail if the object's ETag matches the given value. This is useful for
  11168. // getting updates only after the object has changed since the last
  11169. // request. Use googleapi.IsNotModified to check whether the response
  11170. // error from Do is the result of In-None-Match.
  11171. func (c *ManagementUnsampledReportsGetCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsGetCall {
  11172. c.ifNoneMatch_ = entityTag
  11173. return c
  11174. }
  11175. // Context sets the context to be used in this call's Do method. Any
  11176. // pending HTTP request will be aborted if the provided context is
  11177. // canceled.
  11178. func (c *ManagementUnsampledReportsGetCall) Context(ctx context.Context) *ManagementUnsampledReportsGetCall {
  11179. c.ctx_ = ctx
  11180. return c
  11181. }
  11182. func (c *ManagementUnsampledReportsGetCall) doRequest(alt string) (*http.Response, error) {
  11183. var body io.Reader = nil
  11184. c.urlParams_.Set("alt", alt)
  11185. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}")
  11186. urls += "?" + c.urlParams_.Encode()
  11187. req, _ := http.NewRequest("GET", urls, body)
  11188. googleapi.Expand(req.URL, map[string]string{
  11189. "accountId": c.accountId,
  11190. "webPropertyId": c.webPropertyId,
  11191. "profileId": c.profileId,
  11192. "unsampledReportId": c.unsampledReportId,
  11193. })
  11194. req.Header.Set("User-Agent", c.s.userAgent())
  11195. if c.ifNoneMatch_ != "" {
  11196. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11197. }
  11198. if c.ctx_ != nil {
  11199. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11200. }
  11201. return c.s.client.Do(req)
  11202. }
  11203. // Do executes the "analytics.management.unsampledReports.get" call.
  11204. // Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx
  11205. // status code is an error. Response headers are in either
  11206. // *UnsampledReport.ServerResponse.Header or (if a response was returned
  11207. // at all) in error.(*googleapi.Error).Header. Use
  11208. // googleapi.IsNotModified to check whether the returned error was
  11209. // because http.StatusNotModified was returned.
  11210. func (c *ManagementUnsampledReportsGetCall) Do(opts ...googleapi.CallOption) (*UnsampledReport, error) {
  11211. gensupport.SetOptions(c.urlParams_, opts...)
  11212. res, err := c.doRequest("json")
  11213. if res != nil && res.StatusCode == http.StatusNotModified {
  11214. if res.Body != nil {
  11215. res.Body.Close()
  11216. }
  11217. return nil, &googleapi.Error{
  11218. Code: res.StatusCode,
  11219. Header: res.Header,
  11220. }
  11221. }
  11222. if err != nil {
  11223. return nil, err
  11224. }
  11225. defer googleapi.CloseBody(res)
  11226. if err := googleapi.CheckResponse(res); err != nil {
  11227. return nil, err
  11228. }
  11229. ret := &UnsampledReport{
  11230. ServerResponse: googleapi.ServerResponse{
  11231. Header: res.Header,
  11232. HTTPStatusCode: res.StatusCode,
  11233. },
  11234. }
  11235. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11236. return nil, err
  11237. }
  11238. return ret, nil
  11239. // {
  11240. // "description": "Returns a single unsampled report.",
  11241. // "httpMethod": "GET",
  11242. // "id": "analytics.management.unsampledReports.get",
  11243. // "parameterOrder": [
  11244. // "accountId",
  11245. // "webPropertyId",
  11246. // "profileId",
  11247. // "unsampledReportId"
  11248. // ],
  11249. // "parameters": {
  11250. // "accountId": {
  11251. // "description": "Account ID to retrieve unsampled report for.",
  11252. // "location": "path",
  11253. // "required": true,
  11254. // "type": "string"
  11255. // },
  11256. // "profileId": {
  11257. // "description": "View (Profile) ID to retrieve unsampled report for.",
  11258. // "location": "path",
  11259. // "required": true,
  11260. // "type": "string"
  11261. // },
  11262. // "unsampledReportId": {
  11263. // "description": "ID of the unsampled report to retrieve.",
  11264. // "location": "path",
  11265. // "required": true,
  11266. // "type": "string"
  11267. // },
  11268. // "webPropertyId": {
  11269. // "description": "Web property ID to retrieve unsampled reports for.",
  11270. // "location": "path",
  11271. // "required": true,
  11272. // "type": "string"
  11273. // }
  11274. // },
  11275. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}",
  11276. // "response": {
  11277. // "$ref": "UnsampledReport"
  11278. // },
  11279. // "scopes": [
  11280. // "https://www.googleapis.com/auth/analytics",
  11281. // "https://www.googleapis.com/auth/analytics.edit",
  11282. // "https://www.googleapis.com/auth/analytics.readonly"
  11283. // ]
  11284. // }
  11285. }
  11286. // method id "analytics.management.unsampledReports.insert":
  11287. type ManagementUnsampledReportsInsertCall struct {
  11288. s *Service
  11289. accountId string
  11290. webPropertyId string
  11291. profileId string
  11292. unsampledreport *UnsampledReport
  11293. urlParams_ gensupport.URLParams
  11294. ctx_ context.Context
  11295. }
  11296. // Insert: Create a new unsampled report.
  11297. func (r *ManagementUnsampledReportsService) Insert(accountId string, webPropertyId string, profileId string, unsampledreport *UnsampledReport) *ManagementUnsampledReportsInsertCall {
  11298. c := &ManagementUnsampledReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11299. c.accountId = accountId
  11300. c.webPropertyId = webPropertyId
  11301. c.profileId = profileId
  11302. c.unsampledreport = unsampledreport
  11303. return c
  11304. }
  11305. // Fields allows partial responses to be retrieved. See
  11306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11307. // for more information.
  11308. func (c *ManagementUnsampledReportsInsertCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsInsertCall {
  11309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11310. return c
  11311. }
  11312. // Context sets the context to be used in this call's Do method. Any
  11313. // pending HTTP request will be aborted if the provided context is
  11314. // canceled.
  11315. func (c *ManagementUnsampledReportsInsertCall) Context(ctx context.Context) *ManagementUnsampledReportsInsertCall {
  11316. c.ctx_ = ctx
  11317. return c
  11318. }
  11319. func (c *ManagementUnsampledReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  11320. var body io.Reader = nil
  11321. body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsampledreport)
  11322. if err != nil {
  11323. return nil, err
  11324. }
  11325. ctype := "application/json"
  11326. c.urlParams_.Set("alt", alt)
  11327. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports")
  11328. urls += "?" + c.urlParams_.Encode()
  11329. req, _ := http.NewRequest("POST", urls, body)
  11330. googleapi.Expand(req.URL, map[string]string{
  11331. "accountId": c.accountId,
  11332. "webPropertyId": c.webPropertyId,
  11333. "profileId": c.profileId,
  11334. })
  11335. req.Header.Set("Content-Type", ctype)
  11336. req.Header.Set("User-Agent", c.s.userAgent())
  11337. if c.ctx_ != nil {
  11338. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11339. }
  11340. return c.s.client.Do(req)
  11341. }
  11342. // Do executes the "analytics.management.unsampledReports.insert" call.
  11343. // Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx
  11344. // status code is an error. Response headers are in either
  11345. // *UnsampledReport.ServerResponse.Header or (if a response was returned
  11346. // at all) in error.(*googleapi.Error).Header. Use
  11347. // googleapi.IsNotModified to check whether the returned error was
  11348. // because http.StatusNotModified was returned.
  11349. func (c *ManagementUnsampledReportsInsertCall) Do(opts ...googleapi.CallOption) (*UnsampledReport, error) {
  11350. gensupport.SetOptions(c.urlParams_, opts...)
  11351. res, err := c.doRequest("json")
  11352. if res != nil && res.StatusCode == http.StatusNotModified {
  11353. if res.Body != nil {
  11354. res.Body.Close()
  11355. }
  11356. return nil, &googleapi.Error{
  11357. Code: res.StatusCode,
  11358. Header: res.Header,
  11359. }
  11360. }
  11361. if err != nil {
  11362. return nil, err
  11363. }
  11364. defer googleapi.CloseBody(res)
  11365. if err := googleapi.CheckResponse(res); err != nil {
  11366. return nil, err
  11367. }
  11368. ret := &UnsampledReport{
  11369. ServerResponse: googleapi.ServerResponse{
  11370. Header: res.Header,
  11371. HTTPStatusCode: res.StatusCode,
  11372. },
  11373. }
  11374. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11375. return nil, err
  11376. }
  11377. return ret, nil
  11378. // {
  11379. // "description": "Create a new unsampled report.",
  11380. // "httpMethod": "POST",
  11381. // "id": "analytics.management.unsampledReports.insert",
  11382. // "parameterOrder": [
  11383. // "accountId",
  11384. // "webPropertyId",
  11385. // "profileId"
  11386. // ],
  11387. // "parameters": {
  11388. // "accountId": {
  11389. // "description": "Account ID to create the unsampled report for.",
  11390. // "location": "path",
  11391. // "required": true,
  11392. // "type": "string"
  11393. // },
  11394. // "profileId": {
  11395. // "description": "View (Profile) ID to create the unsampled report for.",
  11396. // "location": "path",
  11397. // "required": true,
  11398. // "type": "string"
  11399. // },
  11400. // "webPropertyId": {
  11401. // "description": "Web property ID to create the unsampled report for.",
  11402. // "location": "path",
  11403. // "required": true,
  11404. // "type": "string"
  11405. // }
  11406. // },
  11407. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports",
  11408. // "request": {
  11409. // "$ref": "UnsampledReport"
  11410. // },
  11411. // "response": {
  11412. // "$ref": "UnsampledReport"
  11413. // },
  11414. // "scopes": [
  11415. // "https://www.googleapis.com/auth/analytics",
  11416. // "https://www.googleapis.com/auth/analytics.edit"
  11417. // ]
  11418. // }
  11419. }
  11420. // method id "analytics.management.unsampledReports.list":
  11421. type ManagementUnsampledReportsListCall struct {
  11422. s *Service
  11423. accountId string
  11424. webPropertyId string
  11425. profileId string
  11426. urlParams_ gensupport.URLParams
  11427. ifNoneMatch_ string
  11428. ctx_ context.Context
  11429. }
  11430. // List: Lists unsampled reports to which the user has access.
  11431. func (r *ManagementUnsampledReportsService) List(accountId string, webPropertyId string, profileId string) *ManagementUnsampledReportsListCall {
  11432. c := &ManagementUnsampledReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11433. c.accountId = accountId
  11434. c.webPropertyId = webPropertyId
  11435. c.profileId = profileId
  11436. return c
  11437. }
  11438. // MaxResults sets the optional parameter "max-results": The maximum
  11439. // number of unsampled reports to include in this response.
  11440. func (c *ManagementUnsampledReportsListCall) MaxResults(maxResults int64) *ManagementUnsampledReportsListCall {
  11441. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  11442. return c
  11443. }
  11444. // StartIndex sets the optional parameter "start-index": An index of the
  11445. // first unsampled report to retrieve. Use this parameter as a
  11446. // pagination mechanism along with the max-results parameter.
  11447. func (c *ManagementUnsampledReportsListCall) StartIndex(startIndex int64) *ManagementUnsampledReportsListCall {
  11448. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  11449. return c
  11450. }
  11451. // Fields allows partial responses to be retrieved. See
  11452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11453. // for more information.
  11454. func (c *ManagementUnsampledReportsListCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsListCall {
  11455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11456. return c
  11457. }
  11458. // IfNoneMatch sets the optional parameter which makes the operation
  11459. // fail if the object's ETag matches the given value. This is useful for
  11460. // getting updates only after the object has changed since the last
  11461. // request. Use googleapi.IsNotModified to check whether the response
  11462. // error from Do is the result of In-None-Match.
  11463. func (c *ManagementUnsampledReportsListCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsListCall {
  11464. c.ifNoneMatch_ = entityTag
  11465. return c
  11466. }
  11467. // Context sets the context to be used in this call's Do method. Any
  11468. // pending HTTP request will be aborted if the provided context is
  11469. // canceled.
  11470. func (c *ManagementUnsampledReportsListCall) Context(ctx context.Context) *ManagementUnsampledReportsListCall {
  11471. c.ctx_ = ctx
  11472. return c
  11473. }
  11474. func (c *ManagementUnsampledReportsListCall) doRequest(alt string) (*http.Response, error) {
  11475. var body io.Reader = nil
  11476. c.urlParams_.Set("alt", alt)
  11477. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports")
  11478. urls += "?" + c.urlParams_.Encode()
  11479. req, _ := http.NewRequest("GET", urls, body)
  11480. googleapi.Expand(req.URL, map[string]string{
  11481. "accountId": c.accountId,
  11482. "webPropertyId": c.webPropertyId,
  11483. "profileId": c.profileId,
  11484. })
  11485. req.Header.Set("User-Agent", c.s.userAgent())
  11486. if c.ifNoneMatch_ != "" {
  11487. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11488. }
  11489. if c.ctx_ != nil {
  11490. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11491. }
  11492. return c.s.client.Do(req)
  11493. }
  11494. // Do executes the "analytics.management.unsampledReports.list" call.
  11495. // Exactly one of *UnsampledReports or error will be non-nil. Any
  11496. // non-2xx status code is an error. Response headers are in either
  11497. // *UnsampledReports.ServerResponse.Header or (if a response was
  11498. // returned at all) in error.(*googleapi.Error).Header. Use
  11499. // googleapi.IsNotModified to check whether the returned error was
  11500. // because http.StatusNotModified was returned.
  11501. func (c *ManagementUnsampledReportsListCall) Do(opts ...googleapi.CallOption) (*UnsampledReports, error) {
  11502. gensupport.SetOptions(c.urlParams_, opts...)
  11503. res, err := c.doRequest("json")
  11504. if res != nil && res.StatusCode == http.StatusNotModified {
  11505. if res.Body != nil {
  11506. res.Body.Close()
  11507. }
  11508. return nil, &googleapi.Error{
  11509. Code: res.StatusCode,
  11510. Header: res.Header,
  11511. }
  11512. }
  11513. if err != nil {
  11514. return nil, err
  11515. }
  11516. defer googleapi.CloseBody(res)
  11517. if err := googleapi.CheckResponse(res); err != nil {
  11518. return nil, err
  11519. }
  11520. ret := &UnsampledReports{
  11521. ServerResponse: googleapi.ServerResponse{
  11522. Header: res.Header,
  11523. HTTPStatusCode: res.StatusCode,
  11524. },
  11525. }
  11526. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11527. return nil, err
  11528. }
  11529. return ret, nil
  11530. // {
  11531. // "description": "Lists unsampled reports to which the user has access.",
  11532. // "httpMethod": "GET",
  11533. // "id": "analytics.management.unsampledReports.list",
  11534. // "parameterOrder": [
  11535. // "accountId",
  11536. // "webPropertyId",
  11537. // "profileId"
  11538. // ],
  11539. // "parameters": {
  11540. // "accountId": {
  11541. // "description": "Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported.",
  11542. // "location": "path",
  11543. // "required": true,
  11544. // "type": "string"
  11545. // },
  11546. // "max-results": {
  11547. // "description": "The maximum number of unsampled reports to include in this response.",
  11548. // "format": "int32",
  11549. // "location": "query",
  11550. // "type": "integer"
  11551. // },
  11552. // "profileId": {
  11553. // "description": "View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported.",
  11554. // "location": "path",
  11555. // "required": true,
  11556. // "type": "string"
  11557. // },
  11558. // "start-index": {
  11559. // "description": "An index of the first unsampled report to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  11560. // "format": "int32",
  11561. // "location": "query",
  11562. // "minimum": "1",
  11563. // "type": "integer"
  11564. // },
  11565. // "webPropertyId": {
  11566. // "description": "Web property ID to retrieve unsampled reports for. Must be a specific web property ID, ~all is not supported.",
  11567. // "location": "path",
  11568. // "required": true,
  11569. // "type": "string"
  11570. // }
  11571. // },
  11572. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports",
  11573. // "response": {
  11574. // "$ref": "UnsampledReports"
  11575. // },
  11576. // "scopes": [
  11577. // "https://www.googleapis.com/auth/analytics",
  11578. // "https://www.googleapis.com/auth/analytics.edit",
  11579. // "https://www.googleapis.com/auth/analytics.readonly"
  11580. // ]
  11581. // }
  11582. }
  11583. // method id "analytics.management.uploads.deleteUploadData":
  11584. type ManagementUploadsDeleteUploadDataCall struct {
  11585. s *Service
  11586. accountId string
  11587. webPropertyId string
  11588. customDataSourceId string
  11589. analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest
  11590. urlParams_ gensupport.URLParams
  11591. ctx_ context.Context
  11592. }
  11593. // DeleteUploadData: Delete data associated with a previous upload.
  11594. func (r *ManagementUploadsService) DeleteUploadData(accountId string, webPropertyId string, customDataSourceId string, analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest) *ManagementUploadsDeleteUploadDataCall {
  11595. c := &ManagementUploadsDeleteUploadDataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11596. c.accountId = accountId
  11597. c.webPropertyId = webPropertyId
  11598. c.customDataSourceId = customDataSourceId
  11599. c.analyticsdataimportdeleteuploaddatarequest = analyticsdataimportdeleteuploaddatarequest
  11600. return c
  11601. }
  11602. // Fields allows partial responses to be retrieved. See
  11603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11604. // for more information.
  11605. func (c *ManagementUploadsDeleteUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsDeleteUploadDataCall {
  11606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11607. return c
  11608. }
  11609. // Context sets the context to be used in this call's Do method. Any
  11610. // pending HTTP request will be aborted if the provided context is
  11611. // canceled.
  11612. func (c *ManagementUploadsDeleteUploadDataCall) Context(ctx context.Context) *ManagementUploadsDeleteUploadDataCall {
  11613. c.ctx_ = ctx
  11614. return c
  11615. }
  11616. func (c *ManagementUploadsDeleteUploadDataCall) doRequest(alt string) (*http.Response, error) {
  11617. var body io.Reader = nil
  11618. body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyticsdataimportdeleteuploaddatarequest)
  11619. if err != nil {
  11620. return nil, err
  11621. }
  11622. ctype := "application/json"
  11623. c.urlParams_.Set("alt", alt)
  11624. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData")
  11625. urls += "?" + c.urlParams_.Encode()
  11626. req, _ := http.NewRequest("POST", urls, body)
  11627. googleapi.Expand(req.URL, map[string]string{
  11628. "accountId": c.accountId,
  11629. "webPropertyId": c.webPropertyId,
  11630. "customDataSourceId": c.customDataSourceId,
  11631. })
  11632. req.Header.Set("Content-Type", ctype)
  11633. req.Header.Set("User-Agent", c.s.userAgent())
  11634. if c.ctx_ != nil {
  11635. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11636. }
  11637. return c.s.client.Do(req)
  11638. }
  11639. // Do executes the "analytics.management.uploads.deleteUploadData" call.
  11640. func (c *ManagementUploadsDeleteUploadDataCall) Do(opts ...googleapi.CallOption) error {
  11641. gensupport.SetOptions(c.urlParams_, opts...)
  11642. res, err := c.doRequest("json")
  11643. if err != nil {
  11644. return err
  11645. }
  11646. defer googleapi.CloseBody(res)
  11647. if err := googleapi.CheckResponse(res); err != nil {
  11648. return err
  11649. }
  11650. return nil
  11651. // {
  11652. // "description": "Delete data associated with a previous upload.",
  11653. // "httpMethod": "POST",
  11654. // "id": "analytics.management.uploads.deleteUploadData",
  11655. // "parameterOrder": [
  11656. // "accountId",
  11657. // "webPropertyId",
  11658. // "customDataSourceId"
  11659. // ],
  11660. // "parameters": {
  11661. // "accountId": {
  11662. // "description": "Account Id for the uploads to be deleted.",
  11663. // "location": "path",
  11664. // "pattern": "\\d+",
  11665. // "required": true,
  11666. // "type": "string"
  11667. // },
  11668. // "customDataSourceId": {
  11669. // "description": "Custom data source Id for the uploads to be deleted.",
  11670. // "location": "path",
  11671. // "pattern": ".{22}",
  11672. // "required": true,
  11673. // "type": "string"
  11674. // },
  11675. // "webPropertyId": {
  11676. // "description": "Web property Id for the uploads to be deleted.",
  11677. // "location": "path",
  11678. // "pattern": "UA-(\\d+)-(\\d+)",
  11679. // "required": true,
  11680. // "type": "string"
  11681. // }
  11682. // },
  11683. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData",
  11684. // "request": {
  11685. // "$ref": "AnalyticsDataimportDeleteUploadDataRequest"
  11686. // },
  11687. // "scopes": [
  11688. // "https://www.googleapis.com/auth/analytics",
  11689. // "https://www.googleapis.com/auth/analytics.edit"
  11690. // ]
  11691. // }
  11692. }
  11693. // method id "analytics.management.uploads.get":
  11694. type ManagementUploadsGetCall struct {
  11695. s *Service
  11696. accountId string
  11697. webPropertyId string
  11698. customDataSourceId string
  11699. uploadId string
  11700. urlParams_ gensupport.URLParams
  11701. ifNoneMatch_ string
  11702. ctx_ context.Context
  11703. }
  11704. // Get: List uploads to which the user has access.
  11705. func (r *ManagementUploadsService) Get(accountId string, webPropertyId string, customDataSourceId string, uploadId string) *ManagementUploadsGetCall {
  11706. c := &ManagementUploadsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11707. c.accountId = accountId
  11708. c.webPropertyId = webPropertyId
  11709. c.customDataSourceId = customDataSourceId
  11710. c.uploadId = uploadId
  11711. return c
  11712. }
  11713. // Fields allows partial responses to be retrieved. See
  11714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11715. // for more information.
  11716. func (c *ManagementUploadsGetCall) Fields(s ...googleapi.Field) *ManagementUploadsGetCall {
  11717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11718. return c
  11719. }
  11720. // IfNoneMatch sets the optional parameter which makes the operation
  11721. // fail if the object's ETag matches the given value. This is useful for
  11722. // getting updates only after the object has changed since the last
  11723. // request. Use googleapi.IsNotModified to check whether the response
  11724. // error from Do is the result of In-None-Match.
  11725. func (c *ManagementUploadsGetCall) IfNoneMatch(entityTag string) *ManagementUploadsGetCall {
  11726. c.ifNoneMatch_ = entityTag
  11727. return c
  11728. }
  11729. // Context sets the context to be used in this call's Do method. Any
  11730. // pending HTTP request will be aborted if the provided context is
  11731. // canceled.
  11732. func (c *ManagementUploadsGetCall) Context(ctx context.Context) *ManagementUploadsGetCall {
  11733. c.ctx_ = ctx
  11734. return c
  11735. }
  11736. func (c *ManagementUploadsGetCall) doRequest(alt string) (*http.Response, error) {
  11737. var body io.Reader = nil
  11738. c.urlParams_.Set("alt", alt)
  11739. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}")
  11740. urls += "?" + c.urlParams_.Encode()
  11741. req, _ := http.NewRequest("GET", urls, body)
  11742. googleapi.Expand(req.URL, map[string]string{
  11743. "accountId": c.accountId,
  11744. "webPropertyId": c.webPropertyId,
  11745. "customDataSourceId": c.customDataSourceId,
  11746. "uploadId": c.uploadId,
  11747. })
  11748. req.Header.Set("User-Agent", c.s.userAgent())
  11749. if c.ifNoneMatch_ != "" {
  11750. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11751. }
  11752. if c.ctx_ != nil {
  11753. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11754. }
  11755. return c.s.client.Do(req)
  11756. }
  11757. // Do executes the "analytics.management.uploads.get" call.
  11758. // Exactly one of *Upload or error will be non-nil. Any non-2xx status
  11759. // code is an error. Response headers are in either
  11760. // *Upload.ServerResponse.Header or (if a response was returned at all)
  11761. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11762. // check whether the returned error was because http.StatusNotModified
  11763. // was returned.
  11764. func (c *ManagementUploadsGetCall) Do(opts ...googleapi.CallOption) (*Upload, error) {
  11765. gensupport.SetOptions(c.urlParams_, opts...)
  11766. res, err := c.doRequest("json")
  11767. if res != nil && res.StatusCode == http.StatusNotModified {
  11768. if res.Body != nil {
  11769. res.Body.Close()
  11770. }
  11771. return nil, &googleapi.Error{
  11772. Code: res.StatusCode,
  11773. Header: res.Header,
  11774. }
  11775. }
  11776. if err != nil {
  11777. return nil, err
  11778. }
  11779. defer googleapi.CloseBody(res)
  11780. if err := googleapi.CheckResponse(res); err != nil {
  11781. return nil, err
  11782. }
  11783. ret := &Upload{
  11784. ServerResponse: googleapi.ServerResponse{
  11785. Header: res.Header,
  11786. HTTPStatusCode: res.StatusCode,
  11787. },
  11788. }
  11789. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11790. return nil, err
  11791. }
  11792. return ret, nil
  11793. // {
  11794. // "description": "List uploads to which the user has access.",
  11795. // "httpMethod": "GET",
  11796. // "id": "analytics.management.uploads.get",
  11797. // "parameterOrder": [
  11798. // "accountId",
  11799. // "webPropertyId",
  11800. // "customDataSourceId",
  11801. // "uploadId"
  11802. // ],
  11803. // "parameters": {
  11804. // "accountId": {
  11805. // "description": "Account Id for the upload to retrieve.",
  11806. // "location": "path",
  11807. // "pattern": "\\d+",
  11808. // "required": true,
  11809. // "type": "string"
  11810. // },
  11811. // "customDataSourceId": {
  11812. // "description": "Custom data source Id for upload to retrieve.",
  11813. // "location": "path",
  11814. // "pattern": ".{22}",
  11815. // "required": true,
  11816. // "type": "string"
  11817. // },
  11818. // "uploadId": {
  11819. // "description": "Upload Id to retrieve.",
  11820. // "location": "path",
  11821. // "pattern": ".{22}",
  11822. // "required": true,
  11823. // "type": "string"
  11824. // },
  11825. // "webPropertyId": {
  11826. // "description": "Web property Id for the upload to retrieve.",
  11827. // "location": "path",
  11828. // "pattern": "UA-(\\d+)-(\\d+)",
  11829. // "required": true,
  11830. // "type": "string"
  11831. // }
  11832. // },
  11833. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}",
  11834. // "response": {
  11835. // "$ref": "Upload"
  11836. // },
  11837. // "scopes": [
  11838. // "https://www.googleapis.com/auth/analytics",
  11839. // "https://www.googleapis.com/auth/analytics.edit",
  11840. // "https://www.googleapis.com/auth/analytics.readonly"
  11841. // ]
  11842. // }
  11843. }
  11844. // method id "analytics.management.uploads.list":
  11845. type ManagementUploadsListCall struct {
  11846. s *Service
  11847. accountId string
  11848. webPropertyId string
  11849. customDataSourceId string
  11850. urlParams_ gensupport.URLParams
  11851. ifNoneMatch_ string
  11852. ctx_ context.Context
  11853. }
  11854. // List: List uploads to which the user has access.
  11855. func (r *ManagementUploadsService) List(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsListCall {
  11856. c := &ManagementUploadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11857. c.accountId = accountId
  11858. c.webPropertyId = webPropertyId
  11859. c.customDataSourceId = customDataSourceId
  11860. return c
  11861. }
  11862. // MaxResults sets the optional parameter "max-results": The maximum
  11863. // number of uploads to include in this response.
  11864. func (c *ManagementUploadsListCall) MaxResults(maxResults int64) *ManagementUploadsListCall {
  11865. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  11866. return c
  11867. }
  11868. // StartIndex sets the optional parameter "start-index": A 1-based index
  11869. // of the first upload to retrieve. Use this parameter as a pagination
  11870. // mechanism along with the max-results parameter.
  11871. func (c *ManagementUploadsListCall) StartIndex(startIndex int64) *ManagementUploadsListCall {
  11872. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  11873. return c
  11874. }
  11875. // Fields allows partial responses to be retrieved. See
  11876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11877. // for more information.
  11878. func (c *ManagementUploadsListCall) Fields(s ...googleapi.Field) *ManagementUploadsListCall {
  11879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11880. return c
  11881. }
  11882. // IfNoneMatch sets the optional parameter which makes the operation
  11883. // fail if the object's ETag matches the given value. This is useful for
  11884. // getting updates only after the object has changed since the last
  11885. // request. Use googleapi.IsNotModified to check whether the response
  11886. // error from Do is the result of In-None-Match.
  11887. func (c *ManagementUploadsListCall) IfNoneMatch(entityTag string) *ManagementUploadsListCall {
  11888. c.ifNoneMatch_ = entityTag
  11889. return c
  11890. }
  11891. // Context sets the context to be used in this call's Do method. Any
  11892. // pending HTTP request will be aborted if the provided context is
  11893. // canceled.
  11894. func (c *ManagementUploadsListCall) Context(ctx context.Context) *ManagementUploadsListCall {
  11895. c.ctx_ = ctx
  11896. return c
  11897. }
  11898. func (c *ManagementUploadsListCall) doRequest(alt string) (*http.Response, error) {
  11899. var body io.Reader = nil
  11900. c.urlParams_.Set("alt", alt)
  11901. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads")
  11902. urls += "?" + c.urlParams_.Encode()
  11903. req, _ := http.NewRequest("GET", urls, body)
  11904. googleapi.Expand(req.URL, map[string]string{
  11905. "accountId": c.accountId,
  11906. "webPropertyId": c.webPropertyId,
  11907. "customDataSourceId": c.customDataSourceId,
  11908. })
  11909. req.Header.Set("User-Agent", c.s.userAgent())
  11910. if c.ifNoneMatch_ != "" {
  11911. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11912. }
  11913. if c.ctx_ != nil {
  11914. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11915. }
  11916. return c.s.client.Do(req)
  11917. }
  11918. // Do executes the "analytics.management.uploads.list" call.
  11919. // Exactly one of *Uploads or error will be non-nil. Any non-2xx status
  11920. // code is an error. Response headers are in either
  11921. // *Uploads.ServerResponse.Header or (if a response was returned at all)
  11922. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11923. // check whether the returned error was because http.StatusNotModified
  11924. // was returned.
  11925. func (c *ManagementUploadsListCall) Do(opts ...googleapi.CallOption) (*Uploads, error) {
  11926. gensupport.SetOptions(c.urlParams_, opts...)
  11927. res, err := c.doRequest("json")
  11928. if res != nil && res.StatusCode == http.StatusNotModified {
  11929. if res.Body != nil {
  11930. res.Body.Close()
  11931. }
  11932. return nil, &googleapi.Error{
  11933. Code: res.StatusCode,
  11934. Header: res.Header,
  11935. }
  11936. }
  11937. if err != nil {
  11938. return nil, err
  11939. }
  11940. defer googleapi.CloseBody(res)
  11941. if err := googleapi.CheckResponse(res); err != nil {
  11942. return nil, err
  11943. }
  11944. ret := &Uploads{
  11945. ServerResponse: googleapi.ServerResponse{
  11946. Header: res.Header,
  11947. HTTPStatusCode: res.StatusCode,
  11948. },
  11949. }
  11950. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11951. return nil, err
  11952. }
  11953. return ret, nil
  11954. // {
  11955. // "description": "List uploads to which the user has access.",
  11956. // "httpMethod": "GET",
  11957. // "id": "analytics.management.uploads.list",
  11958. // "parameterOrder": [
  11959. // "accountId",
  11960. // "webPropertyId",
  11961. // "customDataSourceId"
  11962. // ],
  11963. // "parameters": {
  11964. // "accountId": {
  11965. // "description": "Account Id for the uploads to retrieve.",
  11966. // "location": "path",
  11967. // "pattern": "\\d+",
  11968. // "required": true,
  11969. // "type": "string"
  11970. // },
  11971. // "customDataSourceId": {
  11972. // "description": "Custom data source Id for uploads to retrieve.",
  11973. // "location": "path",
  11974. // "pattern": ".{22}",
  11975. // "required": true,
  11976. // "type": "string"
  11977. // },
  11978. // "max-results": {
  11979. // "description": "The maximum number of uploads to include in this response.",
  11980. // "format": "int32",
  11981. // "location": "query",
  11982. // "minimum": "1",
  11983. // "type": "integer"
  11984. // },
  11985. // "start-index": {
  11986. // "description": "A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  11987. // "format": "int32",
  11988. // "location": "query",
  11989. // "minimum": "1",
  11990. // "type": "integer"
  11991. // },
  11992. // "webPropertyId": {
  11993. // "description": "Web property Id for the uploads to retrieve.",
  11994. // "location": "path",
  11995. // "pattern": "UA-(\\d+)-(\\d+)",
  11996. // "required": true,
  11997. // "type": "string"
  11998. // }
  11999. // },
  12000. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads",
  12001. // "response": {
  12002. // "$ref": "Uploads"
  12003. // },
  12004. // "scopes": [
  12005. // "https://www.googleapis.com/auth/analytics",
  12006. // "https://www.googleapis.com/auth/analytics.edit",
  12007. // "https://www.googleapis.com/auth/analytics.readonly"
  12008. // ]
  12009. // }
  12010. }
  12011. // method id "analytics.management.uploads.uploadData":
  12012. type ManagementUploadsUploadDataCall struct {
  12013. s *Service
  12014. accountId string
  12015. webPropertyId string
  12016. customDataSourceId string
  12017. urlParams_ gensupport.URLParams
  12018. media_ io.Reader
  12019. resumableBuffer_ *gensupport.ResumableBuffer
  12020. mediaType_ string
  12021. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  12022. progressUpdater_ googleapi.ProgressUpdater
  12023. ctx_ context.Context
  12024. }
  12025. // UploadData: Upload data for a custom data source.
  12026. func (r *ManagementUploadsService) UploadData(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsUploadDataCall {
  12027. c := &ManagementUploadsUploadDataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12028. c.accountId = accountId
  12029. c.webPropertyId = webPropertyId
  12030. c.customDataSourceId = customDataSourceId
  12031. return c
  12032. }
  12033. // Media specifies the media to upload in one or more chunks. The chunk
  12034. // size may be controlled by supplying a MediaOption generated by
  12035. // googleapi.ChunkSize. The chunk size defaults to
  12036. // googleapi.DefaultUploadChunkSize.
  12037. // At most one of Media and ResumableMedia may be set.
  12038. func (c *ManagementUploadsUploadDataCall) Media(r io.Reader, options ...googleapi.MediaOption) *ManagementUploadsUploadDataCall {
  12039. opts := googleapi.ProcessMediaOptions(options)
  12040. chunkSize := opts.ChunkSize
  12041. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  12042. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  12043. return c
  12044. }
  12045. // ResumableMedia specifies the media to upload in chunks and can be
  12046. // canceled with ctx.
  12047. //
  12048. // Deprecated: use Media instead.
  12049. //
  12050. // At most one of Media and ResumableMedia may be set. mediaType
  12051. // identifies the MIME media type of the upload, such as "image/png". If
  12052. // mediaType is "", it will be auto-detected. The provided ctx will
  12053. // supersede any context previously provided to the Context method.
  12054. func (c *ManagementUploadsUploadDataCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ManagementUploadsUploadDataCall {
  12055. c.ctx_ = ctx
  12056. rdr := gensupport.ReaderAtToReader(r, size)
  12057. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  12058. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  12059. c.media_ = nil
  12060. c.mediaSize_ = size
  12061. return c
  12062. }
  12063. // ProgressUpdater provides a callback function that will be called
  12064. // after every chunk. It should be a low-latency function in order to
  12065. // not slow down the upload operation. This should only be called when
  12066. // using ResumableMedia (as opposed to Media).
  12067. func (c *ManagementUploadsUploadDataCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ManagementUploadsUploadDataCall {
  12068. c.progressUpdater_ = pu
  12069. return c
  12070. }
  12071. // Fields allows partial responses to be retrieved. See
  12072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12073. // for more information.
  12074. func (c *ManagementUploadsUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsUploadDataCall {
  12075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12076. return c
  12077. }
  12078. // Context sets the context to be used in this call's Do method. Any
  12079. // pending HTTP request will be aborted if the provided context is
  12080. // canceled.
  12081. // This context will supersede any context previously provided to the
  12082. // ResumableMedia method.
  12083. func (c *ManagementUploadsUploadDataCall) Context(ctx context.Context) *ManagementUploadsUploadDataCall {
  12084. c.ctx_ = ctx
  12085. return c
  12086. }
  12087. func (c *ManagementUploadsUploadDataCall) doRequest(alt string) (*http.Response, error) {
  12088. var body io.Reader = nil
  12089. c.urlParams_.Set("alt", alt)
  12090. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads")
  12091. if c.media_ != nil || c.resumableBuffer_ != nil {
  12092. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  12093. protocol := "multipart"
  12094. if c.resumableBuffer_ != nil {
  12095. protocol = "resumable"
  12096. }
  12097. c.urlParams_.Set("uploadType", protocol)
  12098. }
  12099. urls += "?" + c.urlParams_.Encode()
  12100. body = new(bytes.Buffer)
  12101. ctype := "application/json"
  12102. if c.media_ != nil {
  12103. var combined io.ReadCloser
  12104. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  12105. defer combined.Close()
  12106. body = combined
  12107. }
  12108. req, _ := http.NewRequest("POST", urls, body)
  12109. googleapi.Expand(req.URL, map[string]string{
  12110. "accountId": c.accountId,
  12111. "webPropertyId": c.webPropertyId,
  12112. "customDataSourceId": c.customDataSourceId,
  12113. })
  12114. if c.resumableBuffer_ != nil {
  12115. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  12116. }
  12117. req.Header.Set("Content-Type", ctype)
  12118. req.Header.Set("User-Agent", c.s.userAgent())
  12119. if c.ctx_ != nil {
  12120. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12121. }
  12122. return c.s.client.Do(req)
  12123. }
  12124. // Do executes the "analytics.management.uploads.uploadData" call.
  12125. // Exactly one of *Upload or error will be non-nil. Any non-2xx status
  12126. // code is an error. Response headers are in either
  12127. // *Upload.ServerResponse.Header or (if a response was returned at all)
  12128. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12129. // check whether the returned error was because http.StatusNotModified
  12130. // was returned.
  12131. func (c *ManagementUploadsUploadDataCall) Do(opts ...googleapi.CallOption) (*Upload, error) {
  12132. gensupport.SetOptions(c.urlParams_, opts...)
  12133. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  12134. return c.doRequest("json")
  12135. }, gensupport.DefaultBackoffStrategy())
  12136. if res != nil && res.StatusCode == http.StatusNotModified {
  12137. if res.Body != nil {
  12138. res.Body.Close()
  12139. }
  12140. return nil, &googleapi.Error{
  12141. Code: res.StatusCode,
  12142. Header: res.Header,
  12143. }
  12144. }
  12145. if err != nil {
  12146. return nil, err
  12147. }
  12148. defer googleapi.CloseBody(res)
  12149. if err := googleapi.CheckResponse(res); err != nil {
  12150. return nil, err
  12151. }
  12152. if c.resumableBuffer_ != nil {
  12153. loc := res.Header.Get("Location")
  12154. rx := &gensupport.ResumableUpload{
  12155. Client: c.s.client,
  12156. UserAgent: c.s.userAgent(),
  12157. URI: loc,
  12158. Media: c.resumableBuffer_,
  12159. MediaType: c.mediaType_,
  12160. Callback: func(curr int64) {
  12161. if c.progressUpdater_ != nil {
  12162. c.progressUpdater_(curr, c.mediaSize_)
  12163. }
  12164. },
  12165. }
  12166. ctx := c.ctx_
  12167. if ctx == nil {
  12168. ctx = context.TODO()
  12169. }
  12170. res, err = rx.Upload(ctx)
  12171. if err != nil {
  12172. return nil, err
  12173. }
  12174. defer res.Body.Close()
  12175. if err := googleapi.CheckResponse(res); err != nil {
  12176. return nil, err
  12177. }
  12178. }
  12179. ret := &Upload{
  12180. ServerResponse: googleapi.ServerResponse{
  12181. Header: res.Header,
  12182. HTTPStatusCode: res.StatusCode,
  12183. },
  12184. }
  12185. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12186. return nil, err
  12187. }
  12188. return ret, nil
  12189. // {
  12190. // "description": "Upload data for a custom data source.",
  12191. // "httpMethod": "POST",
  12192. // "id": "analytics.management.uploads.uploadData",
  12193. // "mediaUpload": {
  12194. // "accept": [
  12195. // "application/octet-stream"
  12196. // ],
  12197. // "maxSize": "1GB",
  12198. // "protocols": {
  12199. // "resumable": {
  12200. // "multipart": true,
  12201. // "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"
  12202. // },
  12203. // "simple": {
  12204. // "multipart": true,
  12205. // "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"
  12206. // }
  12207. // }
  12208. // },
  12209. // "parameterOrder": [
  12210. // "accountId",
  12211. // "webPropertyId",
  12212. // "customDataSourceId"
  12213. // ],
  12214. // "parameters": {
  12215. // "accountId": {
  12216. // "description": "Account Id associated with the upload.",
  12217. // "location": "path",
  12218. // "pattern": "\\d+",
  12219. // "required": true,
  12220. // "type": "string"
  12221. // },
  12222. // "customDataSourceId": {
  12223. // "description": "Custom data source Id to which the data being uploaded belongs.",
  12224. // "location": "path",
  12225. // "required": true,
  12226. // "type": "string"
  12227. // },
  12228. // "webPropertyId": {
  12229. // "description": "Web property UA-string associated with the upload.",
  12230. // "location": "path",
  12231. // "pattern": "UA-\\d+-\\d+",
  12232. // "required": true,
  12233. // "type": "string"
  12234. // }
  12235. // },
  12236. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads",
  12237. // "response": {
  12238. // "$ref": "Upload"
  12239. // },
  12240. // "scopes": [
  12241. // "https://www.googleapis.com/auth/analytics",
  12242. // "https://www.googleapis.com/auth/analytics.edit"
  12243. // ],
  12244. // "supportsMediaUpload": true
  12245. // }
  12246. }
  12247. // method id "analytics.management.webPropertyAdWordsLinks.delete":
  12248. type ManagementWebPropertyAdWordsLinksDeleteCall struct {
  12249. s *Service
  12250. accountId string
  12251. webPropertyId string
  12252. webPropertyAdWordsLinkId string
  12253. urlParams_ gensupport.URLParams
  12254. ctx_ context.Context
  12255. }
  12256. // Delete: Deletes a web property-AdWords link.
  12257. func (r *ManagementWebPropertyAdWordsLinksService) Delete(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksDeleteCall {
  12258. c := &ManagementWebPropertyAdWordsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12259. c.accountId = accountId
  12260. c.webPropertyId = webPropertyId
  12261. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  12262. return c
  12263. }
  12264. // Fields allows partial responses to be retrieved. See
  12265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12266. // for more information.
  12267. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksDeleteCall {
  12268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12269. return c
  12270. }
  12271. // Context sets the context to be used in this call's Do method. Any
  12272. // pending HTTP request will be aborted if the provided context is
  12273. // canceled.
  12274. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksDeleteCall {
  12275. c.ctx_ = ctx
  12276. return c
  12277. }
  12278. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  12279. var body io.Reader = nil
  12280. c.urlParams_.Set("alt", alt)
  12281. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  12282. urls += "?" + c.urlParams_.Encode()
  12283. req, _ := http.NewRequest("DELETE", urls, body)
  12284. googleapi.Expand(req.URL, map[string]string{
  12285. "accountId": c.accountId,
  12286. "webPropertyId": c.webPropertyId,
  12287. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  12288. })
  12289. req.Header.Set("User-Agent", c.s.userAgent())
  12290. if c.ctx_ != nil {
  12291. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12292. }
  12293. return c.s.client.Do(req)
  12294. }
  12295. // Do executes the "analytics.management.webPropertyAdWordsLinks.delete" call.
  12296. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  12297. gensupport.SetOptions(c.urlParams_, opts...)
  12298. res, err := c.doRequest("json")
  12299. if err != nil {
  12300. return err
  12301. }
  12302. defer googleapi.CloseBody(res)
  12303. if err := googleapi.CheckResponse(res); err != nil {
  12304. return err
  12305. }
  12306. return nil
  12307. // {
  12308. // "description": "Deletes a web property-AdWords link.",
  12309. // "httpMethod": "DELETE",
  12310. // "id": "analytics.management.webPropertyAdWordsLinks.delete",
  12311. // "parameterOrder": [
  12312. // "accountId",
  12313. // "webPropertyId",
  12314. // "webPropertyAdWordsLinkId"
  12315. // ],
  12316. // "parameters": {
  12317. // "accountId": {
  12318. // "description": "ID of the account which the given web property belongs to.",
  12319. // "location": "path",
  12320. // "required": true,
  12321. // "type": "string"
  12322. // },
  12323. // "webPropertyAdWordsLinkId": {
  12324. // "description": "Web property AdWords link ID.",
  12325. // "location": "path",
  12326. // "required": true,
  12327. // "type": "string"
  12328. // },
  12329. // "webPropertyId": {
  12330. // "description": "Web property ID to delete the AdWords link for.",
  12331. // "location": "path",
  12332. // "required": true,
  12333. // "type": "string"
  12334. // }
  12335. // },
  12336. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  12337. // "scopes": [
  12338. // "https://www.googleapis.com/auth/analytics.edit"
  12339. // ]
  12340. // }
  12341. }
  12342. // method id "analytics.management.webPropertyAdWordsLinks.get":
  12343. type ManagementWebPropertyAdWordsLinksGetCall struct {
  12344. s *Service
  12345. accountId string
  12346. webPropertyId string
  12347. webPropertyAdWordsLinkId string
  12348. urlParams_ gensupport.URLParams
  12349. ifNoneMatch_ string
  12350. ctx_ context.Context
  12351. }
  12352. // Get: Returns a web property-AdWords link to which the user has
  12353. // access.
  12354. func (r *ManagementWebPropertyAdWordsLinksService) Get(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksGetCall {
  12355. c := &ManagementWebPropertyAdWordsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12356. c.accountId = accountId
  12357. c.webPropertyId = webPropertyId
  12358. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  12359. return c
  12360. }
  12361. // Fields allows partial responses to be retrieved. See
  12362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12363. // for more information.
  12364. func (c *ManagementWebPropertyAdWordsLinksGetCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksGetCall {
  12365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12366. return c
  12367. }
  12368. // IfNoneMatch sets the optional parameter which makes the operation
  12369. // fail if the object's ETag matches the given value. This is useful for
  12370. // getting updates only after the object has changed since the last
  12371. // request. Use googleapi.IsNotModified to check whether the response
  12372. // error from Do is the result of In-None-Match.
  12373. func (c *ManagementWebPropertyAdWordsLinksGetCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksGetCall {
  12374. c.ifNoneMatch_ = entityTag
  12375. return c
  12376. }
  12377. // Context sets the context to be used in this call's Do method. Any
  12378. // pending HTTP request will be aborted if the provided context is
  12379. // canceled.
  12380. func (c *ManagementWebPropertyAdWordsLinksGetCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksGetCall {
  12381. c.ctx_ = ctx
  12382. return c
  12383. }
  12384. func (c *ManagementWebPropertyAdWordsLinksGetCall) doRequest(alt string) (*http.Response, error) {
  12385. var body io.Reader = nil
  12386. c.urlParams_.Set("alt", alt)
  12387. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  12388. urls += "?" + c.urlParams_.Encode()
  12389. req, _ := http.NewRequest("GET", urls, body)
  12390. googleapi.Expand(req.URL, map[string]string{
  12391. "accountId": c.accountId,
  12392. "webPropertyId": c.webPropertyId,
  12393. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  12394. })
  12395. req.Header.Set("User-Agent", c.s.userAgent())
  12396. if c.ifNoneMatch_ != "" {
  12397. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12398. }
  12399. if c.ctx_ != nil {
  12400. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12401. }
  12402. return c.s.client.Do(req)
  12403. }
  12404. // Do executes the "analytics.management.webPropertyAdWordsLinks.get" call.
  12405. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  12406. // non-2xx status code is an error. Response headers are in either
  12407. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  12408. // returned at all) in error.(*googleapi.Error).Header. Use
  12409. // googleapi.IsNotModified to check whether the returned error was
  12410. // because http.StatusNotModified was returned.
  12411. func (c *ManagementWebPropertyAdWordsLinksGetCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  12412. gensupport.SetOptions(c.urlParams_, opts...)
  12413. res, err := c.doRequest("json")
  12414. if res != nil && res.StatusCode == http.StatusNotModified {
  12415. if res.Body != nil {
  12416. res.Body.Close()
  12417. }
  12418. return nil, &googleapi.Error{
  12419. Code: res.StatusCode,
  12420. Header: res.Header,
  12421. }
  12422. }
  12423. if err != nil {
  12424. return nil, err
  12425. }
  12426. defer googleapi.CloseBody(res)
  12427. if err := googleapi.CheckResponse(res); err != nil {
  12428. return nil, err
  12429. }
  12430. ret := &EntityAdWordsLink{
  12431. ServerResponse: googleapi.ServerResponse{
  12432. Header: res.Header,
  12433. HTTPStatusCode: res.StatusCode,
  12434. },
  12435. }
  12436. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12437. return nil, err
  12438. }
  12439. return ret, nil
  12440. // {
  12441. // "description": "Returns a web property-AdWords link to which the user has access.",
  12442. // "httpMethod": "GET",
  12443. // "id": "analytics.management.webPropertyAdWordsLinks.get",
  12444. // "parameterOrder": [
  12445. // "accountId",
  12446. // "webPropertyId",
  12447. // "webPropertyAdWordsLinkId"
  12448. // ],
  12449. // "parameters": {
  12450. // "accountId": {
  12451. // "description": "ID of the account which the given web property belongs to.",
  12452. // "location": "path",
  12453. // "required": true,
  12454. // "type": "string"
  12455. // },
  12456. // "webPropertyAdWordsLinkId": {
  12457. // "description": "Web property-AdWords link ID.",
  12458. // "location": "path",
  12459. // "required": true,
  12460. // "type": "string"
  12461. // },
  12462. // "webPropertyId": {
  12463. // "description": "Web property ID to retrieve the AdWords link for.",
  12464. // "location": "path",
  12465. // "required": true,
  12466. // "type": "string"
  12467. // }
  12468. // },
  12469. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  12470. // "response": {
  12471. // "$ref": "EntityAdWordsLink"
  12472. // },
  12473. // "scopes": [
  12474. // "https://www.googleapis.com/auth/analytics.edit",
  12475. // "https://www.googleapis.com/auth/analytics.readonly"
  12476. // ]
  12477. // }
  12478. }
  12479. // method id "analytics.management.webPropertyAdWordsLinks.insert":
  12480. type ManagementWebPropertyAdWordsLinksInsertCall struct {
  12481. s *Service
  12482. accountId string
  12483. webPropertyId string
  12484. entityadwordslink *EntityAdWordsLink
  12485. urlParams_ gensupport.URLParams
  12486. ctx_ context.Context
  12487. }
  12488. // Insert: Creates a webProperty-AdWords link.
  12489. func (r *ManagementWebPropertyAdWordsLinksService) Insert(accountId string, webPropertyId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksInsertCall {
  12490. c := &ManagementWebPropertyAdWordsLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12491. c.accountId = accountId
  12492. c.webPropertyId = webPropertyId
  12493. c.entityadwordslink = entityadwordslink
  12494. return c
  12495. }
  12496. // Fields allows partial responses to be retrieved. See
  12497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12498. // for more information.
  12499. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksInsertCall {
  12500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12501. return c
  12502. }
  12503. // Context sets the context to be used in this call's Do method. Any
  12504. // pending HTTP request will be aborted if the provided context is
  12505. // canceled.
  12506. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksInsertCall {
  12507. c.ctx_ = ctx
  12508. return c
  12509. }
  12510. func (c *ManagementWebPropertyAdWordsLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  12511. var body io.Reader = nil
  12512. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  12513. if err != nil {
  12514. return nil, err
  12515. }
  12516. ctype := "application/json"
  12517. c.urlParams_.Set("alt", alt)
  12518. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks")
  12519. urls += "?" + c.urlParams_.Encode()
  12520. req, _ := http.NewRequest("POST", urls, body)
  12521. googleapi.Expand(req.URL, map[string]string{
  12522. "accountId": c.accountId,
  12523. "webPropertyId": c.webPropertyId,
  12524. })
  12525. req.Header.Set("Content-Type", ctype)
  12526. req.Header.Set("User-Agent", c.s.userAgent())
  12527. if c.ctx_ != nil {
  12528. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12529. }
  12530. return c.s.client.Do(req)
  12531. }
  12532. // Do executes the "analytics.management.webPropertyAdWordsLinks.insert" call.
  12533. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  12534. // non-2xx status code is an error. Response headers are in either
  12535. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  12536. // returned at all) in error.(*googleapi.Error).Header. Use
  12537. // googleapi.IsNotModified to check whether the returned error was
  12538. // because http.StatusNotModified was returned.
  12539. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  12540. gensupport.SetOptions(c.urlParams_, opts...)
  12541. res, err := c.doRequest("json")
  12542. if res != nil && res.StatusCode == http.StatusNotModified {
  12543. if res.Body != nil {
  12544. res.Body.Close()
  12545. }
  12546. return nil, &googleapi.Error{
  12547. Code: res.StatusCode,
  12548. Header: res.Header,
  12549. }
  12550. }
  12551. if err != nil {
  12552. return nil, err
  12553. }
  12554. defer googleapi.CloseBody(res)
  12555. if err := googleapi.CheckResponse(res); err != nil {
  12556. return nil, err
  12557. }
  12558. ret := &EntityAdWordsLink{
  12559. ServerResponse: googleapi.ServerResponse{
  12560. Header: res.Header,
  12561. HTTPStatusCode: res.StatusCode,
  12562. },
  12563. }
  12564. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12565. return nil, err
  12566. }
  12567. return ret, nil
  12568. // {
  12569. // "description": "Creates a webProperty-AdWords link.",
  12570. // "httpMethod": "POST",
  12571. // "id": "analytics.management.webPropertyAdWordsLinks.insert",
  12572. // "parameterOrder": [
  12573. // "accountId",
  12574. // "webPropertyId"
  12575. // ],
  12576. // "parameters": {
  12577. // "accountId": {
  12578. // "description": "ID of the Google Analytics account to create the link for.",
  12579. // "location": "path",
  12580. // "required": true,
  12581. // "type": "string"
  12582. // },
  12583. // "webPropertyId": {
  12584. // "description": "Web property ID to create the link for.",
  12585. // "location": "path",
  12586. // "required": true,
  12587. // "type": "string"
  12588. // }
  12589. // },
  12590. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks",
  12591. // "request": {
  12592. // "$ref": "EntityAdWordsLink"
  12593. // },
  12594. // "response": {
  12595. // "$ref": "EntityAdWordsLink"
  12596. // },
  12597. // "scopes": [
  12598. // "https://www.googleapis.com/auth/analytics.edit"
  12599. // ]
  12600. // }
  12601. }
  12602. // method id "analytics.management.webPropertyAdWordsLinks.list":
  12603. type ManagementWebPropertyAdWordsLinksListCall struct {
  12604. s *Service
  12605. accountId string
  12606. webPropertyId string
  12607. urlParams_ gensupport.URLParams
  12608. ifNoneMatch_ string
  12609. ctx_ context.Context
  12610. }
  12611. // List: Lists webProperty-AdWords links for a given web property.
  12612. func (r *ManagementWebPropertyAdWordsLinksService) List(accountId string, webPropertyId string) *ManagementWebPropertyAdWordsLinksListCall {
  12613. c := &ManagementWebPropertyAdWordsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12614. c.accountId = accountId
  12615. c.webPropertyId = webPropertyId
  12616. return c
  12617. }
  12618. // MaxResults sets the optional parameter "max-results": The maximum
  12619. // number of webProperty-AdWords links to include in this response.
  12620. func (c *ManagementWebPropertyAdWordsLinksListCall) MaxResults(maxResults int64) *ManagementWebPropertyAdWordsLinksListCall {
  12621. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  12622. return c
  12623. }
  12624. // StartIndex sets the optional parameter "start-index": An index of the
  12625. // first webProperty-AdWords link to retrieve. Use this parameter as a
  12626. // pagination mechanism along with the max-results parameter.
  12627. func (c *ManagementWebPropertyAdWordsLinksListCall) StartIndex(startIndex int64) *ManagementWebPropertyAdWordsLinksListCall {
  12628. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  12629. return c
  12630. }
  12631. // Fields allows partial responses to be retrieved. See
  12632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12633. // for more information.
  12634. func (c *ManagementWebPropertyAdWordsLinksListCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksListCall {
  12635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12636. return c
  12637. }
  12638. // IfNoneMatch sets the optional parameter which makes the operation
  12639. // fail if the object's ETag matches the given value. This is useful for
  12640. // getting updates only after the object has changed since the last
  12641. // request. Use googleapi.IsNotModified to check whether the response
  12642. // error from Do is the result of In-None-Match.
  12643. func (c *ManagementWebPropertyAdWordsLinksListCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksListCall {
  12644. c.ifNoneMatch_ = entityTag
  12645. return c
  12646. }
  12647. // Context sets the context to be used in this call's Do method. Any
  12648. // pending HTTP request will be aborted if the provided context is
  12649. // canceled.
  12650. func (c *ManagementWebPropertyAdWordsLinksListCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksListCall {
  12651. c.ctx_ = ctx
  12652. return c
  12653. }
  12654. func (c *ManagementWebPropertyAdWordsLinksListCall) doRequest(alt string) (*http.Response, error) {
  12655. var body io.Reader = nil
  12656. c.urlParams_.Set("alt", alt)
  12657. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks")
  12658. urls += "?" + c.urlParams_.Encode()
  12659. req, _ := http.NewRequest("GET", urls, body)
  12660. googleapi.Expand(req.URL, map[string]string{
  12661. "accountId": c.accountId,
  12662. "webPropertyId": c.webPropertyId,
  12663. })
  12664. req.Header.Set("User-Agent", c.s.userAgent())
  12665. if c.ifNoneMatch_ != "" {
  12666. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12667. }
  12668. if c.ctx_ != nil {
  12669. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12670. }
  12671. return c.s.client.Do(req)
  12672. }
  12673. // Do executes the "analytics.management.webPropertyAdWordsLinks.list" call.
  12674. // Exactly one of *EntityAdWordsLinks or error will be non-nil. Any
  12675. // non-2xx status code is an error. Response headers are in either
  12676. // *EntityAdWordsLinks.ServerResponse.Header or (if a response was
  12677. // returned at all) in error.(*googleapi.Error).Header. Use
  12678. // googleapi.IsNotModified to check whether the returned error was
  12679. // because http.StatusNotModified was returned.
  12680. func (c *ManagementWebPropertyAdWordsLinksListCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLinks, error) {
  12681. gensupport.SetOptions(c.urlParams_, opts...)
  12682. res, err := c.doRequest("json")
  12683. if res != nil && res.StatusCode == http.StatusNotModified {
  12684. if res.Body != nil {
  12685. res.Body.Close()
  12686. }
  12687. return nil, &googleapi.Error{
  12688. Code: res.StatusCode,
  12689. Header: res.Header,
  12690. }
  12691. }
  12692. if err != nil {
  12693. return nil, err
  12694. }
  12695. defer googleapi.CloseBody(res)
  12696. if err := googleapi.CheckResponse(res); err != nil {
  12697. return nil, err
  12698. }
  12699. ret := &EntityAdWordsLinks{
  12700. ServerResponse: googleapi.ServerResponse{
  12701. Header: res.Header,
  12702. HTTPStatusCode: res.StatusCode,
  12703. },
  12704. }
  12705. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12706. return nil, err
  12707. }
  12708. return ret, nil
  12709. // {
  12710. // "description": "Lists webProperty-AdWords links for a given web property.",
  12711. // "httpMethod": "GET",
  12712. // "id": "analytics.management.webPropertyAdWordsLinks.list",
  12713. // "parameterOrder": [
  12714. // "accountId",
  12715. // "webPropertyId"
  12716. // ],
  12717. // "parameters": {
  12718. // "accountId": {
  12719. // "description": "ID of the account which the given web property belongs to.",
  12720. // "location": "path",
  12721. // "pattern": "\\d+",
  12722. // "required": true,
  12723. // "type": "string"
  12724. // },
  12725. // "max-results": {
  12726. // "description": "The maximum number of webProperty-AdWords links to include in this response.",
  12727. // "format": "int32",
  12728. // "location": "query",
  12729. // "type": "integer"
  12730. // },
  12731. // "start-index": {
  12732. // "description": "An index of the first webProperty-AdWords link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  12733. // "format": "int32",
  12734. // "location": "query",
  12735. // "minimum": "1",
  12736. // "type": "integer"
  12737. // },
  12738. // "webPropertyId": {
  12739. // "description": "Web property ID to retrieve the AdWords links for.",
  12740. // "location": "path",
  12741. // "required": true,
  12742. // "type": "string"
  12743. // }
  12744. // },
  12745. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks",
  12746. // "response": {
  12747. // "$ref": "EntityAdWordsLinks"
  12748. // },
  12749. // "scopes": [
  12750. // "https://www.googleapis.com/auth/analytics.edit",
  12751. // "https://www.googleapis.com/auth/analytics.readonly"
  12752. // ]
  12753. // }
  12754. }
  12755. // method id "analytics.management.webPropertyAdWordsLinks.patch":
  12756. type ManagementWebPropertyAdWordsLinksPatchCall struct {
  12757. s *Service
  12758. accountId string
  12759. webPropertyId string
  12760. webPropertyAdWordsLinkId string
  12761. entityadwordslink *EntityAdWordsLink
  12762. urlParams_ gensupport.URLParams
  12763. ctx_ context.Context
  12764. }
  12765. // Patch: Updates an existing webProperty-AdWords link. This method
  12766. // supports patch semantics.
  12767. func (r *ManagementWebPropertyAdWordsLinksService) Patch(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksPatchCall {
  12768. c := &ManagementWebPropertyAdWordsLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12769. c.accountId = accountId
  12770. c.webPropertyId = webPropertyId
  12771. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  12772. c.entityadwordslink = entityadwordslink
  12773. return c
  12774. }
  12775. // Fields allows partial responses to be retrieved. See
  12776. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12777. // for more information.
  12778. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksPatchCall {
  12779. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12780. return c
  12781. }
  12782. // Context sets the context to be used in this call's Do method. Any
  12783. // pending HTTP request will be aborted if the provided context is
  12784. // canceled.
  12785. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksPatchCall {
  12786. c.ctx_ = ctx
  12787. return c
  12788. }
  12789. func (c *ManagementWebPropertyAdWordsLinksPatchCall) doRequest(alt string) (*http.Response, error) {
  12790. var body io.Reader = nil
  12791. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  12792. if err != nil {
  12793. return nil, err
  12794. }
  12795. ctype := "application/json"
  12796. c.urlParams_.Set("alt", alt)
  12797. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  12798. urls += "?" + c.urlParams_.Encode()
  12799. req, _ := http.NewRequest("PATCH", urls, body)
  12800. googleapi.Expand(req.URL, map[string]string{
  12801. "accountId": c.accountId,
  12802. "webPropertyId": c.webPropertyId,
  12803. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  12804. })
  12805. req.Header.Set("Content-Type", ctype)
  12806. req.Header.Set("User-Agent", c.s.userAgent())
  12807. if c.ctx_ != nil {
  12808. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12809. }
  12810. return c.s.client.Do(req)
  12811. }
  12812. // Do executes the "analytics.management.webPropertyAdWordsLinks.patch" call.
  12813. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  12814. // non-2xx status code is an error. Response headers are in either
  12815. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  12816. // returned at all) in error.(*googleapi.Error).Header. Use
  12817. // googleapi.IsNotModified to check whether the returned error was
  12818. // because http.StatusNotModified was returned.
  12819. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  12820. gensupport.SetOptions(c.urlParams_, opts...)
  12821. res, err := c.doRequest("json")
  12822. if res != nil && res.StatusCode == http.StatusNotModified {
  12823. if res.Body != nil {
  12824. res.Body.Close()
  12825. }
  12826. return nil, &googleapi.Error{
  12827. Code: res.StatusCode,
  12828. Header: res.Header,
  12829. }
  12830. }
  12831. if err != nil {
  12832. return nil, err
  12833. }
  12834. defer googleapi.CloseBody(res)
  12835. if err := googleapi.CheckResponse(res); err != nil {
  12836. return nil, err
  12837. }
  12838. ret := &EntityAdWordsLink{
  12839. ServerResponse: googleapi.ServerResponse{
  12840. Header: res.Header,
  12841. HTTPStatusCode: res.StatusCode,
  12842. },
  12843. }
  12844. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12845. return nil, err
  12846. }
  12847. return ret, nil
  12848. // {
  12849. // "description": "Updates an existing webProperty-AdWords link. This method supports patch semantics.",
  12850. // "httpMethod": "PATCH",
  12851. // "id": "analytics.management.webPropertyAdWordsLinks.patch",
  12852. // "parameterOrder": [
  12853. // "accountId",
  12854. // "webPropertyId",
  12855. // "webPropertyAdWordsLinkId"
  12856. // ],
  12857. // "parameters": {
  12858. // "accountId": {
  12859. // "description": "ID of the account which the given web property belongs to.",
  12860. // "location": "path",
  12861. // "required": true,
  12862. // "type": "string"
  12863. // },
  12864. // "webPropertyAdWordsLinkId": {
  12865. // "description": "Web property-AdWords link ID.",
  12866. // "location": "path",
  12867. // "required": true,
  12868. // "type": "string"
  12869. // },
  12870. // "webPropertyId": {
  12871. // "description": "Web property ID to retrieve the AdWords link for.",
  12872. // "location": "path",
  12873. // "required": true,
  12874. // "type": "string"
  12875. // }
  12876. // },
  12877. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  12878. // "request": {
  12879. // "$ref": "EntityAdWordsLink"
  12880. // },
  12881. // "response": {
  12882. // "$ref": "EntityAdWordsLink"
  12883. // },
  12884. // "scopes": [
  12885. // "https://www.googleapis.com/auth/analytics.edit"
  12886. // ]
  12887. // }
  12888. }
  12889. // method id "analytics.management.webPropertyAdWordsLinks.update":
  12890. type ManagementWebPropertyAdWordsLinksUpdateCall struct {
  12891. s *Service
  12892. accountId string
  12893. webPropertyId string
  12894. webPropertyAdWordsLinkId string
  12895. entityadwordslink *EntityAdWordsLink
  12896. urlParams_ gensupport.URLParams
  12897. ctx_ context.Context
  12898. }
  12899. // Update: Updates an existing webProperty-AdWords link.
  12900. func (r *ManagementWebPropertyAdWordsLinksService) Update(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksUpdateCall {
  12901. c := &ManagementWebPropertyAdWordsLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12902. c.accountId = accountId
  12903. c.webPropertyId = webPropertyId
  12904. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  12905. c.entityadwordslink = entityadwordslink
  12906. return c
  12907. }
  12908. // Fields allows partial responses to be retrieved. See
  12909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12910. // for more information.
  12911. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksUpdateCall {
  12912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12913. return c
  12914. }
  12915. // Context sets the context to be used in this call's Do method. Any
  12916. // pending HTTP request will be aborted if the provided context is
  12917. // canceled.
  12918. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksUpdateCall {
  12919. c.ctx_ = ctx
  12920. return c
  12921. }
  12922. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  12923. var body io.Reader = nil
  12924. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  12925. if err != nil {
  12926. return nil, err
  12927. }
  12928. ctype := "application/json"
  12929. c.urlParams_.Set("alt", alt)
  12930. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  12931. urls += "?" + c.urlParams_.Encode()
  12932. req, _ := http.NewRequest("PUT", urls, body)
  12933. googleapi.Expand(req.URL, map[string]string{
  12934. "accountId": c.accountId,
  12935. "webPropertyId": c.webPropertyId,
  12936. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  12937. })
  12938. req.Header.Set("Content-Type", ctype)
  12939. req.Header.Set("User-Agent", c.s.userAgent())
  12940. if c.ctx_ != nil {
  12941. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12942. }
  12943. return c.s.client.Do(req)
  12944. }
  12945. // Do executes the "analytics.management.webPropertyAdWordsLinks.update" call.
  12946. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  12947. // non-2xx status code is an error. Response headers are in either
  12948. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  12949. // returned at all) in error.(*googleapi.Error).Header. Use
  12950. // googleapi.IsNotModified to check whether the returned error was
  12951. // because http.StatusNotModified was returned.
  12952. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  12953. gensupport.SetOptions(c.urlParams_, opts...)
  12954. res, err := c.doRequest("json")
  12955. if res != nil && res.StatusCode == http.StatusNotModified {
  12956. if res.Body != nil {
  12957. res.Body.Close()
  12958. }
  12959. return nil, &googleapi.Error{
  12960. Code: res.StatusCode,
  12961. Header: res.Header,
  12962. }
  12963. }
  12964. if err != nil {
  12965. return nil, err
  12966. }
  12967. defer googleapi.CloseBody(res)
  12968. if err := googleapi.CheckResponse(res); err != nil {
  12969. return nil, err
  12970. }
  12971. ret := &EntityAdWordsLink{
  12972. ServerResponse: googleapi.ServerResponse{
  12973. Header: res.Header,
  12974. HTTPStatusCode: res.StatusCode,
  12975. },
  12976. }
  12977. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12978. return nil, err
  12979. }
  12980. return ret, nil
  12981. // {
  12982. // "description": "Updates an existing webProperty-AdWords link.",
  12983. // "httpMethod": "PUT",
  12984. // "id": "analytics.management.webPropertyAdWordsLinks.update",
  12985. // "parameterOrder": [
  12986. // "accountId",
  12987. // "webPropertyId",
  12988. // "webPropertyAdWordsLinkId"
  12989. // ],
  12990. // "parameters": {
  12991. // "accountId": {
  12992. // "description": "ID of the account which the given web property belongs to.",
  12993. // "location": "path",
  12994. // "required": true,
  12995. // "type": "string"
  12996. // },
  12997. // "webPropertyAdWordsLinkId": {
  12998. // "description": "Web property-AdWords link ID.",
  12999. // "location": "path",
  13000. // "required": true,
  13001. // "type": "string"
  13002. // },
  13003. // "webPropertyId": {
  13004. // "description": "Web property ID to retrieve the AdWords link for.",
  13005. // "location": "path",
  13006. // "required": true,
  13007. // "type": "string"
  13008. // }
  13009. // },
  13010. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  13011. // "request": {
  13012. // "$ref": "EntityAdWordsLink"
  13013. // },
  13014. // "response": {
  13015. // "$ref": "EntityAdWordsLink"
  13016. // },
  13017. // "scopes": [
  13018. // "https://www.googleapis.com/auth/analytics.edit"
  13019. // ]
  13020. // }
  13021. }
  13022. // method id "analytics.management.webproperties.get":
  13023. type ManagementWebpropertiesGetCall struct {
  13024. s *Service
  13025. accountId string
  13026. webPropertyId string
  13027. urlParams_ gensupport.URLParams
  13028. ifNoneMatch_ string
  13029. ctx_ context.Context
  13030. }
  13031. // Get: Gets a web property to which the user has access.
  13032. func (r *ManagementWebpropertiesService) Get(accountId string, webPropertyId string) *ManagementWebpropertiesGetCall {
  13033. c := &ManagementWebpropertiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13034. c.accountId = accountId
  13035. c.webPropertyId = webPropertyId
  13036. return c
  13037. }
  13038. // Fields allows partial responses to be retrieved. See
  13039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13040. // for more information.
  13041. func (c *ManagementWebpropertiesGetCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesGetCall {
  13042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13043. return c
  13044. }
  13045. // IfNoneMatch sets the optional parameter which makes the operation
  13046. // fail if the object's ETag matches the given value. This is useful for
  13047. // getting updates only after the object has changed since the last
  13048. // request. Use googleapi.IsNotModified to check whether the response
  13049. // error from Do is the result of In-None-Match.
  13050. func (c *ManagementWebpropertiesGetCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesGetCall {
  13051. c.ifNoneMatch_ = entityTag
  13052. return c
  13053. }
  13054. // Context sets the context to be used in this call's Do method. Any
  13055. // pending HTTP request will be aborted if the provided context is
  13056. // canceled.
  13057. func (c *ManagementWebpropertiesGetCall) Context(ctx context.Context) *ManagementWebpropertiesGetCall {
  13058. c.ctx_ = ctx
  13059. return c
  13060. }
  13061. func (c *ManagementWebpropertiesGetCall) doRequest(alt string) (*http.Response, error) {
  13062. var body io.Reader = nil
  13063. c.urlParams_.Set("alt", alt)
  13064. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  13065. urls += "?" + c.urlParams_.Encode()
  13066. req, _ := http.NewRequest("GET", urls, body)
  13067. googleapi.Expand(req.URL, map[string]string{
  13068. "accountId": c.accountId,
  13069. "webPropertyId": c.webPropertyId,
  13070. })
  13071. req.Header.Set("User-Agent", c.s.userAgent())
  13072. if c.ifNoneMatch_ != "" {
  13073. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13074. }
  13075. if c.ctx_ != nil {
  13076. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13077. }
  13078. return c.s.client.Do(req)
  13079. }
  13080. // Do executes the "analytics.management.webproperties.get" call.
  13081. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  13082. // status code is an error. Response headers are in either
  13083. // *Webproperty.ServerResponse.Header or (if a response was returned at
  13084. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13085. // to check whether the returned error was because
  13086. // http.StatusNotModified was returned.
  13087. func (c *ManagementWebpropertiesGetCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  13088. gensupport.SetOptions(c.urlParams_, opts...)
  13089. res, err := c.doRequest("json")
  13090. if res != nil && res.StatusCode == http.StatusNotModified {
  13091. if res.Body != nil {
  13092. res.Body.Close()
  13093. }
  13094. return nil, &googleapi.Error{
  13095. Code: res.StatusCode,
  13096. Header: res.Header,
  13097. }
  13098. }
  13099. if err != nil {
  13100. return nil, err
  13101. }
  13102. defer googleapi.CloseBody(res)
  13103. if err := googleapi.CheckResponse(res); err != nil {
  13104. return nil, err
  13105. }
  13106. ret := &Webproperty{
  13107. ServerResponse: googleapi.ServerResponse{
  13108. Header: res.Header,
  13109. HTTPStatusCode: res.StatusCode,
  13110. },
  13111. }
  13112. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13113. return nil, err
  13114. }
  13115. return ret, nil
  13116. // {
  13117. // "description": "Gets a web property to which the user has access.",
  13118. // "httpMethod": "GET",
  13119. // "id": "analytics.management.webproperties.get",
  13120. // "parameterOrder": [
  13121. // "accountId",
  13122. // "webPropertyId"
  13123. // ],
  13124. // "parameters": {
  13125. // "accountId": {
  13126. // "description": "Account ID to retrieve the web property for.",
  13127. // "location": "path",
  13128. // "pattern": "[0-9]+",
  13129. // "required": true,
  13130. // "type": "string"
  13131. // },
  13132. // "webPropertyId": {
  13133. // "description": "ID to retrieve the web property for.",
  13134. // "location": "path",
  13135. // "pattern": "UA-[0-9]+-[0-9]+",
  13136. // "required": true,
  13137. // "type": "string"
  13138. // }
  13139. // },
  13140. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  13141. // "response": {
  13142. // "$ref": "Webproperty"
  13143. // },
  13144. // "scopes": [
  13145. // "https://www.googleapis.com/auth/analytics.edit",
  13146. // "https://www.googleapis.com/auth/analytics.readonly"
  13147. // ]
  13148. // }
  13149. }
  13150. // method id "analytics.management.webproperties.insert":
  13151. type ManagementWebpropertiesInsertCall struct {
  13152. s *Service
  13153. accountId string
  13154. webproperty *Webproperty
  13155. urlParams_ gensupport.URLParams
  13156. ctx_ context.Context
  13157. }
  13158. // Insert: Create a new property if the account has fewer than 20
  13159. // properties. Web properties are visible in the Google Analytics
  13160. // interface only if they have at least one profile.
  13161. func (r *ManagementWebpropertiesService) Insert(accountId string, webproperty *Webproperty) *ManagementWebpropertiesInsertCall {
  13162. c := &ManagementWebpropertiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13163. c.accountId = accountId
  13164. c.webproperty = webproperty
  13165. return c
  13166. }
  13167. // Fields allows partial responses to be retrieved. See
  13168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13169. // for more information.
  13170. func (c *ManagementWebpropertiesInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesInsertCall {
  13171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13172. return c
  13173. }
  13174. // Context sets the context to be used in this call's Do method. Any
  13175. // pending HTTP request will be aborted if the provided context is
  13176. // canceled.
  13177. func (c *ManagementWebpropertiesInsertCall) Context(ctx context.Context) *ManagementWebpropertiesInsertCall {
  13178. c.ctx_ = ctx
  13179. return c
  13180. }
  13181. func (c *ManagementWebpropertiesInsertCall) doRequest(alt string) (*http.Response, error) {
  13182. var body io.Reader = nil
  13183. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  13184. if err != nil {
  13185. return nil, err
  13186. }
  13187. ctype := "application/json"
  13188. c.urlParams_.Set("alt", alt)
  13189. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties")
  13190. urls += "?" + c.urlParams_.Encode()
  13191. req, _ := http.NewRequest("POST", urls, body)
  13192. googleapi.Expand(req.URL, map[string]string{
  13193. "accountId": c.accountId,
  13194. })
  13195. req.Header.Set("Content-Type", ctype)
  13196. req.Header.Set("User-Agent", c.s.userAgent())
  13197. if c.ctx_ != nil {
  13198. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13199. }
  13200. return c.s.client.Do(req)
  13201. }
  13202. // Do executes the "analytics.management.webproperties.insert" call.
  13203. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  13204. // status code is an error. Response headers are in either
  13205. // *Webproperty.ServerResponse.Header or (if a response was returned at
  13206. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13207. // to check whether the returned error was because
  13208. // http.StatusNotModified was returned.
  13209. func (c *ManagementWebpropertiesInsertCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  13210. gensupport.SetOptions(c.urlParams_, opts...)
  13211. res, err := c.doRequest("json")
  13212. if res != nil && res.StatusCode == http.StatusNotModified {
  13213. if res.Body != nil {
  13214. res.Body.Close()
  13215. }
  13216. return nil, &googleapi.Error{
  13217. Code: res.StatusCode,
  13218. Header: res.Header,
  13219. }
  13220. }
  13221. if err != nil {
  13222. return nil, err
  13223. }
  13224. defer googleapi.CloseBody(res)
  13225. if err := googleapi.CheckResponse(res); err != nil {
  13226. return nil, err
  13227. }
  13228. ret := &Webproperty{
  13229. ServerResponse: googleapi.ServerResponse{
  13230. Header: res.Header,
  13231. HTTPStatusCode: res.StatusCode,
  13232. },
  13233. }
  13234. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13235. return nil, err
  13236. }
  13237. return ret, nil
  13238. // {
  13239. // "description": "Create a new property if the account has fewer than 20 properties. Web properties are visible in the Google Analytics interface only if they have at least one profile.",
  13240. // "httpMethod": "POST",
  13241. // "id": "analytics.management.webproperties.insert",
  13242. // "parameterOrder": [
  13243. // "accountId"
  13244. // ],
  13245. // "parameters": {
  13246. // "accountId": {
  13247. // "description": "Account ID to create the web property for.",
  13248. // "location": "path",
  13249. // "required": true,
  13250. // "type": "string"
  13251. // }
  13252. // },
  13253. // "path": "management/accounts/{accountId}/webproperties",
  13254. // "request": {
  13255. // "$ref": "Webproperty"
  13256. // },
  13257. // "response": {
  13258. // "$ref": "Webproperty"
  13259. // },
  13260. // "scopes": [
  13261. // "https://www.googleapis.com/auth/analytics.edit"
  13262. // ]
  13263. // }
  13264. }
  13265. // method id "analytics.management.webproperties.list":
  13266. type ManagementWebpropertiesListCall struct {
  13267. s *Service
  13268. accountId string
  13269. urlParams_ gensupport.URLParams
  13270. ifNoneMatch_ string
  13271. ctx_ context.Context
  13272. }
  13273. // List: Lists web properties to which the user has access.
  13274. func (r *ManagementWebpropertiesService) List(accountId string) *ManagementWebpropertiesListCall {
  13275. c := &ManagementWebpropertiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13276. c.accountId = accountId
  13277. return c
  13278. }
  13279. // MaxResults sets the optional parameter "max-results": The maximum
  13280. // number of web properties to include in this response.
  13281. func (c *ManagementWebpropertiesListCall) MaxResults(maxResults int64) *ManagementWebpropertiesListCall {
  13282. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  13283. return c
  13284. }
  13285. // StartIndex sets the optional parameter "start-index": An index of the
  13286. // first entity to retrieve. Use this parameter as a pagination
  13287. // mechanism along with the max-results parameter.
  13288. func (c *ManagementWebpropertiesListCall) StartIndex(startIndex int64) *ManagementWebpropertiesListCall {
  13289. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  13290. return c
  13291. }
  13292. // Fields allows partial responses to be retrieved. See
  13293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13294. // for more information.
  13295. func (c *ManagementWebpropertiesListCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesListCall {
  13296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13297. return c
  13298. }
  13299. // IfNoneMatch sets the optional parameter which makes the operation
  13300. // fail if the object's ETag matches the given value. This is useful for
  13301. // getting updates only after the object has changed since the last
  13302. // request. Use googleapi.IsNotModified to check whether the response
  13303. // error from Do is the result of In-None-Match.
  13304. func (c *ManagementWebpropertiesListCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesListCall {
  13305. c.ifNoneMatch_ = entityTag
  13306. return c
  13307. }
  13308. // Context sets the context to be used in this call's Do method. Any
  13309. // pending HTTP request will be aborted if the provided context is
  13310. // canceled.
  13311. func (c *ManagementWebpropertiesListCall) Context(ctx context.Context) *ManagementWebpropertiesListCall {
  13312. c.ctx_ = ctx
  13313. return c
  13314. }
  13315. func (c *ManagementWebpropertiesListCall) doRequest(alt string) (*http.Response, error) {
  13316. var body io.Reader = nil
  13317. c.urlParams_.Set("alt", alt)
  13318. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties")
  13319. urls += "?" + c.urlParams_.Encode()
  13320. req, _ := http.NewRequest("GET", urls, body)
  13321. googleapi.Expand(req.URL, map[string]string{
  13322. "accountId": c.accountId,
  13323. })
  13324. req.Header.Set("User-Agent", c.s.userAgent())
  13325. if c.ifNoneMatch_ != "" {
  13326. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13327. }
  13328. if c.ctx_ != nil {
  13329. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13330. }
  13331. return c.s.client.Do(req)
  13332. }
  13333. // Do executes the "analytics.management.webproperties.list" call.
  13334. // Exactly one of *Webproperties or error will be non-nil. Any non-2xx
  13335. // status code is an error. Response headers are in either
  13336. // *Webproperties.ServerResponse.Header or (if a response was returned
  13337. // at all) in error.(*googleapi.Error).Header. Use
  13338. // googleapi.IsNotModified to check whether the returned error was
  13339. // because http.StatusNotModified was returned.
  13340. func (c *ManagementWebpropertiesListCall) Do(opts ...googleapi.CallOption) (*Webproperties, error) {
  13341. gensupport.SetOptions(c.urlParams_, opts...)
  13342. res, err := c.doRequest("json")
  13343. if res != nil && res.StatusCode == http.StatusNotModified {
  13344. if res.Body != nil {
  13345. res.Body.Close()
  13346. }
  13347. return nil, &googleapi.Error{
  13348. Code: res.StatusCode,
  13349. Header: res.Header,
  13350. }
  13351. }
  13352. if err != nil {
  13353. return nil, err
  13354. }
  13355. defer googleapi.CloseBody(res)
  13356. if err := googleapi.CheckResponse(res); err != nil {
  13357. return nil, err
  13358. }
  13359. ret := &Webproperties{
  13360. ServerResponse: googleapi.ServerResponse{
  13361. Header: res.Header,
  13362. HTTPStatusCode: res.StatusCode,
  13363. },
  13364. }
  13365. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13366. return nil, err
  13367. }
  13368. return ret, nil
  13369. // {
  13370. // "description": "Lists web properties to which the user has access.",
  13371. // "httpMethod": "GET",
  13372. // "id": "analytics.management.webproperties.list",
  13373. // "parameterOrder": [
  13374. // "accountId"
  13375. // ],
  13376. // "parameters": {
  13377. // "accountId": {
  13378. // "description": "Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.",
  13379. // "location": "path",
  13380. // "required": true,
  13381. // "type": "string"
  13382. // },
  13383. // "max-results": {
  13384. // "description": "The maximum number of web properties to include in this response.",
  13385. // "format": "int32",
  13386. // "location": "query",
  13387. // "type": "integer"
  13388. // },
  13389. // "start-index": {
  13390. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  13391. // "format": "int32",
  13392. // "location": "query",
  13393. // "minimum": "1",
  13394. // "type": "integer"
  13395. // }
  13396. // },
  13397. // "path": "management/accounts/{accountId}/webproperties",
  13398. // "response": {
  13399. // "$ref": "Webproperties"
  13400. // },
  13401. // "scopes": [
  13402. // "https://www.googleapis.com/auth/analytics",
  13403. // "https://www.googleapis.com/auth/analytics.edit",
  13404. // "https://www.googleapis.com/auth/analytics.readonly"
  13405. // ]
  13406. // }
  13407. }
  13408. // method id "analytics.management.webproperties.patch":
  13409. type ManagementWebpropertiesPatchCall struct {
  13410. s *Service
  13411. accountId string
  13412. webPropertyId string
  13413. webproperty *Webproperty
  13414. urlParams_ gensupport.URLParams
  13415. ctx_ context.Context
  13416. }
  13417. // Patch: Updates an existing web property. This method supports patch
  13418. // semantics.
  13419. func (r *ManagementWebpropertiesService) Patch(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesPatchCall {
  13420. c := &ManagementWebpropertiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13421. c.accountId = accountId
  13422. c.webPropertyId = webPropertyId
  13423. c.webproperty = webproperty
  13424. return c
  13425. }
  13426. // Fields allows partial responses to be retrieved. See
  13427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13428. // for more information.
  13429. func (c *ManagementWebpropertiesPatchCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesPatchCall {
  13430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13431. return c
  13432. }
  13433. // Context sets the context to be used in this call's Do method. Any
  13434. // pending HTTP request will be aborted if the provided context is
  13435. // canceled.
  13436. func (c *ManagementWebpropertiesPatchCall) Context(ctx context.Context) *ManagementWebpropertiesPatchCall {
  13437. c.ctx_ = ctx
  13438. return c
  13439. }
  13440. func (c *ManagementWebpropertiesPatchCall) doRequest(alt string) (*http.Response, error) {
  13441. var body io.Reader = nil
  13442. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  13443. if err != nil {
  13444. return nil, err
  13445. }
  13446. ctype := "application/json"
  13447. c.urlParams_.Set("alt", alt)
  13448. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  13449. urls += "?" + c.urlParams_.Encode()
  13450. req, _ := http.NewRequest("PATCH", urls, body)
  13451. googleapi.Expand(req.URL, map[string]string{
  13452. "accountId": c.accountId,
  13453. "webPropertyId": c.webPropertyId,
  13454. })
  13455. req.Header.Set("Content-Type", ctype)
  13456. req.Header.Set("User-Agent", c.s.userAgent())
  13457. if c.ctx_ != nil {
  13458. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13459. }
  13460. return c.s.client.Do(req)
  13461. }
  13462. // Do executes the "analytics.management.webproperties.patch" call.
  13463. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  13464. // status code is an error. Response headers are in either
  13465. // *Webproperty.ServerResponse.Header or (if a response was returned at
  13466. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13467. // to check whether the returned error was because
  13468. // http.StatusNotModified was returned.
  13469. func (c *ManagementWebpropertiesPatchCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  13470. gensupport.SetOptions(c.urlParams_, opts...)
  13471. res, err := c.doRequest("json")
  13472. if res != nil && res.StatusCode == http.StatusNotModified {
  13473. if res.Body != nil {
  13474. res.Body.Close()
  13475. }
  13476. return nil, &googleapi.Error{
  13477. Code: res.StatusCode,
  13478. Header: res.Header,
  13479. }
  13480. }
  13481. if err != nil {
  13482. return nil, err
  13483. }
  13484. defer googleapi.CloseBody(res)
  13485. if err := googleapi.CheckResponse(res); err != nil {
  13486. return nil, err
  13487. }
  13488. ret := &Webproperty{
  13489. ServerResponse: googleapi.ServerResponse{
  13490. Header: res.Header,
  13491. HTTPStatusCode: res.StatusCode,
  13492. },
  13493. }
  13494. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13495. return nil, err
  13496. }
  13497. return ret, nil
  13498. // {
  13499. // "description": "Updates an existing web property. This method supports patch semantics.",
  13500. // "httpMethod": "PATCH",
  13501. // "id": "analytics.management.webproperties.patch",
  13502. // "parameterOrder": [
  13503. // "accountId",
  13504. // "webPropertyId"
  13505. // ],
  13506. // "parameters": {
  13507. // "accountId": {
  13508. // "description": "Account ID to which the web property belongs",
  13509. // "location": "path",
  13510. // "required": true,
  13511. // "type": "string"
  13512. // },
  13513. // "webPropertyId": {
  13514. // "description": "Web property ID",
  13515. // "location": "path",
  13516. // "required": true,
  13517. // "type": "string"
  13518. // }
  13519. // },
  13520. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  13521. // "request": {
  13522. // "$ref": "Webproperty"
  13523. // },
  13524. // "response": {
  13525. // "$ref": "Webproperty"
  13526. // },
  13527. // "scopes": [
  13528. // "https://www.googleapis.com/auth/analytics.edit"
  13529. // ]
  13530. // }
  13531. }
  13532. // method id "analytics.management.webproperties.update":
  13533. type ManagementWebpropertiesUpdateCall struct {
  13534. s *Service
  13535. accountId string
  13536. webPropertyId string
  13537. webproperty *Webproperty
  13538. urlParams_ gensupport.URLParams
  13539. ctx_ context.Context
  13540. }
  13541. // Update: Updates an existing web property.
  13542. func (r *ManagementWebpropertiesService) Update(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesUpdateCall {
  13543. c := &ManagementWebpropertiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13544. c.accountId = accountId
  13545. c.webPropertyId = webPropertyId
  13546. c.webproperty = webproperty
  13547. return c
  13548. }
  13549. // Fields allows partial responses to be retrieved. See
  13550. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13551. // for more information.
  13552. func (c *ManagementWebpropertiesUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesUpdateCall {
  13553. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13554. return c
  13555. }
  13556. // Context sets the context to be used in this call's Do method. Any
  13557. // pending HTTP request will be aborted if the provided context is
  13558. // canceled.
  13559. func (c *ManagementWebpropertiesUpdateCall) Context(ctx context.Context) *ManagementWebpropertiesUpdateCall {
  13560. c.ctx_ = ctx
  13561. return c
  13562. }
  13563. func (c *ManagementWebpropertiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  13564. var body io.Reader = nil
  13565. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  13566. if err != nil {
  13567. return nil, err
  13568. }
  13569. ctype := "application/json"
  13570. c.urlParams_.Set("alt", alt)
  13571. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  13572. urls += "?" + c.urlParams_.Encode()
  13573. req, _ := http.NewRequest("PUT", urls, body)
  13574. googleapi.Expand(req.URL, map[string]string{
  13575. "accountId": c.accountId,
  13576. "webPropertyId": c.webPropertyId,
  13577. })
  13578. req.Header.Set("Content-Type", ctype)
  13579. req.Header.Set("User-Agent", c.s.userAgent())
  13580. if c.ctx_ != nil {
  13581. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13582. }
  13583. return c.s.client.Do(req)
  13584. }
  13585. // Do executes the "analytics.management.webproperties.update" call.
  13586. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  13587. // status code is an error. Response headers are in either
  13588. // *Webproperty.ServerResponse.Header or (if a response was returned at
  13589. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13590. // to check whether the returned error was because
  13591. // http.StatusNotModified was returned.
  13592. func (c *ManagementWebpropertiesUpdateCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  13593. gensupport.SetOptions(c.urlParams_, opts...)
  13594. res, err := c.doRequest("json")
  13595. if res != nil && res.StatusCode == http.StatusNotModified {
  13596. if res.Body != nil {
  13597. res.Body.Close()
  13598. }
  13599. return nil, &googleapi.Error{
  13600. Code: res.StatusCode,
  13601. Header: res.Header,
  13602. }
  13603. }
  13604. if err != nil {
  13605. return nil, err
  13606. }
  13607. defer googleapi.CloseBody(res)
  13608. if err := googleapi.CheckResponse(res); err != nil {
  13609. return nil, err
  13610. }
  13611. ret := &Webproperty{
  13612. ServerResponse: googleapi.ServerResponse{
  13613. Header: res.Header,
  13614. HTTPStatusCode: res.StatusCode,
  13615. },
  13616. }
  13617. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13618. return nil, err
  13619. }
  13620. return ret, nil
  13621. // {
  13622. // "description": "Updates an existing web property.",
  13623. // "httpMethod": "PUT",
  13624. // "id": "analytics.management.webproperties.update",
  13625. // "parameterOrder": [
  13626. // "accountId",
  13627. // "webPropertyId"
  13628. // ],
  13629. // "parameters": {
  13630. // "accountId": {
  13631. // "description": "Account ID to which the web property belongs",
  13632. // "location": "path",
  13633. // "required": true,
  13634. // "type": "string"
  13635. // },
  13636. // "webPropertyId": {
  13637. // "description": "Web property ID",
  13638. // "location": "path",
  13639. // "required": true,
  13640. // "type": "string"
  13641. // }
  13642. // },
  13643. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  13644. // "request": {
  13645. // "$ref": "Webproperty"
  13646. // },
  13647. // "response": {
  13648. // "$ref": "Webproperty"
  13649. // },
  13650. // "scopes": [
  13651. // "https://www.googleapis.com/auth/analytics.edit"
  13652. // ]
  13653. // }
  13654. }
  13655. // method id "analytics.management.webpropertyUserLinks.delete":
  13656. type ManagementWebpropertyUserLinksDeleteCall struct {
  13657. s *Service
  13658. accountId string
  13659. webPropertyId string
  13660. linkId string
  13661. urlParams_ gensupport.URLParams
  13662. ctx_ context.Context
  13663. }
  13664. // Delete: Removes a user from the given web property.
  13665. func (r *ManagementWebpropertyUserLinksService) Delete(accountId string, webPropertyId string, linkId string) *ManagementWebpropertyUserLinksDeleteCall {
  13666. c := &ManagementWebpropertyUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13667. c.accountId = accountId
  13668. c.webPropertyId = webPropertyId
  13669. c.linkId = linkId
  13670. return c
  13671. }
  13672. // Fields allows partial responses to be retrieved. See
  13673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13674. // for more information.
  13675. func (c *ManagementWebpropertyUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksDeleteCall {
  13676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13677. return c
  13678. }
  13679. // Context sets the context to be used in this call's Do method. Any
  13680. // pending HTTP request will be aborted if the provided context is
  13681. // canceled.
  13682. func (c *ManagementWebpropertyUserLinksDeleteCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksDeleteCall {
  13683. c.ctx_ = ctx
  13684. return c
  13685. }
  13686. func (c *ManagementWebpropertyUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  13687. var body io.Reader = nil
  13688. c.urlParams_.Set("alt", alt)
  13689. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}")
  13690. urls += "?" + c.urlParams_.Encode()
  13691. req, _ := http.NewRequest("DELETE", urls, body)
  13692. googleapi.Expand(req.URL, map[string]string{
  13693. "accountId": c.accountId,
  13694. "webPropertyId": c.webPropertyId,
  13695. "linkId": c.linkId,
  13696. })
  13697. req.Header.Set("User-Agent", c.s.userAgent())
  13698. if c.ctx_ != nil {
  13699. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13700. }
  13701. return c.s.client.Do(req)
  13702. }
  13703. // Do executes the "analytics.management.webpropertyUserLinks.delete" call.
  13704. func (c *ManagementWebpropertyUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  13705. gensupport.SetOptions(c.urlParams_, opts...)
  13706. res, err := c.doRequest("json")
  13707. if err != nil {
  13708. return err
  13709. }
  13710. defer googleapi.CloseBody(res)
  13711. if err := googleapi.CheckResponse(res); err != nil {
  13712. return err
  13713. }
  13714. return nil
  13715. // {
  13716. // "description": "Removes a user from the given web property.",
  13717. // "httpMethod": "DELETE",
  13718. // "id": "analytics.management.webpropertyUserLinks.delete",
  13719. // "parameterOrder": [
  13720. // "accountId",
  13721. // "webPropertyId",
  13722. // "linkId"
  13723. // ],
  13724. // "parameters": {
  13725. // "accountId": {
  13726. // "description": "Account ID to delete the user link for.",
  13727. // "location": "path",
  13728. // "required": true,
  13729. // "type": "string"
  13730. // },
  13731. // "linkId": {
  13732. // "description": "Link ID to delete the user link for.",
  13733. // "location": "path",
  13734. // "required": true,
  13735. // "type": "string"
  13736. // },
  13737. // "webPropertyId": {
  13738. // "description": "Web Property ID to delete the user link for.",
  13739. // "location": "path",
  13740. // "required": true,
  13741. // "type": "string"
  13742. // }
  13743. // },
  13744. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}",
  13745. // "scopes": [
  13746. // "https://www.googleapis.com/auth/analytics.manage.users"
  13747. // ]
  13748. // }
  13749. }
  13750. // method id "analytics.management.webpropertyUserLinks.insert":
  13751. type ManagementWebpropertyUserLinksInsertCall struct {
  13752. s *Service
  13753. accountId string
  13754. webPropertyId string
  13755. entityuserlink *EntityUserLink
  13756. urlParams_ gensupport.URLParams
  13757. ctx_ context.Context
  13758. }
  13759. // Insert: Adds a new user to the given web property.
  13760. func (r *ManagementWebpropertyUserLinksService) Insert(accountId string, webPropertyId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksInsertCall {
  13761. c := &ManagementWebpropertyUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13762. c.accountId = accountId
  13763. c.webPropertyId = webPropertyId
  13764. c.entityuserlink = entityuserlink
  13765. return c
  13766. }
  13767. // Fields allows partial responses to be retrieved. See
  13768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13769. // for more information.
  13770. func (c *ManagementWebpropertyUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksInsertCall {
  13771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13772. return c
  13773. }
  13774. // Context sets the context to be used in this call's Do method. Any
  13775. // pending HTTP request will be aborted if the provided context is
  13776. // canceled.
  13777. func (c *ManagementWebpropertyUserLinksInsertCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksInsertCall {
  13778. c.ctx_ = ctx
  13779. return c
  13780. }
  13781. func (c *ManagementWebpropertyUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  13782. var body io.Reader = nil
  13783. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  13784. if err != nil {
  13785. return nil, err
  13786. }
  13787. ctype := "application/json"
  13788. c.urlParams_.Set("alt", alt)
  13789. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks")
  13790. urls += "?" + c.urlParams_.Encode()
  13791. req, _ := http.NewRequest("POST", urls, body)
  13792. googleapi.Expand(req.URL, map[string]string{
  13793. "accountId": c.accountId,
  13794. "webPropertyId": c.webPropertyId,
  13795. })
  13796. req.Header.Set("Content-Type", ctype)
  13797. req.Header.Set("User-Agent", c.s.userAgent())
  13798. if c.ctx_ != nil {
  13799. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13800. }
  13801. return c.s.client.Do(req)
  13802. }
  13803. // Do executes the "analytics.management.webpropertyUserLinks.insert" call.
  13804. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  13805. // status code is an error. Response headers are in either
  13806. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  13807. // at all) in error.(*googleapi.Error).Header. Use
  13808. // googleapi.IsNotModified to check whether the returned error was
  13809. // because http.StatusNotModified was returned.
  13810. func (c *ManagementWebpropertyUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  13811. gensupport.SetOptions(c.urlParams_, opts...)
  13812. res, err := c.doRequest("json")
  13813. if res != nil && res.StatusCode == http.StatusNotModified {
  13814. if res.Body != nil {
  13815. res.Body.Close()
  13816. }
  13817. return nil, &googleapi.Error{
  13818. Code: res.StatusCode,
  13819. Header: res.Header,
  13820. }
  13821. }
  13822. if err != nil {
  13823. return nil, err
  13824. }
  13825. defer googleapi.CloseBody(res)
  13826. if err := googleapi.CheckResponse(res); err != nil {
  13827. return nil, err
  13828. }
  13829. ret := &EntityUserLink{
  13830. ServerResponse: googleapi.ServerResponse{
  13831. Header: res.Header,
  13832. HTTPStatusCode: res.StatusCode,
  13833. },
  13834. }
  13835. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13836. return nil, err
  13837. }
  13838. return ret, nil
  13839. // {
  13840. // "description": "Adds a new user to the given web property.",
  13841. // "httpMethod": "POST",
  13842. // "id": "analytics.management.webpropertyUserLinks.insert",
  13843. // "parameterOrder": [
  13844. // "accountId",
  13845. // "webPropertyId"
  13846. // ],
  13847. // "parameters": {
  13848. // "accountId": {
  13849. // "description": "Account ID to create the user link for.",
  13850. // "location": "path",
  13851. // "required": true,
  13852. // "type": "string"
  13853. // },
  13854. // "webPropertyId": {
  13855. // "description": "Web Property ID to create the user link for.",
  13856. // "location": "path",
  13857. // "required": true,
  13858. // "type": "string"
  13859. // }
  13860. // },
  13861. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks",
  13862. // "request": {
  13863. // "$ref": "EntityUserLink"
  13864. // },
  13865. // "response": {
  13866. // "$ref": "EntityUserLink"
  13867. // },
  13868. // "scopes": [
  13869. // "https://www.googleapis.com/auth/analytics.manage.users"
  13870. // ]
  13871. // }
  13872. }
  13873. // method id "analytics.management.webpropertyUserLinks.list":
  13874. type ManagementWebpropertyUserLinksListCall struct {
  13875. s *Service
  13876. accountId string
  13877. webPropertyId string
  13878. urlParams_ gensupport.URLParams
  13879. ifNoneMatch_ string
  13880. ctx_ context.Context
  13881. }
  13882. // List: Lists webProperty-user links for a given web property.
  13883. func (r *ManagementWebpropertyUserLinksService) List(accountId string, webPropertyId string) *ManagementWebpropertyUserLinksListCall {
  13884. c := &ManagementWebpropertyUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13885. c.accountId = accountId
  13886. c.webPropertyId = webPropertyId
  13887. return c
  13888. }
  13889. // MaxResults sets the optional parameter "max-results": The maximum
  13890. // number of webProperty-user Links to include in this response.
  13891. func (c *ManagementWebpropertyUserLinksListCall) MaxResults(maxResults int64) *ManagementWebpropertyUserLinksListCall {
  13892. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  13893. return c
  13894. }
  13895. // StartIndex sets the optional parameter "start-index": An index of the
  13896. // first webProperty-user link to retrieve. Use this parameter as a
  13897. // pagination mechanism along with the max-results parameter.
  13898. func (c *ManagementWebpropertyUserLinksListCall) StartIndex(startIndex int64) *ManagementWebpropertyUserLinksListCall {
  13899. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  13900. return c
  13901. }
  13902. // Fields allows partial responses to be retrieved. See
  13903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13904. // for more information.
  13905. func (c *ManagementWebpropertyUserLinksListCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksListCall {
  13906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13907. return c
  13908. }
  13909. // IfNoneMatch sets the optional parameter which makes the operation
  13910. // fail if the object's ETag matches the given value. This is useful for
  13911. // getting updates only after the object has changed since the last
  13912. // request. Use googleapi.IsNotModified to check whether the response
  13913. // error from Do is the result of In-None-Match.
  13914. func (c *ManagementWebpropertyUserLinksListCall) IfNoneMatch(entityTag string) *ManagementWebpropertyUserLinksListCall {
  13915. c.ifNoneMatch_ = entityTag
  13916. return c
  13917. }
  13918. // Context sets the context to be used in this call's Do method. Any
  13919. // pending HTTP request will be aborted if the provided context is
  13920. // canceled.
  13921. func (c *ManagementWebpropertyUserLinksListCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksListCall {
  13922. c.ctx_ = ctx
  13923. return c
  13924. }
  13925. func (c *ManagementWebpropertyUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  13926. var body io.Reader = nil
  13927. c.urlParams_.Set("alt", alt)
  13928. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks")
  13929. urls += "?" + c.urlParams_.Encode()
  13930. req, _ := http.NewRequest("GET", urls, body)
  13931. googleapi.Expand(req.URL, map[string]string{
  13932. "accountId": c.accountId,
  13933. "webPropertyId": c.webPropertyId,
  13934. })
  13935. req.Header.Set("User-Agent", c.s.userAgent())
  13936. if c.ifNoneMatch_ != "" {
  13937. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13938. }
  13939. if c.ctx_ != nil {
  13940. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13941. }
  13942. return c.s.client.Do(req)
  13943. }
  13944. // Do executes the "analytics.management.webpropertyUserLinks.list" call.
  13945. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  13946. // status code is an error. Response headers are in either
  13947. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  13948. // at all) in error.(*googleapi.Error).Header. Use
  13949. // googleapi.IsNotModified to check whether the returned error was
  13950. // because http.StatusNotModified was returned.
  13951. func (c *ManagementWebpropertyUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  13952. gensupport.SetOptions(c.urlParams_, opts...)
  13953. res, err := c.doRequest("json")
  13954. if res != nil && res.StatusCode == http.StatusNotModified {
  13955. if res.Body != nil {
  13956. res.Body.Close()
  13957. }
  13958. return nil, &googleapi.Error{
  13959. Code: res.StatusCode,
  13960. Header: res.Header,
  13961. }
  13962. }
  13963. if err != nil {
  13964. return nil, err
  13965. }
  13966. defer googleapi.CloseBody(res)
  13967. if err := googleapi.CheckResponse(res); err != nil {
  13968. return nil, err
  13969. }
  13970. ret := &EntityUserLinks{
  13971. ServerResponse: googleapi.ServerResponse{
  13972. Header: res.Header,
  13973. HTTPStatusCode: res.StatusCode,
  13974. },
  13975. }
  13976. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13977. return nil, err
  13978. }
  13979. return ret, nil
  13980. // {
  13981. // "description": "Lists webProperty-user links for a given web property.",
  13982. // "httpMethod": "GET",
  13983. // "id": "analytics.management.webpropertyUserLinks.list",
  13984. // "parameterOrder": [
  13985. // "accountId",
  13986. // "webPropertyId"
  13987. // ],
  13988. // "parameters": {
  13989. // "accountId": {
  13990. // "description": "Account ID which the given web property belongs to.",
  13991. // "location": "path",
  13992. // "required": true,
  13993. // "type": "string"
  13994. // },
  13995. // "max-results": {
  13996. // "description": "The maximum number of webProperty-user Links to include in this response.",
  13997. // "format": "int32",
  13998. // "location": "query",
  13999. // "type": "integer"
  14000. // },
  14001. // "start-index": {
  14002. // "description": "An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  14003. // "format": "int32",
  14004. // "location": "query",
  14005. // "minimum": "1",
  14006. // "type": "integer"
  14007. // },
  14008. // "webPropertyId": {
  14009. // "description": "Web Property ID for the webProperty-user links to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.",
  14010. // "location": "path",
  14011. // "required": true,
  14012. // "type": "string"
  14013. // }
  14014. // },
  14015. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks",
  14016. // "response": {
  14017. // "$ref": "EntityUserLinks"
  14018. // },
  14019. // "scopes": [
  14020. // "https://www.googleapis.com/auth/analytics.manage.users",
  14021. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  14022. // ]
  14023. // }
  14024. }
  14025. // method id "analytics.management.webpropertyUserLinks.update":
  14026. type ManagementWebpropertyUserLinksUpdateCall struct {
  14027. s *Service
  14028. accountId string
  14029. webPropertyId string
  14030. linkId string
  14031. entityuserlink *EntityUserLink
  14032. urlParams_ gensupport.URLParams
  14033. ctx_ context.Context
  14034. }
  14035. // Update: Updates permissions for an existing user on the given web
  14036. // property.
  14037. func (r *ManagementWebpropertyUserLinksService) Update(accountId string, webPropertyId string, linkId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksUpdateCall {
  14038. c := &ManagementWebpropertyUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14039. c.accountId = accountId
  14040. c.webPropertyId = webPropertyId
  14041. c.linkId = linkId
  14042. c.entityuserlink = entityuserlink
  14043. return c
  14044. }
  14045. // Fields allows partial responses to be retrieved. See
  14046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14047. // for more information.
  14048. func (c *ManagementWebpropertyUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksUpdateCall {
  14049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14050. return c
  14051. }
  14052. // Context sets the context to be used in this call's Do method. Any
  14053. // pending HTTP request will be aborted if the provided context is
  14054. // canceled.
  14055. func (c *ManagementWebpropertyUserLinksUpdateCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksUpdateCall {
  14056. c.ctx_ = ctx
  14057. return c
  14058. }
  14059. func (c *ManagementWebpropertyUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  14060. var body io.Reader = nil
  14061. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  14062. if err != nil {
  14063. return nil, err
  14064. }
  14065. ctype := "application/json"
  14066. c.urlParams_.Set("alt", alt)
  14067. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}")
  14068. urls += "?" + c.urlParams_.Encode()
  14069. req, _ := http.NewRequest("PUT", urls, body)
  14070. googleapi.Expand(req.URL, map[string]string{
  14071. "accountId": c.accountId,
  14072. "webPropertyId": c.webPropertyId,
  14073. "linkId": c.linkId,
  14074. })
  14075. req.Header.Set("Content-Type", ctype)
  14076. req.Header.Set("User-Agent", c.s.userAgent())
  14077. if c.ctx_ != nil {
  14078. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14079. }
  14080. return c.s.client.Do(req)
  14081. }
  14082. // Do executes the "analytics.management.webpropertyUserLinks.update" call.
  14083. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  14084. // status code is an error. Response headers are in either
  14085. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  14086. // at all) in error.(*googleapi.Error).Header. Use
  14087. // googleapi.IsNotModified to check whether the returned error was
  14088. // because http.StatusNotModified was returned.
  14089. func (c *ManagementWebpropertyUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  14090. gensupport.SetOptions(c.urlParams_, opts...)
  14091. res, err := c.doRequest("json")
  14092. if res != nil && res.StatusCode == http.StatusNotModified {
  14093. if res.Body != nil {
  14094. res.Body.Close()
  14095. }
  14096. return nil, &googleapi.Error{
  14097. Code: res.StatusCode,
  14098. Header: res.Header,
  14099. }
  14100. }
  14101. if err != nil {
  14102. return nil, err
  14103. }
  14104. defer googleapi.CloseBody(res)
  14105. if err := googleapi.CheckResponse(res); err != nil {
  14106. return nil, err
  14107. }
  14108. ret := &EntityUserLink{
  14109. ServerResponse: googleapi.ServerResponse{
  14110. Header: res.Header,
  14111. HTTPStatusCode: res.StatusCode,
  14112. },
  14113. }
  14114. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14115. return nil, err
  14116. }
  14117. return ret, nil
  14118. // {
  14119. // "description": "Updates permissions for an existing user on the given web property.",
  14120. // "httpMethod": "PUT",
  14121. // "id": "analytics.management.webpropertyUserLinks.update",
  14122. // "parameterOrder": [
  14123. // "accountId",
  14124. // "webPropertyId",
  14125. // "linkId"
  14126. // ],
  14127. // "parameters": {
  14128. // "accountId": {
  14129. // "description": "Account ID to update the account-user link for.",
  14130. // "location": "path",
  14131. // "required": true,
  14132. // "type": "string"
  14133. // },
  14134. // "linkId": {
  14135. // "description": "Link ID to update the account-user link for.",
  14136. // "location": "path",
  14137. // "required": true,
  14138. // "type": "string"
  14139. // },
  14140. // "webPropertyId": {
  14141. // "description": "Web property ID to update the account-user link for.",
  14142. // "location": "path",
  14143. // "required": true,
  14144. // "type": "string"
  14145. // }
  14146. // },
  14147. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}",
  14148. // "request": {
  14149. // "$ref": "EntityUserLink"
  14150. // },
  14151. // "response": {
  14152. // "$ref": "EntityUserLink"
  14153. // },
  14154. // "scopes": [
  14155. // "https://www.googleapis.com/auth/analytics.manage.users"
  14156. // ]
  14157. // }
  14158. }
  14159. // method id "analytics.metadata.columns.list":
  14160. type MetadataColumnsListCall struct {
  14161. s *Service
  14162. reportType string
  14163. urlParams_ gensupport.URLParams
  14164. ifNoneMatch_ string
  14165. ctx_ context.Context
  14166. }
  14167. // List: Lists all columns for a report type
  14168. func (r *MetadataColumnsService) List(reportType string) *MetadataColumnsListCall {
  14169. c := &MetadataColumnsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14170. c.reportType = reportType
  14171. return c
  14172. }
  14173. // Fields allows partial responses to be retrieved. See
  14174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14175. // for more information.
  14176. func (c *MetadataColumnsListCall) Fields(s ...googleapi.Field) *MetadataColumnsListCall {
  14177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14178. return c
  14179. }
  14180. // IfNoneMatch sets the optional parameter which makes the operation
  14181. // fail if the object's ETag matches the given value. This is useful for
  14182. // getting updates only after the object has changed since the last
  14183. // request. Use googleapi.IsNotModified to check whether the response
  14184. // error from Do is the result of In-None-Match.
  14185. func (c *MetadataColumnsListCall) IfNoneMatch(entityTag string) *MetadataColumnsListCall {
  14186. c.ifNoneMatch_ = entityTag
  14187. return c
  14188. }
  14189. // Context sets the context to be used in this call's Do method. Any
  14190. // pending HTTP request will be aborted if the provided context is
  14191. // canceled.
  14192. func (c *MetadataColumnsListCall) Context(ctx context.Context) *MetadataColumnsListCall {
  14193. c.ctx_ = ctx
  14194. return c
  14195. }
  14196. func (c *MetadataColumnsListCall) doRequest(alt string) (*http.Response, error) {
  14197. var body io.Reader = nil
  14198. c.urlParams_.Set("alt", alt)
  14199. urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/{reportType}/columns")
  14200. urls += "?" + c.urlParams_.Encode()
  14201. req, _ := http.NewRequest("GET", urls, body)
  14202. googleapi.Expand(req.URL, map[string]string{
  14203. "reportType": c.reportType,
  14204. })
  14205. req.Header.Set("User-Agent", c.s.userAgent())
  14206. if c.ifNoneMatch_ != "" {
  14207. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  14208. }
  14209. if c.ctx_ != nil {
  14210. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14211. }
  14212. return c.s.client.Do(req)
  14213. }
  14214. // Do executes the "analytics.metadata.columns.list" call.
  14215. // Exactly one of *Columns or error will be non-nil. Any non-2xx status
  14216. // code is an error. Response headers are in either
  14217. // *Columns.ServerResponse.Header or (if a response was returned at all)
  14218. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14219. // check whether the returned error was because http.StatusNotModified
  14220. // was returned.
  14221. func (c *MetadataColumnsListCall) Do(opts ...googleapi.CallOption) (*Columns, error) {
  14222. gensupport.SetOptions(c.urlParams_, opts...)
  14223. res, err := c.doRequest("json")
  14224. if res != nil && res.StatusCode == http.StatusNotModified {
  14225. if res.Body != nil {
  14226. res.Body.Close()
  14227. }
  14228. return nil, &googleapi.Error{
  14229. Code: res.StatusCode,
  14230. Header: res.Header,
  14231. }
  14232. }
  14233. if err != nil {
  14234. return nil, err
  14235. }
  14236. defer googleapi.CloseBody(res)
  14237. if err := googleapi.CheckResponse(res); err != nil {
  14238. return nil, err
  14239. }
  14240. ret := &Columns{
  14241. ServerResponse: googleapi.ServerResponse{
  14242. Header: res.Header,
  14243. HTTPStatusCode: res.StatusCode,
  14244. },
  14245. }
  14246. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14247. return nil, err
  14248. }
  14249. return ret, nil
  14250. // {
  14251. // "description": "Lists all columns for a report type",
  14252. // "httpMethod": "GET",
  14253. // "id": "analytics.metadata.columns.list",
  14254. // "parameterOrder": [
  14255. // "reportType"
  14256. // ],
  14257. // "parameters": {
  14258. // "reportType": {
  14259. // "description": "Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API",
  14260. // "location": "path",
  14261. // "pattern": "ga",
  14262. // "required": true,
  14263. // "type": "string"
  14264. // }
  14265. // },
  14266. // "path": "metadata/{reportType}/columns",
  14267. // "response": {
  14268. // "$ref": "Columns"
  14269. // },
  14270. // "scopes": [
  14271. // "https://www.googleapis.com/auth/analytics",
  14272. // "https://www.googleapis.com/auth/analytics.edit",
  14273. // "https://www.googleapis.com/auth/analytics.readonly"
  14274. // ]
  14275. // }
  14276. }
  14277. // method id "analytics.provisioning.createAccountTicket":
  14278. type ProvisioningCreateAccountTicketCall struct {
  14279. s *Service
  14280. accountticket *AccountTicket
  14281. urlParams_ gensupport.URLParams
  14282. ctx_ context.Context
  14283. }
  14284. // CreateAccountTicket: Creates an account ticket.
  14285. func (r *ProvisioningService) CreateAccountTicket(accountticket *AccountTicket) *ProvisioningCreateAccountTicketCall {
  14286. c := &ProvisioningCreateAccountTicketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14287. c.accountticket = accountticket
  14288. return c
  14289. }
  14290. // Fields allows partial responses to be retrieved. See
  14291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14292. // for more information.
  14293. func (c *ProvisioningCreateAccountTicketCall) Fields(s ...googleapi.Field) *ProvisioningCreateAccountTicketCall {
  14294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14295. return c
  14296. }
  14297. // Context sets the context to be used in this call's Do method. Any
  14298. // pending HTTP request will be aborted if the provided context is
  14299. // canceled.
  14300. func (c *ProvisioningCreateAccountTicketCall) Context(ctx context.Context) *ProvisioningCreateAccountTicketCall {
  14301. c.ctx_ = ctx
  14302. return c
  14303. }
  14304. func (c *ProvisioningCreateAccountTicketCall) doRequest(alt string) (*http.Response, error) {
  14305. var body io.Reader = nil
  14306. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountticket)
  14307. if err != nil {
  14308. return nil, err
  14309. }
  14310. ctype := "application/json"
  14311. c.urlParams_.Set("alt", alt)
  14312. urls := googleapi.ResolveRelative(c.s.BasePath, "provisioning/createAccountTicket")
  14313. urls += "?" + c.urlParams_.Encode()
  14314. req, _ := http.NewRequest("POST", urls, body)
  14315. googleapi.SetOpaque(req.URL)
  14316. req.Header.Set("Content-Type", ctype)
  14317. req.Header.Set("User-Agent", c.s.userAgent())
  14318. if c.ctx_ != nil {
  14319. return ctxhttp.Do(c.ctx_, c.s.client, req)
  14320. }
  14321. return c.s.client.Do(req)
  14322. }
  14323. // Do executes the "analytics.provisioning.createAccountTicket" call.
  14324. // Exactly one of *AccountTicket or error will be non-nil. Any non-2xx
  14325. // status code is an error. Response headers are in either
  14326. // *AccountTicket.ServerResponse.Header or (if a response was returned
  14327. // at all) in error.(*googleapi.Error).Header. Use
  14328. // googleapi.IsNotModified to check whether the returned error was
  14329. // because http.StatusNotModified was returned.
  14330. func (c *ProvisioningCreateAccountTicketCall) Do(opts ...googleapi.CallOption) (*AccountTicket, error) {
  14331. gensupport.SetOptions(c.urlParams_, opts...)
  14332. res, err := c.doRequest("json")
  14333. if res != nil && res.StatusCode == http.StatusNotModified {
  14334. if res.Body != nil {
  14335. res.Body.Close()
  14336. }
  14337. return nil, &googleapi.Error{
  14338. Code: res.StatusCode,
  14339. Header: res.Header,
  14340. }
  14341. }
  14342. if err != nil {
  14343. return nil, err
  14344. }
  14345. defer googleapi.CloseBody(res)
  14346. if err := googleapi.CheckResponse(res); err != nil {
  14347. return nil, err
  14348. }
  14349. ret := &AccountTicket{
  14350. ServerResponse: googleapi.ServerResponse{
  14351. Header: res.Header,
  14352. HTTPStatusCode: res.StatusCode,
  14353. },
  14354. }
  14355. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  14356. return nil, err
  14357. }
  14358. return ret, nil
  14359. // {
  14360. // "description": "Creates an account ticket.",
  14361. // "httpMethod": "POST",
  14362. // "id": "analytics.provisioning.createAccountTicket",
  14363. // "path": "provisioning/createAccountTicket",
  14364. // "request": {
  14365. // "$ref": "AccountTicket"
  14366. // },
  14367. // "response": {
  14368. // "$ref": "AccountTicket"
  14369. // },
  14370. // "scopes": [
  14371. // "https://www.googleapis.com/auth/analytics.provision"
  14372. // ]
  14373. // }
  14374. }