You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

analytics-gen.go 697 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113
  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package analytics provides access to the Google Analytics API.
  6. //
  7. // For product documentation, see: https://developers.google.com/analytics/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/analytics/v3"
  14. // ...
  15. // ctx := context.Background()
  16. // analyticsService, err := analytics.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // analyticsService, err := analytics.NewService(ctx, option.WithScopes(analytics.AnalyticsUserDeletionScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // analyticsService, err := analytics.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // analyticsService, err := analytics.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package analytics // import "google.golang.org/api/analytics/v3"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "analytics:v3"
  71. const apiName = "analytics"
  72. const apiVersion = "v3"
  73. const basePath = "https://www.googleapis.com/analytics/v3/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your Google Analytics data
  77. AnalyticsScope = "https://www.googleapis.com/auth/analytics"
  78. // Edit Google Analytics management entities
  79. AnalyticsEditScope = "https://www.googleapis.com/auth/analytics.edit"
  80. // Manage Google Analytics Account users by email address
  81. AnalyticsManageUsersScope = "https://www.googleapis.com/auth/analytics.manage.users"
  82. // View Google Analytics user permissions
  83. AnalyticsManageUsersReadonlyScope = "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  84. // Create a new Google Analytics account along with its default property
  85. // and view
  86. AnalyticsProvisionScope = "https://www.googleapis.com/auth/analytics.provision"
  87. // View your Google Analytics data
  88. AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.readonly"
  89. // Manage Google Analytics user deletion requests
  90. AnalyticsUserDeletionScope = "https://www.googleapis.com/auth/analytics.user.deletion"
  91. )
  92. // NewService creates a new Service.
  93. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  94. scopesOption := option.WithScopes(
  95. "https://www.googleapis.com/auth/analytics",
  96. "https://www.googleapis.com/auth/analytics.edit",
  97. "https://www.googleapis.com/auth/analytics.manage.users",
  98. "https://www.googleapis.com/auth/analytics.manage.users.readonly",
  99. "https://www.googleapis.com/auth/analytics.provision",
  100. "https://www.googleapis.com/auth/analytics.readonly",
  101. "https://www.googleapis.com/auth/analytics.user.deletion",
  102. )
  103. // NOTE: prepend, so we don't override user-specified scopes.
  104. opts = append([]option.ClientOption{scopesOption}, opts...)
  105. client, endpoint, err := htransport.NewClient(ctx, opts...)
  106. if err != nil {
  107. return nil, err
  108. }
  109. s, err := New(client)
  110. if err != nil {
  111. return nil, err
  112. }
  113. if endpoint != "" {
  114. s.BasePath = endpoint
  115. }
  116. return s, nil
  117. }
  118. // New creates a new Service. It uses the provided http.Client for requests.
  119. //
  120. // Deprecated: please use NewService instead.
  121. // To provide a custom HTTP client, use option.WithHTTPClient.
  122. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  123. func New(client *http.Client) (*Service, error) {
  124. if client == nil {
  125. return nil, errors.New("client is nil")
  126. }
  127. s := &Service{client: client, BasePath: basePath}
  128. s.Data = NewDataService(s)
  129. s.Management = NewManagementService(s)
  130. s.Metadata = NewMetadataService(s)
  131. s.Provisioning = NewProvisioningService(s)
  132. s.UserDeletion = NewUserDeletionService(s)
  133. return s, nil
  134. }
  135. type Service struct {
  136. client *http.Client
  137. BasePath string // API endpoint base URL
  138. UserAgent string // optional additional User-Agent fragment
  139. Data *DataService
  140. Management *ManagementService
  141. Metadata *MetadataService
  142. Provisioning *ProvisioningService
  143. UserDeletion *UserDeletionService
  144. }
  145. func (s *Service) userAgent() string {
  146. if s.UserAgent == "" {
  147. return googleapi.UserAgent
  148. }
  149. return googleapi.UserAgent + " " + s.UserAgent
  150. }
  151. func NewDataService(s *Service) *DataService {
  152. rs := &DataService{s: s}
  153. rs.Ga = NewDataGaService(s)
  154. rs.Mcf = NewDataMcfService(s)
  155. rs.Realtime = NewDataRealtimeService(s)
  156. return rs
  157. }
  158. type DataService struct {
  159. s *Service
  160. Ga *DataGaService
  161. Mcf *DataMcfService
  162. Realtime *DataRealtimeService
  163. }
  164. func NewDataGaService(s *Service) *DataGaService {
  165. rs := &DataGaService{s: s}
  166. return rs
  167. }
  168. type DataGaService struct {
  169. s *Service
  170. }
  171. func NewDataMcfService(s *Service) *DataMcfService {
  172. rs := &DataMcfService{s: s}
  173. return rs
  174. }
  175. type DataMcfService struct {
  176. s *Service
  177. }
  178. func NewDataRealtimeService(s *Service) *DataRealtimeService {
  179. rs := &DataRealtimeService{s: s}
  180. return rs
  181. }
  182. type DataRealtimeService struct {
  183. s *Service
  184. }
  185. func NewManagementService(s *Service) *ManagementService {
  186. rs := &ManagementService{s: s}
  187. rs.AccountSummaries = NewManagementAccountSummariesService(s)
  188. rs.AccountUserLinks = NewManagementAccountUserLinksService(s)
  189. rs.Accounts = NewManagementAccountsService(s)
  190. rs.ClientId = NewManagementClientIdService(s)
  191. rs.CustomDataSources = NewManagementCustomDataSourcesService(s)
  192. rs.CustomDimensions = NewManagementCustomDimensionsService(s)
  193. rs.CustomMetrics = NewManagementCustomMetricsService(s)
  194. rs.Experiments = NewManagementExperimentsService(s)
  195. rs.Filters = NewManagementFiltersService(s)
  196. rs.Goals = NewManagementGoalsService(s)
  197. rs.ProfileFilterLinks = NewManagementProfileFilterLinksService(s)
  198. rs.ProfileUserLinks = NewManagementProfileUserLinksService(s)
  199. rs.Profiles = NewManagementProfilesService(s)
  200. rs.RemarketingAudience = NewManagementRemarketingAudienceService(s)
  201. rs.Segments = NewManagementSegmentsService(s)
  202. rs.UnsampledReports = NewManagementUnsampledReportsService(s)
  203. rs.Uploads = NewManagementUploadsService(s)
  204. rs.WebPropertyAdWordsLinks = NewManagementWebPropertyAdWordsLinksService(s)
  205. rs.Webproperties = NewManagementWebpropertiesService(s)
  206. rs.WebpropertyUserLinks = NewManagementWebpropertyUserLinksService(s)
  207. return rs
  208. }
  209. type ManagementService struct {
  210. s *Service
  211. AccountSummaries *ManagementAccountSummariesService
  212. AccountUserLinks *ManagementAccountUserLinksService
  213. Accounts *ManagementAccountsService
  214. ClientId *ManagementClientIdService
  215. CustomDataSources *ManagementCustomDataSourcesService
  216. CustomDimensions *ManagementCustomDimensionsService
  217. CustomMetrics *ManagementCustomMetricsService
  218. Experiments *ManagementExperimentsService
  219. Filters *ManagementFiltersService
  220. Goals *ManagementGoalsService
  221. ProfileFilterLinks *ManagementProfileFilterLinksService
  222. ProfileUserLinks *ManagementProfileUserLinksService
  223. Profiles *ManagementProfilesService
  224. RemarketingAudience *ManagementRemarketingAudienceService
  225. Segments *ManagementSegmentsService
  226. UnsampledReports *ManagementUnsampledReportsService
  227. Uploads *ManagementUploadsService
  228. WebPropertyAdWordsLinks *ManagementWebPropertyAdWordsLinksService
  229. Webproperties *ManagementWebpropertiesService
  230. WebpropertyUserLinks *ManagementWebpropertyUserLinksService
  231. }
  232. func NewManagementAccountSummariesService(s *Service) *ManagementAccountSummariesService {
  233. rs := &ManagementAccountSummariesService{s: s}
  234. return rs
  235. }
  236. type ManagementAccountSummariesService struct {
  237. s *Service
  238. }
  239. func NewManagementAccountUserLinksService(s *Service) *ManagementAccountUserLinksService {
  240. rs := &ManagementAccountUserLinksService{s: s}
  241. return rs
  242. }
  243. type ManagementAccountUserLinksService struct {
  244. s *Service
  245. }
  246. func NewManagementAccountsService(s *Service) *ManagementAccountsService {
  247. rs := &ManagementAccountsService{s: s}
  248. return rs
  249. }
  250. type ManagementAccountsService struct {
  251. s *Service
  252. }
  253. func NewManagementClientIdService(s *Service) *ManagementClientIdService {
  254. rs := &ManagementClientIdService{s: s}
  255. return rs
  256. }
  257. type ManagementClientIdService struct {
  258. s *Service
  259. }
  260. func NewManagementCustomDataSourcesService(s *Service) *ManagementCustomDataSourcesService {
  261. rs := &ManagementCustomDataSourcesService{s: s}
  262. return rs
  263. }
  264. type ManagementCustomDataSourcesService struct {
  265. s *Service
  266. }
  267. func NewManagementCustomDimensionsService(s *Service) *ManagementCustomDimensionsService {
  268. rs := &ManagementCustomDimensionsService{s: s}
  269. return rs
  270. }
  271. type ManagementCustomDimensionsService struct {
  272. s *Service
  273. }
  274. func NewManagementCustomMetricsService(s *Service) *ManagementCustomMetricsService {
  275. rs := &ManagementCustomMetricsService{s: s}
  276. return rs
  277. }
  278. type ManagementCustomMetricsService struct {
  279. s *Service
  280. }
  281. func NewManagementExperimentsService(s *Service) *ManagementExperimentsService {
  282. rs := &ManagementExperimentsService{s: s}
  283. return rs
  284. }
  285. type ManagementExperimentsService struct {
  286. s *Service
  287. }
  288. func NewManagementFiltersService(s *Service) *ManagementFiltersService {
  289. rs := &ManagementFiltersService{s: s}
  290. return rs
  291. }
  292. type ManagementFiltersService struct {
  293. s *Service
  294. }
  295. func NewManagementGoalsService(s *Service) *ManagementGoalsService {
  296. rs := &ManagementGoalsService{s: s}
  297. return rs
  298. }
  299. type ManagementGoalsService struct {
  300. s *Service
  301. }
  302. func NewManagementProfileFilterLinksService(s *Service) *ManagementProfileFilterLinksService {
  303. rs := &ManagementProfileFilterLinksService{s: s}
  304. return rs
  305. }
  306. type ManagementProfileFilterLinksService struct {
  307. s *Service
  308. }
  309. func NewManagementProfileUserLinksService(s *Service) *ManagementProfileUserLinksService {
  310. rs := &ManagementProfileUserLinksService{s: s}
  311. return rs
  312. }
  313. type ManagementProfileUserLinksService struct {
  314. s *Service
  315. }
  316. func NewManagementProfilesService(s *Service) *ManagementProfilesService {
  317. rs := &ManagementProfilesService{s: s}
  318. return rs
  319. }
  320. type ManagementProfilesService struct {
  321. s *Service
  322. }
  323. func NewManagementRemarketingAudienceService(s *Service) *ManagementRemarketingAudienceService {
  324. rs := &ManagementRemarketingAudienceService{s: s}
  325. return rs
  326. }
  327. type ManagementRemarketingAudienceService struct {
  328. s *Service
  329. }
  330. func NewManagementSegmentsService(s *Service) *ManagementSegmentsService {
  331. rs := &ManagementSegmentsService{s: s}
  332. return rs
  333. }
  334. type ManagementSegmentsService struct {
  335. s *Service
  336. }
  337. func NewManagementUnsampledReportsService(s *Service) *ManagementUnsampledReportsService {
  338. rs := &ManagementUnsampledReportsService{s: s}
  339. return rs
  340. }
  341. type ManagementUnsampledReportsService struct {
  342. s *Service
  343. }
  344. func NewManagementUploadsService(s *Service) *ManagementUploadsService {
  345. rs := &ManagementUploadsService{s: s}
  346. return rs
  347. }
  348. type ManagementUploadsService struct {
  349. s *Service
  350. }
  351. func NewManagementWebPropertyAdWordsLinksService(s *Service) *ManagementWebPropertyAdWordsLinksService {
  352. rs := &ManagementWebPropertyAdWordsLinksService{s: s}
  353. return rs
  354. }
  355. type ManagementWebPropertyAdWordsLinksService struct {
  356. s *Service
  357. }
  358. func NewManagementWebpropertiesService(s *Service) *ManagementWebpropertiesService {
  359. rs := &ManagementWebpropertiesService{s: s}
  360. return rs
  361. }
  362. type ManagementWebpropertiesService struct {
  363. s *Service
  364. }
  365. func NewManagementWebpropertyUserLinksService(s *Service) *ManagementWebpropertyUserLinksService {
  366. rs := &ManagementWebpropertyUserLinksService{s: s}
  367. return rs
  368. }
  369. type ManagementWebpropertyUserLinksService struct {
  370. s *Service
  371. }
  372. func NewMetadataService(s *Service) *MetadataService {
  373. rs := &MetadataService{s: s}
  374. rs.Columns = NewMetadataColumnsService(s)
  375. return rs
  376. }
  377. type MetadataService struct {
  378. s *Service
  379. Columns *MetadataColumnsService
  380. }
  381. func NewMetadataColumnsService(s *Service) *MetadataColumnsService {
  382. rs := &MetadataColumnsService{s: s}
  383. return rs
  384. }
  385. type MetadataColumnsService struct {
  386. s *Service
  387. }
  388. func NewProvisioningService(s *Service) *ProvisioningService {
  389. rs := &ProvisioningService{s: s}
  390. return rs
  391. }
  392. type ProvisioningService struct {
  393. s *Service
  394. }
  395. func NewUserDeletionService(s *Service) *UserDeletionService {
  396. rs := &UserDeletionService{s: s}
  397. rs.UserDeletionRequest = NewUserDeletionUserDeletionRequestService(s)
  398. return rs
  399. }
  400. type UserDeletionService struct {
  401. s *Service
  402. UserDeletionRequest *UserDeletionUserDeletionRequestService
  403. }
  404. func NewUserDeletionUserDeletionRequestService(s *Service) *UserDeletionUserDeletionRequestService {
  405. rs := &UserDeletionUserDeletionRequestService{s: s}
  406. return rs
  407. }
  408. type UserDeletionUserDeletionRequestService struct {
  409. s *Service
  410. }
  411. // Account: JSON template for Analytics account entry.
  412. type Account struct {
  413. // ChildLink: Child link for an account entry. Points to the list of web
  414. // properties for this account.
  415. ChildLink *AccountChildLink `json:"childLink,omitempty"`
  416. // Created: Time the account was created.
  417. Created string `json:"created,omitempty"`
  418. // Id: Account ID.
  419. Id string `json:"id,omitempty"`
  420. // Kind: Resource type for Analytics account.
  421. Kind string `json:"kind,omitempty"`
  422. // Name: Account name.
  423. Name string `json:"name,omitempty"`
  424. // Permissions: Permissions the user has for this account.
  425. Permissions *AccountPermissions `json:"permissions,omitempty"`
  426. // SelfLink: Link for this account.
  427. SelfLink string `json:"selfLink,omitempty"`
  428. // Starred: Indicates whether this account is starred or not.
  429. Starred bool `json:"starred,omitempty"`
  430. // Updated: Time the account was last modified.
  431. Updated string `json:"updated,omitempty"`
  432. // ForceSendFields is a list of field names (e.g. "ChildLink") to
  433. // unconditionally include in API requests. By default, fields with
  434. // empty values are omitted from API requests. However, any non-pointer,
  435. // non-interface field appearing in ForceSendFields will be sent to the
  436. // server regardless of whether the field is empty or not. This may be
  437. // used to include empty fields in Patch requests.
  438. ForceSendFields []string `json:"-"`
  439. // NullFields is a list of field names (e.g. "ChildLink") to include in
  440. // API requests with the JSON null value. By default, fields with empty
  441. // values are omitted from API requests. However, any field with an
  442. // empty value appearing in NullFields will be sent to the server as
  443. // null. It is an error if a field in this list has a non-empty value.
  444. // This may be used to include null fields in Patch requests.
  445. NullFields []string `json:"-"`
  446. }
  447. func (s *Account) MarshalJSON() ([]byte, error) {
  448. type NoMethod Account
  449. raw := NoMethod(*s)
  450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  451. }
  452. // AccountChildLink: Child link for an account entry. Points to the list
  453. // of web properties for this account.
  454. type AccountChildLink struct {
  455. // Href: Link to the list of web properties for this account.
  456. Href string `json:"href,omitempty"`
  457. // Type: Type of the child link. Its value is "analytics#webproperties".
  458. Type string `json:"type,omitempty"`
  459. // ForceSendFields is a list of field names (e.g. "Href") to
  460. // unconditionally include in API requests. By default, fields with
  461. // empty values are omitted from API requests. However, any non-pointer,
  462. // non-interface field appearing in ForceSendFields will be sent to the
  463. // server regardless of whether the field is empty or not. This may be
  464. // used to include empty fields in Patch requests.
  465. ForceSendFields []string `json:"-"`
  466. // NullFields is a list of field names (e.g. "Href") to include in API
  467. // requests with the JSON null value. By default, fields with empty
  468. // values are omitted from API requests. However, any field with an
  469. // empty value appearing in NullFields will be sent to the server as
  470. // null. It is an error if a field in this list has a non-empty value.
  471. // This may be used to include null fields in Patch requests.
  472. NullFields []string `json:"-"`
  473. }
  474. func (s *AccountChildLink) MarshalJSON() ([]byte, error) {
  475. type NoMethod AccountChildLink
  476. raw := NoMethod(*s)
  477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  478. }
  479. // AccountPermissions: Permissions the user has for this account.
  480. type AccountPermissions struct {
  481. // Effective: All the permissions that the user has for this account.
  482. // These include any implied permissions (e.g., EDIT implies VIEW).
  483. Effective []string `json:"effective,omitempty"`
  484. // ForceSendFields is a list of field names (e.g. "Effective") to
  485. // unconditionally include in API requests. By default, fields with
  486. // empty values are omitted from API requests. However, any non-pointer,
  487. // non-interface field appearing in ForceSendFields will be sent to the
  488. // server regardless of whether the field is empty or not. This may be
  489. // used to include empty fields in Patch requests.
  490. ForceSendFields []string `json:"-"`
  491. // NullFields is a list of field names (e.g. "Effective") to include in
  492. // API requests with the JSON null value. By default, fields with empty
  493. // values are omitted from API requests. However, any field with an
  494. // empty value appearing in NullFields will be sent to the server as
  495. // null. It is an error if a field in this list has a non-empty value.
  496. // This may be used to include null fields in Patch requests.
  497. NullFields []string `json:"-"`
  498. }
  499. func (s *AccountPermissions) MarshalJSON() ([]byte, error) {
  500. type NoMethod AccountPermissions
  501. raw := NoMethod(*s)
  502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  503. }
  504. // AccountRef: JSON template for a linked account.
  505. type AccountRef struct {
  506. // Href: Link for this account.
  507. Href string `json:"href,omitempty"`
  508. // Id: Account ID.
  509. Id string `json:"id,omitempty"`
  510. // Kind: Analytics account reference.
  511. Kind string `json:"kind,omitempty"`
  512. // Name: Account name.
  513. Name string `json:"name,omitempty"`
  514. // ForceSendFields is a list of field names (e.g. "Href") to
  515. // unconditionally include in API requests. By default, fields with
  516. // empty values are omitted from API requests. However, any non-pointer,
  517. // non-interface field appearing in ForceSendFields will be sent to the
  518. // server regardless of whether the field is empty or not. This may be
  519. // used to include empty fields in Patch requests.
  520. ForceSendFields []string `json:"-"`
  521. // NullFields is a list of field names (e.g. "Href") to include in API
  522. // requests with the JSON null value. By default, fields with empty
  523. // values are omitted from API requests. However, any field with an
  524. // empty value appearing in NullFields will be sent to the server as
  525. // null. It is an error if a field in this list has a non-empty value.
  526. // This may be used to include null fields in Patch requests.
  527. NullFields []string `json:"-"`
  528. }
  529. func (s *AccountRef) MarshalJSON() ([]byte, error) {
  530. type NoMethod AccountRef
  531. raw := NoMethod(*s)
  532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  533. }
  534. // AccountSummaries: An AccountSummary collection lists a summary of
  535. // accounts, properties and views (profiles) to which the user has
  536. // access. Each resource in the collection corresponds to a single
  537. // AccountSummary.
  538. type AccountSummaries struct {
  539. // Items: A list of AccountSummaries.
  540. Items []*AccountSummary `json:"items,omitempty"`
  541. // ItemsPerPage: The maximum number of resources the response can
  542. // contain, regardless of the actual number of resources returned. Its
  543. // value ranges from 1 to 1000 with a value of 1000 by default, or
  544. // otherwise specified by the max-results query parameter.
  545. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  546. // Kind: Collection type.
  547. Kind string `json:"kind,omitempty"`
  548. // NextLink: Link to next page for this AccountSummary collection.
  549. NextLink string `json:"nextLink,omitempty"`
  550. // PreviousLink: Link to previous page for this AccountSummary
  551. // collection.
  552. PreviousLink string `json:"previousLink,omitempty"`
  553. // StartIndex: The starting index of the resources, which is 1 by
  554. // default or otherwise specified by the start-index query parameter.
  555. StartIndex int64 `json:"startIndex,omitempty"`
  556. // TotalResults: The total number of results for the query, regardless
  557. // of the number of results in the response.
  558. TotalResults int64 `json:"totalResults,omitempty"`
  559. // Username: Email ID of the authenticated user
  560. Username string `json:"username,omitempty"`
  561. // ServerResponse contains the HTTP response code and headers from the
  562. // server.
  563. googleapi.ServerResponse `json:"-"`
  564. // ForceSendFields is a list of field names (e.g. "Items") to
  565. // unconditionally include in API requests. By default, fields with
  566. // empty values are omitted from API requests. However, any non-pointer,
  567. // non-interface field appearing in ForceSendFields will be sent to the
  568. // server regardless of whether the field is empty or not. This may be
  569. // used to include empty fields in Patch requests.
  570. ForceSendFields []string `json:"-"`
  571. // NullFields is a list of field names (e.g. "Items") to include in API
  572. // requests with the JSON null value. By default, fields with empty
  573. // values are omitted from API requests. However, any field with an
  574. // empty value appearing in NullFields will be sent to the server as
  575. // null. It is an error if a field in this list has a non-empty value.
  576. // This may be used to include null fields in Patch requests.
  577. NullFields []string `json:"-"`
  578. }
  579. func (s *AccountSummaries) MarshalJSON() ([]byte, error) {
  580. type NoMethod AccountSummaries
  581. raw := NoMethod(*s)
  582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  583. }
  584. // AccountSummary: JSON template for an Analytics AccountSummary. An
  585. // AccountSummary is a lightweight tree comprised of
  586. // properties/profiles.
  587. type AccountSummary struct {
  588. // Id: Account ID.
  589. Id string `json:"id,omitempty"`
  590. // Kind: Resource type for Analytics AccountSummary.
  591. Kind string `json:"kind,omitempty"`
  592. // Name: Account name.
  593. Name string `json:"name,omitempty"`
  594. // Starred: Indicates whether this account is starred or not.
  595. Starred bool `json:"starred,omitempty"`
  596. // WebProperties: List of web properties under this account.
  597. WebProperties []*WebPropertySummary `json:"webProperties,omitempty"`
  598. // ForceSendFields is a list of field names (e.g. "Id") to
  599. // unconditionally include in API requests. By default, fields with
  600. // empty values are omitted from API requests. However, any non-pointer,
  601. // non-interface field appearing in ForceSendFields will be sent to the
  602. // server regardless of whether the field is empty or not. This may be
  603. // used to include empty fields in Patch requests.
  604. ForceSendFields []string `json:"-"`
  605. // NullFields is a list of field names (e.g. "Id") to include in API
  606. // requests with the JSON null value. By default, fields with empty
  607. // values are omitted from API requests. However, any field with an
  608. // empty value appearing in NullFields will be sent to the server as
  609. // null. It is an error if a field in this list has a non-empty value.
  610. // This may be used to include null fields in Patch requests.
  611. NullFields []string `json:"-"`
  612. }
  613. func (s *AccountSummary) MarshalJSON() ([]byte, error) {
  614. type NoMethod AccountSummary
  615. raw := NoMethod(*s)
  616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  617. }
  618. // AccountTicket: JSON template for an Analytics account ticket. The
  619. // account ticket consists of the ticket ID and the basic information
  620. // for the account, property and profile.
  621. type AccountTicket struct {
  622. // Account: Account for this ticket.
  623. Account *Account `json:"account,omitempty"`
  624. // Id: Account ticket ID used to access the account ticket.
  625. Id string `json:"id,omitempty"`
  626. // Kind: Resource type for account ticket.
  627. Kind string `json:"kind,omitempty"`
  628. // Profile: View (Profile) for the account.
  629. Profile *Profile `json:"profile,omitempty"`
  630. // RedirectUri: Redirect URI where the user will be sent after accepting
  631. // Terms of Service. Must be configured in APIs console as a callback
  632. // URL.
  633. RedirectUri string `json:"redirectUri,omitempty"`
  634. // Webproperty: Web property for the account.
  635. Webproperty *Webproperty `json:"webproperty,omitempty"`
  636. // ServerResponse contains the HTTP response code and headers from the
  637. // server.
  638. googleapi.ServerResponse `json:"-"`
  639. // ForceSendFields is a list of field names (e.g. "Account") to
  640. // unconditionally include in API requests. By default, fields with
  641. // empty values are omitted from API requests. However, any non-pointer,
  642. // non-interface field appearing in ForceSendFields will be sent to the
  643. // server regardless of whether the field is empty or not. This may be
  644. // used to include empty fields in Patch requests.
  645. ForceSendFields []string `json:"-"`
  646. // NullFields is a list of field names (e.g. "Account") to include in
  647. // API requests with the JSON null value. By default, fields with empty
  648. // values are omitted from API requests. However, any field with an
  649. // empty value appearing in NullFields will be sent to the server as
  650. // null. It is an error if a field in this list has a non-empty value.
  651. // This may be used to include null fields in Patch requests.
  652. NullFields []string `json:"-"`
  653. }
  654. func (s *AccountTicket) MarshalJSON() ([]byte, error) {
  655. type NoMethod AccountTicket
  656. raw := NoMethod(*s)
  657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  658. }
  659. // AccountTreeRequest: JSON template for an Analytics account tree
  660. // requests. The account tree request is used in the provisioning api to
  661. // create an account, property, and view (profile). It contains the
  662. // basic information required to make these fields.
  663. type AccountTreeRequest struct {
  664. AccountName string `json:"accountName,omitempty"`
  665. // Kind: Resource type for account ticket.
  666. Kind string `json:"kind,omitempty"`
  667. ProfileName string `json:"profileName,omitempty"`
  668. Timezone string `json:"timezone,omitempty"`
  669. WebpropertyName string `json:"webpropertyName,omitempty"`
  670. WebsiteUrl string `json:"websiteUrl,omitempty"`
  671. // ForceSendFields is a list of field names (e.g. "AccountName") to
  672. // unconditionally include in API requests. By default, fields with
  673. // empty values are omitted from API requests. However, any non-pointer,
  674. // non-interface field appearing in ForceSendFields will be sent to the
  675. // server regardless of whether the field is empty or not. This may be
  676. // used to include empty fields in Patch requests.
  677. ForceSendFields []string `json:"-"`
  678. // NullFields is a list of field names (e.g. "AccountName") to include
  679. // in API requests with the JSON null value. By default, fields with
  680. // empty values are omitted from API requests. However, any field with
  681. // an empty value appearing in NullFields will be sent to the server as
  682. // null. It is an error if a field in this list has a non-empty value.
  683. // This may be used to include null fields in Patch requests.
  684. NullFields []string `json:"-"`
  685. }
  686. func (s *AccountTreeRequest) MarshalJSON() ([]byte, error) {
  687. type NoMethod AccountTreeRequest
  688. raw := NoMethod(*s)
  689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  690. }
  691. // AccountTreeResponse: JSON template for an Analytics account tree
  692. // response. The account tree response is used in the provisioning api
  693. // to return the result of creating an account, property, and view
  694. // (profile).
  695. type AccountTreeResponse struct {
  696. // Account: The account created.
  697. Account *Account `json:"account,omitempty"`
  698. // Kind: Resource type for account ticket.
  699. Kind string `json:"kind,omitempty"`
  700. // Profile: View (Profile) for the account.
  701. Profile *Profile `json:"profile,omitempty"`
  702. // Webproperty: Web property for the account.
  703. Webproperty *Webproperty `json:"webproperty,omitempty"`
  704. // ServerResponse contains the HTTP response code and headers from the
  705. // server.
  706. googleapi.ServerResponse `json:"-"`
  707. // ForceSendFields is a list of field names (e.g. "Account") to
  708. // unconditionally include in API requests. By default, fields with
  709. // empty values are omitted from API requests. However, any non-pointer,
  710. // non-interface field appearing in ForceSendFields will be sent to the
  711. // server regardless of whether the field is empty or not. This may be
  712. // used to include empty fields in Patch requests.
  713. ForceSendFields []string `json:"-"`
  714. // NullFields is a list of field names (e.g. "Account") to include in
  715. // API requests with the JSON null value. By default, fields with empty
  716. // values are omitted from API requests. However, any field with an
  717. // empty value appearing in NullFields will be sent to the server as
  718. // null. It is an error if a field in this list has a non-empty value.
  719. // This may be used to include null fields in Patch requests.
  720. NullFields []string `json:"-"`
  721. }
  722. func (s *AccountTreeResponse) MarshalJSON() ([]byte, error) {
  723. type NoMethod AccountTreeResponse
  724. raw := NoMethod(*s)
  725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  726. }
  727. // Accounts: An account collection provides a list of Analytics accounts
  728. // to which a user has access. The account collection is the entry point
  729. // to all management information. Each resource in the collection
  730. // corresponds to a single Analytics account.
  731. type Accounts struct {
  732. // Items: A list of accounts.
  733. Items []*Account `json:"items,omitempty"`
  734. // ItemsPerPage: The maximum number of entries the response can contain,
  735. // regardless of the actual number of entries returned. Its value ranges
  736. // from 1 to 1000 with a value of 1000 by default, or otherwise
  737. // 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: Next link for this account collection.
  742. NextLink string `json:"nextLink,omitempty"`
  743. // PreviousLink: Previous link for this account collection.
  744. PreviousLink string `json:"previousLink,omitempty"`
  745. // StartIndex: The starting index of the entries, which is 1 by default
  746. // or otherwise specified by the start-index query parameter.
  747. StartIndex int64 `json:"startIndex,omitempty"`
  748. // TotalResults: The total number of results for the query, regardless
  749. // of the number of results in the response.
  750. TotalResults int64 `json:"totalResults,omitempty"`
  751. // Username: Email ID of the authenticated user
  752. Username string `json:"username,omitempty"`
  753. // ServerResponse contains the HTTP response code and headers from the
  754. // server.
  755. googleapi.ServerResponse `json:"-"`
  756. // ForceSendFields is a list of field names (e.g. "Items") to
  757. // unconditionally include in API requests. By default, fields with
  758. // empty values are omitted from API requests. However, any non-pointer,
  759. // non-interface field appearing in ForceSendFields will be sent to the
  760. // server regardless of whether the field is empty or not. This may be
  761. // used to include empty fields in Patch requests.
  762. ForceSendFields []string `json:"-"`
  763. // NullFields is a list of field names (e.g. "Items") to include in API
  764. // requests with the JSON null value. By default, fields with empty
  765. // values are omitted from API requests. However, any field with an
  766. // empty value appearing in NullFields will be sent to the server as
  767. // null. It is an error if a field in this list has a non-empty value.
  768. // This may be used to include null fields in Patch requests.
  769. NullFields []string `json:"-"`
  770. }
  771. func (s *Accounts) MarshalJSON() ([]byte, error) {
  772. type NoMethod Accounts
  773. raw := NoMethod(*s)
  774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  775. }
  776. // AdWordsAccount: JSON template for an Google Ads account.
  777. type AdWordsAccount struct {
  778. // AutoTaggingEnabled: True if auto-tagging is enabled on the Google Ads
  779. // account. Read-only after the insert operation.
  780. AutoTaggingEnabled bool `json:"autoTaggingEnabled,omitempty"`
  781. // CustomerId: Customer ID. This field is required when creating a
  782. // Google Ads link.
  783. CustomerId string `json:"customerId,omitempty"`
  784. // Kind: Resource type for Google Ads account.
  785. Kind string `json:"kind,omitempty"`
  786. // ForceSendFields is a list of field names (e.g. "AutoTaggingEnabled")
  787. // to unconditionally include in API requests. By default, fields with
  788. // empty values are omitted from API requests. However, any non-pointer,
  789. // non-interface field appearing in ForceSendFields will be sent to the
  790. // server regardless of whether the field is empty or not. This may be
  791. // used to include empty fields in Patch requests.
  792. ForceSendFields []string `json:"-"`
  793. // NullFields is a list of field names (e.g. "AutoTaggingEnabled") to
  794. // include in API requests with the JSON null value. By default, fields
  795. // with empty values are omitted from API requests. However, any field
  796. // with an empty value appearing in NullFields will be sent to the
  797. // server as null. It is an error if a field in this list has a
  798. // non-empty value. This may be used to include null fields in Patch
  799. // requests.
  800. NullFields []string `json:"-"`
  801. }
  802. func (s *AdWordsAccount) MarshalJSON() ([]byte, error) {
  803. type NoMethod AdWordsAccount
  804. raw := NoMethod(*s)
  805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  806. }
  807. // AnalyticsDataimportDeleteUploadDataRequest: Request template for the
  808. // delete upload data request.
  809. type AnalyticsDataimportDeleteUploadDataRequest struct {
  810. // CustomDataImportUids: A list of upload UIDs.
  811. CustomDataImportUids []string `json:"customDataImportUids,omitempty"`
  812. // ForceSendFields is a list of field names (e.g.
  813. // "CustomDataImportUids") to unconditionally include in API requests.
  814. // By default, fields with empty values are omitted from API requests.
  815. // However, any non-pointer, non-interface field appearing in
  816. // ForceSendFields will be sent to the server regardless of whether the
  817. // field is empty or not. This may be used to include empty fields in
  818. // Patch requests.
  819. ForceSendFields []string `json:"-"`
  820. // NullFields is a list of field names (e.g. "CustomDataImportUids") to
  821. // include in API requests with the JSON null value. By default, fields
  822. // with empty values are omitted from API requests. However, any field
  823. // with an empty value appearing in NullFields will be sent to the
  824. // server as null. It is an error if a field in this list has a
  825. // non-empty value. This may be used to include null fields in Patch
  826. // requests.
  827. NullFields []string `json:"-"`
  828. }
  829. func (s *AnalyticsDataimportDeleteUploadDataRequest) MarshalJSON() ([]byte, error) {
  830. type NoMethod AnalyticsDataimportDeleteUploadDataRequest
  831. raw := NoMethod(*s)
  832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  833. }
  834. // Column: JSON template for a metadata column.
  835. type Column struct {
  836. // Attributes: Map of attribute name and value for this column.
  837. Attributes map[string]string `json:"attributes,omitempty"`
  838. // Id: Column id.
  839. Id string `json:"id,omitempty"`
  840. // Kind: Resource type for Analytics column.
  841. Kind string `json:"kind,omitempty"`
  842. // ForceSendFields is a list of field names (e.g. "Attributes") to
  843. // unconditionally include in API requests. By default, fields with
  844. // empty values are omitted from API requests. However, any non-pointer,
  845. // non-interface field appearing in ForceSendFields will be sent to the
  846. // server regardless of whether the field is empty or not. This may be
  847. // used to include empty fields in Patch requests.
  848. ForceSendFields []string `json:"-"`
  849. // NullFields is a list of field names (e.g. "Attributes") to include in
  850. // API requests with the JSON null value. By default, fields with empty
  851. // values are omitted from API requests. However, any field with an
  852. // empty value appearing in NullFields will be sent to the server as
  853. // null. It is an error if a field in this list has a non-empty value.
  854. // This may be used to include null fields in Patch requests.
  855. NullFields []string `json:"-"`
  856. }
  857. func (s *Column) MarshalJSON() ([]byte, error) {
  858. type NoMethod Column
  859. raw := NoMethod(*s)
  860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  861. }
  862. // Columns: Lists columns (dimensions and metrics) for a particular
  863. // report type.
  864. type Columns struct {
  865. // AttributeNames: List of attributes names returned by columns.
  866. AttributeNames []string `json:"attributeNames,omitempty"`
  867. // Etag: Etag of collection. This etag can be compared with the last
  868. // response etag to check if response has changed.
  869. Etag string `json:"etag,omitempty"`
  870. // Items: List of columns for a report type.
  871. Items []*Column `json:"items,omitempty"`
  872. // Kind: Collection type.
  873. Kind string `json:"kind,omitempty"`
  874. // TotalResults: Total number of columns returned in the response.
  875. TotalResults int64 `json:"totalResults,omitempty"`
  876. // ServerResponse contains the HTTP response code and headers from the
  877. // server.
  878. googleapi.ServerResponse `json:"-"`
  879. // ForceSendFields is a list of field names (e.g. "AttributeNames") to
  880. // unconditionally include in API requests. By default, fields with
  881. // empty values are omitted from API requests. However, any non-pointer,
  882. // non-interface field appearing in ForceSendFields will be sent to the
  883. // server regardless of whether the field is empty or not. This may be
  884. // used to include empty fields in Patch requests.
  885. ForceSendFields []string `json:"-"`
  886. // NullFields is a list of field names (e.g. "AttributeNames") to
  887. // include in API requests with the JSON null value. By default, fields
  888. // with empty values are omitted from API requests. However, any field
  889. // with an empty value appearing in NullFields will be sent to the
  890. // server as null. It is an error if a field in this list has a
  891. // non-empty value. This may be used to include null fields in Patch
  892. // requests.
  893. NullFields []string `json:"-"`
  894. }
  895. func (s *Columns) MarshalJSON() ([]byte, error) {
  896. type NoMethod Columns
  897. raw := NoMethod(*s)
  898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  899. }
  900. // CustomDataSource: JSON template for an Analytics custom data source.
  901. type CustomDataSource struct {
  902. // AccountId: Account ID to which this custom data source belongs.
  903. AccountId string `json:"accountId,omitempty"`
  904. ChildLink *CustomDataSourceChildLink `json:"childLink,omitempty"`
  905. // Created: Time this custom data source was created.
  906. Created string `json:"created,omitempty"`
  907. // Description: Description of custom data source.
  908. Description string `json:"description,omitempty"`
  909. // Id: Custom data source ID.
  910. Id string `json:"id,omitempty"`
  911. ImportBehavior string `json:"importBehavior,omitempty"`
  912. // Kind: Resource type for Analytics custom data source.
  913. Kind string `json:"kind,omitempty"`
  914. // Name: Name of this custom data source.
  915. Name string `json:"name,omitempty"`
  916. // ParentLink: Parent link for this custom data source. Points to the
  917. // web property to which this custom data source belongs.
  918. ParentLink *CustomDataSourceParentLink `json:"parentLink,omitempty"`
  919. // ProfilesLinked: IDs of views (profiles) linked to the custom data
  920. // source.
  921. ProfilesLinked []string `json:"profilesLinked,omitempty"`
  922. // Schema: Collection of schema headers of the custom data source.
  923. Schema []string `json:"schema,omitempty"`
  924. // SelfLink: Link for this Analytics custom data source.
  925. SelfLink string `json:"selfLink,omitempty"`
  926. // Type: Type of the custom data source.
  927. Type string `json:"type,omitempty"`
  928. // Updated: Time this custom data source was last modified.
  929. Updated string `json:"updated,omitempty"`
  930. // UploadType: Upload type of the custom data source.
  931. UploadType string `json:"uploadType,omitempty"`
  932. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  933. // custom data source belongs.
  934. WebPropertyId string `json:"webPropertyId,omitempty"`
  935. // ForceSendFields is a list of field names (e.g. "AccountId") to
  936. // unconditionally include in API requests. By default, fields with
  937. // empty values are omitted from API requests. However, any non-pointer,
  938. // non-interface field appearing in ForceSendFields will be sent to the
  939. // server regardless of whether the field is empty or not. This may be
  940. // used to include empty fields in Patch requests.
  941. ForceSendFields []string `json:"-"`
  942. // NullFields is a list of field names (e.g. "AccountId") to include in
  943. // API requests with the JSON null value. By default, fields with empty
  944. // values are omitted from API requests. However, any field with an
  945. // empty value appearing in NullFields will be sent to the server as
  946. // null. It is an error if a field in this list has a non-empty value.
  947. // This may be used to include null fields in Patch requests.
  948. NullFields []string `json:"-"`
  949. }
  950. func (s *CustomDataSource) MarshalJSON() ([]byte, error) {
  951. type NoMethod CustomDataSource
  952. raw := NoMethod(*s)
  953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  954. }
  955. type CustomDataSourceChildLink struct {
  956. // Href: Link to the list of daily uploads for this custom data source.
  957. // Link to the list of uploads for this custom data source.
  958. Href string `json:"href,omitempty"`
  959. // Type: Value is "analytics#dailyUploads". Value is
  960. // "analytics#uploads".
  961. Type string `json:"type,omitempty"`
  962. // ForceSendFields is a list of field names (e.g. "Href") to
  963. // unconditionally include in API requests. By default, fields with
  964. // empty values are omitted from API requests. However, any non-pointer,
  965. // non-interface field appearing in ForceSendFields will be sent to the
  966. // server regardless of whether the field is empty or not. This may be
  967. // used to include empty fields in Patch requests.
  968. ForceSendFields []string `json:"-"`
  969. // NullFields is a list of field names (e.g. "Href") to include in API
  970. // requests with the JSON null value. By default, fields with empty
  971. // values are omitted from API requests. However, any field with an
  972. // empty value appearing in NullFields will be sent to the server as
  973. // null. It is an error if a field in this list has a non-empty value.
  974. // This may be used to include null fields in Patch requests.
  975. NullFields []string `json:"-"`
  976. }
  977. func (s *CustomDataSourceChildLink) MarshalJSON() ([]byte, error) {
  978. type NoMethod CustomDataSourceChildLink
  979. raw := NoMethod(*s)
  980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  981. }
  982. // CustomDataSourceParentLink: Parent link for this custom data source.
  983. // Points to the web property to which this custom data source belongs.
  984. type CustomDataSourceParentLink struct {
  985. // Href: Link to the web property to which this custom data source
  986. // belongs.
  987. Href string `json:"href,omitempty"`
  988. // Type: Value is "analytics#webproperty".
  989. Type string `json:"type,omitempty"`
  990. // ForceSendFields is a list of field names (e.g. "Href") to
  991. // unconditionally include in API requests. By default, fields with
  992. // empty values are omitted from API requests. However, any non-pointer,
  993. // non-interface field appearing in ForceSendFields will be sent to the
  994. // server regardless of whether the field is empty or not. This may be
  995. // used to include empty fields in Patch requests.
  996. ForceSendFields []string `json:"-"`
  997. // NullFields is a list of field names (e.g. "Href") to include in API
  998. // requests with the JSON null value. By default, fields with empty
  999. // values are omitted from API requests. However, any field with an
  1000. // empty value appearing in NullFields will be sent to the server as
  1001. // null. It is an error if a field in this list has a non-empty value.
  1002. // This may be used to include null fields in Patch requests.
  1003. NullFields []string `json:"-"`
  1004. }
  1005. func (s *CustomDataSourceParentLink) MarshalJSON() ([]byte, error) {
  1006. type NoMethod CustomDataSourceParentLink
  1007. raw := NoMethod(*s)
  1008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1009. }
  1010. // CustomDataSources: Lists Analytics custom data sources to which the
  1011. // user has access. Each resource in the collection corresponds to a
  1012. // single Analytics custom data source.
  1013. type CustomDataSources struct {
  1014. // Items: Collection of custom data sources.
  1015. Items []*CustomDataSource `json:"items,omitempty"`
  1016. // ItemsPerPage: The maximum number of resources the response can
  1017. // contain, regardless of the actual number of resources returned. Its
  1018. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1019. // otherwise specified by the max-results query parameter.
  1020. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1021. // Kind: Collection type.
  1022. Kind string `json:"kind,omitempty"`
  1023. // NextLink: Link to next page for this custom data source collection.
  1024. NextLink string `json:"nextLink,omitempty"`
  1025. // PreviousLink: Link to previous page for this custom data source
  1026. // collection.
  1027. PreviousLink string `json:"previousLink,omitempty"`
  1028. // StartIndex: The starting index of the resources, which is 1 by
  1029. // default or otherwise specified by the start-index query parameter.
  1030. StartIndex int64 `json:"startIndex,omitempty"`
  1031. // TotalResults: The total number of results for the query, regardless
  1032. // of the number of results in the response.
  1033. TotalResults int64 `json:"totalResults,omitempty"`
  1034. // Username: Email ID of the authenticated user
  1035. Username string `json:"username,omitempty"`
  1036. // ServerResponse contains the HTTP response code and headers from the
  1037. // server.
  1038. googleapi.ServerResponse `json:"-"`
  1039. // ForceSendFields is a list of field names (e.g. "Items") to
  1040. // unconditionally include in API requests. By default, fields with
  1041. // empty values are omitted from API requests. However, any non-pointer,
  1042. // non-interface field appearing in ForceSendFields will be sent to the
  1043. // server regardless of whether the field is empty or not. This may be
  1044. // used to include empty fields in Patch requests.
  1045. ForceSendFields []string `json:"-"`
  1046. // NullFields is a list of field names (e.g. "Items") to include in API
  1047. // requests with the JSON null value. By default, fields with empty
  1048. // values are omitted from API requests. However, any field with an
  1049. // empty value appearing in NullFields will be sent to the server as
  1050. // null. It is an error if a field in this list has a non-empty value.
  1051. // This may be used to include null fields in Patch requests.
  1052. NullFields []string `json:"-"`
  1053. }
  1054. func (s *CustomDataSources) MarshalJSON() ([]byte, error) {
  1055. type NoMethod CustomDataSources
  1056. raw := NoMethod(*s)
  1057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1058. }
  1059. // CustomDimension: JSON template for Analytics Custom Dimension.
  1060. type CustomDimension struct {
  1061. // AccountId: Account ID.
  1062. AccountId string `json:"accountId,omitempty"`
  1063. // Active: Boolean indicating whether the custom dimension is active.
  1064. Active bool `json:"active,omitempty"`
  1065. // Created: Time the custom dimension was created.
  1066. Created string `json:"created,omitempty"`
  1067. // Id: Custom dimension ID.
  1068. Id string `json:"id,omitempty"`
  1069. // Index: Index of the custom dimension.
  1070. Index int64 `json:"index,omitempty"`
  1071. // Kind: Kind value for a custom dimension. Set to
  1072. // "analytics#customDimension". It is a read-only field.
  1073. Kind string `json:"kind,omitempty"`
  1074. // Name: Name of the custom dimension.
  1075. Name string `json:"name,omitempty"`
  1076. // ParentLink: Parent link for the custom dimension. Points to the
  1077. // property to which the custom dimension belongs.
  1078. ParentLink *CustomDimensionParentLink `json:"parentLink,omitempty"`
  1079. // Scope: Scope of the custom dimension: HIT, SESSION, USER or PRODUCT.
  1080. Scope string `json:"scope,omitempty"`
  1081. // SelfLink: Link for the custom dimension
  1082. SelfLink string `json:"selfLink,omitempty"`
  1083. // Updated: Time the custom dimension was last modified.
  1084. Updated string `json:"updated,omitempty"`
  1085. // WebPropertyId: Property ID.
  1086. WebPropertyId string `json:"webPropertyId,omitempty"`
  1087. // ServerResponse contains the HTTP response code and headers from the
  1088. // server.
  1089. googleapi.ServerResponse `json:"-"`
  1090. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1091. // unconditionally include in API requests. By default, fields with
  1092. // empty values are omitted from API requests. However, any non-pointer,
  1093. // non-interface field appearing in ForceSendFields will be sent to the
  1094. // server regardless of whether the field is empty or not. This may be
  1095. // used to include empty fields in Patch requests.
  1096. ForceSendFields []string `json:"-"`
  1097. // NullFields is a list of field names (e.g. "AccountId") to include in
  1098. // API requests with the JSON null value. By default, fields with empty
  1099. // values are omitted from API requests. However, any field with an
  1100. // empty value appearing in NullFields will be sent to the server as
  1101. // null. It is an error if a field in this list has a non-empty value.
  1102. // This may be used to include null fields in Patch requests.
  1103. NullFields []string `json:"-"`
  1104. }
  1105. func (s *CustomDimension) MarshalJSON() ([]byte, error) {
  1106. type NoMethod CustomDimension
  1107. raw := NoMethod(*s)
  1108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1109. }
  1110. // CustomDimensionParentLink: Parent link for the custom dimension.
  1111. // Points to the property to which the custom dimension belongs.
  1112. type CustomDimensionParentLink struct {
  1113. // Href: Link to the property to which the custom dimension belongs.
  1114. Href string `json:"href,omitempty"`
  1115. // Type: Type of the parent link. Set to "analytics#webproperty".
  1116. Type string `json:"type,omitempty"`
  1117. // ForceSendFields is a list of field names (e.g. "Href") to
  1118. // unconditionally include in API requests. By default, fields with
  1119. // empty values are omitted from API requests. However, any non-pointer,
  1120. // non-interface field appearing in ForceSendFields will be sent to the
  1121. // server regardless of whether the field is empty or not. This may be
  1122. // used to include empty fields in Patch requests.
  1123. ForceSendFields []string `json:"-"`
  1124. // NullFields is a list of field names (e.g. "Href") to include in API
  1125. // requests with the JSON null value. By default, fields with empty
  1126. // values are omitted from API requests. However, any field with an
  1127. // empty value appearing in NullFields will be sent to the server as
  1128. // null. It is an error if a field in this list has a non-empty value.
  1129. // This may be used to include null fields in Patch requests.
  1130. NullFields []string `json:"-"`
  1131. }
  1132. func (s *CustomDimensionParentLink) MarshalJSON() ([]byte, error) {
  1133. type NoMethod CustomDimensionParentLink
  1134. raw := NoMethod(*s)
  1135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1136. }
  1137. // CustomDimensions: A custom dimension collection lists Analytics
  1138. // custom dimensions to which the user has access. Each resource in the
  1139. // collection corresponds to a single Analytics custom dimension.
  1140. type CustomDimensions struct {
  1141. // Items: Collection of custom dimensions.
  1142. Items []*CustomDimension `json:"items,omitempty"`
  1143. // ItemsPerPage: The maximum number of resources the response can
  1144. // contain, regardless of the actual number of resources returned. Its
  1145. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1146. // otherwise specified by the max-results query parameter.
  1147. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1148. // Kind: Collection type.
  1149. Kind string `json:"kind,omitempty"`
  1150. // NextLink: Link to next page for this custom dimension collection.
  1151. NextLink string `json:"nextLink,omitempty"`
  1152. // PreviousLink: Link to previous page for this custom dimension
  1153. // collection.
  1154. PreviousLink string `json:"previousLink,omitempty"`
  1155. // StartIndex: The starting index of the resources, which is 1 by
  1156. // default or otherwise specified by the start-index query parameter.
  1157. StartIndex int64 `json:"startIndex,omitempty"`
  1158. // TotalResults: The total number of results for the query, regardless
  1159. // of the number of results in the response.
  1160. TotalResults int64 `json:"totalResults,omitempty"`
  1161. // Username: Email ID of the authenticated user
  1162. Username string `json:"username,omitempty"`
  1163. // ServerResponse contains the HTTP response code and headers from the
  1164. // server.
  1165. googleapi.ServerResponse `json:"-"`
  1166. // ForceSendFields is a list of field names (e.g. "Items") to
  1167. // unconditionally include in API requests. By default, fields with
  1168. // empty values are omitted from API requests. However, any non-pointer,
  1169. // non-interface field appearing in ForceSendFields will be sent to the
  1170. // server regardless of whether the field is empty or not. This may be
  1171. // used to include empty fields in Patch requests.
  1172. ForceSendFields []string `json:"-"`
  1173. // NullFields is a list of field names (e.g. "Items") to include in API
  1174. // requests with the JSON null value. By default, fields with empty
  1175. // values are omitted from API requests. However, any field with an
  1176. // empty value appearing in NullFields will be sent to the server as
  1177. // null. It is an error if a field in this list has a non-empty value.
  1178. // This may be used to include null fields in Patch requests.
  1179. NullFields []string `json:"-"`
  1180. }
  1181. func (s *CustomDimensions) MarshalJSON() ([]byte, error) {
  1182. type NoMethod CustomDimensions
  1183. raw := NoMethod(*s)
  1184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1185. }
  1186. // CustomMetric: JSON template for Analytics Custom Metric.
  1187. type CustomMetric struct {
  1188. // AccountId: Account ID.
  1189. AccountId string `json:"accountId,omitempty"`
  1190. // Active: Boolean indicating whether the custom metric is active.
  1191. Active bool `json:"active,omitempty"`
  1192. // Created: Time the custom metric was created.
  1193. Created string `json:"created,omitempty"`
  1194. // Id: Custom metric ID.
  1195. Id string `json:"id,omitempty"`
  1196. // Index: Index of the custom metric.
  1197. Index int64 `json:"index,omitempty"`
  1198. // Kind: Kind value for a custom metric. Set to
  1199. // "analytics#customMetric". It is a read-only field.
  1200. Kind string `json:"kind,omitempty"`
  1201. // MaxValue: Max value of custom metric.
  1202. MaxValue string `json:"max_value,omitempty"`
  1203. // MinValue: Min value of custom metric.
  1204. MinValue string `json:"min_value,omitempty"`
  1205. // Name: Name of the custom metric.
  1206. Name string `json:"name,omitempty"`
  1207. // ParentLink: Parent link for the custom metric. Points to the property
  1208. // to which the custom metric belongs.
  1209. ParentLink *CustomMetricParentLink `json:"parentLink,omitempty"`
  1210. // Scope: Scope of the custom metric: HIT or PRODUCT.
  1211. Scope string `json:"scope,omitempty"`
  1212. // SelfLink: Link for the custom metric
  1213. SelfLink string `json:"selfLink,omitempty"`
  1214. // Type: Data type of custom metric.
  1215. Type string `json:"type,omitempty"`
  1216. // Updated: Time the custom metric was last modified.
  1217. Updated string `json:"updated,omitempty"`
  1218. // WebPropertyId: Property ID.
  1219. WebPropertyId string `json:"webPropertyId,omitempty"`
  1220. // ServerResponse contains the HTTP response code and headers from the
  1221. // server.
  1222. googleapi.ServerResponse `json:"-"`
  1223. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1224. // unconditionally include in API requests. By default, fields with
  1225. // empty values are omitted from API requests. However, any non-pointer,
  1226. // non-interface field appearing in ForceSendFields will be sent to the
  1227. // server regardless of whether the field is empty or not. This may be
  1228. // used to include empty fields in Patch requests.
  1229. ForceSendFields []string `json:"-"`
  1230. // NullFields is a list of field names (e.g. "AccountId") to include in
  1231. // API requests with the JSON null value. By default, fields with empty
  1232. // values are omitted from API requests. However, any field with an
  1233. // empty value appearing in NullFields will be sent to the server as
  1234. // null. It is an error if a field in this list has a non-empty value.
  1235. // This may be used to include null fields in Patch requests.
  1236. NullFields []string `json:"-"`
  1237. }
  1238. func (s *CustomMetric) MarshalJSON() ([]byte, error) {
  1239. type NoMethod CustomMetric
  1240. raw := NoMethod(*s)
  1241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1242. }
  1243. // CustomMetricParentLink: Parent link for the custom metric. Points to
  1244. // the property to which the custom metric belongs.
  1245. type CustomMetricParentLink struct {
  1246. // Href: Link to the property to which the custom metric belongs.
  1247. Href string `json:"href,omitempty"`
  1248. // Type: Type of the parent link. Set to "analytics#webproperty".
  1249. Type string `json:"type,omitempty"`
  1250. // ForceSendFields is a list of field names (e.g. "Href") to
  1251. // unconditionally include in API requests. By default, fields with
  1252. // empty values are omitted from API requests. However, any non-pointer,
  1253. // non-interface field appearing in ForceSendFields will be sent to the
  1254. // server regardless of whether the field is empty or not. This may be
  1255. // used to include empty fields in Patch requests.
  1256. ForceSendFields []string `json:"-"`
  1257. // NullFields is a list of field names (e.g. "Href") to include in API
  1258. // requests with the JSON null value. By default, fields with empty
  1259. // values are omitted from API requests. However, any field with an
  1260. // empty value appearing in NullFields will be sent to the server as
  1261. // null. It is an error if a field in this list has a non-empty value.
  1262. // This may be used to include null fields in Patch requests.
  1263. NullFields []string `json:"-"`
  1264. }
  1265. func (s *CustomMetricParentLink) MarshalJSON() ([]byte, error) {
  1266. type NoMethod CustomMetricParentLink
  1267. raw := NoMethod(*s)
  1268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1269. }
  1270. // CustomMetrics: A custom metric collection lists Analytics custom
  1271. // metrics to which the user has access. Each resource in the collection
  1272. // corresponds to a single Analytics custom metric.
  1273. type CustomMetrics struct {
  1274. // Items: Collection of custom metrics.
  1275. Items []*CustomMetric `json:"items,omitempty"`
  1276. // ItemsPerPage: The maximum number of resources the response can
  1277. // contain, regardless of the actual number of resources returned. Its
  1278. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1279. // otherwise specified by the max-results query parameter.
  1280. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1281. // Kind: Collection type.
  1282. Kind string `json:"kind,omitempty"`
  1283. // NextLink: Link to next page for this custom metric collection.
  1284. NextLink string `json:"nextLink,omitempty"`
  1285. // PreviousLink: Link to previous page for this custom metric
  1286. // collection.
  1287. PreviousLink string `json:"previousLink,omitempty"`
  1288. // StartIndex: The starting index of the resources, which is 1 by
  1289. // default or otherwise specified by the start-index query parameter.
  1290. StartIndex int64 `json:"startIndex,omitempty"`
  1291. // TotalResults: The total number of results for the query, regardless
  1292. // of the number of results in the response.
  1293. TotalResults int64 `json:"totalResults,omitempty"`
  1294. // Username: Email ID of the authenticated user
  1295. Username string `json:"username,omitempty"`
  1296. // ServerResponse contains the HTTP response code and headers from the
  1297. // server.
  1298. googleapi.ServerResponse `json:"-"`
  1299. // ForceSendFields is a list of field names (e.g. "Items") to
  1300. // unconditionally include in API requests. By default, fields with
  1301. // empty values are omitted from API requests. However, any non-pointer,
  1302. // non-interface field appearing in ForceSendFields will be sent to the
  1303. // server regardless of whether the field is empty or not. This may be
  1304. // used to include empty fields in Patch requests.
  1305. ForceSendFields []string `json:"-"`
  1306. // NullFields is a list of field names (e.g. "Items") to include in API
  1307. // requests with the JSON null value. By default, fields with empty
  1308. // values are omitted from API requests. However, any field with an
  1309. // empty value appearing in NullFields will be sent to the server as
  1310. // null. It is an error if a field in this list has a non-empty value.
  1311. // This may be used to include null fields in Patch requests.
  1312. NullFields []string `json:"-"`
  1313. }
  1314. func (s *CustomMetrics) MarshalJSON() ([]byte, error) {
  1315. type NoMethod CustomMetrics
  1316. raw := NoMethod(*s)
  1317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1318. }
  1319. // EntityAdWordsLink: JSON template for Analytics Entity Google Ads
  1320. // Link.
  1321. type EntityAdWordsLink struct {
  1322. // AdWordsAccounts: A list of Google Ads client accounts. These cannot
  1323. // be MCC accounts. This field is required when creating a Google Ads
  1324. // link. It cannot be empty.
  1325. AdWordsAccounts []*AdWordsAccount `json:"adWordsAccounts,omitempty"`
  1326. // Entity: Web property being linked.
  1327. Entity *EntityAdWordsLinkEntity `json:"entity,omitempty"`
  1328. // Id: Entity Google Ads link ID
  1329. Id string `json:"id,omitempty"`
  1330. // Kind: Resource type for entity Google Ads link.
  1331. Kind string `json:"kind,omitempty"`
  1332. // Name: Name of the link. This field is required when creating a Google
  1333. // Ads link.
  1334. Name string `json:"name,omitempty"`
  1335. // ProfileIds: IDs of linked Views (Profiles) represented as strings.
  1336. ProfileIds []string `json:"profileIds,omitempty"`
  1337. // SelfLink: URL link for this Google Analytics - Google Ads link.
  1338. SelfLink string `json:"selfLink,omitempty"`
  1339. // ServerResponse contains the HTTP response code and headers from the
  1340. // server.
  1341. googleapi.ServerResponse `json:"-"`
  1342. // ForceSendFields is a list of field names (e.g. "AdWordsAccounts") to
  1343. // unconditionally include in API requests. By default, fields with
  1344. // empty values are omitted from API requests. However, any non-pointer,
  1345. // non-interface field appearing in ForceSendFields will be sent to the
  1346. // server regardless of whether the field is empty or not. This may be
  1347. // used to include empty fields in Patch requests.
  1348. ForceSendFields []string `json:"-"`
  1349. // NullFields is a list of field names (e.g. "AdWordsAccounts") to
  1350. // include in API requests with the JSON null value. By default, fields
  1351. // with empty values are omitted from API requests. However, any field
  1352. // with an empty value appearing in NullFields will be sent to the
  1353. // server as null. It is an error if a field in this list has a
  1354. // non-empty value. This may be used to include null fields in Patch
  1355. // requests.
  1356. NullFields []string `json:"-"`
  1357. }
  1358. func (s *EntityAdWordsLink) MarshalJSON() ([]byte, error) {
  1359. type NoMethod EntityAdWordsLink
  1360. raw := NoMethod(*s)
  1361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1362. }
  1363. // EntityAdWordsLinkEntity: Web property being linked.
  1364. type EntityAdWordsLinkEntity struct {
  1365. WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"`
  1366. // ForceSendFields is a list of field names (e.g. "WebPropertyRef") to
  1367. // unconditionally include in API requests. By default, fields with
  1368. // empty values are omitted from API requests. However, any non-pointer,
  1369. // non-interface field appearing in ForceSendFields will be sent to the
  1370. // server regardless of whether the field is empty or not. This may be
  1371. // used to include empty fields in Patch requests.
  1372. ForceSendFields []string `json:"-"`
  1373. // NullFields is a list of field names (e.g. "WebPropertyRef") to
  1374. // include in API requests with the JSON null value. By default, fields
  1375. // with empty values are omitted from API requests. However, any field
  1376. // with an empty value appearing in NullFields will be sent to the
  1377. // server as null. It is an error if a field in this list has a
  1378. // non-empty value. This may be used to include null fields in Patch
  1379. // requests.
  1380. NullFields []string `json:"-"`
  1381. }
  1382. func (s *EntityAdWordsLinkEntity) MarshalJSON() ([]byte, error) {
  1383. type NoMethod EntityAdWordsLinkEntity
  1384. raw := NoMethod(*s)
  1385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1386. }
  1387. // EntityAdWordsLinks: An entity Google Ads link collection provides a
  1388. // list of GA-Google Ads links Each resource in this collection
  1389. // corresponds to a single link.
  1390. type EntityAdWordsLinks struct {
  1391. // Items: A list of entity Google Ads links.
  1392. Items []*EntityAdWordsLink `json:"items,omitempty"`
  1393. // ItemsPerPage: The maximum number of entries the response can contain,
  1394. // regardless of the actual number of entries returned. Its value ranges
  1395. // from 1 to 1000 with a value of 1000 by default, or otherwise
  1396. // specified by the max-results query parameter.
  1397. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1398. // Kind: Collection type.
  1399. Kind string `json:"kind,omitempty"`
  1400. // NextLink: Next link for this Google Ads link collection.
  1401. NextLink string `json:"nextLink,omitempty"`
  1402. // PreviousLink: Previous link for this Google Ads link collection.
  1403. PreviousLink string `json:"previousLink,omitempty"`
  1404. // StartIndex: The starting index of the entries, which is 1 by default
  1405. // or otherwise specified by the start-index query parameter.
  1406. StartIndex int64 `json:"startIndex,omitempty"`
  1407. // TotalResults: The total number of results for the query, regardless
  1408. // of the number of results in the response.
  1409. TotalResults int64 `json:"totalResults,omitempty"`
  1410. // ServerResponse contains the HTTP response code and headers from the
  1411. // server.
  1412. googleapi.ServerResponse `json:"-"`
  1413. // ForceSendFields is a list of field names (e.g. "Items") to
  1414. // unconditionally include in API requests. By default, fields with
  1415. // empty values are omitted from API requests. However, any non-pointer,
  1416. // non-interface field appearing in ForceSendFields will be sent to the
  1417. // server regardless of whether the field is empty or not. This may be
  1418. // used to include empty fields in Patch requests.
  1419. ForceSendFields []string `json:"-"`
  1420. // NullFields is a list of field names (e.g. "Items") to include in API
  1421. // requests with the JSON null value. By default, fields with empty
  1422. // values are omitted from API requests. However, any field with an
  1423. // empty value appearing in NullFields will be sent to the server as
  1424. // null. It is an error if a field in this list has a non-empty value.
  1425. // This may be used to include null fields in Patch requests.
  1426. NullFields []string `json:"-"`
  1427. }
  1428. func (s *EntityAdWordsLinks) MarshalJSON() ([]byte, error) {
  1429. type NoMethod EntityAdWordsLinks
  1430. raw := NoMethod(*s)
  1431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1432. }
  1433. // EntityUserLink: JSON template for an Analytics Entity-User Link.
  1434. // Returns permissions that a user has for an entity.
  1435. type EntityUserLink struct {
  1436. // Entity: Entity for this link. It can be an account, a web property,
  1437. // or a view (profile).
  1438. Entity *EntityUserLinkEntity `json:"entity,omitempty"`
  1439. // Id: Entity user link ID
  1440. Id string `json:"id,omitempty"`
  1441. // Kind: Resource type for entity user link.
  1442. Kind string `json:"kind,omitempty"`
  1443. // Permissions: Permissions the user has for this entity.
  1444. Permissions *EntityUserLinkPermissions `json:"permissions,omitempty"`
  1445. // SelfLink: Self link for this resource.
  1446. SelfLink string `json:"selfLink,omitempty"`
  1447. // UserRef: User reference.
  1448. UserRef *UserRef `json:"userRef,omitempty"`
  1449. // ServerResponse contains the HTTP response code and headers from the
  1450. // server.
  1451. googleapi.ServerResponse `json:"-"`
  1452. // ForceSendFields is a list of field names (e.g. "Entity") to
  1453. // unconditionally include in API requests. By default, fields with
  1454. // empty values are omitted from API requests. However, any non-pointer,
  1455. // non-interface field appearing in ForceSendFields will be sent to the
  1456. // server regardless of whether the field is empty or not. This may be
  1457. // used to include empty fields in Patch requests.
  1458. ForceSendFields []string `json:"-"`
  1459. // NullFields is a list of field names (e.g. "Entity") to include in API
  1460. // requests with the JSON null value. By default, fields with empty
  1461. // values are omitted from API requests. However, any field with an
  1462. // empty value appearing in NullFields will be sent to the server as
  1463. // null. It is an error if a field in this list has a non-empty value.
  1464. // This may be used to include null fields in Patch requests.
  1465. NullFields []string `json:"-"`
  1466. }
  1467. func (s *EntityUserLink) MarshalJSON() ([]byte, error) {
  1468. type NoMethod EntityUserLink
  1469. raw := NoMethod(*s)
  1470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1471. }
  1472. // EntityUserLinkEntity: Entity for this link. It can be an account, a
  1473. // web property, or a view (profile).
  1474. type EntityUserLinkEntity struct {
  1475. // AccountRef: Account for this link.
  1476. AccountRef *AccountRef `json:"accountRef,omitempty"`
  1477. // ProfileRef: View (Profile) for this link.
  1478. ProfileRef *ProfileRef `json:"profileRef,omitempty"`
  1479. // WebPropertyRef: Web property for this link.
  1480. WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"`
  1481. // ForceSendFields is a list of field names (e.g. "AccountRef") to
  1482. // unconditionally include in API requests. By default, fields with
  1483. // empty values are omitted from API requests. However, any non-pointer,
  1484. // non-interface field appearing in ForceSendFields will be sent to the
  1485. // server regardless of whether the field is empty or not. This may be
  1486. // used to include empty fields in Patch requests.
  1487. ForceSendFields []string `json:"-"`
  1488. // NullFields is a list of field names (e.g. "AccountRef") to include in
  1489. // API requests with the JSON null value. By default, fields with empty
  1490. // values are omitted from API requests. However, any field with an
  1491. // empty value appearing in NullFields will be sent to the server as
  1492. // null. It is an error if a field in this list has a non-empty value.
  1493. // This may be used to include null fields in Patch requests.
  1494. NullFields []string `json:"-"`
  1495. }
  1496. func (s *EntityUserLinkEntity) MarshalJSON() ([]byte, error) {
  1497. type NoMethod EntityUserLinkEntity
  1498. raw := NoMethod(*s)
  1499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1500. }
  1501. // EntityUserLinkPermissions: Permissions the user has for this entity.
  1502. type EntityUserLinkPermissions struct {
  1503. // Effective: Effective permissions represent all the permissions that a
  1504. // user has for this entity. These include any implied permissions
  1505. // (e.g., EDIT implies VIEW) or inherited permissions from the parent
  1506. // entity. Effective permissions are read-only.
  1507. Effective []string `json:"effective,omitempty"`
  1508. // Local: Permissions that a user has been assigned at this very level.
  1509. // Does not include any implied or inherited permissions. Local
  1510. // permissions are modifiable.
  1511. Local []string `json:"local,omitempty"`
  1512. // ForceSendFields is a list of field names (e.g. "Effective") to
  1513. // unconditionally include in API requests. By default, fields with
  1514. // empty values are omitted from API requests. However, any non-pointer,
  1515. // non-interface field appearing in ForceSendFields will be sent to the
  1516. // server regardless of whether the field is empty or not. This may be
  1517. // used to include empty fields in Patch requests.
  1518. ForceSendFields []string `json:"-"`
  1519. // NullFields is a list of field names (e.g. "Effective") to include in
  1520. // API requests with the JSON null value. By default, fields with empty
  1521. // values are omitted from API requests. However, any field with an
  1522. // empty value appearing in NullFields will be sent to the server as
  1523. // null. It is an error if a field in this list has a non-empty value.
  1524. // This may be used to include null fields in Patch requests.
  1525. NullFields []string `json:"-"`
  1526. }
  1527. func (s *EntityUserLinkPermissions) MarshalJSON() ([]byte, error) {
  1528. type NoMethod EntityUserLinkPermissions
  1529. raw := NoMethod(*s)
  1530. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1531. }
  1532. // EntityUserLinks: An entity user link collection provides a list of
  1533. // Analytics ACL links Each resource in this collection corresponds to a
  1534. // single link.
  1535. type EntityUserLinks struct {
  1536. // Items: A list of entity user links.
  1537. Items []*EntityUserLink `json:"items,omitempty"`
  1538. // ItemsPerPage: The maximum number of entries the response can contain,
  1539. // regardless of the actual number of entries returned. Its value ranges
  1540. // from 1 to 1000 with a value of 1000 by default, or otherwise
  1541. // specified by the max-results query parameter.
  1542. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1543. // Kind: Collection type.
  1544. Kind string `json:"kind,omitempty"`
  1545. // NextLink: Next link for this account collection.
  1546. NextLink string `json:"nextLink,omitempty"`
  1547. // PreviousLink: Previous link for this account collection.
  1548. PreviousLink string `json:"previousLink,omitempty"`
  1549. // StartIndex: The starting index of the entries, which is 1 by default
  1550. // or otherwise specified by the start-index query parameter.
  1551. StartIndex int64 `json:"startIndex,omitempty"`
  1552. // TotalResults: The total number of results for the query, regardless
  1553. // of the number of results in the response.
  1554. TotalResults int64 `json:"totalResults,omitempty"`
  1555. // ServerResponse contains the HTTP response code and headers from the
  1556. // server.
  1557. googleapi.ServerResponse `json:"-"`
  1558. // ForceSendFields is a list of field names (e.g. "Items") to
  1559. // unconditionally include in API requests. By default, fields with
  1560. // empty values are omitted from API requests. However, any non-pointer,
  1561. // non-interface field appearing in ForceSendFields will be sent to the
  1562. // server regardless of whether the field is empty or not. This may be
  1563. // used to include empty fields in Patch requests.
  1564. ForceSendFields []string `json:"-"`
  1565. // NullFields is a list of field names (e.g. "Items") to include in API
  1566. // requests with the JSON null value. By default, fields with empty
  1567. // values are omitted from API requests. However, any field with an
  1568. // empty value appearing in NullFields will be sent to the server as
  1569. // null. It is an error if a field in this list has a non-empty value.
  1570. // This may be used to include null fields in Patch requests.
  1571. NullFields []string `json:"-"`
  1572. }
  1573. func (s *EntityUserLinks) MarshalJSON() ([]byte, error) {
  1574. type NoMethod EntityUserLinks
  1575. raw := NoMethod(*s)
  1576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1577. }
  1578. // Experiment: JSON template for Analytics experiment resource.
  1579. type Experiment struct {
  1580. // AccountId: Account ID to which this experiment belongs. This field is
  1581. // read-only.
  1582. AccountId string `json:"accountId,omitempty"`
  1583. // Created: Time the experiment was created. This field is read-only.
  1584. Created string `json:"created,omitempty"`
  1585. // Description: Notes about this experiment.
  1586. Description string `json:"description,omitempty"`
  1587. // EditableInGaUi: If true, the end user will be able to edit the
  1588. // experiment via the Google Analytics user interface.
  1589. EditableInGaUi bool `json:"editableInGaUi,omitempty"`
  1590. // EndTime: The ending time of the experiment (the time the status
  1591. // changed from RUNNING to ENDED). This field is present only if the
  1592. // experiment has ended. This field is read-only.
  1593. EndTime string `json:"endTime,omitempty"`
  1594. // EqualWeighting: Boolean specifying whether to distribute traffic
  1595. // evenly across all variations. If the value is False, content
  1596. // experiments follows the default behavior of adjusting traffic
  1597. // dynamically based on variation performance. Optional -- defaults to
  1598. // False. This field may not be changed for an experiment whose status
  1599. // is ENDED.
  1600. EqualWeighting bool `json:"equalWeighting,omitempty"`
  1601. // Id: Experiment ID. Required for patch and update. Disallowed for
  1602. // create.
  1603. Id string `json:"id,omitempty"`
  1604. // InternalWebPropertyId: Internal ID for the web property to which this
  1605. // experiment belongs. This field is read-only.
  1606. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  1607. // Kind: Resource type for an Analytics experiment. This field is
  1608. // read-only.
  1609. Kind string `json:"kind,omitempty"`
  1610. // MinimumExperimentLengthInDays: An integer number in [3, 90].
  1611. // Specifies the minimum length of the experiment. Can be changed for a
  1612. // running experiment. This field may not be changed for an experiments
  1613. // whose status is ENDED.
  1614. MinimumExperimentLengthInDays int64 `json:"minimumExperimentLengthInDays,omitempty"`
  1615. // Name: Experiment name. This field may not be changed for an
  1616. // experiment whose status is ENDED. This field is required when
  1617. // creating an experiment.
  1618. Name string `json:"name,omitempty"`
  1619. // ObjectiveMetric: The metric that the experiment is optimizing. Valid
  1620. // values: "ga:goal(n)Completions", "ga:adsenseAdsClicks",
  1621. // "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces",
  1622. // "ga:pageviews", "ga:sessionDuration", "ga:transactions",
  1623. // "ga:transactionRevenue". This field is required if status is
  1624. // "RUNNING" and servingFramework is one of "REDIRECT" or "API".
  1625. ObjectiveMetric string `json:"objectiveMetric,omitempty"`
  1626. // OptimizationType: Whether the objectiveMetric should be minimized or
  1627. // maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults
  1628. // to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be
  1629. // modified when status is "RUNNING" or "ENDED".
  1630. OptimizationType string `json:"optimizationType,omitempty"`
  1631. // ParentLink: Parent link for an experiment. Points to the view
  1632. // (profile) to which this experiment belongs.
  1633. ParentLink *ExperimentParentLink `json:"parentLink,omitempty"`
  1634. // ProfileId: View (Profile) ID to which this experiment belongs. This
  1635. // field is read-only.
  1636. ProfileId string `json:"profileId,omitempty"`
  1637. // ReasonExperimentEnded: Why the experiment ended. Possible values:
  1638. // "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED",
  1639. // "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED".
  1640. // "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no
  1641. // winner was projected to be found. If the experiment status is changed
  1642. // via the API to ENDED this field is set to STOPPED_BY_USER. This field
  1643. // is read-only.
  1644. ReasonExperimentEnded string `json:"reasonExperimentEnded,omitempty"`
  1645. // RewriteVariationUrlsAsOriginal: Boolean specifying whether variations
  1646. // URLS are rewritten to match those of the original. This field may not
  1647. // be changed for an experiments whose status is ENDED.
  1648. RewriteVariationUrlsAsOriginal bool `json:"rewriteVariationUrlsAsOriginal,omitempty"`
  1649. // SelfLink: Link for this experiment. This field is read-only.
  1650. SelfLink string `json:"selfLink,omitempty"`
  1651. // ServingFramework: The framework used to serve the experiment
  1652. // variations and evaluate the results. One of:
  1653. // - REDIRECT: Google Analytics redirects traffic to different variation
  1654. // pages, reports the chosen variation and evaluates the results.
  1655. // - API: Google Analytics chooses and reports the variation to serve
  1656. // and evaluates the results; the caller is responsible for serving the
  1657. // selected variation.
  1658. // - EXTERNAL: The variations will be served externally and the chosen
  1659. // variation reported to Google Analytics. The caller is responsible for
  1660. // serving the selected variation and evaluating the results.
  1661. ServingFramework string `json:"servingFramework,omitempty"`
  1662. // Snippet: The snippet of code to include on the control page(s). This
  1663. // field is read-only.
  1664. Snippet string `json:"snippet,omitempty"`
  1665. // StartTime: The starting time of the experiment (the time the status
  1666. // changed from READY_TO_RUN to RUNNING). This field is present only if
  1667. // the experiment has started. This field is read-only.
  1668. StartTime string `json:"startTime,omitempty"`
  1669. // Status: Experiment status. Possible values: "DRAFT", "READY_TO_RUN",
  1670. // "RUNNING", "ENDED". Experiments can be created in the "DRAFT",
  1671. // "READY_TO_RUN" or "RUNNING" state. This field is required when
  1672. // creating an experiment.
  1673. Status string `json:"status,omitempty"`
  1674. // TrafficCoverage: A floating-point number in (0, 1]. Specifies the
  1675. // fraction of the traffic that participates in the experiment. Can be
  1676. // changed for a running experiment. This field may not be changed for
  1677. // an experiments whose status is ENDED.
  1678. TrafficCoverage float64 `json:"trafficCoverage,omitempty"`
  1679. // Updated: Time the experiment was last modified. This field is
  1680. // read-only.
  1681. Updated string `json:"updated,omitempty"`
  1682. // Variations: Array of variations. The first variation in the array is
  1683. // the original. The number of variations may not change once an
  1684. // experiment is in the RUNNING state. At least two variations are
  1685. // required before status can be set to RUNNING.
  1686. Variations []*ExperimentVariations `json:"variations,omitempty"`
  1687. // WebPropertyId: Web property ID to which this experiment belongs. The
  1688. // web property ID is of the form UA-XXXXX-YY. This field is read-only.
  1689. WebPropertyId string `json:"webPropertyId,omitempty"`
  1690. // WinnerConfidenceLevel: A floating-point number in (0, 1). Specifies
  1691. // the necessary confidence level to choose a winner. This field may not
  1692. // be changed for an experiments whose status is ENDED.
  1693. WinnerConfidenceLevel float64 `json:"winnerConfidenceLevel,omitempty"`
  1694. // WinnerFound: Boolean specifying whether a winner has been found for
  1695. // this experiment. This field is read-only.
  1696. WinnerFound bool `json:"winnerFound,omitempty"`
  1697. // ServerResponse contains the HTTP response code and headers from the
  1698. // server.
  1699. googleapi.ServerResponse `json:"-"`
  1700. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1701. // unconditionally include in API requests. By default, fields with
  1702. // empty values are omitted from API requests. However, any non-pointer,
  1703. // non-interface field appearing in ForceSendFields will be sent to the
  1704. // server regardless of whether the field is empty or not. This may be
  1705. // used to include empty fields in Patch requests.
  1706. ForceSendFields []string `json:"-"`
  1707. // NullFields is a list of field names (e.g. "AccountId") to include in
  1708. // API requests with the JSON null value. By default, fields with empty
  1709. // values are omitted from API requests. However, any field with an
  1710. // empty value appearing in NullFields will be sent to the server as
  1711. // null. It is an error if a field in this list has a non-empty value.
  1712. // This may be used to include null fields in Patch requests.
  1713. NullFields []string `json:"-"`
  1714. }
  1715. func (s *Experiment) MarshalJSON() ([]byte, error) {
  1716. type NoMethod Experiment
  1717. raw := NoMethod(*s)
  1718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1719. }
  1720. func (s *Experiment) UnmarshalJSON(data []byte) error {
  1721. type NoMethod Experiment
  1722. var s1 struct {
  1723. TrafficCoverage gensupport.JSONFloat64 `json:"trafficCoverage"`
  1724. WinnerConfidenceLevel gensupport.JSONFloat64 `json:"winnerConfidenceLevel"`
  1725. *NoMethod
  1726. }
  1727. s1.NoMethod = (*NoMethod)(s)
  1728. if err := json.Unmarshal(data, &s1); err != nil {
  1729. return err
  1730. }
  1731. s.TrafficCoverage = float64(s1.TrafficCoverage)
  1732. s.WinnerConfidenceLevel = float64(s1.WinnerConfidenceLevel)
  1733. return nil
  1734. }
  1735. // ExperimentParentLink: Parent link for an experiment. Points to the
  1736. // view (profile) to which this experiment belongs.
  1737. type ExperimentParentLink struct {
  1738. // Href: Link to the view (profile) to which this experiment belongs.
  1739. // This field is read-only.
  1740. Href string `json:"href,omitempty"`
  1741. // Type: Value is "analytics#profile". This field is read-only.
  1742. Type string `json:"type,omitempty"`
  1743. // ForceSendFields is a list of field names (e.g. "Href") to
  1744. // unconditionally include in API requests. By default, fields with
  1745. // empty values are omitted from API requests. However, any non-pointer,
  1746. // non-interface field appearing in ForceSendFields will be sent to the
  1747. // server regardless of whether the field is empty or not. This may be
  1748. // used to include empty fields in Patch requests.
  1749. ForceSendFields []string `json:"-"`
  1750. // NullFields is a list of field names (e.g. "Href") to include in API
  1751. // requests with the JSON null value. By default, fields with empty
  1752. // values are omitted from API requests. However, any field with an
  1753. // empty value appearing in NullFields will be sent to the server as
  1754. // null. It is an error if a field in this list has a non-empty value.
  1755. // This may be used to include null fields in Patch requests.
  1756. NullFields []string `json:"-"`
  1757. }
  1758. func (s *ExperimentParentLink) MarshalJSON() ([]byte, error) {
  1759. type NoMethod ExperimentParentLink
  1760. raw := NoMethod(*s)
  1761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1762. }
  1763. type ExperimentVariations struct {
  1764. // Name: The name of the variation. This field is required when creating
  1765. // an experiment. This field may not be changed for an experiment whose
  1766. // status is ENDED.
  1767. Name string `json:"name,omitempty"`
  1768. // Status: Status of the variation. Possible values: "ACTIVE",
  1769. // "INACTIVE". INACTIVE variations are not served. This field may not be
  1770. // changed for an experiment whose status is ENDED.
  1771. Status string `json:"status,omitempty"`
  1772. // Url: The URL of the variation. This field may not be changed for an
  1773. // experiment whose status is RUNNING or ENDED.
  1774. Url string `json:"url,omitempty"`
  1775. // Weight: Weight that this variation should receive. Only present if
  1776. // the experiment is running. This field is read-only.
  1777. Weight float64 `json:"weight,omitempty"`
  1778. // Won: True if the experiment has ended and this variation performed
  1779. // (statistically) significantly better than the original. This field is
  1780. // read-only.
  1781. Won bool `json:"won,omitempty"`
  1782. // ForceSendFields is a list of field names (e.g. "Name") to
  1783. // unconditionally include in API requests. By default, fields with
  1784. // empty values are omitted from API requests. However, any non-pointer,
  1785. // non-interface field appearing in ForceSendFields will be sent to the
  1786. // server regardless of whether the field is empty or not. This may be
  1787. // used to include empty fields in Patch requests.
  1788. ForceSendFields []string `json:"-"`
  1789. // NullFields is a list of field names (e.g. "Name") to include in API
  1790. // requests with the JSON null value. By default, fields with empty
  1791. // values are omitted from API requests. However, any field with an
  1792. // empty value appearing in NullFields will be sent to the server as
  1793. // null. It is an error if a field in this list has a non-empty value.
  1794. // This may be used to include null fields in Patch requests.
  1795. NullFields []string `json:"-"`
  1796. }
  1797. func (s *ExperimentVariations) MarshalJSON() ([]byte, error) {
  1798. type NoMethod ExperimentVariations
  1799. raw := NoMethod(*s)
  1800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1801. }
  1802. func (s *ExperimentVariations) UnmarshalJSON(data []byte) error {
  1803. type NoMethod ExperimentVariations
  1804. var s1 struct {
  1805. Weight gensupport.JSONFloat64 `json:"weight"`
  1806. *NoMethod
  1807. }
  1808. s1.NoMethod = (*NoMethod)(s)
  1809. if err := json.Unmarshal(data, &s1); err != nil {
  1810. return err
  1811. }
  1812. s.Weight = float64(s1.Weight)
  1813. return nil
  1814. }
  1815. // Experiments: An experiment collection lists Analytics experiments to
  1816. // which the user has access. Each view (profile) can have a set of
  1817. // experiments. Each resource in the Experiment collection corresponds
  1818. // to a single Analytics experiment.
  1819. type Experiments struct {
  1820. // Items: A list of experiments.
  1821. Items []*Experiment `json:"items,omitempty"`
  1822. // ItemsPerPage: The maximum number of resources the response can
  1823. // contain, regardless of the actual number of resources returned. Its
  1824. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1825. // otherwise specified by the max-results query parameter.
  1826. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1827. // Kind: Collection type.
  1828. Kind string `json:"kind,omitempty"`
  1829. // NextLink: Link to next page for this experiment collection.
  1830. NextLink string `json:"nextLink,omitempty"`
  1831. // PreviousLink: Link to previous page for this experiment collection.
  1832. PreviousLink string `json:"previousLink,omitempty"`
  1833. // StartIndex: The starting index of the resources, which is 1 by
  1834. // default or otherwise specified by the start-index query parameter.
  1835. StartIndex int64 `json:"startIndex,omitempty"`
  1836. // TotalResults: The total number of results for the query, regardless
  1837. // of the number of resources in the result.
  1838. TotalResults int64 `json:"totalResults,omitempty"`
  1839. // Username: Email ID of the authenticated user
  1840. Username string `json:"username,omitempty"`
  1841. // ServerResponse contains the HTTP response code and headers from the
  1842. // server.
  1843. googleapi.ServerResponse `json:"-"`
  1844. // ForceSendFields is a list of field names (e.g. "Items") to
  1845. // unconditionally include in API requests. By default, fields with
  1846. // empty values are omitted from API requests. However, any non-pointer,
  1847. // non-interface field appearing in ForceSendFields will be sent to the
  1848. // server regardless of whether the field is empty or not. This may be
  1849. // used to include empty fields in Patch requests.
  1850. ForceSendFields []string `json:"-"`
  1851. // NullFields is a list of field names (e.g. "Items") to include in API
  1852. // requests with the JSON null value. By default, fields with empty
  1853. // values are omitted from API requests. However, any field with an
  1854. // empty value appearing in NullFields will be sent to the server as
  1855. // null. It is an error if a field in this list has a non-empty value.
  1856. // This may be used to include null fields in Patch requests.
  1857. NullFields []string `json:"-"`
  1858. }
  1859. func (s *Experiments) MarshalJSON() ([]byte, error) {
  1860. type NoMethod Experiments
  1861. raw := NoMethod(*s)
  1862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1863. }
  1864. // Filter: JSON template for an Analytics account filter.
  1865. type Filter struct {
  1866. // AccountId: Account ID to which this filter belongs.
  1867. AccountId string `json:"accountId,omitempty"`
  1868. // AdvancedDetails: Details for the filter of the type ADVANCED.
  1869. AdvancedDetails *FilterAdvancedDetails `json:"advancedDetails,omitempty"`
  1870. // Created: Time this filter was created.
  1871. Created string `json:"created,omitempty"`
  1872. // ExcludeDetails: Details for the filter of the type EXCLUDE.
  1873. ExcludeDetails *FilterExpression `json:"excludeDetails,omitempty"`
  1874. // Id: Filter ID.
  1875. Id string `json:"id,omitempty"`
  1876. // IncludeDetails: Details for the filter of the type INCLUDE.
  1877. IncludeDetails *FilterExpression `json:"includeDetails,omitempty"`
  1878. // Kind: Resource type for Analytics filter.
  1879. Kind string `json:"kind,omitempty"`
  1880. // LowercaseDetails: Details for the filter of the type LOWER.
  1881. LowercaseDetails *FilterLowercaseDetails `json:"lowercaseDetails,omitempty"`
  1882. // Name: Name of this filter.
  1883. Name string `json:"name,omitempty"`
  1884. // ParentLink: Parent link for this filter. Points to the account to
  1885. // which this filter belongs.
  1886. ParentLink *FilterParentLink `json:"parentLink,omitempty"`
  1887. // SearchAndReplaceDetails: Details for the filter of the type
  1888. // SEARCH_AND_REPLACE.
  1889. SearchAndReplaceDetails *FilterSearchAndReplaceDetails `json:"searchAndReplaceDetails,omitempty"`
  1890. // SelfLink: Link for this filter.
  1891. SelfLink string `json:"selfLink,omitempty"`
  1892. // Type: Type of this filter. Possible values are INCLUDE, EXCLUDE,
  1893. // LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED.
  1894. Type string `json:"type,omitempty"`
  1895. // Updated: Time this filter was last modified.
  1896. Updated string `json:"updated,omitempty"`
  1897. // UppercaseDetails: Details for the filter of the type UPPER.
  1898. UppercaseDetails *FilterUppercaseDetails `json:"uppercaseDetails,omitempty"`
  1899. // ServerResponse contains the HTTP response code and headers from the
  1900. // server.
  1901. googleapi.ServerResponse `json:"-"`
  1902. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1903. // unconditionally include in API requests. By default, fields with
  1904. // empty values are omitted from API requests. However, any non-pointer,
  1905. // non-interface field appearing in ForceSendFields will be sent to the
  1906. // server regardless of whether the field is empty or not. This may be
  1907. // used to include empty fields in Patch requests.
  1908. ForceSendFields []string `json:"-"`
  1909. // NullFields is a list of field names (e.g. "AccountId") to include in
  1910. // API requests with the JSON null value. By default, fields with empty
  1911. // values are omitted from API requests. However, any field with an
  1912. // empty value appearing in NullFields will be sent to the server as
  1913. // null. It is an error if a field in this list has a non-empty value.
  1914. // This may be used to include null fields in Patch requests.
  1915. NullFields []string `json:"-"`
  1916. }
  1917. func (s *Filter) MarshalJSON() ([]byte, error) {
  1918. type NoMethod Filter
  1919. raw := NoMethod(*s)
  1920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1921. }
  1922. // FilterAdvancedDetails: Details for the filter of the type ADVANCED.
  1923. type FilterAdvancedDetails struct {
  1924. // CaseSensitive: Indicates if the filter expressions are case
  1925. // sensitive.
  1926. CaseSensitive bool `json:"caseSensitive,omitempty"`
  1927. // ExtractA: Expression to extract from field A.
  1928. ExtractA string `json:"extractA,omitempty"`
  1929. // ExtractB: Expression to extract from field B.
  1930. ExtractB string `json:"extractB,omitempty"`
  1931. // FieldA: Field A.
  1932. FieldA string `json:"fieldA,omitempty"`
  1933. // FieldAIndex: The Index of the custom dimension. Required if field is
  1934. // a CUSTOM_DIMENSION.
  1935. FieldAIndex int64 `json:"fieldAIndex,omitempty"`
  1936. // FieldARequired: Indicates if field A is required to match.
  1937. FieldARequired bool `json:"fieldARequired,omitempty"`
  1938. // FieldB: Field B.
  1939. FieldB string `json:"fieldB,omitempty"`
  1940. // FieldBIndex: The Index of the custom dimension. Required if field is
  1941. // a CUSTOM_DIMENSION.
  1942. FieldBIndex int64 `json:"fieldBIndex,omitempty"`
  1943. // FieldBRequired: Indicates if field B is required to match.
  1944. FieldBRequired bool `json:"fieldBRequired,omitempty"`
  1945. // OutputConstructor: Expression used to construct the output value.
  1946. OutputConstructor string `json:"outputConstructor,omitempty"`
  1947. // OutputToField: Output field.
  1948. OutputToField string `json:"outputToField,omitempty"`
  1949. // OutputToFieldIndex: The Index of the custom dimension. Required if
  1950. // field is a CUSTOM_DIMENSION.
  1951. OutputToFieldIndex int64 `json:"outputToFieldIndex,omitempty"`
  1952. // OverrideOutputField: Indicates if the existing value of the output
  1953. // field, if any, should be overridden by the output expression.
  1954. OverrideOutputField bool `json:"overrideOutputField,omitempty"`
  1955. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  1956. // unconditionally include in API requests. By default, fields with
  1957. // empty values are omitted from API requests. However, any non-pointer,
  1958. // non-interface field appearing in ForceSendFields will be sent to the
  1959. // server regardless of whether the field is empty or not. This may be
  1960. // used to include empty fields in Patch requests.
  1961. ForceSendFields []string `json:"-"`
  1962. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  1963. // in API requests with the JSON null value. By default, fields with
  1964. // empty values are omitted from API requests. However, any field with
  1965. // an empty value appearing in NullFields will be sent to the server as
  1966. // null. It is an error if a field in this list has a non-empty value.
  1967. // This may be used to include null fields in Patch requests.
  1968. NullFields []string `json:"-"`
  1969. }
  1970. func (s *FilterAdvancedDetails) MarshalJSON() ([]byte, error) {
  1971. type NoMethod FilterAdvancedDetails
  1972. raw := NoMethod(*s)
  1973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1974. }
  1975. // FilterLowercaseDetails: Details for the filter of the type LOWER.
  1976. type FilterLowercaseDetails struct {
  1977. // Field: Field to use in the filter.
  1978. Field string `json:"field,omitempty"`
  1979. // FieldIndex: The Index of the custom dimension. Required if field is a
  1980. // CUSTOM_DIMENSION.
  1981. FieldIndex int64 `json:"fieldIndex,omitempty"`
  1982. // ForceSendFields is a list of field names (e.g. "Field") to
  1983. // unconditionally include in API requests. By default, fields with
  1984. // empty values are omitted from API requests. However, any non-pointer,
  1985. // non-interface field appearing in ForceSendFields will be sent to the
  1986. // server regardless of whether the field is empty or not. This may be
  1987. // used to include empty fields in Patch requests.
  1988. ForceSendFields []string `json:"-"`
  1989. // NullFields is a list of field names (e.g. "Field") to include in API
  1990. // requests with the JSON null value. By default, fields with empty
  1991. // values are omitted from API requests. However, any field with an
  1992. // empty value appearing in NullFields will be sent to the server as
  1993. // null. It is an error if a field in this list has a non-empty value.
  1994. // This may be used to include null fields in Patch requests.
  1995. NullFields []string `json:"-"`
  1996. }
  1997. func (s *FilterLowercaseDetails) MarshalJSON() ([]byte, error) {
  1998. type NoMethod FilterLowercaseDetails
  1999. raw := NoMethod(*s)
  2000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2001. }
  2002. // FilterParentLink: Parent link for this filter. Points to the account
  2003. // to which this filter belongs.
  2004. type FilterParentLink struct {
  2005. // Href: Link to the account to which this filter belongs.
  2006. Href string `json:"href,omitempty"`
  2007. // Type: Value is "analytics#account".
  2008. Type string `json:"type,omitempty"`
  2009. // ForceSendFields is a list of field names (e.g. "Href") to
  2010. // unconditionally include in API requests. By default, fields with
  2011. // empty values are omitted from API requests. However, any non-pointer,
  2012. // non-interface field appearing in ForceSendFields will be sent to the
  2013. // server regardless of whether the field is empty or not. This may be
  2014. // used to include empty fields in Patch requests.
  2015. ForceSendFields []string `json:"-"`
  2016. // NullFields is a list of field names (e.g. "Href") to include in API
  2017. // requests with the JSON null value. By default, fields with empty
  2018. // values are omitted from API requests. However, any field with an
  2019. // empty value appearing in NullFields will be sent to the server as
  2020. // null. It is an error if a field in this list has a non-empty value.
  2021. // This may be used to include null fields in Patch requests.
  2022. NullFields []string `json:"-"`
  2023. }
  2024. func (s *FilterParentLink) MarshalJSON() ([]byte, error) {
  2025. type NoMethod FilterParentLink
  2026. raw := NoMethod(*s)
  2027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2028. }
  2029. // FilterSearchAndReplaceDetails: Details for the filter of the type
  2030. // SEARCH_AND_REPLACE.
  2031. type FilterSearchAndReplaceDetails struct {
  2032. // CaseSensitive: Determines if the filter is case sensitive.
  2033. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2034. // Field: Field to use in the filter.
  2035. Field string `json:"field,omitempty"`
  2036. // FieldIndex: The Index of the custom dimension. Required if field is a
  2037. // CUSTOM_DIMENSION.
  2038. FieldIndex int64 `json:"fieldIndex,omitempty"`
  2039. // ReplaceString: Term to replace the search term with.
  2040. ReplaceString string `json:"replaceString,omitempty"`
  2041. // SearchString: Term to search.
  2042. SearchString string `json:"searchString,omitempty"`
  2043. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2044. // unconditionally include in API requests. By default, fields with
  2045. // empty values are omitted from API requests. However, any non-pointer,
  2046. // non-interface field appearing in ForceSendFields will be sent to the
  2047. // server regardless of whether the field is empty or not. This may be
  2048. // used to include empty fields in Patch requests.
  2049. ForceSendFields []string `json:"-"`
  2050. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  2051. // in API requests with the JSON null value. By default, fields with
  2052. // empty values are omitted from API requests. However, any field with
  2053. // an empty value appearing in NullFields will be sent to the server as
  2054. // null. It is an error if a field in this list has a non-empty value.
  2055. // This may be used to include null fields in Patch requests.
  2056. NullFields []string `json:"-"`
  2057. }
  2058. func (s *FilterSearchAndReplaceDetails) MarshalJSON() ([]byte, error) {
  2059. type NoMethod FilterSearchAndReplaceDetails
  2060. raw := NoMethod(*s)
  2061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2062. }
  2063. // FilterUppercaseDetails: Details for the filter of the type UPPER.
  2064. type FilterUppercaseDetails struct {
  2065. // Field: Field to use in the filter.
  2066. Field string `json:"field,omitempty"`
  2067. // FieldIndex: The Index of the custom dimension. Required if field is a
  2068. // CUSTOM_DIMENSION.
  2069. FieldIndex int64 `json:"fieldIndex,omitempty"`
  2070. // ForceSendFields is a list of field names (e.g. "Field") to
  2071. // unconditionally include in API requests. By default, fields with
  2072. // empty values are omitted from API requests. However, any non-pointer,
  2073. // non-interface field appearing in ForceSendFields will be sent to the
  2074. // server regardless of whether the field is empty or not. This may be
  2075. // used to include empty fields in Patch requests.
  2076. ForceSendFields []string `json:"-"`
  2077. // NullFields is a list of field names (e.g. "Field") to include in API
  2078. // requests with the JSON null value. By default, fields with empty
  2079. // values are omitted from API requests. However, any field with an
  2080. // empty value appearing in NullFields will be sent to the server as
  2081. // null. It is an error if a field in this list has a non-empty value.
  2082. // This may be used to include null fields in Patch requests.
  2083. NullFields []string `json:"-"`
  2084. }
  2085. func (s *FilterUppercaseDetails) MarshalJSON() ([]byte, error) {
  2086. type NoMethod FilterUppercaseDetails
  2087. raw := NoMethod(*s)
  2088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2089. }
  2090. // FilterExpression: JSON template for an Analytics filter expression.
  2091. type FilterExpression struct {
  2092. // CaseSensitive: Determines if the filter is case sensitive.
  2093. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2094. // ExpressionValue: Filter expression value
  2095. ExpressionValue string `json:"expressionValue,omitempty"`
  2096. // Field: Field to filter. Possible values:
  2097. // - Content and Traffic
  2098. // - PAGE_REQUEST_URI,
  2099. // - PAGE_HOSTNAME,
  2100. // - PAGE_TITLE,
  2101. // - REFERRAL,
  2102. // - COST_DATA_URI (Campaign target URL),
  2103. // - HIT_TYPE,
  2104. // - INTERNAL_SEARCH_TERM,
  2105. // - INTERNAL_SEARCH_TYPE,
  2106. // - SOURCE_PROPERTY_TRACKING_ID,
  2107. // - Campaign or AdGroup
  2108. // - CAMPAIGN_SOURCE,
  2109. // - CAMPAIGN_MEDIUM,
  2110. // - CAMPAIGN_NAME,
  2111. // - CAMPAIGN_AD_GROUP,
  2112. // - CAMPAIGN_TERM,
  2113. // - CAMPAIGN_CONTENT,
  2114. // - CAMPAIGN_CODE,
  2115. // - CAMPAIGN_REFERRAL_PATH,
  2116. // - E-Commerce
  2117. // - TRANSACTION_COUNTRY,
  2118. // - TRANSACTION_REGION,
  2119. // - TRANSACTION_CITY,
  2120. // - TRANSACTION_AFFILIATION (Store or order location),
  2121. // - ITEM_NAME,
  2122. // - ITEM_CODE,
  2123. // - ITEM_VARIATION,
  2124. // - TRANSACTION_ID,
  2125. // - TRANSACTION_CURRENCY_CODE,
  2126. // - PRODUCT_ACTION_TYPE,
  2127. // - Audience/Users
  2128. // - BROWSER,
  2129. // - BROWSER_VERSION,
  2130. // - BROWSER_SIZE,
  2131. // - PLATFORM,
  2132. // - PLATFORM_VERSION,
  2133. // - LANGUAGE,
  2134. // - SCREEN_RESOLUTION,
  2135. // - SCREEN_COLORS,
  2136. // - JAVA_ENABLED (Boolean Field),
  2137. // - FLASH_VERSION,
  2138. // - GEO_SPEED (Connection speed),
  2139. // - VISITOR_TYPE,
  2140. // - GEO_ORGANIZATION (ISP organization),
  2141. // - GEO_DOMAIN,
  2142. // - GEO_IP_ADDRESS,
  2143. // - GEO_IP_VERSION,
  2144. // - Location
  2145. // - GEO_COUNTRY,
  2146. // - GEO_REGION,
  2147. // - GEO_CITY,
  2148. // - Event
  2149. // - EVENT_CATEGORY,
  2150. // - EVENT_ACTION,
  2151. // - EVENT_LABEL,
  2152. // - Other
  2153. // - CUSTOM_FIELD_1,
  2154. // - CUSTOM_FIELD_2,
  2155. // - USER_DEFINED_VALUE,
  2156. // - Application
  2157. // - APP_ID,
  2158. // - APP_INSTALLER_ID,
  2159. // - APP_NAME,
  2160. // - APP_VERSION,
  2161. // - SCREEN,
  2162. // - IS_APP (Boolean Field),
  2163. // - IS_FATAL_EXCEPTION (Boolean Field),
  2164. // - EXCEPTION_DESCRIPTION,
  2165. // - Mobile device
  2166. // - IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile),
  2167. //
  2168. // - IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet),
  2169. //
  2170. // - DEVICE_CATEGORY,
  2171. // - MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field),
  2172. // - MOBILE_HAS_NFC_SUPPORT (Boolean Field),
  2173. // - MOBILE_HAS_CELLULAR_RADIO (Boolean Field),
  2174. // - MOBILE_HAS_WIFI_SUPPORT (Boolean Field),
  2175. // - MOBILE_BRAND_NAME,
  2176. // - MOBILE_MODEL_NAME,
  2177. // - MOBILE_MARKETING_NAME,
  2178. // - MOBILE_POINTING_METHOD,
  2179. // - Social
  2180. // - SOCIAL_NETWORK,
  2181. // - SOCIAL_ACTION,
  2182. // - SOCIAL_ACTION_TARGET,
  2183. // - Custom dimension
  2184. // - CUSTOM_DIMENSION (See accompanying field index),
  2185. Field string `json:"field,omitempty"`
  2186. // FieldIndex: The Index of the custom dimension. Set only if the field
  2187. // is a is CUSTOM_DIMENSION.
  2188. FieldIndex int64 `json:"fieldIndex,omitempty"`
  2189. // Kind: Kind value for filter expression
  2190. Kind string `json:"kind,omitempty"`
  2191. // MatchType: Match type for this filter. Possible values are
  2192. // BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN,
  2193. // GEO_IP_ADDRESS, PAGE_REQUEST_URI, or PAGE_HOSTNAME filters can use
  2194. // any match type; all other filters must use MATCHES.
  2195. MatchType string `json:"matchType,omitempty"`
  2196. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2197. // unconditionally include in API requests. By default, fields with
  2198. // empty values are omitted from API requests. However, any non-pointer,
  2199. // non-interface field appearing in ForceSendFields will be sent to the
  2200. // server regardless of whether the field is empty or not. This may be
  2201. // used to include empty fields in Patch requests.
  2202. ForceSendFields []string `json:"-"`
  2203. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  2204. // in API requests with the JSON null value. By default, fields with
  2205. // empty values are omitted from API requests. However, any field with
  2206. // an empty value appearing in NullFields will be sent to the server as
  2207. // null. It is an error if a field in this list has a non-empty value.
  2208. // This may be used to include null fields in Patch requests.
  2209. NullFields []string `json:"-"`
  2210. }
  2211. func (s *FilterExpression) MarshalJSON() ([]byte, error) {
  2212. type NoMethod FilterExpression
  2213. raw := NoMethod(*s)
  2214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2215. }
  2216. // FilterRef: JSON template for a profile filter link.
  2217. type FilterRef struct {
  2218. // AccountId: Account ID to which this filter belongs.
  2219. AccountId string `json:"accountId,omitempty"`
  2220. // Href: Link for this filter.
  2221. Href string `json:"href,omitempty"`
  2222. // Id: Filter ID.
  2223. Id string `json:"id,omitempty"`
  2224. // Kind: Kind value for filter reference.
  2225. Kind string `json:"kind,omitempty"`
  2226. // Name: Name of this filter.
  2227. Name string `json:"name,omitempty"`
  2228. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2229. // unconditionally include in API requests. By default, fields with
  2230. // empty values are omitted from API requests. However, any non-pointer,
  2231. // non-interface field appearing in ForceSendFields will be sent to the
  2232. // server regardless of whether the field is empty or not. This may be
  2233. // used to include empty fields in Patch requests.
  2234. ForceSendFields []string `json:"-"`
  2235. // NullFields is a list of field names (e.g. "AccountId") to include in
  2236. // API requests with the JSON null value. By default, fields with empty
  2237. // values are omitted from API requests. However, any field with an
  2238. // empty value appearing in NullFields will be sent to the server as
  2239. // null. It is an error if a field in this list has a non-empty value.
  2240. // This may be used to include null fields in Patch requests.
  2241. NullFields []string `json:"-"`
  2242. }
  2243. func (s *FilterRef) MarshalJSON() ([]byte, error) {
  2244. type NoMethod FilterRef
  2245. raw := NoMethod(*s)
  2246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2247. }
  2248. // Filters: A filter collection lists filters created by users in an
  2249. // Analytics account. Each resource in the collection corresponds to a
  2250. // filter.
  2251. type Filters struct {
  2252. // Items: A list of filters.
  2253. Items []*Filter `json:"items,omitempty"`
  2254. // ItemsPerPage: The maximum number of resources the response can
  2255. // contain, regardless of the actual number of resources returned. Its
  2256. // value ranges from 1 to 1,000 with a value of 1000 by default, or
  2257. // otherwise specified by the max-results query parameter.
  2258. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2259. // Kind: Collection type.
  2260. Kind string `json:"kind,omitempty"`
  2261. // NextLink: Link to next page for this filter collection.
  2262. NextLink string `json:"nextLink,omitempty"`
  2263. // PreviousLink: Link to previous page for this filter collection.
  2264. PreviousLink string `json:"previousLink,omitempty"`
  2265. // StartIndex: The starting index of the resources, which is 1 by
  2266. // default or otherwise specified by the start-index query parameter.
  2267. StartIndex int64 `json:"startIndex,omitempty"`
  2268. // TotalResults: The total number of results for the query, regardless
  2269. // of the number of results in the response.
  2270. TotalResults int64 `json:"totalResults,omitempty"`
  2271. // Username: Email ID of the authenticated user
  2272. Username string `json:"username,omitempty"`
  2273. // ServerResponse contains the HTTP response code and headers from the
  2274. // server.
  2275. googleapi.ServerResponse `json:"-"`
  2276. // ForceSendFields is a list of field names (e.g. "Items") to
  2277. // unconditionally include in API requests. By default, fields with
  2278. // empty values are omitted from API requests. However, any non-pointer,
  2279. // non-interface field appearing in ForceSendFields will be sent to the
  2280. // server regardless of whether the field is empty or not. This may be
  2281. // used to include empty fields in Patch requests.
  2282. ForceSendFields []string `json:"-"`
  2283. // NullFields is a list of field names (e.g. "Items") to include in API
  2284. // requests with the JSON null value. By default, fields with empty
  2285. // values are omitted from API requests. However, any field with an
  2286. // empty value appearing in NullFields will be sent to the server as
  2287. // null. It is an error if a field in this list has a non-empty value.
  2288. // This may be used to include null fields in Patch requests.
  2289. NullFields []string `json:"-"`
  2290. }
  2291. func (s *Filters) MarshalJSON() ([]byte, error) {
  2292. type NoMethod Filters
  2293. raw := NoMethod(*s)
  2294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2295. }
  2296. // GaData: Analytics data for a given view (profile).
  2297. type GaData struct {
  2298. // ColumnHeaders: Column headers that list dimension names followed by
  2299. // the metric names. The order of dimensions and metrics is same as
  2300. // specified in the request.
  2301. ColumnHeaders []*GaDataColumnHeaders `json:"columnHeaders,omitempty"`
  2302. // ContainsSampledData: Determines if Analytics data contains samples.
  2303. ContainsSampledData bool `json:"containsSampledData,omitempty"`
  2304. // DataLastRefreshed: The last refreshed time in seconds for Analytics
  2305. // data.
  2306. DataLastRefreshed int64 `json:"dataLastRefreshed,omitempty,string"`
  2307. DataTable *GaDataDataTable `json:"dataTable,omitempty"`
  2308. // Id: Unique ID for this data response.
  2309. Id string `json:"id,omitempty"`
  2310. // ItemsPerPage: The maximum number of rows the response can contain,
  2311. // regardless of the actual number of rows returned. Its value ranges
  2312. // from 1 to 10,000 with a value of 1000 by default, or otherwise
  2313. // specified by the max-results query parameter.
  2314. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2315. // Kind: Resource type.
  2316. Kind string `json:"kind,omitempty"`
  2317. // NextLink: Link to next page for this Analytics data query.
  2318. NextLink string `json:"nextLink,omitempty"`
  2319. // PreviousLink: Link to previous page for this Analytics data query.
  2320. PreviousLink string `json:"previousLink,omitempty"`
  2321. // ProfileInfo: Information for the view (profile), for which the
  2322. // Analytics data was requested.
  2323. ProfileInfo *GaDataProfileInfo `json:"profileInfo,omitempty"`
  2324. // Query: Analytics data request query parameters.
  2325. Query *GaDataQuery `json:"query,omitempty"`
  2326. // Rows: Analytics data rows, where each row contains a list of
  2327. // dimension values followed by the metric values. The order of
  2328. // dimensions and metrics is same as specified in the request.
  2329. Rows [][]string `json:"rows,omitempty"`
  2330. // SampleSize: The number of samples used to calculate the result.
  2331. SampleSize int64 `json:"sampleSize,omitempty,string"`
  2332. // SampleSpace: Total size of the sample space from which the samples
  2333. // were selected.
  2334. SampleSpace int64 `json:"sampleSpace,omitempty,string"`
  2335. // SelfLink: Link to this page.
  2336. SelfLink string `json:"selfLink,omitempty"`
  2337. // TotalResults: The total number of rows for the query, regardless of
  2338. // the number of rows in the response.
  2339. TotalResults int64 `json:"totalResults,omitempty"`
  2340. // TotalsForAllResults: Total values for the requested metrics over all
  2341. // the results, not just the results returned in this response. The
  2342. // order of the metric totals is same as the metric order specified in
  2343. // the request.
  2344. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  2345. // ServerResponse contains the HTTP response code and headers from the
  2346. // server.
  2347. googleapi.ServerResponse `json:"-"`
  2348. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  2349. // unconditionally include in API requests. By default, fields with
  2350. // empty values are omitted from API requests. However, any non-pointer,
  2351. // non-interface field appearing in ForceSendFields will be sent to the
  2352. // server regardless of whether the field is empty or not. This may be
  2353. // used to include empty fields in Patch requests.
  2354. ForceSendFields []string `json:"-"`
  2355. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  2356. // in API requests with the JSON null value. By default, fields with
  2357. // empty values are omitted from API requests. However, any field with
  2358. // an empty value appearing in NullFields will be sent to the server as
  2359. // null. It is an error if a field in this list has a non-empty value.
  2360. // This may be used to include null fields in Patch requests.
  2361. NullFields []string `json:"-"`
  2362. }
  2363. func (s *GaData) MarshalJSON() ([]byte, error) {
  2364. type NoMethod GaData
  2365. raw := NoMethod(*s)
  2366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2367. }
  2368. type GaDataColumnHeaders struct {
  2369. // ColumnType: Column Type. Either DIMENSION or METRIC.
  2370. ColumnType string `json:"columnType,omitempty"`
  2371. // DataType: Data type. Dimension column headers have only STRING as the
  2372. // data type. Metric column headers have data types for metric values
  2373. // such as INTEGER, DOUBLE, CURRENCY etc.
  2374. DataType string `json:"dataType,omitempty"`
  2375. // Name: Column name.
  2376. Name string `json:"name,omitempty"`
  2377. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  2378. // unconditionally include in API requests. By default, fields with
  2379. // empty values are omitted from API requests. However, any non-pointer,
  2380. // non-interface field appearing in ForceSendFields will be sent to the
  2381. // server regardless of whether the field is empty or not. This may be
  2382. // used to include empty fields in Patch requests.
  2383. ForceSendFields []string `json:"-"`
  2384. // NullFields is a list of field names (e.g. "ColumnType") to include in
  2385. // API requests with the JSON null value. By default, fields with empty
  2386. // values are omitted from API requests. However, any field with an
  2387. // empty value appearing in NullFields will be sent to the server as
  2388. // null. It is an error if a field in this list has a non-empty value.
  2389. // This may be used to include null fields in Patch requests.
  2390. NullFields []string `json:"-"`
  2391. }
  2392. func (s *GaDataColumnHeaders) MarshalJSON() ([]byte, error) {
  2393. type NoMethod GaDataColumnHeaders
  2394. raw := NoMethod(*s)
  2395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2396. }
  2397. type GaDataDataTable struct {
  2398. Cols []*GaDataDataTableCols `json:"cols,omitempty"`
  2399. Rows []*GaDataDataTableRows `json:"rows,omitempty"`
  2400. // ForceSendFields is a list of field names (e.g. "Cols") to
  2401. // unconditionally include in API requests. By default, fields with
  2402. // empty values are omitted from API requests. However, any non-pointer,
  2403. // non-interface field appearing in ForceSendFields will be sent to the
  2404. // server regardless of whether the field is empty or not. This may be
  2405. // used to include empty fields in Patch requests.
  2406. ForceSendFields []string `json:"-"`
  2407. // NullFields is a list of field names (e.g. "Cols") to include in API
  2408. // requests with the JSON null value. By default, fields with empty
  2409. // values are omitted from API requests. However, any field with an
  2410. // empty value appearing in NullFields will be sent to the server as
  2411. // null. It is an error if a field in this list has a non-empty value.
  2412. // This may be used to include null fields in Patch requests.
  2413. NullFields []string `json:"-"`
  2414. }
  2415. func (s *GaDataDataTable) MarshalJSON() ([]byte, error) {
  2416. type NoMethod GaDataDataTable
  2417. raw := NoMethod(*s)
  2418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2419. }
  2420. type GaDataDataTableCols struct {
  2421. Id string `json:"id,omitempty"`
  2422. Label string `json:"label,omitempty"`
  2423. Type string `json:"type,omitempty"`
  2424. // ForceSendFields is a list of field names (e.g. "Id") to
  2425. // unconditionally include in API requests. By default, fields with
  2426. // empty values are omitted from API requests. However, any non-pointer,
  2427. // non-interface field appearing in ForceSendFields will be sent to the
  2428. // server regardless of whether the field is empty or not. This may be
  2429. // used to include empty fields in Patch requests.
  2430. ForceSendFields []string `json:"-"`
  2431. // NullFields is a list of field names (e.g. "Id") to include in API
  2432. // requests with the JSON null value. By default, fields with empty
  2433. // values are omitted from API requests. However, any field with an
  2434. // empty value appearing in NullFields will be sent to the server as
  2435. // null. It is an error if a field in this list has a non-empty value.
  2436. // This may be used to include null fields in Patch requests.
  2437. NullFields []string `json:"-"`
  2438. }
  2439. func (s *GaDataDataTableCols) MarshalJSON() ([]byte, error) {
  2440. type NoMethod GaDataDataTableCols
  2441. raw := NoMethod(*s)
  2442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2443. }
  2444. type GaDataDataTableRows struct {
  2445. C []*GaDataDataTableRowsC `json:"c,omitempty"`
  2446. // ForceSendFields is a list of field names (e.g. "C") to
  2447. // unconditionally include in API requests. By default, fields with
  2448. // empty values are omitted from API requests. However, any non-pointer,
  2449. // non-interface field appearing in ForceSendFields will be sent to the
  2450. // server regardless of whether the field is empty or not. This may be
  2451. // used to include empty fields in Patch requests.
  2452. ForceSendFields []string `json:"-"`
  2453. // NullFields is a list of field names (e.g. "C") to include in API
  2454. // requests with the JSON null value. By default, fields with empty
  2455. // values are omitted from API requests. However, any field with an
  2456. // empty value appearing in NullFields will be sent to the server as
  2457. // null. It is an error if a field in this list has a non-empty value.
  2458. // This may be used to include null fields in Patch requests.
  2459. NullFields []string `json:"-"`
  2460. }
  2461. func (s *GaDataDataTableRows) MarshalJSON() ([]byte, error) {
  2462. type NoMethod GaDataDataTableRows
  2463. raw := NoMethod(*s)
  2464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2465. }
  2466. type GaDataDataTableRowsC struct {
  2467. V string `json:"v,omitempty"`
  2468. // ForceSendFields is a list of field names (e.g. "V") to
  2469. // unconditionally include in API requests. By default, fields with
  2470. // empty values are omitted from API requests. However, any non-pointer,
  2471. // non-interface field appearing in ForceSendFields will be sent to the
  2472. // server regardless of whether the field is empty or not. This may be
  2473. // used to include empty fields in Patch requests.
  2474. ForceSendFields []string `json:"-"`
  2475. // NullFields is a list of field names (e.g. "V") to include in API
  2476. // requests with the JSON null value. By default, fields with empty
  2477. // values are omitted from API requests. However, any field with an
  2478. // empty value appearing in NullFields will be sent to the server as
  2479. // null. It is an error if a field in this list has a non-empty value.
  2480. // This may be used to include null fields in Patch requests.
  2481. NullFields []string `json:"-"`
  2482. }
  2483. func (s *GaDataDataTableRowsC) MarshalJSON() ([]byte, error) {
  2484. type NoMethod GaDataDataTableRowsC
  2485. raw := NoMethod(*s)
  2486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2487. }
  2488. // GaDataProfileInfo: Information for the view (profile), for which the
  2489. // Analytics data was requested.
  2490. type GaDataProfileInfo struct {
  2491. // AccountId: Account ID to which this view (profile) belongs.
  2492. AccountId string `json:"accountId,omitempty"`
  2493. // InternalWebPropertyId: Internal ID for the web property to which this
  2494. // view (profile) belongs.
  2495. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2496. // ProfileId: View (Profile) ID.
  2497. ProfileId string `json:"profileId,omitempty"`
  2498. // ProfileName: View (Profile) name.
  2499. ProfileName string `json:"profileName,omitempty"`
  2500. // TableId: Table ID for view (profile).
  2501. TableId string `json:"tableId,omitempty"`
  2502. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  2503. WebPropertyId string `json:"webPropertyId,omitempty"`
  2504. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2505. // unconditionally include in API requests. By default, fields with
  2506. // empty values are omitted from API requests. However, any non-pointer,
  2507. // non-interface field appearing in ForceSendFields will be sent to the
  2508. // server regardless of whether the field is empty or not. This may be
  2509. // used to include empty fields in Patch requests.
  2510. ForceSendFields []string `json:"-"`
  2511. // NullFields is a list of field names (e.g. "AccountId") to include in
  2512. // API requests with the JSON null value. By default, fields with empty
  2513. // values are omitted from API requests. However, any field with an
  2514. // empty value appearing in NullFields will be sent to the server as
  2515. // null. It is an error if a field in this list has a non-empty value.
  2516. // This may be used to include null fields in Patch requests.
  2517. NullFields []string `json:"-"`
  2518. }
  2519. func (s *GaDataProfileInfo) MarshalJSON() ([]byte, error) {
  2520. type NoMethod GaDataProfileInfo
  2521. raw := NoMethod(*s)
  2522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2523. }
  2524. // GaDataQuery: Analytics data request query parameters.
  2525. type GaDataQuery struct {
  2526. // Dimensions: List of analytics dimensions.
  2527. Dimensions string `json:"dimensions,omitempty"`
  2528. // EndDate: End date.
  2529. EndDate string `json:"end-date,omitempty"`
  2530. // Filters: Comma-separated list of dimension or metric filters.
  2531. Filters string `json:"filters,omitempty"`
  2532. // Ids: Unique table ID.
  2533. Ids string `json:"ids,omitempty"`
  2534. // MaxResults: Maximum results per page.
  2535. MaxResults int64 `json:"max-results,omitempty"`
  2536. // Metrics: List of analytics metrics.
  2537. Metrics []string `json:"metrics,omitempty"`
  2538. // SamplingLevel: Desired sampling level
  2539. SamplingLevel string `json:"samplingLevel,omitempty"`
  2540. // Segment: Analytics advanced segment.
  2541. Segment string `json:"segment,omitempty"`
  2542. // Sort: List of dimensions or metrics based on which Analytics data is
  2543. // sorted.
  2544. Sort []string `json:"sort,omitempty"`
  2545. // StartDate: Start date.
  2546. StartDate string `json:"start-date,omitempty"`
  2547. // StartIndex: Start index.
  2548. StartIndex int64 `json:"start-index,omitempty"`
  2549. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  2550. // unconditionally include in API requests. By default, fields with
  2551. // empty values are omitted from API requests. However, any non-pointer,
  2552. // non-interface field appearing in ForceSendFields will be sent to the
  2553. // server regardless of whether the field is empty or not. This may be
  2554. // used to include empty fields in Patch requests.
  2555. ForceSendFields []string `json:"-"`
  2556. // NullFields is a list of field names (e.g. "Dimensions") to include in
  2557. // API requests with the JSON null value. By default, fields with empty
  2558. // values are omitted from API requests. However, any field with an
  2559. // empty value appearing in NullFields will be sent to the server as
  2560. // null. It is an error if a field in this list has a non-empty value.
  2561. // This may be used to include null fields in Patch requests.
  2562. NullFields []string `json:"-"`
  2563. }
  2564. func (s *GaDataQuery) MarshalJSON() ([]byte, error) {
  2565. type NoMethod GaDataQuery
  2566. raw := NoMethod(*s)
  2567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2568. }
  2569. // Goal: JSON template for Analytics goal resource.
  2570. type Goal struct {
  2571. // AccountId: Account ID to which this goal belongs.
  2572. AccountId string `json:"accountId,omitempty"`
  2573. // Active: Determines whether this goal is active.
  2574. Active bool `json:"active,omitempty"`
  2575. // Created: Time this goal was created.
  2576. Created string `json:"created,omitempty"`
  2577. // EventDetails: Details for the goal of the type EVENT.
  2578. EventDetails *GoalEventDetails `json:"eventDetails,omitempty"`
  2579. // Id: Goal ID.
  2580. Id string `json:"id,omitempty"`
  2581. // InternalWebPropertyId: Internal ID for the web property to which this
  2582. // goal belongs.
  2583. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2584. // Kind: Resource type for an Analytics goal.
  2585. Kind string `json:"kind,omitempty"`
  2586. // Name: Goal name.
  2587. Name string `json:"name,omitempty"`
  2588. // ParentLink: Parent link for a goal. Points to the view (profile) to
  2589. // which this goal belongs.
  2590. ParentLink *GoalParentLink `json:"parentLink,omitempty"`
  2591. // ProfileId: View (Profile) ID to which this goal belongs.
  2592. ProfileId string `json:"profileId,omitempty"`
  2593. // SelfLink: Link for this goal.
  2594. SelfLink string `json:"selfLink,omitempty"`
  2595. // Type: Goal type. Possible values are URL_DESTINATION,
  2596. // VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT.
  2597. Type string `json:"type,omitempty"`
  2598. // Updated: Time this goal was last modified.
  2599. Updated string `json:"updated,omitempty"`
  2600. // UrlDestinationDetails: Details for the goal of the type
  2601. // URL_DESTINATION.
  2602. UrlDestinationDetails *GoalUrlDestinationDetails `json:"urlDestinationDetails,omitempty"`
  2603. // Value: Goal value.
  2604. Value float64 `json:"value,omitempty"`
  2605. // VisitNumPagesDetails: Details for the goal of the type
  2606. // VISIT_NUM_PAGES.
  2607. VisitNumPagesDetails *GoalVisitNumPagesDetails `json:"visitNumPagesDetails,omitempty"`
  2608. // VisitTimeOnSiteDetails: Details for the goal of the type
  2609. // VISIT_TIME_ON_SITE.
  2610. VisitTimeOnSiteDetails *GoalVisitTimeOnSiteDetails `json:"visitTimeOnSiteDetails,omitempty"`
  2611. // WebPropertyId: Web property ID to which this goal belongs. The web
  2612. // property ID is of the form UA-XXXXX-YY.
  2613. WebPropertyId string `json:"webPropertyId,omitempty"`
  2614. // ServerResponse contains the HTTP response code and headers from the
  2615. // server.
  2616. googleapi.ServerResponse `json:"-"`
  2617. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2618. // unconditionally include in API requests. By default, fields with
  2619. // empty values are omitted from API requests. However, any non-pointer,
  2620. // non-interface field appearing in ForceSendFields will be sent to the
  2621. // server regardless of whether the field is empty or not. This may be
  2622. // used to include empty fields in Patch requests.
  2623. ForceSendFields []string `json:"-"`
  2624. // NullFields is a list of field names (e.g. "AccountId") to include in
  2625. // API requests with the JSON null value. By default, fields with empty
  2626. // values are omitted from API requests. However, any field with an
  2627. // empty value appearing in NullFields will be sent to the server as
  2628. // null. It is an error if a field in this list has a non-empty value.
  2629. // This may be used to include null fields in Patch requests.
  2630. NullFields []string `json:"-"`
  2631. }
  2632. func (s *Goal) MarshalJSON() ([]byte, error) {
  2633. type NoMethod Goal
  2634. raw := NoMethod(*s)
  2635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2636. }
  2637. func (s *Goal) UnmarshalJSON(data []byte) error {
  2638. type NoMethod Goal
  2639. var s1 struct {
  2640. Value gensupport.JSONFloat64 `json:"value"`
  2641. *NoMethod
  2642. }
  2643. s1.NoMethod = (*NoMethod)(s)
  2644. if err := json.Unmarshal(data, &s1); err != nil {
  2645. return err
  2646. }
  2647. s.Value = float64(s1.Value)
  2648. return nil
  2649. }
  2650. // GoalEventDetails: Details for the goal of the type EVENT.
  2651. type GoalEventDetails struct {
  2652. // EventConditions: List of event conditions.
  2653. EventConditions []*GoalEventDetailsEventConditions `json:"eventConditions,omitempty"`
  2654. // UseEventValue: Determines if the event value should be used as the
  2655. // value for this goal.
  2656. UseEventValue bool `json:"useEventValue,omitempty"`
  2657. // ForceSendFields is a list of field names (e.g. "EventConditions") to
  2658. // unconditionally include in API requests. By default, fields with
  2659. // empty values are omitted from API requests. However, any non-pointer,
  2660. // non-interface field appearing in ForceSendFields will be sent to the
  2661. // server regardless of whether the field is empty or not. This may be
  2662. // used to include empty fields in Patch requests.
  2663. ForceSendFields []string `json:"-"`
  2664. // NullFields is a list of field names (e.g. "EventConditions") to
  2665. // include in API requests with the JSON null value. By default, fields
  2666. // with empty values are omitted from API requests. However, any field
  2667. // with an empty value appearing in NullFields will be sent to the
  2668. // server as null. It is an error if a field in this list has a
  2669. // non-empty value. This may be used to include null fields in Patch
  2670. // requests.
  2671. NullFields []string `json:"-"`
  2672. }
  2673. func (s *GoalEventDetails) MarshalJSON() ([]byte, error) {
  2674. type NoMethod GoalEventDetails
  2675. raw := NoMethod(*s)
  2676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2677. }
  2678. type GoalEventDetailsEventConditions struct {
  2679. // ComparisonType: Type of comparison. Possible values are LESS_THAN,
  2680. // GREATER_THAN or EQUAL.
  2681. ComparisonType string `json:"comparisonType,omitempty"`
  2682. // ComparisonValue: Value used for this comparison.
  2683. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2684. // Expression: Expression used for this match.
  2685. Expression string `json:"expression,omitempty"`
  2686. // MatchType: Type of the match to be performed. Possible values are
  2687. // REGEXP, BEGINS_WITH, or EXACT.
  2688. MatchType string `json:"matchType,omitempty"`
  2689. // Type: Type of this event condition. Possible values are CATEGORY,
  2690. // ACTION, LABEL, or VALUE.
  2691. Type string `json:"type,omitempty"`
  2692. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2693. // unconditionally include in API requests. By default, fields with
  2694. // empty values are omitted from API requests. However, any non-pointer,
  2695. // non-interface field appearing in ForceSendFields will be sent to the
  2696. // server regardless of whether the field is empty or not. This may be
  2697. // used to include empty fields in Patch requests.
  2698. ForceSendFields []string `json:"-"`
  2699. // NullFields is a list of field names (e.g. "ComparisonType") to
  2700. // include in API requests with the JSON null value. By default, fields
  2701. // with empty values are omitted from API requests. However, any field
  2702. // with an empty value appearing in NullFields will be sent to the
  2703. // server as null. It is an error if a field in this list has a
  2704. // non-empty value. This may be used to include null fields in Patch
  2705. // requests.
  2706. NullFields []string `json:"-"`
  2707. }
  2708. func (s *GoalEventDetailsEventConditions) MarshalJSON() ([]byte, error) {
  2709. type NoMethod GoalEventDetailsEventConditions
  2710. raw := NoMethod(*s)
  2711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2712. }
  2713. // GoalParentLink: Parent link for a goal. Points to the view (profile)
  2714. // to which this goal belongs.
  2715. type GoalParentLink struct {
  2716. // Href: Link to the view (profile) to which this goal belongs.
  2717. Href string `json:"href,omitempty"`
  2718. // Type: Value is "analytics#profile".
  2719. Type string `json:"type,omitempty"`
  2720. // ForceSendFields is a list of field names (e.g. "Href") to
  2721. // unconditionally include in API requests. By default, fields with
  2722. // empty values are omitted from API requests. However, any non-pointer,
  2723. // non-interface field appearing in ForceSendFields will be sent to the
  2724. // server regardless of whether the field is empty or not. This may be
  2725. // used to include empty fields in Patch requests.
  2726. ForceSendFields []string `json:"-"`
  2727. // NullFields is a list of field names (e.g. "Href") to include in API
  2728. // requests with the JSON null value. By default, fields with empty
  2729. // values are omitted from API requests. However, any field with an
  2730. // empty value appearing in NullFields will be sent to the server as
  2731. // null. It is an error if a field in this list has a non-empty value.
  2732. // This may be used to include null fields in Patch requests.
  2733. NullFields []string `json:"-"`
  2734. }
  2735. func (s *GoalParentLink) MarshalJSON() ([]byte, error) {
  2736. type NoMethod GoalParentLink
  2737. raw := NoMethod(*s)
  2738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2739. }
  2740. // GoalUrlDestinationDetails: Details for the goal of the type
  2741. // URL_DESTINATION.
  2742. type GoalUrlDestinationDetails struct {
  2743. // CaseSensitive: Determines if the goal URL must exactly match the
  2744. // capitalization of visited URLs.
  2745. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2746. // FirstStepRequired: Determines if the first step in this goal is
  2747. // required.
  2748. FirstStepRequired bool `json:"firstStepRequired,omitempty"`
  2749. // MatchType: Match type for the goal URL. Possible values are HEAD,
  2750. // EXACT, or REGEX.
  2751. MatchType string `json:"matchType,omitempty"`
  2752. // Steps: List of steps configured for this goal funnel.
  2753. Steps []*GoalUrlDestinationDetailsSteps `json:"steps,omitempty"`
  2754. // Url: URL for this goal.
  2755. Url string `json:"url,omitempty"`
  2756. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2757. // unconditionally include in API requests. By default, fields with
  2758. // empty values are omitted from API requests. However, any non-pointer,
  2759. // non-interface field appearing in ForceSendFields will be sent to the
  2760. // server regardless of whether the field is empty or not. This may be
  2761. // used to include empty fields in Patch requests.
  2762. ForceSendFields []string `json:"-"`
  2763. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  2764. // in API requests with the JSON null value. By default, fields with
  2765. // empty values are omitted from API requests. However, any field with
  2766. // an empty value appearing in NullFields will be sent to the server as
  2767. // null. It is an error if a field in this list has a non-empty value.
  2768. // This may be used to include null fields in Patch requests.
  2769. NullFields []string `json:"-"`
  2770. }
  2771. func (s *GoalUrlDestinationDetails) MarshalJSON() ([]byte, error) {
  2772. type NoMethod GoalUrlDestinationDetails
  2773. raw := NoMethod(*s)
  2774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2775. }
  2776. type GoalUrlDestinationDetailsSteps struct {
  2777. // Name: Step name.
  2778. Name string `json:"name,omitempty"`
  2779. // Number: Step number.
  2780. Number int64 `json:"number,omitempty"`
  2781. // Url: URL for this step.
  2782. Url string `json:"url,omitempty"`
  2783. // ForceSendFields is a list of field names (e.g. "Name") to
  2784. // unconditionally include in API requests. By default, fields with
  2785. // empty values are omitted from API requests. However, any non-pointer,
  2786. // non-interface field appearing in ForceSendFields will be sent to the
  2787. // server regardless of whether the field is empty or not. This may be
  2788. // used to include empty fields in Patch requests.
  2789. ForceSendFields []string `json:"-"`
  2790. // NullFields is a list of field names (e.g. "Name") to include in API
  2791. // requests with the JSON null value. By default, fields with empty
  2792. // values are omitted from API requests. However, any field with an
  2793. // empty value appearing in NullFields will be sent to the server as
  2794. // null. It is an error if a field in this list has a non-empty value.
  2795. // This may be used to include null fields in Patch requests.
  2796. NullFields []string `json:"-"`
  2797. }
  2798. func (s *GoalUrlDestinationDetailsSteps) MarshalJSON() ([]byte, error) {
  2799. type NoMethod GoalUrlDestinationDetailsSteps
  2800. raw := NoMethod(*s)
  2801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2802. }
  2803. // GoalVisitNumPagesDetails: Details for the goal of the type
  2804. // VISIT_NUM_PAGES.
  2805. type GoalVisitNumPagesDetails struct {
  2806. // ComparisonType: Type of comparison. Possible values are LESS_THAN,
  2807. // GREATER_THAN, or EQUAL.
  2808. ComparisonType string `json:"comparisonType,omitempty"`
  2809. // ComparisonValue: Value used for this comparison.
  2810. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2811. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2812. // unconditionally include in API requests. By default, fields with
  2813. // empty values are omitted from API requests. However, any non-pointer,
  2814. // non-interface field appearing in ForceSendFields will be sent to the
  2815. // server regardless of whether the field is empty or not. This may be
  2816. // used to include empty fields in Patch requests.
  2817. ForceSendFields []string `json:"-"`
  2818. // NullFields is a list of field names (e.g. "ComparisonType") to
  2819. // include in API requests with the JSON null value. By default, fields
  2820. // with empty values are omitted from API requests. However, any field
  2821. // with an empty value appearing in NullFields will be sent to the
  2822. // server as null. It is an error if a field in this list has a
  2823. // non-empty value. This may be used to include null fields in Patch
  2824. // requests.
  2825. NullFields []string `json:"-"`
  2826. }
  2827. func (s *GoalVisitNumPagesDetails) MarshalJSON() ([]byte, error) {
  2828. type NoMethod GoalVisitNumPagesDetails
  2829. raw := NoMethod(*s)
  2830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2831. }
  2832. // GoalVisitTimeOnSiteDetails: Details for the goal of the type
  2833. // VISIT_TIME_ON_SITE.
  2834. type GoalVisitTimeOnSiteDetails struct {
  2835. // ComparisonType: Type of comparison. Possible values are LESS_THAN or
  2836. // GREATER_THAN.
  2837. ComparisonType string `json:"comparisonType,omitempty"`
  2838. // ComparisonValue: Value used for this comparison.
  2839. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2840. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2841. // unconditionally include in API requests. By default, fields with
  2842. // empty values are omitted from API requests. However, any non-pointer,
  2843. // non-interface field appearing in ForceSendFields will be sent to the
  2844. // server regardless of whether the field is empty or not. This may be
  2845. // used to include empty fields in Patch requests.
  2846. ForceSendFields []string `json:"-"`
  2847. // NullFields is a list of field names (e.g. "ComparisonType") to
  2848. // include in API requests with the JSON null value. By default, fields
  2849. // with empty values are omitted from API requests. However, any field
  2850. // with an empty value appearing in NullFields will be sent to the
  2851. // server as null. It is an error if a field in this list has a
  2852. // non-empty value. This may be used to include null fields in Patch
  2853. // requests.
  2854. NullFields []string `json:"-"`
  2855. }
  2856. func (s *GoalVisitTimeOnSiteDetails) MarshalJSON() ([]byte, error) {
  2857. type NoMethod GoalVisitTimeOnSiteDetails
  2858. raw := NoMethod(*s)
  2859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2860. }
  2861. // Goals: A goal collection lists Analytics goals to which the user has
  2862. // access. Each view (profile) can have a set of goals. Each resource in
  2863. // the Goal collection corresponds to a single Analytics goal.
  2864. type Goals struct {
  2865. // Items: A list of goals.
  2866. Items []*Goal `json:"items,omitempty"`
  2867. // ItemsPerPage: The maximum number of resources the response can
  2868. // contain, regardless of the actual number of resources returned. Its
  2869. // value ranges from 1 to 1000 with a value of 1000 by default, or
  2870. // otherwise specified by the max-results query parameter.
  2871. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2872. // Kind: Collection type.
  2873. Kind string `json:"kind,omitempty"`
  2874. // NextLink: Link to next page for this goal collection.
  2875. NextLink string `json:"nextLink,omitempty"`
  2876. // PreviousLink: Link to previous page for this goal collection.
  2877. PreviousLink string `json:"previousLink,omitempty"`
  2878. // StartIndex: The starting index of the resources, which is 1 by
  2879. // default or otherwise specified by the start-index query parameter.
  2880. StartIndex int64 `json:"startIndex,omitempty"`
  2881. // TotalResults: The total number of results for the query, regardless
  2882. // of the number of resources in the result.
  2883. TotalResults int64 `json:"totalResults,omitempty"`
  2884. // Username: Email ID of the authenticated user
  2885. Username string `json:"username,omitempty"`
  2886. // ServerResponse contains the HTTP response code and headers from the
  2887. // server.
  2888. googleapi.ServerResponse `json:"-"`
  2889. // ForceSendFields is a list of field names (e.g. "Items") to
  2890. // unconditionally include in API requests. By default, fields with
  2891. // empty values are omitted from API requests. However, any non-pointer,
  2892. // non-interface field appearing in ForceSendFields will be sent to the
  2893. // server regardless of whether the field is empty or not. This may be
  2894. // used to include empty fields in Patch requests.
  2895. ForceSendFields []string `json:"-"`
  2896. // NullFields is a list of field names (e.g. "Items") to include in API
  2897. // requests with the JSON null value. By default, fields with empty
  2898. // values are omitted from API requests. However, any field with an
  2899. // empty value appearing in NullFields will be sent to the server as
  2900. // null. It is an error if a field in this list has a non-empty value.
  2901. // This may be used to include null fields in Patch requests.
  2902. NullFields []string `json:"-"`
  2903. }
  2904. func (s *Goals) MarshalJSON() ([]byte, error) {
  2905. type NoMethod Goals
  2906. raw := NoMethod(*s)
  2907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2908. }
  2909. // HashClientIdRequest: JSON template for a hash Client Id request
  2910. // resource.
  2911. type HashClientIdRequest struct {
  2912. ClientId string `json:"clientId,omitempty"`
  2913. Kind string `json:"kind,omitempty"`
  2914. WebPropertyId string `json:"webPropertyId,omitempty"`
  2915. // ForceSendFields is a list of field names (e.g. "ClientId") to
  2916. // unconditionally include in API requests. By default, fields with
  2917. // empty values are omitted from API requests. However, any non-pointer,
  2918. // non-interface field appearing in ForceSendFields will be sent to the
  2919. // server regardless of whether the field is empty or not. This may be
  2920. // used to include empty fields in Patch requests.
  2921. ForceSendFields []string `json:"-"`
  2922. // NullFields is a list of field names (e.g. "ClientId") to include in
  2923. // API requests with the JSON null value. By default, fields with empty
  2924. // values are omitted from API requests. However, any field with an
  2925. // empty value appearing in NullFields will be sent to the server as
  2926. // null. It is an error if a field in this list has a non-empty value.
  2927. // This may be used to include null fields in Patch requests.
  2928. NullFields []string `json:"-"`
  2929. }
  2930. func (s *HashClientIdRequest) MarshalJSON() ([]byte, error) {
  2931. type NoMethod HashClientIdRequest
  2932. raw := NoMethod(*s)
  2933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2934. }
  2935. // HashClientIdResponse: JSON template for a hash Client Id response
  2936. // resource.
  2937. type HashClientIdResponse struct {
  2938. ClientId string `json:"clientId,omitempty"`
  2939. HashedClientId string `json:"hashedClientId,omitempty"`
  2940. Kind string `json:"kind,omitempty"`
  2941. WebPropertyId string `json:"webPropertyId,omitempty"`
  2942. // ServerResponse contains the HTTP response code and headers from the
  2943. // server.
  2944. googleapi.ServerResponse `json:"-"`
  2945. // ForceSendFields is a list of field names (e.g. "ClientId") to
  2946. // unconditionally include in API requests. By default, fields with
  2947. // empty values are omitted from API requests. However, any non-pointer,
  2948. // non-interface field appearing in ForceSendFields will be sent to the
  2949. // server regardless of whether the field is empty or not. This may be
  2950. // used to include empty fields in Patch requests.
  2951. ForceSendFields []string `json:"-"`
  2952. // NullFields is a list of field names (e.g. "ClientId") to include in
  2953. // API requests with the JSON null value. By default, fields with empty
  2954. // values are omitted from API requests. However, any field with an
  2955. // empty value appearing in NullFields will be sent to the server as
  2956. // null. It is an error if a field in this list has a non-empty value.
  2957. // This may be used to include null fields in Patch requests.
  2958. NullFields []string `json:"-"`
  2959. }
  2960. func (s *HashClientIdResponse) MarshalJSON() ([]byte, error) {
  2961. type NoMethod HashClientIdResponse
  2962. raw := NoMethod(*s)
  2963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2964. }
  2965. // IncludeConditions: JSON template for an Analytics Remarketing Include
  2966. // Conditions.
  2967. type IncludeConditions struct {
  2968. // DaysToLookBack: The look-back window lets you specify a time frame
  2969. // for evaluating the behavior that qualifies users for your audience.
  2970. // For example, if your filters include users from Central Asia, and
  2971. // Transactions Greater than 2, and you set the look-back window to 14
  2972. // days, then any user from Central Asia whose cumulative transactions
  2973. // exceed 2 during the last 14 days is added to the audience.
  2974. DaysToLookBack int64 `json:"daysToLookBack,omitempty"`
  2975. // IsSmartList: Boolean indicating whether this segment is a smart list.
  2976. // https://support.google.com/analytics/answer/4628577
  2977. IsSmartList bool `json:"isSmartList,omitempty"`
  2978. // Kind: Resource type for include conditions.
  2979. Kind string `json:"kind,omitempty"`
  2980. // MembershipDurationDays: Number of days (in the range 1 to 540) a user
  2981. // remains in the audience.
  2982. MembershipDurationDays int64 `json:"membershipDurationDays,omitempty"`
  2983. // Segment: The segment condition that will cause a user to be added to
  2984. // an audience.
  2985. Segment string `json:"segment,omitempty"`
  2986. // ForceSendFields is a list of field names (e.g. "DaysToLookBack") to
  2987. // unconditionally include in API requests. By default, fields with
  2988. // empty values are omitted from API requests. However, any non-pointer,
  2989. // non-interface field appearing in ForceSendFields will be sent to the
  2990. // server regardless of whether the field is empty or not. This may be
  2991. // used to include empty fields in Patch requests.
  2992. ForceSendFields []string `json:"-"`
  2993. // NullFields is a list of field names (e.g. "DaysToLookBack") to
  2994. // include in API requests with the JSON null value. By default, fields
  2995. // with empty values are omitted from API requests. However, any field
  2996. // with an empty value appearing in NullFields will be sent to the
  2997. // server as null. It is an error if a field in this list has a
  2998. // non-empty value. This may be used to include null fields in Patch
  2999. // requests.
  3000. NullFields []string `json:"-"`
  3001. }
  3002. func (s *IncludeConditions) MarshalJSON() ([]byte, error) {
  3003. type NoMethod IncludeConditions
  3004. raw := NoMethod(*s)
  3005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3006. }
  3007. // LinkedForeignAccount: JSON template for an Analytics Remarketing
  3008. // Audience Foreign Link.
  3009. type LinkedForeignAccount struct {
  3010. // AccountId: Account ID to which this linked foreign account belongs.
  3011. AccountId string `json:"accountId,omitempty"`
  3012. // EligibleForSearch: Boolean indicating whether this is eligible for
  3013. // search.
  3014. EligibleForSearch bool `json:"eligibleForSearch,omitempty"`
  3015. // Id: Entity ad account link ID.
  3016. Id string `json:"id,omitempty"`
  3017. // InternalWebPropertyId: Internal ID for the web property to which this
  3018. // linked foreign account belongs.
  3019. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3020. // Kind: Resource type for linked foreign account.
  3021. Kind string `json:"kind,omitempty"`
  3022. // LinkedAccountId: The foreign account ID. For example the an Google
  3023. // Ads `linkedAccountId` has the following format XXX-XXX-XXXX.
  3024. LinkedAccountId string `json:"linkedAccountId,omitempty"`
  3025. // RemarketingAudienceId: Remarketing audience ID to which this linked
  3026. // foreign account belongs.
  3027. RemarketingAudienceId string `json:"remarketingAudienceId,omitempty"`
  3028. // Status: The status of this foreign account link.
  3029. Status string `json:"status,omitempty"`
  3030. // Type: The type of the foreign account. For example, `ADWORDS_LINKS`,
  3031. // `DBM_LINKS`, `MCC_LINKS` or `OPTIMIZE`.
  3032. Type string `json:"type,omitempty"`
  3033. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3034. // linked foreign account belongs.
  3035. WebPropertyId string `json:"webPropertyId,omitempty"`
  3036. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3037. // unconditionally include in API requests. By default, fields with
  3038. // empty values are omitted from API requests. However, any non-pointer,
  3039. // non-interface field appearing in ForceSendFields will be sent to the
  3040. // server regardless of whether the field is empty or not. This may be
  3041. // used to include empty fields in Patch requests.
  3042. ForceSendFields []string `json:"-"`
  3043. // NullFields is a list of field names (e.g. "AccountId") to include in
  3044. // API requests with the JSON null value. By default, fields with empty
  3045. // values are omitted from API requests. However, any field with an
  3046. // empty value appearing in NullFields will be sent to the server as
  3047. // null. It is an error if a field in this list has a non-empty value.
  3048. // This may be used to include null fields in Patch requests.
  3049. NullFields []string `json:"-"`
  3050. }
  3051. func (s *LinkedForeignAccount) MarshalJSON() ([]byte, error) {
  3052. type NoMethod LinkedForeignAccount
  3053. raw := NoMethod(*s)
  3054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3055. }
  3056. // McfData: Multi-Channel Funnels data for a given view (profile).
  3057. type McfData struct {
  3058. // ColumnHeaders: Column headers that list dimension names followed by
  3059. // the metric names. The order of dimensions and metrics is same as
  3060. // specified in the request.
  3061. ColumnHeaders []*McfDataColumnHeaders `json:"columnHeaders,omitempty"`
  3062. // ContainsSampledData: Determines if the Analytics data contains
  3063. // sampled data.
  3064. ContainsSampledData bool `json:"containsSampledData,omitempty"`
  3065. // Id: Unique ID for this data response.
  3066. Id string `json:"id,omitempty"`
  3067. // ItemsPerPage: The maximum number of rows the response can contain,
  3068. // regardless of the actual number of rows returned. Its value ranges
  3069. // from 1 to 10,000 with a value of 1000 by default, or otherwise
  3070. // specified by the max-results query parameter.
  3071. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3072. // Kind: Resource type.
  3073. Kind string `json:"kind,omitempty"`
  3074. // NextLink: Link to next page for this Analytics data query.
  3075. NextLink string `json:"nextLink,omitempty"`
  3076. // PreviousLink: Link to previous page for this Analytics data query.
  3077. PreviousLink string `json:"previousLink,omitempty"`
  3078. // ProfileInfo: Information for the view (profile), for which the
  3079. // Analytics data was requested.
  3080. ProfileInfo *McfDataProfileInfo `json:"profileInfo,omitempty"`
  3081. // Query: Analytics data request query parameters.
  3082. Query *McfDataQuery `json:"query,omitempty"`
  3083. // Rows: Analytics data rows, where each row contains a list of
  3084. // dimension values followed by the metric values. The order of
  3085. // dimensions and metrics is same as specified in the request.
  3086. Rows [][]*McfDataRowsItem `json:"rows,omitempty"`
  3087. // SampleSize: The number of samples used to calculate the result.
  3088. SampleSize int64 `json:"sampleSize,omitempty,string"`
  3089. // SampleSpace: Total size of the sample space from which the samples
  3090. // were selected.
  3091. SampleSpace int64 `json:"sampleSpace,omitempty,string"`
  3092. // SelfLink: Link to this page.
  3093. SelfLink string `json:"selfLink,omitempty"`
  3094. // TotalResults: The total number of rows for the query, regardless of
  3095. // the number of rows in the response.
  3096. TotalResults int64 `json:"totalResults,omitempty"`
  3097. // TotalsForAllResults: Total values for the requested metrics over all
  3098. // the results, not just the results returned in this response. The
  3099. // order of the metric totals is same as the metric order specified in
  3100. // the request.
  3101. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  3102. // ServerResponse contains the HTTP response code and headers from the
  3103. // server.
  3104. googleapi.ServerResponse `json:"-"`
  3105. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  3106. // unconditionally include in API requests. By default, fields with
  3107. // empty values are omitted from API requests. However, any non-pointer,
  3108. // non-interface field appearing in ForceSendFields will be sent to the
  3109. // server regardless of whether the field is empty or not. This may be
  3110. // used to include empty fields in Patch requests.
  3111. ForceSendFields []string `json:"-"`
  3112. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  3113. // in API requests with the JSON null value. By default, fields with
  3114. // empty values are omitted from API requests. However, any field with
  3115. // an empty value appearing in NullFields will be sent to the server as
  3116. // null. It is an error if a field in this list has a non-empty value.
  3117. // This may be used to include null fields in Patch requests.
  3118. NullFields []string `json:"-"`
  3119. }
  3120. func (s *McfData) MarshalJSON() ([]byte, error) {
  3121. type NoMethod McfData
  3122. raw := NoMethod(*s)
  3123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3124. }
  3125. type McfDataColumnHeaders struct {
  3126. // ColumnType: Column Type. Either DIMENSION or METRIC.
  3127. ColumnType string `json:"columnType,omitempty"`
  3128. // DataType: Data type. Dimension and metric values data types such as
  3129. // INTEGER, DOUBLE, CURRENCY, MCF_SEQUENCE etc.
  3130. DataType string `json:"dataType,omitempty"`
  3131. // Name: Column name.
  3132. Name string `json:"name,omitempty"`
  3133. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  3134. // unconditionally include in API requests. By default, fields with
  3135. // empty values are omitted from API requests. However, any non-pointer,
  3136. // non-interface field appearing in ForceSendFields will be sent to the
  3137. // server regardless of whether the field is empty or not. This may be
  3138. // used to include empty fields in Patch requests.
  3139. ForceSendFields []string `json:"-"`
  3140. // NullFields is a list of field names (e.g. "ColumnType") to include in
  3141. // API requests with the JSON null value. By default, fields with empty
  3142. // values are omitted from API requests. However, any field with an
  3143. // empty value appearing in NullFields will be sent to the server as
  3144. // null. It is an error if a field in this list has a non-empty value.
  3145. // This may be used to include null fields in Patch requests.
  3146. NullFields []string `json:"-"`
  3147. }
  3148. func (s *McfDataColumnHeaders) MarshalJSON() ([]byte, error) {
  3149. type NoMethod McfDataColumnHeaders
  3150. raw := NoMethod(*s)
  3151. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3152. }
  3153. // McfDataProfileInfo: Information for the view (profile), for which the
  3154. // Analytics data was requested.
  3155. type McfDataProfileInfo struct {
  3156. // AccountId: Account ID to which this view (profile) belongs.
  3157. AccountId string `json:"accountId,omitempty"`
  3158. // InternalWebPropertyId: Internal ID for the web property to which this
  3159. // view (profile) belongs.
  3160. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3161. // ProfileId: View (Profile) ID.
  3162. ProfileId string `json:"profileId,omitempty"`
  3163. // ProfileName: View (Profile) name.
  3164. ProfileName string `json:"profileName,omitempty"`
  3165. // TableId: Table ID for view (profile).
  3166. TableId string `json:"tableId,omitempty"`
  3167. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  3168. WebPropertyId string `json:"webPropertyId,omitempty"`
  3169. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3170. // unconditionally include in API requests. By default, fields with
  3171. // empty values are omitted from API requests. However, any non-pointer,
  3172. // non-interface field appearing in ForceSendFields will be sent to the
  3173. // server regardless of whether the field is empty or not. This may be
  3174. // used to include empty fields in Patch requests.
  3175. ForceSendFields []string `json:"-"`
  3176. // NullFields is a list of field names (e.g. "AccountId") to include in
  3177. // API requests with the JSON null value. By default, fields with empty
  3178. // values are omitted from API requests. However, any field with an
  3179. // empty value appearing in NullFields will be sent to the server as
  3180. // null. It is an error if a field in this list has a non-empty value.
  3181. // This may be used to include null fields in Patch requests.
  3182. NullFields []string `json:"-"`
  3183. }
  3184. func (s *McfDataProfileInfo) MarshalJSON() ([]byte, error) {
  3185. type NoMethod McfDataProfileInfo
  3186. raw := NoMethod(*s)
  3187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3188. }
  3189. // McfDataQuery: Analytics data request query parameters.
  3190. type McfDataQuery struct {
  3191. // Dimensions: List of analytics dimensions.
  3192. Dimensions string `json:"dimensions,omitempty"`
  3193. // EndDate: End date.
  3194. EndDate string `json:"end-date,omitempty"`
  3195. // Filters: Comma-separated list of dimension or metric filters.
  3196. Filters string `json:"filters,omitempty"`
  3197. // Ids: Unique table ID.
  3198. Ids string `json:"ids,omitempty"`
  3199. // MaxResults: Maximum results per page.
  3200. MaxResults int64 `json:"max-results,omitempty"`
  3201. // Metrics: List of analytics metrics.
  3202. Metrics []string `json:"metrics,omitempty"`
  3203. // SamplingLevel: Desired sampling level
  3204. SamplingLevel string `json:"samplingLevel,omitempty"`
  3205. // Segment: Analytics advanced segment.
  3206. Segment string `json:"segment,omitempty"`
  3207. // Sort: List of dimensions or metrics based on which Analytics data is
  3208. // sorted.
  3209. Sort []string `json:"sort,omitempty"`
  3210. // StartDate: Start date.
  3211. StartDate string `json:"start-date,omitempty"`
  3212. // StartIndex: Start index.
  3213. StartIndex int64 `json:"start-index,omitempty"`
  3214. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  3215. // unconditionally include in API requests. By default, fields with
  3216. // empty values are omitted from API requests. However, any non-pointer,
  3217. // non-interface field appearing in ForceSendFields will be sent to the
  3218. // server regardless of whether the field is empty or not. This may be
  3219. // used to include empty fields in Patch requests.
  3220. ForceSendFields []string `json:"-"`
  3221. // NullFields is a list of field names (e.g. "Dimensions") to include in
  3222. // API requests with the JSON null value. By default, fields with empty
  3223. // values are omitted from API requests. However, any field with an
  3224. // empty value appearing in NullFields will be sent to the server as
  3225. // null. It is an error if a field in this list has a non-empty value.
  3226. // This may be used to include null fields in Patch requests.
  3227. NullFields []string `json:"-"`
  3228. }
  3229. func (s *McfDataQuery) MarshalJSON() ([]byte, error) {
  3230. type NoMethod McfDataQuery
  3231. raw := NoMethod(*s)
  3232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3233. }
  3234. // McfDataRowsItem: A union object representing a dimension or metric
  3235. // value. Only one of "primitiveValue" or "conversionPathValue"
  3236. // attribute will be populated.
  3237. type McfDataRowsItem struct {
  3238. // ConversionPathValue: A conversion path dimension value, containing a
  3239. // list of interactions with their attributes.
  3240. ConversionPathValue []*McfDataRowsItemConversionPathValue `json:"conversionPathValue,omitempty"`
  3241. // PrimitiveValue: A primitive dimension value. A primitive metric
  3242. // value.
  3243. PrimitiveValue string `json:"primitiveValue,omitempty"`
  3244. // ForceSendFields is a list of field names (e.g. "ConversionPathValue")
  3245. // to unconditionally include in API requests. By default, fields with
  3246. // empty values are omitted from API requests. However, any non-pointer,
  3247. // non-interface field appearing in ForceSendFields will be sent to the
  3248. // server regardless of whether the field is empty or not. This may be
  3249. // used to include empty fields in Patch requests.
  3250. ForceSendFields []string `json:"-"`
  3251. // NullFields is a list of field names (e.g. "ConversionPathValue") to
  3252. // include in API requests with the JSON null value. By default, fields
  3253. // with empty values are omitted from API requests. However, any field
  3254. // with an empty value appearing in NullFields will be sent to the
  3255. // server as null. It is an error if a field in this list has a
  3256. // non-empty value. This may be used to include null fields in Patch
  3257. // requests.
  3258. NullFields []string `json:"-"`
  3259. }
  3260. func (s *McfDataRowsItem) MarshalJSON() ([]byte, error) {
  3261. type NoMethod McfDataRowsItem
  3262. raw := NoMethod(*s)
  3263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3264. }
  3265. type McfDataRowsItemConversionPathValue struct {
  3266. // InteractionType: Type of an interaction on conversion path. Such as
  3267. // CLICK, IMPRESSION etc.
  3268. InteractionType string `json:"interactionType,omitempty"`
  3269. // NodeValue: Node value of an interaction on conversion path. Such as
  3270. // source, medium etc.
  3271. NodeValue string `json:"nodeValue,omitempty"`
  3272. // ForceSendFields is a list of field names (e.g. "InteractionType") to
  3273. // unconditionally include in API requests. By default, fields with
  3274. // empty values are omitted from API requests. However, any non-pointer,
  3275. // non-interface field appearing in ForceSendFields will be sent to the
  3276. // server regardless of whether the field is empty or not. This may be
  3277. // used to include empty fields in Patch requests.
  3278. ForceSendFields []string `json:"-"`
  3279. // NullFields is a list of field names (e.g. "InteractionType") to
  3280. // include in API requests with the JSON null value. By default, fields
  3281. // with empty values are omitted from API requests. However, any field
  3282. // with an empty value appearing in NullFields will be sent to the
  3283. // server as null. It is an error if a field in this list has a
  3284. // non-empty value. This may be used to include null fields in Patch
  3285. // requests.
  3286. NullFields []string `json:"-"`
  3287. }
  3288. func (s *McfDataRowsItemConversionPathValue) MarshalJSON() ([]byte, error) {
  3289. type NoMethod McfDataRowsItemConversionPathValue
  3290. raw := NoMethod(*s)
  3291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3292. }
  3293. // Profile: JSON template for an Analytics view (profile).
  3294. type Profile struct {
  3295. // AccountId: Account ID to which this view (profile) belongs.
  3296. AccountId string `json:"accountId,omitempty"`
  3297. // BotFilteringEnabled: Indicates whether bot filtering is enabled for
  3298. // this view (profile).
  3299. BotFilteringEnabled bool `json:"botFilteringEnabled,omitempty"`
  3300. // ChildLink: Child link for this view (profile). Points to the list of
  3301. // goals for this view (profile).
  3302. ChildLink *ProfileChildLink `json:"childLink,omitempty"`
  3303. // Created: Time this view (profile) was created.
  3304. Created string `json:"created,omitempty"`
  3305. // Currency: The currency type associated with this view (profile),
  3306. // defaults to USD. The supported values are:
  3307. // USD, JPY, EUR, GBP, AUD, KRW, BRL, CNY, DKK, RUB, SEK, NOK, PLN, TRY,
  3308. // TWD, HKD, THB, IDR, ARS, MXN, VND, PHP, INR, CHF, CAD, CZK, NZD, HUF,
  3309. // BGN, LTL, ZAR, UAH, AED, BOB, CLP, COP, EGP, HRK, ILS, MAD, MYR, PEN,
  3310. // PKR, RON, RSD, SAR, SGD, VEF, LVL
  3311. Currency string `json:"currency,omitempty"`
  3312. // DefaultPage: Default page for this view (profile).
  3313. DefaultPage string `json:"defaultPage,omitempty"`
  3314. // ECommerceTracking: Indicates whether ecommerce tracking is enabled
  3315. // for this view (profile).
  3316. ECommerceTracking bool `json:"eCommerceTracking,omitempty"`
  3317. // EnhancedECommerceTracking: Indicates whether enhanced ecommerce
  3318. // tracking is enabled for this view (profile). This property can only
  3319. // be enabled if ecommerce tracking is enabled.
  3320. EnhancedECommerceTracking bool `json:"enhancedECommerceTracking,omitempty"`
  3321. // ExcludeQueryParameters: The query parameters that are excluded from
  3322. // this view (profile).
  3323. ExcludeQueryParameters string `json:"excludeQueryParameters,omitempty"`
  3324. // Id: View (Profile) ID.
  3325. Id string `json:"id,omitempty"`
  3326. // InternalWebPropertyId: Internal ID for the web property to which this
  3327. // view (profile) belongs.
  3328. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3329. // Kind: Resource type for Analytics view (profile).
  3330. Kind string `json:"kind,omitempty"`
  3331. // Name: Name of this view (profile).
  3332. Name string `json:"name,omitempty"`
  3333. // ParentLink: Parent link for this view (profile). Points to the web
  3334. // property to which this view (profile) belongs.
  3335. ParentLink *ProfileParentLink `json:"parentLink,omitempty"`
  3336. // Permissions: Permissions the user has for this view (profile).
  3337. Permissions *ProfilePermissions `json:"permissions,omitempty"`
  3338. // SelfLink: Link for this view (profile).
  3339. SelfLink string `json:"selfLink,omitempty"`
  3340. // SiteSearchCategoryParameters: Site search category parameters for
  3341. // this view (profile).
  3342. SiteSearchCategoryParameters string `json:"siteSearchCategoryParameters,omitempty"`
  3343. // SiteSearchQueryParameters: The site search query parameters for this
  3344. // view (profile).
  3345. SiteSearchQueryParameters string `json:"siteSearchQueryParameters,omitempty"`
  3346. // Starred: Indicates whether this view (profile) is starred or not.
  3347. Starred bool `json:"starred,omitempty"`
  3348. // StripSiteSearchCategoryParameters: Whether or not Analytics will
  3349. // strip search category parameters from the URLs in your reports.
  3350. StripSiteSearchCategoryParameters bool `json:"stripSiteSearchCategoryParameters,omitempty"`
  3351. // StripSiteSearchQueryParameters: Whether or not Analytics will strip
  3352. // search query parameters from the URLs in your reports.
  3353. StripSiteSearchQueryParameters bool `json:"stripSiteSearchQueryParameters,omitempty"`
  3354. // Timezone: Time zone for which this view (profile) has been
  3355. // configured. Time zones are identified by strings from the TZ
  3356. // database.
  3357. Timezone string `json:"timezone,omitempty"`
  3358. // Type: View (Profile) type. Supported types: WEB or APP.
  3359. Type string `json:"type,omitempty"`
  3360. // Updated: Time this view (profile) was last modified.
  3361. Updated string `json:"updated,omitempty"`
  3362. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3363. // view (profile) belongs.
  3364. WebPropertyId string `json:"webPropertyId,omitempty"`
  3365. // WebsiteUrl: Website URL for this view (profile).
  3366. WebsiteUrl string `json:"websiteUrl,omitempty"`
  3367. // ServerResponse contains the HTTP response code and headers from the
  3368. // server.
  3369. googleapi.ServerResponse `json:"-"`
  3370. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3371. // unconditionally include in API requests. By default, fields with
  3372. // empty values are omitted from API requests. However, any non-pointer,
  3373. // non-interface field appearing in ForceSendFields will be sent to the
  3374. // server regardless of whether the field is empty or not. This may be
  3375. // used to include empty fields in Patch requests.
  3376. ForceSendFields []string `json:"-"`
  3377. // NullFields is a list of field names (e.g. "AccountId") to include in
  3378. // API requests with the JSON null value. By default, fields with empty
  3379. // values are omitted from API requests. However, any field with an
  3380. // empty value appearing in NullFields will be sent to the server as
  3381. // null. It is an error if a field in this list has a non-empty value.
  3382. // This may be used to include null fields in Patch requests.
  3383. NullFields []string `json:"-"`
  3384. }
  3385. func (s *Profile) MarshalJSON() ([]byte, error) {
  3386. type NoMethod Profile
  3387. raw := NoMethod(*s)
  3388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3389. }
  3390. // ProfileChildLink: Child link for this view (profile). Points to the
  3391. // list of goals for this view (profile).
  3392. type ProfileChildLink struct {
  3393. // Href: Link to the list of goals for this view (profile).
  3394. Href string `json:"href,omitempty"`
  3395. // Type: Value is "analytics#goals".
  3396. Type string `json:"type,omitempty"`
  3397. // ForceSendFields is a list of field names (e.g. "Href") to
  3398. // unconditionally include in API requests. By default, fields with
  3399. // empty values are omitted from API requests. However, any non-pointer,
  3400. // non-interface field appearing in ForceSendFields will be sent to the
  3401. // server regardless of whether the field is empty or not. This may be
  3402. // used to include empty fields in Patch requests.
  3403. ForceSendFields []string `json:"-"`
  3404. // NullFields is a list of field names (e.g. "Href") to include in API
  3405. // requests with the JSON null value. By default, fields with empty
  3406. // values are omitted from API requests. However, any field with an
  3407. // empty value appearing in NullFields will be sent to the server as
  3408. // null. It is an error if a field in this list has a non-empty value.
  3409. // This may be used to include null fields in Patch requests.
  3410. NullFields []string `json:"-"`
  3411. }
  3412. func (s *ProfileChildLink) MarshalJSON() ([]byte, error) {
  3413. type NoMethod ProfileChildLink
  3414. raw := NoMethod(*s)
  3415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3416. }
  3417. // ProfileParentLink: Parent link for this view (profile). Points to the
  3418. // web property to which this view (profile) belongs.
  3419. type ProfileParentLink struct {
  3420. // Href: Link to the web property to which this view (profile) belongs.
  3421. Href string `json:"href,omitempty"`
  3422. // Type: Value is "analytics#webproperty".
  3423. Type string `json:"type,omitempty"`
  3424. // ForceSendFields is a list of field names (e.g. "Href") to
  3425. // unconditionally include in API requests. By default, fields with
  3426. // empty values are omitted from API requests. However, any non-pointer,
  3427. // non-interface field appearing in ForceSendFields will be sent to the
  3428. // server regardless of whether the field is empty or not. This may be
  3429. // used to include empty fields in Patch requests.
  3430. ForceSendFields []string `json:"-"`
  3431. // NullFields is a list of field names (e.g. "Href") to include in API
  3432. // requests with the JSON null value. By default, fields with empty
  3433. // values are omitted from API requests. However, any field with an
  3434. // empty value appearing in NullFields will be sent to the server as
  3435. // null. It is an error if a field in this list has a non-empty value.
  3436. // This may be used to include null fields in Patch requests.
  3437. NullFields []string `json:"-"`
  3438. }
  3439. func (s *ProfileParentLink) MarshalJSON() ([]byte, error) {
  3440. type NoMethod ProfileParentLink
  3441. raw := NoMethod(*s)
  3442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3443. }
  3444. // ProfilePermissions: Permissions the user has for this view (profile).
  3445. type ProfilePermissions struct {
  3446. // Effective: All the permissions that the user has for this view
  3447. // (profile). These include any implied permissions (e.g., EDIT implies
  3448. // VIEW) or inherited permissions from the parent web property.
  3449. Effective []string `json:"effective,omitempty"`
  3450. // ForceSendFields is a list of field names (e.g. "Effective") to
  3451. // unconditionally include in API requests. By default, fields with
  3452. // empty values are omitted from API requests. However, any non-pointer,
  3453. // non-interface field appearing in ForceSendFields will be sent to the
  3454. // server regardless of whether the field is empty or not. This may be
  3455. // used to include empty fields in Patch requests.
  3456. ForceSendFields []string `json:"-"`
  3457. // NullFields is a list of field names (e.g. "Effective") to include in
  3458. // API requests with the JSON null value. By default, fields with empty
  3459. // values are omitted from API requests. However, any field with an
  3460. // empty value appearing in NullFields will be sent to the server as
  3461. // null. It is an error if a field in this list has a non-empty value.
  3462. // This may be used to include null fields in Patch requests.
  3463. NullFields []string `json:"-"`
  3464. }
  3465. func (s *ProfilePermissions) MarshalJSON() ([]byte, error) {
  3466. type NoMethod ProfilePermissions
  3467. raw := NoMethod(*s)
  3468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3469. }
  3470. // ProfileFilterLink: JSON template for an Analytics profile filter
  3471. // link.
  3472. type ProfileFilterLink struct {
  3473. // FilterRef: Filter for this link.
  3474. FilterRef *FilterRef `json:"filterRef,omitempty"`
  3475. // Id: Profile filter link ID.
  3476. Id string `json:"id,omitempty"`
  3477. // Kind: Resource type for Analytics filter.
  3478. Kind string `json:"kind,omitempty"`
  3479. // ProfileRef: View (Profile) for this link.
  3480. ProfileRef *ProfileRef `json:"profileRef,omitempty"`
  3481. // Rank: The rank of this profile filter link relative to the other
  3482. // filters linked to the same profile.
  3483. // For readonly (i.e., list and get) operations, the rank always starts
  3484. // at 1.
  3485. // For write (i.e., create, update, or delete) operations, you may
  3486. // specify a value between 0 and 255 inclusively, [0, 255]. In order to
  3487. // insert a link at the end of the list, either don't specify a rank or
  3488. // set a rank to a number greater than the largest rank in the list. In
  3489. // order to insert a link to the beginning of the list specify a rank
  3490. // that is less than or equal to 1. The new link will move all existing
  3491. // filters with the same or lower rank down the list. After the link is
  3492. // inserted/updated/deleted all profile filter links will be renumbered
  3493. // starting at 1.
  3494. Rank int64 `json:"rank,omitempty"`
  3495. // SelfLink: Link for this profile filter link.
  3496. SelfLink string `json:"selfLink,omitempty"`
  3497. // ServerResponse contains the HTTP response code and headers from the
  3498. // server.
  3499. googleapi.ServerResponse `json:"-"`
  3500. // ForceSendFields is a list of field names (e.g. "FilterRef") to
  3501. // unconditionally include in API requests. By default, fields with
  3502. // empty values are omitted from API requests. However, any non-pointer,
  3503. // non-interface field appearing in ForceSendFields will be sent to the
  3504. // server regardless of whether the field is empty or not. This may be
  3505. // used to include empty fields in Patch requests.
  3506. ForceSendFields []string `json:"-"`
  3507. // NullFields is a list of field names (e.g. "FilterRef") to include in
  3508. // API requests with the JSON null value. By default, fields with empty
  3509. // values are omitted from API requests. However, any field with an
  3510. // empty value appearing in NullFields will be sent to the server as
  3511. // null. It is an error if a field in this list has a non-empty value.
  3512. // This may be used to include null fields in Patch requests.
  3513. NullFields []string `json:"-"`
  3514. }
  3515. func (s *ProfileFilterLink) MarshalJSON() ([]byte, error) {
  3516. type NoMethod ProfileFilterLink
  3517. raw := NoMethod(*s)
  3518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3519. }
  3520. // ProfileFilterLinks: A profile filter link collection lists profile
  3521. // filter links between profiles and filters. Each resource in the
  3522. // collection corresponds to a profile filter link.
  3523. type ProfileFilterLinks struct {
  3524. // Items: A list of profile filter links.
  3525. Items []*ProfileFilterLink `json:"items,omitempty"`
  3526. // ItemsPerPage: The maximum number of resources the response can
  3527. // contain, regardless of the actual number of resources returned. Its
  3528. // value ranges from 1 to 1,000 with a value of 1000 by default, or
  3529. // otherwise specified by the max-results query parameter.
  3530. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3531. // Kind: Collection type.
  3532. Kind string `json:"kind,omitempty"`
  3533. // NextLink: Link to next page for this profile filter link collection.
  3534. NextLink string `json:"nextLink,omitempty"`
  3535. // PreviousLink: Link to previous page for this profile filter link
  3536. // collection.
  3537. PreviousLink string `json:"previousLink,omitempty"`
  3538. // StartIndex: The starting index of the resources, which is 1 by
  3539. // default or otherwise specified by the start-index query parameter.
  3540. StartIndex int64 `json:"startIndex,omitempty"`
  3541. // TotalResults: The total number of results for the query, regardless
  3542. // of the number of results in the response.
  3543. TotalResults int64 `json:"totalResults,omitempty"`
  3544. // Username: Email ID of the authenticated user
  3545. Username string `json:"username,omitempty"`
  3546. // ServerResponse contains the HTTP response code and headers from the
  3547. // server.
  3548. googleapi.ServerResponse `json:"-"`
  3549. // ForceSendFields is a list of field names (e.g. "Items") to
  3550. // unconditionally include in API requests. By default, fields with
  3551. // empty values are omitted from API requests. However, any non-pointer,
  3552. // non-interface field appearing in ForceSendFields will be sent to the
  3553. // server regardless of whether the field is empty or not. This may be
  3554. // used to include empty fields in Patch requests.
  3555. ForceSendFields []string `json:"-"`
  3556. // NullFields is a list of field names (e.g. "Items") to include in API
  3557. // requests with the JSON null value. By default, fields with empty
  3558. // values are omitted from API requests. However, any field with an
  3559. // empty value appearing in NullFields will be sent to the server as
  3560. // null. It is an error if a field in this list has a non-empty value.
  3561. // This may be used to include null fields in Patch requests.
  3562. NullFields []string `json:"-"`
  3563. }
  3564. func (s *ProfileFilterLinks) MarshalJSON() ([]byte, error) {
  3565. type NoMethod ProfileFilterLinks
  3566. raw := NoMethod(*s)
  3567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3568. }
  3569. // ProfileRef: JSON template for a linked view (profile).
  3570. type ProfileRef struct {
  3571. // AccountId: Account ID to which this view (profile) belongs.
  3572. AccountId string `json:"accountId,omitempty"`
  3573. // Href: Link for this view (profile).
  3574. Href string `json:"href,omitempty"`
  3575. // Id: View (Profile) ID.
  3576. Id string `json:"id,omitempty"`
  3577. // InternalWebPropertyId: Internal ID for the web property to which this
  3578. // view (profile) belongs.
  3579. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3580. // Kind: Analytics view (profile) reference.
  3581. Kind string `json:"kind,omitempty"`
  3582. // Name: Name of this view (profile).
  3583. Name string `json:"name,omitempty"`
  3584. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3585. // view (profile) belongs.
  3586. WebPropertyId string `json:"webPropertyId,omitempty"`
  3587. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3588. // unconditionally include in API requests. By default, fields with
  3589. // empty values are omitted from API requests. However, any non-pointer,
  3590. // non-interface field appearing in ForceSendFields will be sent to the
  3591. // server regardless of whether the field is empty or not. This may be
  3592. // used to include empty fields in Patch requests.
  3593. ForceSendFields []string `json:"-"`
  3594. // NullFields is a list of field names (e.g. "AccountId") to include in
  3595. // API requests with the JSON null value. By default, fields with empty
  3596. // values are omitted from API requests. However, any field with an
  3597. // empty value appearing in NullFields will be sent to the server as
  3598. // null. It is an error if a field in this list has a non-empty value.
  3599. // This may be used to include null fields in Patch requests.
  3600. NullFields []string `json:"-"`
  3601. }
  3602. func (s *ProfileRef) MarshalJSON() ([]byte, error) {
  3603. type NoMethod ProfileRef
  3604. raw := NoMethod(*s)
  3605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3606. }
  3607. // ProfileSummary: JSON template for an Analytics ProfileSummary.
  3608. // ProfileSummary returns basic information (i.e., summary) for a
  3609. // profile.
  3610. type ProfileSummary struct {
  3611. // Id: View (profile) ID.
  3612. Id string `json:"id,omitempty"`
  3613. // Kind: Resource type for Analytics ProfileSummary.
  3614. Kind string `json:"kind,omitempty"`
  3615. // Name: View (profile) name.
  3616. Name string `json:"name,omitempty"`
  3617. // Starred: Indicates whether this view (profile) is starred or not.
  3618. Starred bool `json:"starred,omitempty"`
  3619. // Type: View (Profile) type. Supported types: WEB or APP.
  3620. Type string `json:"type,omitempty"`
  3621. // ForceSendFields is a list of field names (e.g. "Id") to
  3622. // unconditionally include in API requests. By default, fields with
  3623. // empty values are omitted from API requests. However, any non-pointer,
  3624. // non-interface field appearing in ForceSendFields will be sent to the
  3625. // server regardless of whether the field is empty or not. This may be
  3626. // used to include empty fields in Patch requests.
  3627. ForceSendFields []string `json:"-"`
  3628. // NullFields is a list of field names (e.g. "Id") to include in API
  3629. // requests with the JSON null value. By default, fields with empty
  3630. // values are omitted from API requests. However, any field with an
  3631. // empty value appearing in NullFields will be sent to the server as
  3632. // null. It is an error if a field in this list has a non-empty value.
  3633. // This may be used to include null fields in Patch requests.
  3634. NullFields []string `json:"-"`
  3635. }
  3636. func (s *ProfileSummary) MarshalJSON() ([]byte, error) {
  3637. type NoMethod ProfileSummary
  3638. raw := NoMethod(*s)
  3639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3640. }
  3641. // Profiles: A view (profile) collection lists Analytics views
  3642. // (profiles) to which the user has access. Each resource in the
  3643. // collection corresponds to a single Analytics view (profile).
  3644. type Profiles struct {
  3645. // Items: A list of views (profiles).
  3646. Items []*Profile `json:"items,omitempty"`
  3647. // ItemsPerPage: The maximum number of resources the response can
  3648. // contain, regardless of the actual number of resources returned. Its
  3649. // value ranges from 1 to 1000 with a value of 1000 by default, or
  3650. // otherwise specified by the max-results query parameter.
  3651. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3652. // Kind: Collection type.
  3653. Kind string `json:"kind,omitempty"`
  3654. // NextLink: Link to next page for this view (profile) collection.
  3655. NextLink string `json:"nextLink,omitempty"`
  3656. // PreviousLink: Link to previous page for this view (profile)
  3657. // collection.
  3658. PreviousLink string `json:"previousLink,omitempty"`
  3659. // StartIndex: The starting index of the resources, which is 1 by
  3660. // default or otherwise specified by the start-index query parameter.
  3661. StartIndex int64 `json:"startIndex,omitempty"`
  3662. // TotalResults: The total number of results for the query, regardless
  3663. // of the number of results in the response.
  3664. TotalResults int64 `json:"totalResults,omitempty"`
  3665. // Username: Email ID of the authenticated user
  3666. Username string `json:"username,omitempty"`
  3667. // ServerResponse contains the HTTP response code and headers from the
  3668. // server.
  3669. googleapi.ServerResponse `json:"-"`
  3670. // ForceSendFields is a list of field names (e.g. "Items") to
  3671. // unconditionally include in API requests. By default, fields with
  3672. // empty values are omitted from API requests. However, any non-pointer,
  3673. // non-interface field appearing in ForceSendFields will be sent to the
  3674. // server regardless of whether the field is empty or not. This may be
  3675. // used to include empty fields in Patch requests.
  3676. ForceSendFields []string `json:"-"`
  3677. // NullFields is a list of field names (e.g. "Items") to include in API
  3678. // requests with the JSON null value. By default, fields with empty
  3679. // values are omitted from API requests. However, any field with an
  3680. // empty value appearing in NullFields will be sent to the server as
  3681. // null. It is an error if a field in this list has a non-empty value.
  3682. // This may be used to include null fields in Patch requests.
  3683. NullFields []string `json:"-"`
  3684. }
  3685. func (s *Profiles) MarshalJSON() ([]byte, error) {
  3686. type NoMethod Profiles
  3687. raw := NoMethod(*s)
  3688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3689. }
  3690. // RealtimeData: Real time data for a given view (profile).
  3691. type RealtimeData struct {
  3692. // ColumnHeaders: Column headers that list dimension names followed by
  3693. // the metric names. The order of dimensions and metrics is same as
  3694. // specified in the request.
  3695. ColumnHeaders []*RealtimeDataColumnHeaders `json:"columnHeaders,omitempty"`
  3696. // Id: Unique ID for this data response.
  3697. Id string `json:"id,omitempty"`
  3698. // Kind: Resource type.
  3699. Kind string `json:"kind,omitempty"`
  3700. // ProfileInfo: Information for the view (profile), for which the real
  3701. // time data was requested.
  3702. ProfileInfo *RealtimeDataProfileInfo `json:"profileInfo,omitempty"`
  3703. // Query: Real time data request query parameters.
  3704. Query *RealtimeDataQuery `json:"query,omitempty"`
  3705. // Rows: Real time data rows, where each row contains a list of
  3706. // dimension values followed by the metric values. The order of
  3707. // dimensions and metrics is same as specified in the request.
  3708. Rows [][]string `json:"rows,omitempty"`
  3709. // SelfLink: Link to this page.
  3710. SelfLink string `json:"selfLink,omitempty"`
  3711. // TotalResults: The total number of rows for the query, regardless of
  3712. // the number of rows in the response.
  3713. TotalResults int64 `json:"totalResults,omitempty"`
  3714. // TotalsForAllResults: Total values for the requested metrics over all
  3715. // the results, not just the results returned in this response. The
  3716. // order of the metric totals is same as the metric order specified in
  3717. // the request.
  3718. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  3719. // ServerResponse contains the HTTP response code and headers from the
  3720. // server.
  3721. googleapi.ServerResponse `json:"-"`
  3722. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  3723. // unconditionally include in API requests. By default, fields with
  3724. // empty values are omitted from API requests. However, any non-pointer,
  3725. // non-interface field appearing in ForceSendFields will be sent to the
  3726. // server regardless of whether the field is empty or not. This may be
  3727. // used to include empty fields in Patch requests.
  3728. ForceSendFields []string `json:"-"`
  3729. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  3730. // in API requests with the JSON null value. By default, fields with
  3731. // empty values are omitted from API requests. However, any field with
  3732. // an empty value appearing in NullFields will be sent to the server as
  3733. // null. It is an error if a field in this list has a non-empty value.
  3734. // This may be used to include null fields in Patch requests.
  3735. NullFields []string `json:"-"`
  3736. }
  3737. func (s *RealtimeData) MarshalJSON() ([]byte, error) {
  3738. type NoMethod RealtimeData
  3739. raw := NoMethod(*s)
  3740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3741. }
  3742. type RealtimeDataColumnHeaders struct {
  3743. // ColumnType: Column Type. Either DIMENSION or METRIC.
  3744. ColumnType string `json:"columnType,omitempty"`
  3745. // DataType: Data type. Dimension column headers have only STRING as the
  3746. // data type. Metric column headers have data types for metric values
  3747. // such as INTEGER, DOUBLE, CURRENCY etc.
  3748. DataType string `json:"dataType,omitempty"`
  3749. // Name: Column name.
  3750. Name string `json:"name,omitempty"`
  3751. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  3752. // unconditionally include in API requests. By default, fields with
  3753. // empty values are omitted from API requests. However, any non-pointer,
  3754. // non-interface field appearing in ForceSendFields will be sent to the
  3755. // server regardless of whether the field is empty or not. This may be
  3756. // used to include empty fields in Patch requests.
  3757. ForceSendFields []string `json:"-"`
  3758. // NullFields is a list of field names (e.g. "ColumnType") to include in
  3759. // API requests with the JSON null value. By default, fields with empty
  3760. // values are omitted from API requests. However, any field with an
  3761. // empty value appearing in NullFields will be sent to the server as
  3762. // null. It is an error if a field in this list has a non-empty value.
  3763. // This may be used to include null fields in Patch requests.
  3764. NullFields []string `json:"-"`
  3765. }
  3766. func (s *RealtimeDataColumnHeaders) MarshalJSON() ([]byte, error) {
  3767. type NoMethod RealtimeDataColumnHeaders
  3768. raw := NoMethod(*s)
  3769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3770. }
  3771. // RealtimeDataProfileInfo: Information for the view (profile), for
  3772. // which the real time data was requested.
  3773. type RealtimeDataProfileInfo struct {
  3774. // AccountId: Account ID to which this view (profile) belongs.
  3775. AccountId string `json:"accountId,omitempty"`
  3776. // InternalWebPropertyId: Internal ID for the web property to which this
  3777. // view (profile) belongs.
  3778. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3779. // ProfileId: View (Profile) ID.
  3780. ProfileId string `json:"profileId,omitempty"`
  3781. // ProfileName: View (Profile) name.
  3782. ProfileName string `json:"profileName,omitempty"`
  3783. // TableId: Table ID for view (profile).
  3784. TableId string `json:"tableId,omitempty"`
  3785. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  3786. WebPropertyId string `json:"webPropertyId,omitempty"`
  3787. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3788. // unconditionally include in API requests. By default, fields with
  3789. // empty values are omitted from API requests. However, any non-pointer,
  3790. // non-interface field appearing in ForceSendFields will be sent to the
  3791. // server regardless of whether the field is empty or not. This may be
  3792. // used to include empty fields in Patch requests.
  3793. ForceSendFields []string `json:"-"`
  3794. // NullFields is a list of field names (e.g. "AccountId") to include in
  3795. // API requests with the JSON null value. By default, fields with empty
  3796. // values are omitted from API requests. However, any field with an
  3797. // empty value appearing in NullFields will be sent to the server as
  3798. // null. It is an error if a field in this list has a non-empty value.
  3799. // This may be used to include null fields in Patch requests.
  3800. NullFields []string `json:"-"`
  3801. }
  3802. func (s *RealtimeDataProfileInfo) MarshalJSON() ([]byte, error) {
  3803. type NoMethod RealtimeDataProfileInfo
  3804. raw := NoMethod(*s)
  3805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3806. }
  3807. // RealtimeDataQuery: Real time data request query parameters.
  3808. type RealtimeDataQuery struct {
  3809. // Dimensions: List of real time dimensions.
  3810. Dimensions string `json:"dimensions,omitempty"`
  3811. // Filters: Comma-separated list of dimension or metric filters.
  3812. Filters string `json:"filters,omitempty"`
  3813. // Ids: Unique table ID.
  3814. Ids string `json:"ids,omitempty"`
  3815. // MaxResults: Maximum results per page.
  3816. MaxResults int64 `json:"max-results,omitempty"`
  3817. // Metrics: List of real time metrics.
  3818. Metrics []string `json:"metrics,omitempty"`
  3819. // Sort: List of dimensions or metrics based on which real time data is
  3820. // sorted.
  3821. Sort []string `json:"sort,omitempty"`
  3822. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  3823. // unconditionally include in API requests. By default, fields with
  3824. // empty values are omitted from API requests. However, any non-pointer,
  3825. // non-interface field appearing in ForceSendFields will be sent to the
  3826. // server regardless of whether the field is empty or not. This may be
  3827. // used to include empty fields in Patch requests.
  3828. ForceSendFields []string `json:"-"`
  3829. // NullFields is a list of field names (e.g. "Dimensions") to include in
  3830. // API requests with the JSON null value. By default, fields with empty
  3831. // values are omitted from API requests. However, any field with an
  3832. // empty value appearing in NullFields will be sent to the server as
  3833. // null. It is an error if a field in this list has a non-empty value.
  3834. // This may be used to include null fields in Patch requests.
  3835. NullFields []string `json:"-"`
  3836. }
  3837. func (s *RealtimeDataQuery) MarshalJSON() ([]byte, error) {
  3838. type NoMethod RealtimeDataQuery
  3839. raw := NoMethod(*s)
  3840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3841. }
  3842. // RemarketingAudience: JSON template for an Analytics remarketing
  3843. // audience.
  3844. type RemarketingAudience struct {
  3845. // AccountId: Account ID to which this remarketing audience belongs.
  3846. AccountId string `json:"accountId,omitempty"`
  3847. // AudienceDefinition: The simple audience definition that will cause a
  3848. // user to be added to an audience.
  3849. AudienceDefinition *RemarketingAudienceAudienceDefinition `json:"audienceDefinition,omitempty"`
  3850. // AudienceType: The type of audience, either SIMPLE or STATE_BASED.
  3851. AudienceType string `json:"audienceType,omitempty"`
  3852. // Created: Time this remarketing audience was created.
  3853. Created string `json:"created,omitempty"`
  3854. // Description: The description of this remarketing audience.
  3855. Description string `json:"description,omitempty"`
  3856. // Id: Remarketing Audience ID.
  3857. Id string `json:"id,omitempty"`
  3858. // InternalWebPropertyId: Internal ID for the web property to which this
  3859. // remarketing audience belongs.
  3860. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3861. // Kind: Collection type.
  3862. Kind string `json:"kind,omitempty"`
  3863. // LinkedAdAccounts: The linked ad accounts associated with this
  3864. // remarketing audience. A remarketing audience can have only one
  3865. // linkedAdAccount currently.
  3866. LinkedAdAccounts []*LinkedForeignAccount `json:"linkedAdAccounts,omitempty"`
  3867. // LinkedViews: The views (profiles) that this remarketing audience is
  3868. // linked to.
  3869. LinkedViews []string `json:"linkedViews,omitempty"`
  3870. // Name: The name of this remarketing audience.
  3871. Name string `json:"name,omitempty"`
  3872. // StateBasedAudienceDefinition: A state based audience definition that
  3873. // will cause a user to be added or removed from an audience.
  3874. StateBasedAudienceDefinition *RemarketingAudienceStateBasedAudienceDefinition `json:"stateBasedAudienceDefinition,omitempty"`
  3875. // Updated: Time this remarketing audience was last modified.
  3876. Updated string `json:"updated,omitempty"`
  3877. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3878. // remarketing audience belongs.
  3879. WebPropertyId string `json:"webPropertyId,omitempty"`
  3880. // ServerResponse contains the HTTP response code and headers from the
  3881. // server.
  3882. googleapi.ServerResponse `json:"-"`
  3883. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3884. // unconditionally include in API requests. By default, fields with
  3885. // empty values are omitted from API requests. However, any non-pointer,
  3886. // non-interface field appearing in ForceSendFields will be sent to the
  3887. // server regardless of whether the field is empty or not. This may be
  3888. // used to include empty fields in Patch requests.
  3889. ForceSendFields []string `json:"-"`
  3890. // NullFields is a list of field names (e.g. "AccountId") to include in
  3891. // API requests with the JSON null value. By default, fields with empty
  3892. // values are omitted from API requests. However, any field with an
  3893. // empty value appearing in NullFields will be sent to the server as
  3894. // null. It is an error if a field in this list has a non-empty value.
  3895. // This may be used to include null fields in Patch requests.
  3896. NullFields []string `json:"-"`
  3897. }
  3898. func (s *RemarketingAudience) MarshalJSON() ([]byte, error) {
  3899. type NoMethod RemarketingAudience
  3900. raw := NoMethod(*s)
  3901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3902. }
  3903. // RemarketingAudienceAudienceDefinition: The simple audience definition
  3904. // that will cause a user to be added to an audience.
  3905. type RemarketingAudienceAudienceDefinition struct {
  3906. // IncludeConditions: Defines the conditions to include users to the
  3907. // audience.
  3908. IncludeConditions *IncludeConditions `json:"includeConditions,omitempty"`
  3909. // ForceSendFields is a list of field names (e.g. "IncludeConditions")
  3910. // to unconditionally include in API requests. By default, fields with
  3911. // empty values are omitted from API requests. However, any non-pointer,
  3912. // non-interface field appearing in ForceSendFields will be sent to the
  3913. // server regardless of whether the field is empty or not. This may be
  3914. // used to include empty fields in Patch requests.
  3915. ForceSendFields []string `json:"-"`
  3916. // NullFields is a list of field names (e.g. "IncludeConditions") to
  3917. // include in API requests with the JSON null value. By default, fields
  3918. // with empty values are omitted from API requests. However, any field
  3919. // with an empty value appearing in NullFields will be sent to the
  3920. // server as null. It is an error if a field in this list has a
  3921. // non-empty value. This may be used to include null fields in Patch
  3922. // requests.
  3923. NullFields []string `json:"-"`
  3924. }
  3925. func (s *RemarketingAudienceAudienceDefinition) MarshalJSON() ([]byte, error) {
  3926. type NoMethod RemarketingAudienceAudienceDefinition
  3927. raw := NoMethod(*s)
  3928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3929. }
  3930. // RemarketingAudienceStateBasedAudienceDefinition: A state based
  3931. // audience definition that will cause a user to be added or removed
  3932. // from an audience.
  3933. type RemarketingAudienceStateBasedAudienceDefinition struct {
  3934. // ExcludeConditions: Defines the conditions to exclude users from the
  3935. // audience.
  3936. ExcludeConditions *RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions `json:"excludeConditions,omitempty"`
  3937. // IncludeConditions: Defines the conditions to include users to the
  3938. // audience.
  3939. IncludeConditions *IncludeConditions `json:"includeConditions,omitempty"`
  3940. // ForceSendFields is a list of field names (e.g. "ExcludeConditions")
  3941. // to unconditionally include in API requests. By default, fields with
  3942. // empty values are omitted from API requests. However, any non-pointer,
  3943. // non-interface field appearing in ForceSendFields will be sent to the
  3944. // server regardless of whether the field is empty or not. This may be
  3945. // used to include empty fields in Patch requests.
  3946. ForceSendFields []string `json:"-"`
  3947. // NullFields is a list of field names (e.g. "ExcludeConditions") to
  3948. // include in API requests with the JSON null value. By default, fields
  3949. // with empty values are omitted from API requests. However, any field
  3950. // with an empty value appearing in NullFields will be sent to the
  3951. // server as null. It is an error if a field in this list has a
  3952. // non-empty value. This may be used to include null fields in Patch
  3953. // requests.
  3954. NullFields []string `json:"-"`
  3955. }
  3956. func (s *RemarketingAudienceStateBasedAudienceDefinition) MarshalJSON() ([]byte, error) {
  3957. type NoMethod RemarketingAudienceStateBasedAudienceDefinition
  3958. raw := NoMethod(*s)
  3959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3960. }
  3961. // RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions:
  3962. // Defines the conditions to exclude users from the audience.
  3963. type RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions struct {
  3964. // ExclusionDuration: Whether to make the exclusion TEMPORARY or
  3965. // PERMANENT.
  3966. ExclusionDuration string `json:"exclusionDuration,omitempty"`
  3967. // Segment: The segment condition that will cause a user to be removed
  3968. // from an audience.
  3969. Segment string `json:"segment,omitempty"`
  3970. // ForceSendFields is a list of field names (e.g. "ExclusionDuration")
  3971. // to unconditionally include in API requests. By default, fields with
  3972. // empty values are omitted from API requests. However, any non-pointer,
  3973. // non-interface field appearing in ForceSendFields will be sent to the
  3974. // server regardless of whether the field is empty or not. This may be
  3975. // used to include empty fields in Patch requests.
  3976. ForceSendFields []string `json:"-"`
  3977. // NullFields is a list of field names (e.g. "ExclusionDuration") to
  3978. // include in API requests with the JSON null value. By default, fields
  3979. // with empty values are omitted from API requests. However, any field
  3980. // with an empty value appearing in NullFields will be sent to the
  3981. // server as null. It is an error if a field in this list has a
  3982. // non-empty value. This may be used to include null fields in Patch
  3983. // requests.
  3984. NullFields []string `json:"-"`
  3985. }
  3986. func (s *RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions) MarshalJSON() ([]byte, error) {
  3987. type NoMethod RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions
  3988. raw := NoMethod(*s)
  3989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3990. }
  3991. // RemarketingAudiences: A remarketing audience collection lists
  3992. // Analytics remarketing audiences to which the user has access. Each
  3993. // resource in the collection corresponds to a single Analytics
  3994. // remarketing audience.
  3995. type RemarketingAudiences struct {
  3996. // Items: A list of remarketing audiences.
  3997. Items []*RemarketingAudience `json:"items,omitempty"`
  3998. // ItemsPerPage: The maximum number of resources the response can
  3999. // contain, regardless of the actual number of resources returned. Its
  4000. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4001. // otherwise specified by the max-results query parameter.
  4002. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4003. // Kind: Collection type.
  4004. Kind string `json:"kind,omitempty"`
  4005. // NextLink: Link to next page for this remarketing audience collection.
  4006. NextLink string `json:"nextLink,omitempty"`
  4007. // PreviousLink: Link to previous page for this view (profile)
  4008. // collection.
  4009. PreviousLink string `json:"previousLink,omitempty"`
  4010. // StartIndex: The starting index of the resources, which is 1 by
  4011. // default or otherwise specified by the start-index query parameter.
  4012. StartIndex int64 `json:"startIndex,omitempty"`
  4013. // TotalResults: The total number of results for the query, regardless
  4014. // of the number of results in the response.
  4015. TotalResults int64 `json:"totalResults,omitempty"`
  4016. // Username: Email ID of the authenticated user
  4017. Username string `json:"username,omitempty"`
  4018. // ServerResponse contains the HTTP response code and headers from the
  4019. // server.
  4020. googleapi.ServerResponse `json:"-"`
  4021. // ForceSendFields is a list of field names (e.g. "Items") to
  4022. // unconditionally include in API requests. By default, fields with
  4023. // empty values are omitted from API requests. However, any non-pointer,
  4024. // non-interface field appearing in ForceSendFields will be sent to the
  4025. // server regardless of whether the field is empty or not. This may be
  4026. // used to include empty fields in Patch requests.
  4027. ForceSendFields []string `json:"-"`
  4028. // NullFields is a list of field names (e.g. "Items") to include in API
  4029. // requests with the JSON null value. By default, fields with empty
  4030. // values are omitted from API requests. However, any field with an
  4031. // empty value appearing in NullFields will be sent to the server as
  4032. // null. It is an error if a field in this list has a non-empty value.
  4033. // This may be used to include null fields in Patch requests.
  4034. NullFields []string `json:"-"`
  4035. }
  4036. func (s *RemarketingAudiences) MarshalJSON() ([]byte, error) {
  4037. type NoMethod RemarketingAudiences
  4038. raw := NoMethod(*s)
  4039. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4040. }
  4041. // Segment: JSON template for an Analytics segment.
  4042. type Segment struct {
  4043. // Created: Time the segment was created.
  4044. Created string `json:"created,omitempty"`
  4045. // Definition: Segment definition.
  4046. Definition string `json:"definition,omitempty"`
  4047. // Id: Segment ID.
  4048. Id string `json:"id,omitempty"`
  4049. // Kind: Resource type for Analytics segment.
  4050. Kind string `json:"kind,omitempty"`
  4051. // Name: Segment name.
  4052. Name string `json:"name,omitempty"`
  4053. // SegmentId: Segment ID. Can be used with the 'segment' parameter in
  4054. // Core Reporting API.
  4055. SegmentId string `json:"segmentId,omitempty"`
  4056. // SelfLink: Link for this segment.
  4057. SelfLink string `json:"selfLink,omitempty"`
  4058. // Type: Type for a segment. Possible values are "BUILT_IN" or "CUSTOM".
  4059. Type string `json:"type,omitempty"`
  4060. // Updated: Time the segment was last modified.
  4061. Updated string `json:"updated,omitempty"`
  4062. // ForceSendFields is a list of field names (e.g. "Created") to
  4063. // unconditionally include in API requests. By default, fields with
  4064. // empty values are omitted from API requests. However, any non-pointer,
  4065. // non-interface field appearing in ForceSendFields will be sent to the
  4066. // server regardless of whether the field is empty or not. This may be
  4067. // used to include empty fields in Patch requests.
  4068. ForceSendFields []string `json:"-"`
  4069. // NullFields is a list of field names (e.g. "Created") to include in
  4070. // API requests with the JSON null value. By default, fields with empty
  4071. // values are omitted from API requests. However, any field with an
  4072. // empty value appearing in NullFields will be sent to the server as
  4073. // null. It is an error if a field in this list has a non-empty value.
  4074. // This may be used to include null fields in Patch requests.
  4075. NullFields []string `json:"-"`
  4076. }
  4077. func (s *Segment) MarshalJSON() ([]byte, error) {
  4078. type NoMethod Segment
  4079. raw := NoMethod(*s)
  4080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4081. }
  4082. // Segments: An segment collection lists Analytics segments that the
  4083. // user has access to. Each resource in the collection corresponds to a
  4084. // single Analytics segment.
  4085. type Segments struct {
  4086. // Items: A list of segments.
  4087. Items []*Segment `json:"items,omitempty"`
  4088. // ItemsPerPage: The maximum number of resources the response can
  4089. // contain, regardless of the actual number of resources returned. Its
  4090. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4091. // otherwise specified by the max-results query parameter.
  4092. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4093. // Kind: Collection type for segments.
  4094. Kind string `json:"kind,omitempty"`
  4095. // NextLink: Link to next page for this segment collection.
  4096. NextLink string `json:"nextLink,omitempty"`
  4097. // PreviousLink: Link to previous page for this segment collection.
  4098. PreviousLink string `json:"previousLink,omitempty"`
  4099. // StartIndex: The starting index of the resources, which is 1 by
  4100. // default or otherwise specified by the start-index query parameter.
  4101. StartIndex int64 `json:"startIndex,omitempty"`
  4102. // TotalResults: The total number of results for the query, regardless
  4103. // of the number of results in the response.
  4104. TotalResults int64 `json:"totalResults,omitempty"`
  4105. // Username: Email ID of the authenticated user
  4106. Username string `json:"username,omitempty"`
  4107. // ServerResponse contains the HTTP response code and headers from the
  4108. // server.
  4109. googleapi.ServerResponse `json:"-"`
  4110. // ForceSendFields is a list of field names (e.g. "Items") to
  4111. // unconditionally include in API requests. By default, fields with
  4112. // empty values are omitted from API requests. However, any non-pointer,
  4113. // non-interface field appearing in ForceSendFields will be sent to the
  4114. // server regardless of whether the field is empty or not. This may be
  4115. // used to include empty fields in Patch requests.
  4116. ForceSendFields []string `json:"-"`
  4117. // NullFields is a list of field names (e.g. "Items") to include in API
  4118. // requests with the JSON null value. By default, fields with empty
  4119. // values are omitted from API requests. However, any field with an
  4120. // empty value appearing in NullFields will be sent to the server as
  4121. // null. It is an error if a field in this list has a non-empty value.
  4122. // This may be used to include null fields in Patch requests.
  4123. NullFields []string `json:"-"`
  4124. }
  4125. func (s *Segments) MarshalJSON() ([]byte, error) {
  4126. type NoMethod Segments
  4127. raw := NoMethod(*s)
  4128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4129. }
  4130. // UnsampledReport: JSON template for Analytics unsampled report
  4131. // resource.
  4132. type UnsampledReport struct {
  4133. // AccountId: Account ID to which this unsampled report belongs.
  4134. AccountId string `json:"accountId,omitempty"`
  4135. // CloudStorageDownloadDetails: Download details for a file stored in
  4136. // Google Cloud Storage.
  4137. CloudStorageDownloadDetails *UnsampledReportCloudStorageDownloadDetails `json:"cloudStorageDownloadDetails,omitempty"`
  4138. // Created: Time this unsampled report was created.
  4139. Created string `json:"created,omitempty"`
  4140. // Dimensions: The dimensions for the unsampled report.
  4141. Dimensions string `json:"dimensions,omitempty"`
  4142. // DownloadType: The type of download you need to use for the report
  4143. // data file. Possible values include `GOOGLE_DRIVE` and
  4144. // `GOOGLE_CLOUD_STORAGE`. If the value is `GOOGLE_DRIVE`, see the
  4145. // `driveDownloadDetails` field. If the value is `GOOGLE_CLOUD_STORAGE`,
  4146. // see the `cloudStorageDownloadDetails` field.
  4147. DownloadType string `json:"downloadType,omitempty"`
  4148. // DriveDownloadDetails: Download details for a file stored in Google
  4149. // Drive.
  4150. DriveDownloadDetails *UnsampledReportDriveDownloadDetails `json:"driveDownloadDetails,omitempty"`
  4151. // EndDate: The end date for the unsampled report.
  4152. EndDate string `json:"end-date,omitempty"`
  4153. // Filters: The filters for the unsampled report.
  4154. Filters string `json:"filters,omitempty"`
  4155. // Id: Unsampled report ID.
  4156. Id string `json:"id,omitempty"`
  4157. // Kind: Resource type for an Analytics unsampled report.
  4158. Kind string `json:"kind,omitempty"`
  4159. // Metrics: The metrics for the unsampled report.
  4160. Metrics string `json:"metrics,omitempty"`
  4161. // ProfileId: View (Profile) ID to which this unsampled report belongs.
  4162. ProfileId string `json:"profileId,omitempty"`
  4163. // Segment: The segment for the unsampled report.
  4164. Segment string `json:"segment,omitempty"`
  4165. // SelfLink: Link for this unsampled report.
  4166. SelfLink string `json:"selfLink,omitempty"`
  4167. // StartDate: The start date for the unsampled report.
  4168. StartDate string `json:"start-date,omitempty"`
  4169. // Status: Status of this unsampled report. Possible values are PENDING,
  4170. // COMPLETED, or FAILED.
  4171. Status string `json:"status,omitempty"`
  4172. // Title: Title of the unsampled report.
  4173. Title string `json:"title,omitempty"`
  4174. // Updated: Time this unsampled report was last modified.
  4175. Updated string `json:"updated,omitempty"`
  4176. // WebPropertyId: Web property ID to which this unsampled report
  4177. // belongs. The web property ID is of the form UA-XXXXX-YY.
  4178. WebPropertyId string `json:"webPropertyId,omitempty"`
  4179. // ServerResponse contains the HTTP response code and headers from the
  4180. // server.
  4181. googleapi.ServerResponse `json:"-"`
  4182. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4183. // unconditionally include in API requests. By default, fields with
  4184. // empty values are omitted from API requests. However, any non-pointer,
  4185. // non-interface field appearing in ForceSendFields will be sent to the
  4186. // server regardless of whether the field is empty or not. This may be
  4187. // used to include empty fields in Patch requests.
  4188. ForceSendFields []string `json:"-"`
  4189. // NullFields is a list of field names (e.g. "AccountId") to include in
  4190. // API requests with the JSON null value. By default, fields with empty
  4191. // values are omitted from API requests. However, any field with an
  4192. // empty value appearing in NullFields will be sent to the server as
  4193. // null. It is an error if a field in this list has a non-empty value.
  4194. // This may be used to include null fields in Patch requests.
  4195. NullFields []string `json:"-"`
  4196. }
  4197. func (s *UnsampledReport) MarshalJSON() ([]byte, error) {
  4198. type NoMethod UnsampledReport
  4199. raw := NoMethod(*s)
  4200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4201. }
  4202. // UnsampledReportCloudStorageDownloadDetails: Download details for a
  4203. // file stored in Google Cloud Storage.
  4204. type UnsampledReportCloudStorageDownloadDetails struct {
  4205. // BucketId: Id of the bucket the file object is stored in.
  4206. BucketId string `json:"bucketId,omitempty"`
  4207. // ObjectId: Id of the file object containing the report data.
  4208. ObjectId string `json:"objectId,omitempty"`
  4209. // ForceSendFields is a list of field names (e.g. "BucketId") to
  4210. // unconditionally include in API requests. By default, fields with
  4211. // empty values are omitted from API requests. However, any non-pointer,
  4212. // non-interface field appearing in ForceSendFields will be sent to the
  4213. // server regardless of whether the field is empty or not. This may be
  4214. // used to include empty fields in Patch requests.
  4215. ForceSendFields []string `json:"-"`
  4216. // NullFields is a list of field names (e.g. "BucketId") to include in
  4217. // API requests with the JSON null value. By default, fields with empty
  4218. // values are omitted from API requests. However, any field with an
  4219. // empty value appearing in NullFields will be sent to the server as
  4220. // null. It is an error if a field in this list has a non-empty value.
  4221. // This may be used to include null fields in Patch requests.
  4222. NullFields []string `json:"-"`
  4223. }
  4224. func (s *UnsampledReportCloudStorageDownloadDetails) MarshalJSON() ([]byte, error) {
  4225. type NoMethod UnsampledReportCloudStorageDownloadDetails
  4226. raw := NoMethod(*s)
  4227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4228. }
  4229. // UnsampledReportDriveDownloadDetails: Download details for a file
  4230. // stored in Google Drive.
  4231. type UnsampledReportDriveDownloadDetails struct {
  4232. // DocumentId: Id of the document/file containing the report data.
  4233. DocumentId string `json:"documentId,omitempty"`
  4234. // ForceSendFields is a list of field names (e.g. "DocumentId") to
  4235. // unconditionally include in API requests. By default, fields with
  4236. // empty values are omitted from API requests. However, any non-pointer,
  4237. // non-interface field appearing in ForceSendFields will be sent to the
  4238. // server regardless of whether the field is empty or not. This may be
  4239. // used to include empty fields in Patch requests.
  4240. ForceSendFields []string `json:"-"`
  4241. // NullFields is a list of field names (e.g. "DocumentId") to include in
  4242. // API requests with the JSON null value. By default, fields with empty
  4243. // values are omitted from API requests. However, any field with an
  4244. // empty value appearing in NullFields will be sent to the server as
  4245. // null. It is an error if a field in this list has a non-empty value.
  4246. // This may be used to include null fields in Patch requests.
  4247. NullFields []string `json:"-"`
  4248. }
  4249. func (s *UnsampledReportDriveDownloadDetails) MarshalJSON() ([]byte, error) {
  4250. type NoMethod UnsampledReportDriveDownloadDetails
  4251. raw := NoMethod(*s)
  4252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4253. }
  4254. // UnsampledReports: An unsampled report collection lists Analytics
  4255. // unsampled reports to which the user has access. Each view (profile)
  4256. // can have a set of unsampled reports. Each resource in the unsampled
  4257. // report collection corresponds to a single Analytics unsampled report.
  4258. type UnsampledReports struct {
  4259. // Items: A list of unsampled reports.
  4260. Items []*UnsampledReport `json:"items,omitempty"`
  4261. // ItemsPerPage: The maximum number of resources the response can
  4262. // contain, regardless of the actual number of resources returned. Its
  4263. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4264. // otherwise specified by the max-results query parameter.
  4265. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4266. // Kind: Collection type.
  4267. Kind string `json:"kind,omitempty"`
  4268. // NextLink: Link to next page for this unsampled report collection.
  4269. NextLink string `json:"nextLink,omitempty"`
  4270. // PreviousLink: Link to previous page for this unsampled report
  4271. // collection.
  4272. PreviousLink string `json:"previousLink,omitempty"`
  4273. // StartIndex: The starting index of the resources, which is 1 by
  4274. // default or otherwise specified by the start-index query parameter.
  4275. StartIndex int64 `json:"startIndex,omitempty"`
  4276. // TotalResults: The total number of results for the query, regardless
  4277. // of the number of resources in the result.
  4278. TotalResults int64 `json:"totalResults,omitempty"`
  4279. // Username: Email ID of the authenticated user
  4280. Username string `json:"username,omitempty"`
  4281. // ServerResponse contains the HTTP response code and headers from the
  4282. // server.
  4283. googleapi.ServerResponse `json:"-"`
  4284. // ForceSendFields is a list of field names (e.g. "Items") to
  4285. // unconditionally include in API requests. By default, fields with
  4286. // empty values are omitted from API requests. However, any non-pointer,
  4287. // non-interface field appearing in ForceSendFields will be sent to the
  4288. // server regardless of whether the field is empty or not. This may be
  4289. // used to include empty fields in Patch requests.
  4290. ForceSendFields []string `json:"-"`
  4291. // NullFields is a list of field names (e.g. "Items") to include in API
  4292. // requests with the JSON null value. By default, fields with empty
  4293. // values are omitted from API requests. However, any field with an
  4294. // empty value appearing in NullFields will be sent to the server as
  4295. // null. It is an error if a field in this list has a non-empty value.
  4296. // This may be used to include null fields in Patch requests.
  4297. NullFields []string `json:"-"`
  4298. }
  4299. func (s *UnsampledReports) MarshalJSON() ([]byte, error) {
  4300. type NoMethod UnsampledReports
  4301. raw := NoMethod(*s)
  4302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4303. }
  4304. // Upload: Metadata returned for an upload operation.
  4305. type Upload struct {
  4306. // AccountId: Account Id to which this upload belongs.
  4307. AccountId int64 `json:"accountId,omitempty,string"`
  4308. // CustomDataSourceId: Custom data source Id to which this data import
  4309. // belongs.
  4310. CustomDataSourceId string `json:"customDataSourceId,omitempty"`
  4311. // Errors: Data import errors collection.
  4312. Errors []string `json:"errors,omitempty"`
  4313. // Id: A unique ID for this upload.
  4314. Id string `json:"id,omitempty"`
  4315. // Kind: Resource type for Analytics upload.
  4316. Kind string `json:"kind,omitempty"`
  4317. // Status: Upload status. Possible values: PENDING, COMPLETED, FAILED,
  4318. // DELETING, DELETED.
  4319. Status string `json:"status,omitempty"`
  4320. // UploadTime: Time this file is uploaded.
  4321. UploadTime string `json:"uploadTime,omitempty"`
  4322. // ServerResponse contains the HTTP response code and headers from the
  4323. // server.
  4324. googleapi.ServerResponse `json:"-"`
  4325. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4326. // unconditionally include in API requests. By default, fields with
  4327. // empty values are omitted from API requests. However, any non-pointer,
  4328. // non-interface field appearing in ForceSendFields will be sent to the
  4329. // server regardless of whether the field is empty or not. This may be
  4330. // used to include empty fields in Patch requests.
  4331. ForceSendFields []string `json:"-"`
  4332. // NullFields is a list of field names (e.g. "AccountId") to include in
  4333. // API requests with the JSON null value. By default, fields with empty
  4334. // values are omitted from API requests. However, any field with an
  4335. // empty value appearing in NullFields will be sent to the server as
  4336. // null. It is an error if a field in this list has a non-empty value.
  4337. // This may be used to include null fields in Patch requests.
  4338. NullFields []string `json:"-"`
  4339. }
  4340. func (s *Upload) MarshalJSON() ([]byte, error) {
  4341. type NoMethod Upload
  4342. raw := NoMethod(*s)
  4343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4344. }
  4345. // Uploads: Upload collection lists Analytics uploads to which the user
  4346. // has access. Each custom data source can have a set of uploads. Each
  4347. // resource in the upload collection corresponds to a single Analytics
  4348. // data upload.
  4349. type Uploads struct {
  4350. // Items: A list of uploads.
  4351. Items []*Upload `json:"items,omitempty"`
  4352. // ItemsPerPage: The maximum number of resources the response can
  4353. // contain, regardless of the actual number of resources returned. Its
  4354. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4355. // otherwise specified by the max-results query parameter.
  4356. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4357. // Kind: Collection type.
  4358. Kind string `json:"kind,omitempty"`
  4359. // NextLink: Link to next page for this upload collection.
  4360. NextLink string `json:"nextLink,omitempty"`
  4361. // PreviousLink: Link to previous page for this upload collection.
  4362. PreviousLink string `json:"previousLink,omitempty"`
  4363. // StartIndex: The starting index of the resources, which is 1 by
  4364. // default or otherwise specified by the start-index query parameter.
  4365. StartIndex int64 `json:"startIndex,omitempty"`
  4366. // TotalResults: The total number of results for the query, regardless
  4367. // of the number of resources in the result.
  4368. TotalResults int64 `json:"totalResults,omitempty"`
  4369. // ServerResponse contains the HTTP response code and headers from the
  4370. // server.
  4371. googleapi.ServerResponse `json:"-"`
  4372. // ForceSendFields is a list of field names (e.g. "Items") to
  4373. // unconditionally include in API requests. By default, fields with
  4374. // empty values are omitted from API requests. However, any non-pointer,
  4375. // non-interface field appearing in ForceSendFields will be sent to the
  4376. // server regardless of whether the field is empty or not. This may be
  4377. // used to include empty fields in Patch requests.
  4378. ForceSendFields []string `json:"-"`
  4379. // NullFields is a list of field names (e.g. "Items") to include in API
  4380. // requests with the JSON null value. By default, fields with empty
  4381. // values are omitted from API requests. However, any field with an
  4382. // empty value appearing in NullFields will be sent to the server as
  4383. // null. It is an error if a field in this list has a non-empty value.
  4384. // This may be used to include null fields in Patch requests.
  4385. NullFields []string `json:"-"`
  4386. }
  4387. func (s *Uploads) MarshalJSON() ([]byte, error) {
  4388. type NoMethod Uploads
  4389. raw := NoMethod(*s)
  4390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4391. }
  4392. // UserDeletionRequest: JSON template for a user deletion request
  4393. // resource.
  4394. type UserDeletionRequest struct {
  4395. // DeletionRequestTime: This marks the point in time for which all user
  4396. // data before should be deleted
  4397. DeletionRequestTime string `json:"deletionRequestTime,omitempty"`
  4398. // FirebaseProjectId: Firebase Project Id
  4399. FirebaseProjectId string `json:"firebaseProjectId,omitempty"`
  4400. // Id: User ID.
  4401. Id *UserDeletionRequestId `json:"id,omitempty"`
  4402. // Kind: Value is "analytics#userDeletionRequest".
  4403. Kind string `json:"kind,omitempty"`
  4404. // WebPropertyId: Web property ID of the form UA-XXXXX-YY.
  4405. WebPropertyId string `json:"webPropertyId,omitempty"`
  4406. // ServerResponse contains the HTTP response code and headers from the
  4407. // server.
  4408. googleapi.ServerResponse `json:"-"`
  4409. // ForceSendFields is a list of field names (e.g. "DeletionRequestTime")
  4410. // to unconditionally include in API requests. By default, fields with
  4411. // empty values are omitted from API requests. However, any non-pointer,
  4412. // non-interface field appearing in ForceSendFields will be sent to the
  4413. // server regardless of whether the field is empty or not. This may be
  4414. // used to include empty fields in Patch requests.
  4415. ForceSendFields []string `json:"-"`
  4416. // NullFields is a list of field names (e.g. "DeletionRequestTime") to
  4417. // include in API requests with the JSON null value. By default, fields
  4418. // with empty values are omitted from API requests. However, any field
  4419. // with an empty value appearing in NullFields will be sent to the
  4420. // server as null. It is an error if a field in this list has a
  4421. // non-empty value. This may be used to include null fields in Patch
  4422. // requests.
  4423. NullFields []string `json:"-"`
  4424. }
  4425. func (s *UserDeletionRequest) MarshalJSON() ([]byte, error) {
  4426. type NoMethod UserDeletionRequest
  4427. raw := NoMethod(*s)
  4428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4429. }
  4430. // UserDeletionRequestId: User ID.
  4431. type UserDeletionRequestId struct {
  4432. // Type: Type of user
  4433. Type string `json:"type,omitempty"`
  4434. // UserId: The User's id
  4435. UserId string `json:"userId,omitempty"`
  4436. // ForceSendFields is a list of field names (e.g. "Type") to
  4437. // unconditionally include in API requests. By default, fields with
  4438. // empty values are omitted from API requests. However, any non-pointer,
  4439. // non-interface field appearing in ForceSendFields will be sent to the
  4440. // server regardless of whether the field is empty or not. This may be
  4441. // used to include empty fields in Patch requests.
  4442. ForceSendFields []string `json:"-"`
  4443. // NullFields is a list of field names (e.g. "Type") to include in API
  4444. // requests with the JSON null value. By default, fields with empty
  4445. // values are omitted from API requests. However, any field with an
  4446. // empty value appearing in NullFields will be sent to the server as
  4447. // null. It is an error if a field in this list has a non-empty value.
  4448. // This may be used to include null fields in Patch requests.
  4449. NullFields []string `json:"-"`
  4450. }
  4451. func (s *UserDeletionRequestId) MarshalJSON() ([]byte, error) {
  4452. type NoMethod UserDeletionRequestId
  4453. raw := NoMethod(*s)
  4454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4455. }
  4456. // UserRef: JSON template for a user reference.
  4457. type UserRef struct {
  4458. // Email: Email ID of this user.
  4459. Email string `json:"email,omitempty"`
  4460. // Id: User ID.
  4461. Id string `json:"id,omitempty"`
  4462. Kind string `json:"kind,omitempty"`
  4463. // ForceSendFields is a list of field names (e.g. "Email") to
  4464. // unconditionally include in API requests. By default, fields with
  4465. // empty values are omitted from API requests. However, any non-pointer,
  4466. // non-interface field appearing in ForceSendFields will be sent to the
  4467. // server regardless of whether the field is empty or not. This may be
  4468. // used to include empty fields in Patch requests.
  4469. ForceSendFields []string `json:"-"`
  4470. // NullFields is a list of field names (e.g. "Email") to include in API
  4471. // requests with the JSON null value. By default, fields with empty
  4472. // values are omitted from API requests. However, any field with an
  4473. // empty value appearing in NullFields will be sent to the server as
  4474. // null. It is an error if a field in this list has a non-empty value.
  4475. // This may be used to include null fields in Patch requests.
  4476. NullFields []string `json:"-"`
  4477. }
  4478. func (s *UserRef) MarshalJSON() ([]byte, error) {
  4479. type NoMethod UserRef
  4480. raw := NoMethod(*s)
  4481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4482. }
  4483. // WebPropertyRef: JSON template for a web property reference.
  4484. type WebPropertyRef struct {
  4485. // AccountId: Account ID to which this web property belongs.
  4486. AccountId string `json:"accountId,omitempty"`
  4487. // Href: Link for this web property.
  4488. Href string `json:"href,omitempty"`
  4489. // Id: Web property ID of the form UA-XXXXX-YY.
  4490. Id string `json:"id,omitempty"`
  4491. // InternalWebPropertyId: Internal ID for this web property.
  4492. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  4493. // Kind: Analytics web property reference.
  4494. Kind string `json:"kind,omitempty"`
  4495. // Name: Name of this web property.
  4496. Name string `json:"name,omitempty"`
  4497. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4498. // unconditionally include in API requests. By default, fields with
  4499. // empty values are omitted from API requests. However, any non-pointer,
  4500. // non-interface field appearing in ForceSendFields will be sent to the
  4501. // server regardless of whether the field is empty or not. This may be
  4502. // used to include empty fields in Patch requests.
  4503. ForceSendFields []string `json:"-"`
  4504. // NullFields is a list of field names (e.g. "AccountId") to include in
  4505. // API requests with the JSON null value. By default, fields with empty
  4506. // values are omitted from API requests. However, any field with an
  4507. // empty value appearing in NullFields will be sent to the server as
  4508. // null. It is an error if a field in this list has a non-empty value.
  4509. // This may be used to include null fields in Patch requests.
  4510. NullFields []string `json:"-"`
  4511. }
  4512. func (s *WebPropertyRef) MarshalJSON() ([]byte, error) {
  4513. type NoMethod WebPropertyRef
  4514. raw := NoMethod(*s)
  4515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4516. }
  4517. // WebPropertySummary: JSON template for an Analytics
  4518. // WebPropertySummary. WebPropertySummary returns basic information
  4519. // (i.e., summary) for a web property.
  4520. type WebPropertySummary struct {
  4521. // Id: Web property ID of the form UA-XXXXX-YY.
  4522. Id string `json:"id,omitempty"`
  4523. // InternalWebPropertyId: Internal ID for this web property.
  4524. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  4525. // Kind: Resource type for Analytics WebPropertySummary.
  4526. Kind string `json:"kind,omitempty"`
  4527. // Level: Level for this web property. Possible values are STANDARD or
  4528. // PREMIUM.
  4529. Level string `json:"level,omitempty"`
  4530. // Name: Web property name.
  4531. Name string `json:"name,omitempty"`
  4532. // Profiles: List of profiles under this web property.
  4533. Profiles []*ProfileSummary `json:"profiles,omitempty"`
  4534. // Starred: Indicates whether this web property is starred or not.
  4535. Starred bool `json:"starred,omitempty"`
  4536. // WebsiteUrl: Website url for this web property.
  4537. WebsiteUrl string `json:"websiteUrl,omitempty"`
  4538. // ForceSendFields is a list of field names (e.g. "Id") to
  4539. // unconditionally include in API requests. By default, fields with
  4540. // empty values are omitted from API requests. However, any non-pointer,
  4541. // non-interface field appearing in ForceSendFields will be sent to the
  4542. // server regardless of whether the field is empty or not. This may be
  4543. // used to include empty fields in Patch requests.
  4544. ForceSendFields []string `json:"-"`
  4545. // NullFields is a list of field names (e.g. "Id") to include in API
  4546. // requests with the JSON null value. By default, fields with empty
  4547. // values are omitted from API requests. However, any field with an
  4548. // empty value appearing in NullFields will be sent to the server as
  4549. // null. It is an error if a field in this list has a non-empty value.
  4550. // This may be used to include null fields in Patch requests.
  4551. NullFields []string `json:"-"`
  4552. }
  4553. func (s *WebPropertySummary) MarshalJSON() ([]byte, error) {
  4554. type NoMethod WebPropertySummary
  4555. raw := NoMethod(*s)
  4556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4557. }
  4558. // Webproperties: A web property collection lists Analytics web
  4559. // properties to which the user has access. Each resource in the
  4560. // collection corresponds to a single Analytics web property.
  4561. type Webproperties struct {
  4562. // Items: A list of web properties.
  4563. Items []*Webproperty `json:"items,omitempty"`
  4564. // ItemsPerPage: The maximum number of resources the response can
  4565. // contain, regardless of the actual number of resources returned. Its
  4566. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4567. // otherwise specified by the max-results query parameter.
  4568. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4569. // Kind: Collection type.
  4570. Kind string `json:"kind,omitempty"`
  4571. // NextLink: Link to next page for this web property collection.
  4572. NextLink string `json:"nextLink,omitempty"`
  4573. // PreviousLink: Link to previous page for this web property collection.
  4574. PreviousLink string `json:"previousLink,omitempty"`
  4575. // StartIndex: The starting index of the resources, which is 1 by
  4576. // default or otherwise specified by the start-index query parameter.
  4577. StartIndex int64 `json:"startIndex,omitempty"`
  4578. // TotalResults: The total number of results for the query, regardless
  4579. // of the number of results in the response.
  4580. TotalResults int64 `json:"totalResults,omitempty"`
  4581. // Username: Email ID of the authenticated user
  4582. Username string `json:"username,omitempty"`
  4583. // ServerResponse contains the HTTP response code and headers from the
  4584. // server.
  4585. googleapi.ServerResponse `json:"-"`
  4586. // ForceSendFields is a list of field names (e.g. "Items") to
  4587. // unconditionally include in API requests. By default, fields with
  4588. // empty values are omitted from API requests. However, any non-pointer,
  4589. // non-interface field appearing in ForceSendFields will be sent to the
  4590. // server regardless of whether the field is empty or not. This may be
  4591. // used to include empty fields in Patch requests.
  4592. ForceSendFields []string `json:"-"`
  4593. // NullFields is a list of field names (e.g. "Items") to include in API
  4594. // requests with the JSON null value. By default, fields with empty
  4595. // values are omitted from API requests. However, any field with an
  4596. // empty value appearing in NullFields will be sent to the server as
  4597. // null. It is an error if a field in this list has a non-empty value.
  4598. // This may be used to include null fields in Patch requests.
  4599. NullFields []string `json:"-"`
  4600. }
  4601. func (s *Webproperties) MarshalJSON() ([]byte, error) {
  4602. type NoMethod Webproperties
  4603. raw := NoMethod(*s)
  4604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4605. }
  4606. // Webproperty: JSON template for an Analytics web property.
  4607. type Webproperty struct {
  4608. // AccountId: Account ID to which this web property belongs.
  4609. AccountId string `json:"accountId,omitempty"`
  4610. // ChildLink: Child link for this web property. Points to the list of
  4611. // views (profiles) for this web property.
  4612. ChildLink *WebpropertyChildLink `json:"childLink,omitempty"`
  4613. // Created: Time this web property was created.
  4614. Created string `json:"created,omitempty"`
  4615. // DataRetentionResetOnNewActivity: Set to true to reset the retention
  4616. // period of the user identifier with each new event from that user
  4617. // (thus setting the expiration date to current time plus retention
  4618. // period).
  4619. // Set to false to delete data associated with the user identifer
  4620. // automatically after the rentention period.
  4621. // This property cannot be set on insert.
  4622. DataRetentionResetOnNewActivity bool `json:"dataRetentionResetOnNewActivity,omitempty"`
  4623. // DataRetentionTtl: The length of time for which user and event data is
  4624. // retained.
  4625. // This property cannot be set on insert.
  4626. DataRetentionTtl string `json:"dataRetentionTtl,omitempty"`
  4627. // DefaultProfileId: Default view (profile) ID.
  4628. DefaultProfileId int64 `json:"defaultProfileId,omitempty,string"`
  4629. // Id: Web property ID of the form UA-XXXXX-YY.
  4630. Id string `json:"id,omitempty"`
  4631. // IndustryVertical: The industry vertical/category selected for this
  4632. // web property.
  4633. IndustryVertical string `json:"industryVertical,omitempty"`
  4634. // InternalWebPropertyId: Internal ID for this web property.
  4635. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  4636. // Kind: Resource type for Analytics WebProperty.
  4637. Kind string `json:"kind,omitempty"`
  4638. // Level: Level for this web property. Possible values are STANDARD or
  4639. // PREMIUM.
  4640. Level string `json:"level,omitempty"`
  4641. // Name: Name of this web property.
  4642. Name string `json:"name,omitempty"`
  4643. // ParentLink: Parent link for this web property. Points to the account
  4644. // to which this web property belongs.
  4645. ParentLink *WebpropertyParentLink `json:"parentLink,omitempty"`
  4646. // Permissions: Permissions the user has for this web property.
  4647. Permissions *WebpropertyPermissions `json:"permissions,omitempty"`
  4648. // ProfileCount: View (Profile) count for this web property.
  4649. ProfileCount int64 `json:"profileCount,omitempty"`
  4650. // SelfLink: Link for this web property.
  4651. SelfLink string `json:"selfLink,omitempty"`
  4652. // Starred: Indicates whether this web property is starred or not.
  4653. Starred bool `json:"starred,omitempty"`
  4654. // Updated: Time this web property was last modified.
  4655. Updated string `json:"updated,omitempty"`
  4656. // WebsiteUrl: Website url for this web property.
  4657. WebsiteUrl string `json:"websiteUrl,omitempty"`
  4658. // ServerResponse contains the HTTP response code and headers from the
  4659. // server.
  4660. googleapi.ServerResponse `json:"-"`
  4661. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4662. // unconditionally include in API requests. By default, fields with
  4663. // empty values are omitted from API requests. However, any non-pointer,
  4664. // non-interface field appearing in ForceSendFields will be sent to the
  4665. // server regardless of whether the field is empty or not. This may be
  4666. // used to include empty fields in Patch requests.
  4667. ForceSendFields []string `json:"-"`
  4668. // NullFields is a list of field names (e.g. "AccountId") to include in
  4669. // API requests with the JSON null value. By default, fields with empty
  4670. // values are omitted from API requests. However, any field with an
  4671. // empty value appearing in NullFields will be sent to the server as
  4672. // null. It is an error if a field in this list has a non-empty value.
  4673. // This may be used to include null fields in Patch requests.
  4674. NullFields []string `json:"-"`
  4675. }
  4676. func (s *Webproperty) MarshalJSON() ([]byte, error) {
  4677. type NoMethod Webproperty
  4678. raw := NoMethod(*s)
  4679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4680. }
  4681. // WebpropertyChildLink: Child link for this web property. Points to the
  4682. // list of views (profiles) for this web property.
  4683. type WebpropertyChildLink struct {
  4684. // Href: Link to the list of views (profiles) for this web property.
  4685. Href string `json:"href,omitempty"`
  4686. // Type: Type of the parent link. Its value is "analytics#profiles".
  4687. Type string `json:"type,omitempty"`
  4688. // ForceSendFields is a list of field names (e.g. "Href") to
  4689. // unconditionally include in API requests. By default, fields with
  4690. // empty values are omitted from API requests. However, any non-pointer,
  4691. // non-interface field appearing in ForceSendFields will be sent to the
  4692. // server regardless of whether the field is empty or not. This may be
  4693. // used to include empty fields in Patch requests.
  4694. ForceSendFields []string `json:"-"`
  4695. // NullFields is a list of field names (e.g. "Href") to include in API
  4696. // requests with the JSON null value. By default, fields with empty
  4697. // values are omitted from API requests. However, any field with an
  4698. // empty value appearing in NullFields will be sent to the server as
  4699. // null. It is an error if a field in this list has a non-empty value.
  4700. // This may be used to include null fields in Patch requests.
  4701. NullFields []string `json:"-"`
  4702. }
  4703. func (s *WebpropertyChildLink) MarshalJSON() ([]byte, error) {
  4704. type NoMethod WebpropertyChildLink
  4705. raw := NoMethod(*s)
  4706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4707. }
  4708. // WebpropertyParentLink: Parent link for this web property. Points to
  4709. // the account to which this web property belongs.
  4710. type WebpropertyParentLink struct {
  4711. // Href: Link to the account for this web property.
  4712. Href string `json:"href,omitempty"`
  4713. // Type: Type of the parent link. Its value is "analytics#account".
  4714. Type string `json:"type,omitempty"`
  4715. // ForceSendFields is a list of field names (e.g. "Href") to
  4716. // unconditionally include in API requests. By default, fields with
  4717. // empty values are omitted from API requests. However, any non-pointer,
  4718. // non-interface field appearing in ForceSendFields will be sent to the
  4719. // server regardless of whether the field is empty or not. This may be
  4720. // used to include empty fields in Patch requests.
  4721. ForceSendFields []string `json:"-"`
  4722. // NullFields is a list of field names (e.g. "Href") to include in API
  4723. // requests with the JSON null value. By default, fields with empty
  4724. // values are omitted from API requests. However, any field with an
  4725. // empty value appearing in NullFields will be sent to the server as
  4726. // null. It is an error if a field in this list has a non-empty value.
  4727. // This may be used to include null fields in Patch requests.
  4728. NullFields []string `json:"-"`
  4729. }
  4730. func (s *WebpropertyParentLink) MarshalJSON() ([]byte, error) {
  4731. type NoMethod WebpropertyParentLink
  4732. raw := NoMethod(*s)
  4733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4734. }
  4735. // WebpropertyPermissions: Permissions the user has for this web
  4736. // property.
  4737. type WebpropertyPermissions struct {
  4738. // Effective: All the permissions that the user has for this web
  4739. // property. These include any implied permissions (e.g., EDIT implies
  4740. // VIEW) or inherited permissions from the parent account.
  4741. Effective []string `json:"effective,omitempty"`
  4742. // ForceSendFields is a list of field names (e.g. "Effective") to
  4743. // unconditionally include in API requests. By default, fields with
  4744. // empty values are omitted from API requests. However, any non-pointer,
  4745. // non-interface field appearing in ForceSendFields will be sent to the
  4746. // server regardless of whether the field is empty or not. This may be
  4747. // used to include empty fields in Patch requests.
  4748. ForceSendFields []string `json:"-"`
  4749. // NullFields is a list of field names (e.g. "Effective") to include in
  4750. // API requests with the JSON null value. By default, fields with empty
  4751. // values are omitted from API requests. However, any field with an
  4752. // empty value appearing in NullFields will be sent to the server as
  4753. // null. It is an error if a field in this list has a non-empty value.
  4754. // This may be used to include null fields in Patch requests.
  4755. NullFields []string `json:"-"`
  4756. }
  4757. func (s *WebpropertyPermissions) MarshalJSON() ([]byte, error) {
  4758. type NoMethod WebpropertyPermissions
  4759. raw := NoMethod(*s)
  4760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4761. }
  4762. // method id "analytics.data.ga.get":
  4763. type DataGaGetCall struct {
  4764. s *Service
  4765. urlParams_ gensupport.URLParams
  4766. ifNoneMatch_ string
  4767. ctx_ context.Context
  4768. header_ http.Header
  4769. }
  4770. // Get: Returns Analytics data for a view (profile).
  4771. func (r *DataGaService) Get(ids string, startDate string, endDate string, metrics string) *DataGaGetCall {
  4772. c := &DataGaGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4773. c.urlParams_.Set("ids", ids)
  4774. c.urlParams_.Set("start-date", startDate)
  4775. c.urlParams_.Set("end-date", endDate)
  4776. c.urlParams_.Set("metrics", metrics)
  4777. return c
  4778. }
  4779. // Dimensions sets the optional parameter "dimensions": A
  4780. // comma-separated list of Analytics dimensions. E.g.,
  4781. // 'ga:browser,ga:city'.
  4782. func (c *DataGaGetCall) Dimensions(dimensions string) *DataGaGetCall {
  4783. c.urlParams_.Set("dimensions", dimensions)
  4784. return c
  4785. }
  4786. // Filters sets the optional parameter "filters": A comma-separated list
  4787. // of dimension or metric filters to be applied to Analytics data.
  4788. func (c *DataGaGetCall) Filters(filters string) *DataGaGetCall {
  4789. c.urlParams_.Set("filters", filters)
  4790. return c
  4791. }
  4792. // IncludeEmptyRows sets the optional parameter "include-empty-rows":
  4793. // The response will include empty rows if this parameter is set to
  4794. // true, the default is true
  4795. func (c *DataGaGetCall) IncludeEmptyRows(includeEmptyRows bool) *DataGaGetCall {
  4796. c.urlParams_.Set("include-empty-rows", fmt.Sprint(includeEmptyRows))
  4797. return c
  4798. }
  4799. // MaxResults sets the optional parameter "max-results": The maximum
  4800. // number of entries to include in this feed.
  4801. func (c *DataGaGetCall) MaxResults(maxResults int64) *DataGaGetCall {
  4802. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  4803. return c
  4804. }
  4805. // Output sets the optional parameter "output": The selected format for
  4806. // the response. Default format is JSON.
  4807. //
  4808. // Possible values:
  4809. // "dataTable" - Returns the response in Google Charts Data Table
  4810. // format. This is useful in creating visualization using Google Charts.
  4811. // "json" - Returns the response in standard JSON format.
  4812. func (c *DataGaGetCall) Output(output string) *DataGaGetCall {
  4813. c.urlParams_.Set("output", output)
  4814. return c
  4815. }
  4816. // SamplingLevel sets the optional parameter "samplingLevel": The
  4817. // desired sampling level.
  4818. //
  4819. // Possible values:
  4820. // "DEFAULT" - Returns response with a sample size that balances speed
  4821. // and accuracy.
  4822. // "FASTER" - Returns a fast response with a smaller sample size.
  4823. // "HIGHER_PRECISION" - Returns a more accurate response using a large
  4824. // sample size, but this may result in the response being slower.
  4825. func (c *DataGaGetCall) SamplingLevel(samplingLevel string) *DataGaGetCall {
  4826. c.urlParams_.Set("samplingLevel", samplingLevel)
  4827. return c
  4828. }
  4829. // Segment sets the optional parameter "segment": An Analytics segment
  4830. // to be applied to data.
  4831. func (c *DataGaGetCall) Segment(segment string) *DataGaGetCall {
  4832. c.urlParams_.Set("segment", segment)
  4833. return c
  4834. }
  4835. // Sort sets the optional parameter "sort": A comma-separated list of
  4836. // dimensions or metrics that determine the sort order for Analytics
  4837. // data.
  4838. func (c *DataGaGetCall) Sort(sort string) *DataGaGetCall {
  4839. c.urlParams_.Set("sort", sort)
  4840. return c
  4841. }
  4842. // StartIndex sets the optional parameter "start-index": An index of the
  4843. // first entity to retrieve. Use this parameter as a pagination
  4844. // mechanism along with the max-results parameter.
  4845. func (c *DataGaGetCall) StartIndex(startIndex int64) *DataGaGetCall {
  4846. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  4847. return c
  4848. }
  4849. // Fields allows partial responses to be retrieved. See
  4850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4851. // for more information.
  4852. func (c *DataGaGetCall) Fields(s ...googleapi.Field) *DataGaGetCall {
  4853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4854. return c
  4855. }
  4856. // IfNoneMatch sets the optional parameter which makes the operation
  4857. // fail if the object's ETag matches the given value. This is useful for
  4858. // getting updates only after the object has changed since the last
  4859. // request. Use googleapi.IsNotModified to check whether the response
  4860. // error from Do is the result of In-None-Match.
  4861. func (c *DataGaGetCall) IfNoneMatch(entityTag string) *DataGaGetCall {
  4862. c.ifNoneMatch_ = entityTag
  4863. return c
  4864. }
  4865. // Context sets the context to be used in this call's Do method. Any
  4866. // pending HTTP request will be aborted if the provided context is
  4867. // canceled.
  4868. func (c *DataGaGetCall) Context(ctx context.Context) *DataGaGetCall {
  4869. c.ctx_ = ctx
  4870. return c
  4871. }
  4872. // Header returns an http.Header that can be modified by the caller to
  4873. // add HTTP headers to the request.
  4874. func (c *DataGaGetCall) Header() http.Header {
  4875. if c.header_ == nil {
  4876. c.header_ = make(http.Header)
  4877. }
  4878. return c.header_
  4879. }
  4880. func (c *DataGaGetCall) doRequest(alt string) (*http.Response, error) {
  4881. reqHeaders := make(http.Header)
  4882. for k, v := range c.header_ {
  4883. reqHeaders[k] = v
  4884. }
  4885. reqHeaders.Set("User-Agent", c.s.userAgent())
  4886. if c.ifNoneMatch_ != "" {
  4887. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4888. }
  4889. var body io.Reader = nil
  4890. c.urlParams_.Set("alt", alt)
  4891. c.urlParams_.Set("prettyPrint", "false")
  4892. urls := googleapi.ResolveRelative(c.s.BasePath, "data/ga")
  4893. urls += "?" + c.urlParams_.Encode()
  4894. req, err := http.NewRequest("GET", urls, body)
  4895. if err != nil {
  4896. return nil, err
  4897. }
  4898. req.Header = reqHeaders
  4899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4900. }
  4901. // Do executes the "analytics.data.ga.get" call.
  4902. // Exactly one of *GaData or error will be non-nil. Any non-2xx status
  4903. // code is an error. Response headers are in either
  4904. // *GaData.ServerResponse.Header or (if a response was returned at all)
  4905. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4906. // check whether the returned error was because http.StatusNotModified
  4907. // was returned.
  4908. func (c *DataGaGetCall) Do(opts ...googleapi.CallOption) (*GaData, error) {
  4909. gensupport.SetOptions(c.urlParams_, opts...)
  4910. res, err := c.doRequest("json")
  4911. if res != nil && res.StatusCode == http.StatusNotModified {
  4912. if res.Body != nil {
  4913. res.Body.Close()
  4914. }
  4915. return nil, &googleapi.Error{
  4916. Code: res.StatusCode,
  4917. Header: res.Header,
  4918. }
  4919. }
  4920. if err != nil {
  4921. return nil, err
  4922. }
  4923. defer googleapi.CloseBody(res)
  4924. if err := googleapi.CheckResponse(res); err != nil {
  4925. return nil, err
  4926. }
  4927. ret := &GaData{
  4928. ServerResponse: googleapi.ServerResponse{
  4929. Header: res.Header,
  4930. HTTPStatusCode: res.StatusCode,
  4931. },
  4932. }
  4933. target := &ret
  4934. if err := gensupport.DecodeResponse(target, res); err != nil {
  4935. return nil, err
  4936. }
  4937. return ret, nil
  4938. // {
  4939. // "description": "Returns Analytics data for a view (profile).",
  4940. // "httpMethod": "GET",
  4941. // "id": "analytics.data.ga.get",
  4942. // "parameterOrder": [
  4943. // "ids",
  4944. // "start-date",
  4945. // "end-date",
  4946. // "metrics"
  4947. // ],
  4948. // "parameters": {
  4949. // "dimensions": {
  4950. // "description": "A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.",
  4951. // "location": "query",
  4952. // "pattern": "(ga:.+)?",
  4953. // "type": "string"
  4954. // },
  4955. // "end-date": {
  4956. // "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.",
  4957. // "location": "query",
  4958. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  4959. // "required": true,
  4960. // "type": "string"
  4961. // },
  4962. // "filters": {
  4963. // "description": "A comma-separated list of dimension or metric filters to be applied to Analytics data.",
  4964. // "location": "query",
  4965. // "pattern": "ga:.+",
  4966. // "type": "string"
  4967. // },
  4968. // "ids": {
  4969. // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  4970. // "location": "query",
  4971. // "pattern": "ga:[0-9]+",
  4972. // "required": true,
  4973. // "type": "string"
  4974. // },
  4975. // "include-empty-rows": {
  4976. // "description": "The response will include empty rows if this parameter is set to true, the default is true",
  4977. // "location": "query",
  4978. // "type": "boolean"
  4979. // },
  4980. // "max-results": {
  4981. // "description": "The maximum number of entries to include in this feed.",
  4982. // "format": "int32",
  4983. // "location": "query",
  4984. // "type": "integer"
  4985. // },
  4986. // "metrics": {
  4987. // "description": "A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified.",
  4988. // "location": "query",
  4989. // "pattern": "ga:.+",
  4990. // "required": true,
  4991. // "type": "string"
  4992. // },
  4993. // "output": {
  4994. // "description": "The selected format for the response. Default format is JSON.",
  4995. // "enum": [
  4996. // "dataTable",
  4997. // "json"
  4998. // ],
  4999. // "enumDescriptions": [
  5000. // "Returns the response in Google Charts Data Table format. This is useful in creating visualization using Google Charts.",
  5001. // "Returns the response in standard JSON format."
  5002. // ],
  5003. // "location": "query",
  5004. // "type": "string"
  5005. // },
  5006. // "samplingLevel": {
  5007. // "description": "The desired sampling level.",
  5008. // "enum": [
  5009. // "DEFAULT",
  5010. // "FASTER",
  5011. // "HIGHER_PRECISION"
  5012. // ],
  5013. // "enumDescriptions": [
  5014. // "Returns response with a sample size that balances speed and accuracy.",
  5015. // "Returns a fast response with a smaller sample size.",
  5016. // "Returns a more accurate response using a large sample size, but this may result in the response being slower."
  5017. // ],
  5018. // "location": "query",
  5019. // "type": "string"
  5020. // },
  5021. // "segment": {
  5022. // "description": "An Analytics segment to be applied to data.",
  5023. // "location": "query",
  5024. // "type": "string"
  5025. // },
  5026. // "sort": {
  5027. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for Analytics data.",
  5028. // "location": "query",
  5029. // "pattern": "(-)?ga:.+",
  5030. // "type": "string"
  5031. // },
  5032. // "start-date": {
  5033. // "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.",
  5034. // "location": "query",
  5035. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  5036. // "required": true,
  5037. // "type": "string"
  5038. // },
  5039. // "start-index": {
  5040. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5041. // "format": "int32",
  5042. // "location": "query",
  5043. // "minimum": "1",
  5044. // "type": "integer"
  5045. // }
  5046. // },
  5047. // "path": "data/ga",
  5048. // "response": {
  5049. // "$ref": "GaData"
  5050. // },
  5051. // "scopes": [
  5052. // "https://www.googleapis.com/auth/analytics",
  5053. // "https://www.googleapis.com/auth/analytics.readonly"
  5054. // ]
  5055. // }
  5056. }
  5057. // method id "analytics.data.mcf.get":
  5058. type DataMcfGetCall struct {
  5059. s *Service
  5060. urlParams_ gensupport.URLParams
  5061. ifNoneMatch_ string
  5062. ctx_ context.Context
  5063. header_ http.Header
  5064. }
  5065. // Get: Returns Analytics Multi-Channel Funnels data for a view
  5066. // (profile).
  5067. func (r *DataMcfService) Get(ids string, startDate string, endDate string, metrics string) *DataMcfGetCall {
  5068. c := &DataMcfGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5069. c.urlParams_.Set("ids", ids)
  5070. c.urlParams_.Set("start-date", startDate)
  5071. c.urlParams_.Set("end-date", endDate)
  5072. c.urlParams_.Set("metrics", metrics)
  5073. return c
  5074. }
  5075. // Dimensions sets the optional parameter "dimensions": A
  5076. // comma-separated list of Multi-Channel Funnels dimensions. E.g.,
  5077. // 'mcf:source,mcf:medium'.
  5078. func (c *DataMcfGetCall) Dimensions(dimensions string) *DataMcfGetCall {
  5079. c.urlParams_.Set("dimensions", dimensions)
  5080. return c
  5081. }
  5082. // Filters sets the optional parameter "filters": A comma-separated list
  5083. // of dimension or metric filters to be applied to the Analytics data.
  5084. func (c *DataMcfGetCall) Filters(filters string) *DataMcfGetCall {
  5085. c.urlParams_.Set("filters", filters)
  5086. return c
  5087. }
  5088. // MaxResults sets the optional parameter "max-results": The maximum
  5089. // number of entries to include in this feed.
  5090. func (c *DataMcfGetCall) MaxResults(maxResults int64) *DataMcfGetCall {
  5091. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5092. return c
  5093. }
  5094. // SamplingLevel sets the optional parameter "samplingLevel": The
  5095. // desired sampling level.
  5096. //
  5097. // Possible values:
  5098. // "DEFAULT" - Returns response with a sample size that balances speed
  5099. // and accuracy.
  5100. // "FASTER" - Returns a fast response with a smaller sample size.
  5101. // "HIGHER_PRECISION" - Returns a more accurate response using a large
  5102. // sample size, but this may result in the response being slower.
  5103. func (c *DataMcfGetCall) SamplingLevel(samplingLevel string) *DataMcfGetCall {
  5104. c.urlParams_.Set("samplingLevel", samplingLevel)
  5105. return c
  5106. }
  5107. // Sort sets the optional parameter "sort": A comma-separated list of
  5108. // dimensions or metrics that determine the sort order for the Analytics
  5109. // data.
  5110. func (c *DataMcfGetCall) Sort(sort string) *DataMcfGetCall {
  5111. c.urlParams_.Set("sort", sort)
  5112. return c
  5113. }
  5114. // StartIndex sets the optional parameter "start-index": An index of the
  5115. // first entity to retrieve. Use this parameter as a pagination
  5116. // mechanism along with the max-results parameter.
  5117. func (c *DataMcfGetCall) StartIndex(startIndex int64) *DataMcfGetCall {
  5118. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5119. return c
  5120. }
  5121. // Fields allows partial responses to be retrieved. See
  5122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5123. // for more information.
  5124. func (c *DataMcfGetCall) Fields(s ...googleapi.Field) *DataMcfGetCall {
  5125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5126. return c
  5127. }
  5128. // IfNoneMatch sets the optional parameter which makes the operation
  5129. // fail if the object's ETag matches the given value. This is useful for
  5130. // getting updates only after the object has changed since the last
  5131. // request. Use googleapi.IsNotModified to check whether the response
  5132. // error from Do is the result of In-None-Match.
  5133. func (c *DataMcfGetCall) IfNoneMatch(entityTag string) *DataMcfGetCall {
  5134. c.ifNoneMatch_ = entityTag
  5135. return c
  5136. }
  5137. // Context sets the context to be used in this call's Do method. Any
  5138. // pending HTTP request will be aborted if the provided context is
  5139. // canceled.
  5140. func (c *DataMcfGetCall) Context(ctx context.Context) *DataMcfGetCall {
  5141. c.ctx_ = ctx
  5142. return c
  5143. }
  5144. // Header returns an http.Header that can be modified by the caller to
  5145. // add HTTP headers to the request.
  5146. func (c *DataMcfGetCall) Header() http.Header {
  5147. if c.header_ == nil {
  5148. c.header_ = make(http.Header)
  5149. }
  5150. return c.header_
  5151. }
  5152. func (c *DataMcfGetCall) doRequest(alt string) (*http.Response, error) {
  5153. reqHeaders := make(http.Header)
  5154. for k, v := range c.header_ {
  5155. reqHeaders[k] = v
  5156. }
  5157. reqHeaders.Set("User-Agent", c.s.userAgent())
  5158. if c.ifNoneMatch_ != "" {
  5159. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5160. }
  5161. var body io.Reader = nil
  5162. c.urlParams_.Set("alt", alt)
  5163. c.urlParams_.Set("prettyPrint", "false")
  5164. urls := googleapi.ResolveRelative(c.s.BasePath, "data/mcf")
  5165. urls += "?" + c.urlParams_.Encode()
  5166. req, err := http.NewRequest("GET", urls, body)
  5167. if err != nil {
  5168. return nil, err
  5169. }
  5170. req.Header = reqHeaders
  5171. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5172. }
  5173. // Do executes the "analytics.data.mcf.get" call.
  5174. // Exactly one of *McfData or error will be non-nil. Any non-2xx status
  5175. // code is an error. Response headers are in either
  5176. // *McfData.ServerResponse.Header or (if a response was returned at all)
  5177. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5178. // check whether the returned error was because http.StatusNotModified
  5179. // was returned.
  5180. func (c *DataMcfGetCall) Do(opts ...googleapi.CallOption) (*McfData, error) {
  5181. gensupport.SetOptions(c.urlParams_, opts...)
  5182. res, err := c.doRequest("json")
  5183. if res != nil && res.StatusCode == http.StatusNotModified {
  5184. if res.Body != nil {
  5185. res.Body.Close()
  5186. }
  5187. return nil, &googleapi.Error{
  5188. Code: res.StatusCode,
  5189. Header: res.Header,
  5190. }
  5191. }
  5192. if err != nil {
  5193. return nil, err
  5194. }
  5195. defer googleapi.CloseBody(res)
  5196. if err := googleapi.CheckResponse(res); err != nil {
  5197. return nil, err
  5198. }
  5199. ret := &McfData{
  5200. ServerResponse: googleapi.ServerResponse{
  5201. Header: res.Header,
  5202. HTTPStatusCode: res.StatusCode,
  5203. },
  5204. }
  5205. target := &ret
  5206. if err := gensupport.DecodeResponse(target, res); err != nil {
  5207. return nil, err
  5208. }
  5209. return ret, nil
  5210. // {
  5211. // "description": "Returns Analytics Multi-Channel Funnels data for a view (profile).",
  5212. // "httpMethod": "GET",
  5213. // "id": "analytics.data.mcf.get",
  5214. // "parameterOrder": [
  5215. // "ids",
  5216. // "start-date",
  5217. // "end-date",
  5218. // "metrics"
  5219. // ],
  5220. // "parameters": {
  5221. // "dimensions": {
  5222. // "description": "A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'.",
  5223. // "location": "query",
  5224. // "pattern": "(mcf:.+)?",
  5225. // "type": "string"
  5226. // },
  5227. // "end-date": {
  5228. // "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.",
  5229. // "location": "query",
  5230. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  5231. // "required": true,
  5232. // "type": "string"
  5233. // },
  5234. // "filters": {
  5235. // "description": "A comma-separated list of dimension or metric filters to be applied to the Analytics data.",
  5236. // "location": "query",
  5237. // "pattern": "mcf:.+",
  5238. // "type": "string"
  5239. // },
  5240. // "ids": {
  5241. // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  5242. // "location": "query",
  5243. // "pattern": "ga:[0-9]+",
  5244. // "required": true,
  5245. // "type": "string"
  5246. // },
  5247. // "max-results": {
  5248. // "description": "The maximum number of entries to include in this feed.",
  5249. // "format": "int32",
  5250. // "location": "query",
  5251. // "type": "integer"
  5252. // },
  5253. // "metrics": {
  5254. // "description": "A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified.",
  5255. // "location": "query",
  5256. // "pattern": "mcf:.+",
  5257. // "required": true,
  5258. // "type": "string"
  5259. // },
  5260. // "samplingLevel": {
  5261. // "description": "The desired sampling level.",
  5262. // "enum": [
  5263. // "DEFAULT",
  5264. // "FASTER",
  5265. // "HIGHER_PRECISION"
  5266. // ],
  5267. // "enumDescriptions": [
  5268. // "Returns response with a sample size that balances speed and accuracy.",
  5269. // "Returns a fast response with a smaller sample size.",
  5270. // "Returns a more accurate response using a large sample size, but this may result in the response being slower."
  5271. // ],
  5272. // "location": "query",
  5273. // "type": "string"
  5274. // },
  5275. // "sort": {
  5276. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data.",
  5277. // "location": "query",
  5278. // "pattern": "(-)?mcf:.+",
  5279. // "type": "string"
  5280. // },
  5281. // "start-date": {
  5282. // "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.",
  5283. // "location": "query",
  5284. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  5285. // "required": true,
  5286. // "type": "string"
  5287. // },
  5288. // "start-index": {
  5289. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5290. // "format": "int32",
  5291. // "location": "query",
  5292. // "minimum": "1",
  5293. // "type": "integer"
  5294. // }
  5295. // },
  5296. // "path": "data/mcf",
  5297. // "response": {
  5298. // "$ref": "McfData"
  5299. // },
  5300. // "scopes": [
  5301. // "https://www.googleapis.com/auth/analytics",
  5302. // "https://www.googleapis.com/auth/analytics.readonly"
  5303. // ]
  5304. // }
  5305. }
  5306. // method id "analytics.data.realtime.get":
  5307. type DataRealtimeGetCall struct {
  5308. s *Service
  5309. urlParams_ gensupport.URLParams
  5310. ifNoneMatch_ string
  5311. ctx_ context.Context
  5312. header_ http.Header
  5313. }
  5314. // Get: Returns real time data for a view (profile).
  5315. func (r *DataRealtimeService) Get(ids string, metrics string) *DataRealtimeGetCall {
  5316. c := &DataRealtimeGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5317. c.urlParams_.Set("ids", ids)
  5318. c.urlParams_.Set("metrics", metrics)
  5319. return c
  5320. }
  5321. // Dimensions sets the optional parameter "dimensions": A
  5322. // comma-separated list of real time dimensions. E.g.,
  5323. // 'rt:medium,rt:city'.
  5324. func (c *DataRealtimeGetCall) Dimensions(dimensions string) *DataRealtimeGetCall {
  5325. c.urlParams_.Set("dimensions", dimensions)
  5326. return c
  5327. }
  5328. // Filters sets the optional parameter "filters": A comma-separated list
  5329. // of dimension or metric filters to be applied to real time data.
  5330. func (c *DataRealtimeGetCall) Filters(filters string) *DataRealtimeGetCall {
  5331. c.urlParams_.Set("filters", filters)
  5332. return c
  5333. }
  5334. // MaxResults sets the optional parameter "max-results": The maximum
  5335. // number of entries to include in this feed.
  5336. func (c *DataRealtimeGetCall) MaxResults(maxResults int64) *DataRealtimeGetCall {
  5337. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5338. return c
  5339. }
  5340. // Sort sets the optional parameter "sort": A comma-separated list of
  5341. // dimensions or metrics that determine the sort order for real time
  5342. // data.
  5343. func (c *DataRealtimeGetCall) Sort(sort string) *DataRealtimeGetCall {
  5344. c.urlParams_.Set("sort", sort)
  5345. return c
  5346. }
  5347. // Fields allows partial responses to be retrieved. See
  5348. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5349. // for more information.
  5350. func (c *DataRealtimeGetCall) Fields(s ...googleapi.Field) *DataRealtimeGetCall {
  5351. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5352. return c
  5353. }
  5354. // IfNoneMatch sets the optional parameter which makes the operation
  5355. // fail if the object's ETag matches the given value. This is useful for
  5356. // getting updates only after the object has changed since the last
  5357. // request. Use googleapi.IsNotModified to check whether the response
  5358. // error from Do is the result of In-None-Match.
  5359. func (c *DataRealtimeGetCall) IfNoneMatch(entityTag string) *DataRealtimeGetCall {
  5360. c.ifNoneMatch_ = entityTag
  5361. return c
  5362. }
  5363. // Context sets the context to be used in this call's Do method. Any
  5364. // pending HTTP request will be aborted if the provided context is
  5365. // canceled.
  5366. func (c *DataRealtimeGetCall) Context(ctx context.Context) *DataRealtimeGetCall {
  5367. c.ctx_ = ctx
  5368. return c
  5369. }
  5370. // Header returns an http.Header that can be modified by the caller to
  5371. // add HTTP headers to the request.
  5372. func (c *DataRealtimeGetCall) Header() http.Header {
  5373. if c.header_ == nil {
  5374. c.header_ = make(http.Header)
  5375. }
  5376. return c.header_
  5377. }
  5378. func (c *DataRealtimeGetCall) doRequest(alt string) (*http.Response, error) {
  5379. reqHeaders := make(http.Header)
  5380. for k, v := range c.header_ {
  5381. reqHeaders[k] = v
  5382. }
  5383. reqHeaders.Set("User-Agent", c.s.userAgent())
  5384. if c.ifNoneMatch_ != "" {
  5385. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5386. }
  5387. var body io.Reader = nil
  5388. c.urlParams_.Set("alt", alt)
  5389. c.urlParams_.Set("prettyPrint", "false")
  5390. urls := googleapi.ResolveRelative(c.s.BasePath, "data/realtime")
  5391. urls += "?" + c.urlParams_.Encode()
  5392. req, err := http.NewRequest("GET", urls, body)
  5393. if err != nil {
  5394. return nil, err
  5395. }
  5396. req.Header = reqHeaders
  5397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5398. }
  5399. // Do executes the "analytics.data.realtime.get" call.
  5400. // Exactly one of *RealtimeData or error will be non-nil. Any non-2xx
  5401. // status code is an error. Response headers are in either
  5402. // *RealtimeData.ServerResponse.Header or (if a response was returned at
  5403. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5404. // to check whether the returned error was because
  5405. // http.StatusNotModified was returned.
  5406. func (c *DataRealtimeGetCall) Do(opts ...googleapi.CallOption) (*RealtimeData, error) {
  5407. gensupport.SetOptions(c.urlParams_, opts...)
  5408. res, err := c.doRequest("json")
  5409. if res != nil && res.StatusCode == http.StatusNotModified {
  5410. if res.Body != nil {
  5411. res.Body.Close()
  5412. }
  5413. return nil, &googleapi.Error{
  5414. Code: res.StatusCode,
  5415. Header: res.Header,
  5416. }
  5417. }
  5418. if err != nil {
  5419. return nil, err
  5420. }
  5421. defer googleapi.CloseBody(res)
  5422. if err := googleapi.CheckResponse(res); err != nil {
  5423. return nil, err
  5424. }
  5425. ret := &RealtimeData{
  5426. ServerResponse: googleapi.ServerResponse{
  5427. Header: res.Header,
  5428. HTTPStatusCode: res.StatusCode,
  5429. },
  5430. }
  5431. target := &ret
  5432. if err := gensupport.DecodeResponse(target, res); err != nil {
  5433. return nil, err
  5434. }
  5435. return ret, nil
  5436. // {
  5437. // "description": "Returns real time data for a view (profile).",
  5438. // "httpMethod": "GET",
  5439. // "id": "analytics.data.realtime.get",
  5440. // "parameterOrder": [
  5441. // "ids",
  5442. // "metrics"
  5443. // ],
  5444. // "parameters": {
  5445. // "dimensions": {
  5446. // "description": "A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'.",
  5447. // "location": "query",
  5448. // "pattern": "(ga:.+)|(rt:.+)",
  5449. // "type": "string"
  5450. // },
  5451. // "filters": {
  5452. // "description": "A comma-separated list of dimension or metric filters to be applied to real time data.",
  5453. // "location": "query",
  5454. // "pattern": "(ga:.+)|(rt:.+)",
  5455. // "type": "string"
  5456. // },
  5457. // "ids": {
  5458. // "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.",
  5459. // "location": "query",
  5460. // "pattern": "ga:[0-9]+",
  5461. // "required": true,
  5462. // "type": "string"
  5463. // },
  5464. // "max-results": {
  5465. // "description": "The maximum number of entries to include in this feed.",
  5466. // "format": "int32",
  5467. // "location": "query",
  5468. // "type": "integer"
  5469. // },
  5470. // "metrics": {
  5471. // "description": "A comma-separated list of real time metrics. E.g., 'rt:activeUsers'. At least one metric must be specified.",
  5472. // "location": "query",
  5473. // "pattern": "(ga:.+)|(rt:.+)",
  5474. // "required": true,
  5475. // "type": "string"
  5476. // },
  5477. // "sort": {
  5478. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for real time data.",
  5479. // "location": "query",
  5480. // "pattern": "(-)?((ga:.+)|(rt:.+))",
  5481. // "type": "string"
  5482. // }
  5483. // },
  5484. // "path": "data/realtime",
  5485. // "response": {
  5486. // "$ref": "RealtimeData"
  5487. // },
  5488. // "scopes": [
  5489. // "https://www.googleapis.com/auth/analytics",
  5490. // "https://www.googleapis.com/auth/analytics.readonly"
  5491. // ]
  5492. // }
  5493. }
  5494. // method id "analytics.management.accountSummaries.list":
  5495. type ManagementAccountSummariesListCall struct {
  5496. s *Service
  5497. urlParams_ gensupport.URLParams
  5498. ifNoneMatch_ string
  5499. ctx_ context.Context
  5500. header_ http.Header
  5501. }
  5502. // List: Lists account summaries (lightweight tree comprised of
  5503. // accounts/properties/profiles) to which the user has access.
  5504. func (r *ManagementAccountSummariesService) List() *ManagementAccountSummariesListCall {
  5505. c := &ManagementAccountSummariesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5506. return c
  5507. }
  5508. // MaxResults sets the optional parameter "max-results": The maximum
  5509. // number of account summaries to include in this response, where the
  5510. // largest acceptable value is 1000.
  5511. func (c *ManagementAccountSummariesListCall) MaxResults(maxResults int64) *ManagementAccountSummariesListCall {
  5512. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5513. return c
  5514. }
  5515. // StartIndex sets the optional parameter "start-index": An index of the
  5516. // first entity to retrieve. Use this parameter as a pagination
  5517. // mechanism along with the max-results parameter.
  5518. func (c *ManagementAccountSummariesListCall) StartIndex(startIndex int64) *ManagementAccountSummariesListCall {
  5519. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5520. return c
  5521. }
  5522. // Fields allows partial responses to be retrieved. See
  5523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5524. // for more information.
  5525. func (c *ManagementAccountSummariesListCall) Fields(s ...googleapi.Field) *ManagementAccountSummariesListCall {
  5526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5527. return c
  5528. }
  5529. // IfNoneMatch sets the optional parameter which makes the operation
  5530. // fail if the object's ETag matches the given value. This is useful for
  5531. // getting updates only after the object has changed since the last
  5532. // request. Use googleapi.IsNotModified to check whether the response
  5533. // error from Do is the result of In-None-Match.
  5534. func (c *ManagementAccountSummariesListCall) IfNoneMatch(entityTag string) *ManagementAccountSummariesListCall {
  5535. c.ifNoneMatch_ = entityTag
  5536. return c
  5537. }
  5538. // Context sets the context to be used in this call's Do method. Any
  5539. // pending HTTP request will be aborted if the provided context is
  5540. // canceled.
  5541. func (c *ManagementAccountSummariesListCall) Context(ctx context.Context) *ManagementAccountSummariesListCall {
  5542. c.ctx_ = ctx
  5543. return c
  5544. }
  5545. // Header returns an http.Header that can be modified by the caller to
  5546. // add HTTP headers to the request.
  5547. func (c *ManagementAccountSummariesListCall) Header() http.Header {
  5548. if c.header_ == nil {
  5549. c.header_ = make(http.Header)
  5550. }
  5551. return c.header_
  5552. }
  5553. func (c *ManagementAccountSummariesListCall) doRequest(alt string) (*http.Response, error) {
  5554. reqHeaders := make(http.Header)
  5555. for k, v := range c.header_ {
  5556. reqHeaders[k] = v
  5557. }
  5558. reqHeaders.Set("User-Agent", c.s.userAgent())
  5559. if c.ifNoneMatch_ != "" {
  5560. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5561. }
  5562. var body io.Reader = nil
  5563. c.urlParams_.Set("alt", alt)
  5564. c.urlParams_.Set("prettyPrint", "false")
  5565. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accountSummaries")
  5566. urls += "?" + c.urlParams_.Encode()
  5567. req, err := http.NewRequest("GET", urls, body)
  5568. if err != nil {
  5569. return nil, err
  5570. }
  5571. req.Header = reqHeaders
  5572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5573. }
  5574. // Do executes the "analytics.management.accountSummaries.list" call.
  5575. // Exactly one of *AccountSummaries or error will be non-nil. Any
  5576. // non-2xx status code is an error. Response headers are in either
  5577. // *AccountSummaries.ServerResponse.Header or (if a response was
  5578. // returned at all) in error.(*googleapi.Error).Header. Use
  5579. // googleapi.IsNotModified to check whether the returned error was
  5580. // because http.StatusNotModified was returned.
  5581. func (c *ManagementAccountSummariesListCall) Do(opts ...googleapi.CallOption) (*AccountSummaries, error) {
  5582. gensupport.SetOptions(c.urlParams_, opts...)
  5583. res, err := c.doRequest("json")
  5584. if res != nil && res.StatusCode == http.StatusNotModified {
  5585. if res.Body != nil {
  5586. res.Body.Close()
  5587. }
  5588. return nil, &googleapi.Error{
  5589. Code: res.StatusCode,
  5590. Header: res.Header,
  5591. }
  5592. }
  5593. if err != nil {
  5594. return nil, err
  5595. }
  5596. defer googleapi.CloseBody(res)
  5597. if err := googleapi.CheckResponse(res); err != nil {
  5598. return nil, err
  5599. }
  5600. ret := &AccountSummaries{
  5601. ServerResponse: googleapi.ServerResponse{
  5602. Header: res.Header,
  5603. HTTPStatusCode: res.StatusCode,
  5604. },
  5605. }
  5606. target := &ret
  5607. if err := gensupport.DecodeResponse(target, res); err != nil {
  5608. return nil, err
  5609. }
  5610. return ret, nil
  5611. // {
  5612. // "description": "Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access.",
  5613. // "httpMethod": "GET",
  5614. // "id": "analytics.management.accountSummaries.list",
  5615. // "parameters": {
  5616. // "max-results": {
  5617. // "description": "The maximum number of account summaries to include in this response, where the largest acceptable value is 1000.",
  5618. // "format": "int32",
  5619. // "location": "query",
  5620. // "type": "integer"
  5621. // },
  5622. // "start-index": {
  5623. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5624. // "format": "int32",
  5625. // "location": "query",
  5626. // "minimum": "1",
  5627. // "type": "integer"
  5628. // }
  5629. // },
  5630. // "path": "management/accountSummaries",
  5631. // "response": {
  5632. // "$ref": "AccountSummaries"
  5633. // },
  5634. // "scopes": [
  5635. // "https://www.googleapis.com/auth/analytics.edit",
  5636. // "https://www.googleapis.com/auth/analytics.readonly"
  5637. // ]
  5638. // }
  5639. }
  5640. // method id "analytics.management.accountUserLinks.delete":
  5641. type ManagementAccountUserLinksDeleteCall struct {
  5642. s *Service
  5643. accountId string
  5644. linkId string
  5645. urlParams_ gensupport.URLParams
  5646. ctx_ context.Context
  5647. header_ http.Header
  5648. }
  5649. // Delete: Removes a user from the given account.
  5650. func (r *ManagementAccountUserLinksService) Delete(accountId string, linkId string) *ManagementAccountUserLinksDeleteCall {
  5651. c := &ManagementAccountUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5652. c.accountId = accountId
  5653. c.linkId = linkId
  5654. return c
  5655. }
  5656. // Fields allows partial responses to be retrieved. See
  5657. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5658. // for more information.
  5659. func (c *ManagementAccountUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksDeleteCall {
  5660. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5661. return c
  5662. }
  5663. // Context sets the context to be used in this call's Do method. Any
  5664. // pending HTTP request will be aborted if the provided context is
  5665. // canceled.
  5666. func (c *ManagementAccountUserLinksDeleteCall) Context(ctx context.Context) *ManagementAccountUserLinksDeleteCall {
  5667. c.ctx_ = ctx
  5668. return c
  5669. }
  5670. // Header returns an http.Header that can be modified by the caller to
  5671. // add HTTP headers to the request.
  5672. func (c *ManagementAccountUserLinksDeleteCall) Header() http.Header {
  5673. if c.header_ == nil {
  5674. c.header_ = make(http.Header)
  5675. }
  5676. return c.header_
  5677. }
  5678. func (c *ManagementAccountUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  5679. reqHeaders := make(http.Header)
  5680. for k, v := range c.header_ {
  5681. reqHeaders[k] = v
  5682. }
  5683. reqHeaders.Set("User-Agent", c.s.userAgent())
  5684. var body io.Reader = nil
  5685. c.urlParams_.Set("alt", alt)
  5686. c.urlParams_.Set("prettyPrint", "false")
  5687. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}")
  5688. urls += "?" + c.urlParams_.Encode()
  5689. req, err := http.NewRequest("DELETE", urls, body)
  5690. if err != nil {
  5691. return nil, err
  5692. }
  5693. req.Header = reqHeaders
  5694. googleapi.Expand(req.URL, map[string]string{
  5695. "accountId": c.accountId,
  5696. "linkId": c.linkId,
  5697. })
  5698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5699. }
  5700. // Do executes the "analytics.management.accountUserLinks.delete" call.
  5701. func (c *ManagementAccountUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  5702. gensupport.SetOptions(c.urlParams_, opts...)
  5703. res, err := c.doRequest("json")
  5704. if err != nil {
  5705. return err
  5706. }
  5707. defer googleapi.CloseBody(res)
  5708. if err := googleapi.CheckResponse(res); err != nil {
  5709. return err
  5710. }
  5711. return nil
  5712. // {
  5713. // "description": "Removes a user from the given account.",
  5714. // "httpMethod": "DELETE",
  5715. // "id": "analytics.management.accountUserLinks.delete",
  5716. // "parameterOrder": [
  5717. // "accountId",
  5718. // "linkId"
  5719. // ],
  5720. // "parameters": {
  5721. // "accountId": {
  5722. // "description": "Account ID to delete the user link for.",
  5723. // "location": "path",
  5724. // "required": true,
  5725. // "type": "string"
  5726. // },
  5727. // "linkId": {
  5728. // "description": "Link ID to delete the user link for.",
  5729. // "location": "path",
  5730. // "required": true,
  5731. // "type": "string"
  5732. // }
  5733. // },
  5734. // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}",
  5735. // "scopes": [
  5736. // "https://www.googleapis.com/auth/analytics.manage.users"
  5737. // ]
  5738. // }
  5739. }
  5740. // method id "analytics.management.accountUserLinks.insert":
  5741. type ManagementAccountUserLinksInsertCall struct {
  5742. s *Service
  5743. accountId string
  5744. entityuserlink *EntityUserLink
  5745. urlParams_ gensupport.URLParams
  5746. ctx_ context.Context
  5747. header_ http.Header
  5748. }
  5749. // Insert: Adds a new user to the given account.
  5750. func (r *ManagementAccountUserLinksService) Insert(accountId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksInsertCall {
  5751. c := &ManagementAccountUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5752. c.accountId = accountId
  5753. c.entityuserlink = entityuserlink
  5754. return c
  5755. }
  5756. // Fields allows partial responses to be retrieved. See
  5757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5758. // for more information.
  5759. func (c *ManagementAccountUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksInsertCall {
  5760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5761. return c
  5762. }
  5763. // Context sets the context to be used in this call's Do method. Any
  5764. // pending HTTP request will be aborted if the provided context is
  5765. // canceled.
  5766. func (c *ManagementAccountUserLinksInsertCall) Context(ctx context.Context) *ManagementAccountUserLinksInsertCall {
  5767. c.ctx_ = ctx
  5768. return c
  5769. }
  5770. // Header returns an http.Header that can be modified by the caller to
  5771. // add HTTP headers to the request.
  5772. func (c *ManagementAccountUserLinksInsertCall) Header() http.Header {
  5773. if c.header_ == nil {
  5774. c.header_ = make(http.Header)
  5775. }
  5776. return c.header_
  5777. }
  5778. func (c *ManagementAccountUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  5779. reqHeaders := make(http.Header)
  5780. for k, v := range c.header_ {
  5781. reqHeaders[k] = v
  5782. }
  5783. reqHeaders.Set("User-Agent", c.s.userAgent())
  5784. var body io.Reader = nil
  5785. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  5786. if err != nil {
  5787. return nil, err
  5788. }
  5789. reqHeaders.Set("Content-Type", "application/json")
  5790. c.urlParams_.Set("alt", alt)
  5791. c.urlParams_.Set("prettyPrint", "false")
  5792. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks")
  5793. urls += "?" + c.urlParams_.Encode()
  5794. req, err := http.NewRequest("POST", urls, body)
  5795. if err != nil {
  5796. return nil, err
  5797. }
  5798. req.Header = reqHeaders
  5799. googleapi.Expand(req.URL, map[string]string{
  5800. "accountId": c.accountId,
  5801. })
  5802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5803. }
  5804. // Do executes the "analytics.management.accountUserLinks.insert" call.
  5805. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  5806. // status code is an error. Response headers are in either
  5807. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  5808. // at all) in error.(*googleapi.Error).Header. Use
  5809. // googleapi.IsNotModified to check whether the returned error was
  5810. // because http.StatusNotModified was returned.
  5811. func (c *ManagementAccountUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  5812. gensupport.SetOptions(c.urlParams_, opts...)
  5813. res, err := c.doRequest("json")
  5814. if res != nil && res.StatusCode == http.StatusNotModified {
  5815. if res.Body != nil {
  5816. res.Body.Close()
  5817. }
  5818. return nil, &googleapi.Error{
  5819. Code: res.StatusCode,
  5820. Header: res.Header,
  5821. }
  5822. }
  5823. if err != nil {
  5824. return nil, err
  5825. }
  5826. defer googleapi.CloseBody(res)
  5827. if err := googleapi.CheckResponse(res); err != nil {
  5828. return nil, err
  5829. }
  5830. ret := &EntityUserLink{
  5831. ServerResponse: googleapi.ServerResponse{
  5832. Header: res.Header,
  5833. HTTPStatusCode: res.StatusCode,
  5834. },
  5835. }
  5836. target := &ret
  5837. if err := gensupport.DecodeResponse(target, res); err != nil {
  5838. return nil, err
  5839. }
  5840. return ret, nil
  5841. // {
  5842. // "description": "Adds a new user to the given account.",
  5843. // "httpMethod": "POST",
  5844. // "id": "analytics.management.accountUserLinks.insert",
  5845. // "parameterOrder": [
  5846. // "accountId"
  5847. // ],
  5848. // "parameters": {
  5849. // "accountId": {
  5850. // "description": "Account ID to create the user link for.",
  5851. // "location": "path",
  5852. // "required": true,
  5853. // "type": "string"
  5854. // }
  5855. // },
  5856. // "path": "management/accounts/{accountId}/entityUserLinks",
  5857. // "request": {
  5858. // "$ref": "EntityUserLink"
  5859. // },
  5860. // "response": {
  5861. // "$ref": "EntityUserLink"
  5862. // },
  5863. // "scopes": [
  5864. // "https://www.googleapis.com/auth/analytics.manage.users"
  5865. // ]
  5866. // }
  5867. }
  5868. // method id "analytics.management.accountUserLinks.list":
  5869. type ManagementAccountUserLinksListCall struct {
  5870. s *Service
  5871. accountId string
  5872. urlParams_ gensupport.URLParams
  5873. ifNoneMatch_ string
  5874. ctx_ context.Context
  5875. header_ http.Header
  5876. }
  5877. // List: Lists account-user links for a given account.
  5878. func (r *ManagementAccountUserLinksService) List(accountId string) *ManagementAccountUserLinksListCall {
  5879. c := &ManagementAccountUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5880. c.accountId = accountId
  5881. return c
  5882. }
  5883. // MaxResults sets the optional parameter "max-results": The maximum
  5884. // number of account-user links to include in this response.
  5885. func (c *ManagementAccountUserLinksListCall) MaxResults(maxResults int64) *ManagementAccountUserLinksListCall {
  5886. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5887. return c
  5888. }
  5889. // StartIndex sets the optional parameter "start-index": An index of the
  5890. // first account-user link to retrieve. Use this parameter as a
  5891. // pagination mechanism along with the max-results parameter.
  5892. func (c *ManagementAccountUserLinksListCall) StartIndex(startIndex int64) *ManagementAccountUserLinksListCall {
  5893. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5894. return c
  5895. }
  5896. // Fields allows partial responses to be retrieved. See
  5897. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5898. // for more information.
  5899. func (c *ManagementAccountUserLinksListCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksListCall {
  5900. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5901. return c
  5902. }
  5903. // IfNoneMatch sets the optional parameter which makes the operation
  5904. // fail if the object's ETag matches the given value. This is useful for
  5905. // getting updates only after the object has changed since the last
  5906. // request. Use googleapi.IsNotModified to check whether the response
  5907. // error from Do is the result of In-None-Match.
  5908. func (c *ManagementAccountUserLinksListCall) IfNoneMatch(entityTag string) *ManagementAccountUserLinksListCall {
  5909. c.ifNoneMatch_ = entityTag
  5910. return c
  5911. }
  5912. // Context sets the context to be used in this call's Do method. Any
  5913. // pending HTTP request will be aborted if the provided context is
  5914. // canceled.
  5915. func (c *ManagementAccountUserLinksListCall) Context(ctx context.Context) *ManagementAccountUserLinksListCall {
  5916. c.ctx_ = ctx
  5917. return c
  5918. }
  5919. // Header returns an http.Header that can be modified by the caller to
  5920. // add HTTP headers to the request.
  5921. func (c *ManagementAccountUserLinksListCall) Header() http.Header {
  5922. if c.header_ == nil {
  5923. c.header_ = make(http.Header)
  5924. }
  5925. return c.header_
  5926. }
  5927. func (c *ManagementAccountUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  5928. reqHeaders := make(http.Header)
  5929. for k, v := range c.header_ {
  5930. reqHeaders[k] = v
  5931. }
  5932. reqHeaders.Set("User-Agent", c.s.userAgent())
  5933. if c.ifNoneMatch_ != "" {
  5934. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5935. }
  5936. var body io.Reader = nil
  5937. c.urlParams_.Set("alt", alt)
  5938. c.urlParams_.Set("prettyPrint", "false")
  5939. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks")
  5940. urls += "?" + c.urlParams_.Encode()
  5941. req, err := http.NewRequest("GET", urls, body)
  5942. if err != nil {
  5943. return nil, err
  5944. }
  5945. req.Header = reqHeaders
  5946. googleapi.Expand(req.URL, map[string]string{
  5947. "accountId": c.accountId,
  5948. })
  5949. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5950. }
  5951. // Do executes the "analytics.management.accountUserLinks.list" call.
  5952. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  5953. // status code is an error. Response headers are in either
  5954. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  5955. // at all) in error.(*googleapi.Error).Header. Use
  5956. // googleapi.IsNotModified to check whether the returned error was
  5957. // because http.StatusNotModified was returned.
  5958. func (c *ManagementAccountUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  5959. gensupport.SetOptions(c.urlParams_, opts...)
  5960. res, err := c.doRequest("json")
  5961. if res != nil && res.StatusCode == http.StatusNotModified {
  5962. if res.Body != nil {
  5963. res.Body.Close()
  5964. }
  5965. return nil, &googleapi.Error{
  5966. Code: res.StatusCode,
  5967. Header: res.Header,
  5968. }
  5969. }
  5970. if err != nil {
  5971. return nil, err
  5972. }
  5973. defer googleapi.CloseBody(res)
  5974. if err := googleapi.CheckResponse(res); err != nil {
  5975. return nil, err
  5976. }
  5977. ret := &EntityUserLinks{
  5978. ServerResponse: googleapi.ServerResponse{
  5979. Header: res.Header,
  5980. HTTPStatusCode: res.StatusCode,
  5981. },
  5982. }
  5983. target := &ret
  5984. if err := gensupport.DecodeResponse(target, res); err != nil {
  5985. return nil, err
  5986. }
  5987. return ret, nil
  5988. // {
  5989. // "description": "Lists account-user links for a given account.",
  5990. // "httpMethod": "GET",
  5991. // "id": "analytics.management.accountUserLinks.list",
  5992. // "parameterOrder": [
  5993. // "accountId"
  5994. // ],
  5995. // "parameters": {
  5996. // "accountId": {
  5997. // "description": "Account ID to retrieve the user links for.",
  5998. // "location": "path",
  5999. // "required": true,
  6000. // "type": "string"
  6001. // },
  6002. // "max-results": {
  6003. // "description": "The maximum number of account-user links to include in this response.",
  6004. // "format": "int32",
  6005. // "location": "query",
  6006. // "type": "integer"
  6007. // },
  6008. // "start-index": {
  6009. // "description": "An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  6010. // "format": "int32",
  6011. // "location": "query",
  6012. // "minimum": "1",
  6013. // "type": "integer"
  6014. // }
  6015. // },
  6016. // "path": "management/accounts/{accountId}/entityUserLinks",
  6017. // "response": {
  6018. // "$ref": "EntityUserLinks"
  6019. // },
  6020. // "scopes": [
  6021. // "https://www.googleapis.com/auth/analytics.manage.users",
  6022. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  6023. // ]
  6024. // }
  6025. }
  6026. // method id "analytics.management.accountUserLinks.update":
  6027. type ManagementAccountUserLinksUpdateCall struct {
  6028. s *Service
  6029. accountId string
  6030. linkId string
  6031. entityuserlink *EntityUserLink
  6032. urlParams_ gensupport.URLParams
  6033. ctx_ context.Context
  6034. header_ http.Header
  6035. }
  6036. // Update: Updates permissions for an existing user on the given
  6037. // account.
  6038. func (r *ManagementAccountUserLinksService) Update(accountId string, linkId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksUpdateCall {
  6039. c := &ManagementAccountUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6040. c.accountId = accountId
  6041. c.linkId = linkId
  6042. c.entityuserlink = entityuserlink
  6043. return c
  6044. }
  6045. // Fields allows partial responses to be retrieved. See
  6046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6047. // for more information.
  6048. func (c *ManagementAccountUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksUpdateCall {
  6049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6050. return c
  6051. }
  6052. // Context sets the context to be used in this call's Do method. Any
  6053. // pending HTTP request will be aborted if the provided context is
  6054. // canceled.
  6055. func (c *ManagementAccountUserLinksUpdateCall) Context(ctx context.Context) *ManagementAccountUserLinksUpdateCall {
  6056. c.ctx_ = ctx
  6057. return c
  6058. }
  6059. // Header returns an http.Header that can be modified by the caller to
  6060. // add HTTP headers to the request.
  6061. func (c *ManagementAccountUserLinksUpdateCall) Header() http.Header {
  6062. if c.header_ == nil {
  6063. c.header_ = make(http.Header)
  6064. }
  6065. return c.header_
  6066. }
  6067. func (c *ManagementAccountUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  6068. reqHeaders := make(http.Header)
  6069. for k, v := range c.header_ {
  6070. reqHeaders[k] = v
  6071. }
  6072. reqHeaders.Set("User-Agent", c.s.userAgent())
  6073. var body io.Reader = nil
  6074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  6075. if err != nil {
  6076. return nil, err
  6077. }
  6078. reqHeaders.Set("Content-Type", "application/json")
  6079. c.urlParams_.Set("alt", alt)
  6080. c.urlParams_.Set("prettyPrint", "false")
  6081. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}")
  6082. urls += "?" + c.urlParams_.Encode()
  6083. req, err := http.NewRequest("PUT", urls, body)
  6084. if err != nil {
  6085. return nil, err
  6086. }
  6087. req.Header = reqHeaders
  6088. googleapi.Expand(req.URL, map[string]string{
  6089. "accountId": c.accountId,
  6090. "linkId": c.linkId,
  6091. })
  6092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6093. }
  6094. // Do executes the "analytics.management.accountUserLinks.update" call.
  6095. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  6096. // status code is an error. Response headers are in either
  6097. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  6098. // at all) in error.(*googleapi.Error).Header. Use
  6099. // googleapi.IsNotModified to check whether the returned error was
  6100. // because http.StatusNotModified was returned.
  6101. func (c *ManagementAccountUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  6102. gensupport.SetOptions(c.urlParams_, opts...)
  6103. res, err := c.doRequest("json")
  6104. if res != nil && res.StatusCode == http.StatusNotModified {
  6105. if res.Body != nil {
  6106. res.Body.Close()
  6107. }
  6108. return nil, &googleapi.Error{
  6109. Code: res.StatusCode,
  6110. Header: res.Header,
  6111. }
  6112. }
  6113. if err != nil {
  6114. return nil, err
  6115. }
  6116. defer googleapi.CloseBody(res)
  6117. if err := googleapi.CheckResponse(res); err != nil {
  6118. return nil, err
  6119. }
  6120. ret := &EntityUserLink{
  6121. ServerResponse: googleapi.ServerResponse{
  6122. Header: res.Header,
  6123. HTTPStatusCode: res.StatusCode,
  6124. },
  6125. }
  6126. target := &ret
  6127. if err := gensupport.DecodeResponse(target, res); err != nil {
  6128. return nil, err
  6129. }
  6130. return ret, nil
  6131. // {
  6132. // "description": "Updates permissions for an existing user on the given account.",
  6133. // "httpMethod": "PUT",
  6134. // "id": "analytics.management.accountUserLinks.update",
  6135. // "parameterOrder": [
  6136. // "accountId",
  6137. // "linkId"
  6138. // ],
  6139. // "parameters": {
  6140. // "accountId": {
  6141. // "description": "Account ID to update the account-user link for.",
  6142. // "location": "path",
  6143. // "required": true,
  6144. // "type": "string"
  6145. // },
  6146. // "linkId": {
  6147. // "description": "Link ID to update the account-user link for.",
  6148. // "location": "path",
  6149. // "required": true,
  6150. // "type": "string"
  6151. // }
  6152. // },
  6153. // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}",
  6154. // "request": {
  6155. // "$ref": "EntityUserLink"
  6156. // },
  6157. // "response": {
  6158. // "$ref": "EntityUserLink"
  6159. // },
  6160. // "scopes": [
  6161. // "https://www.googleapis.com/auth/analytics.manage.users"
  6162. // ]
  6163. // }
  6164. }
  6165. // method id "analytics.management.accounts.list":
  6166. type ManagementAccountsListCall struct {
  6167. s *Service
  6168. urlParams_ gensupport.URLParams
  6169. ifNoneMatch_ string
  6170. ctx_ context.Context
  6171. header_ http.Header
  6172. }
  6173. // List: Lists all accounts to which the user has access.
  6174. func (r *ManagementAccountsService) List() *ManagementAccountsListCall {
  6175. c := &ManagementAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6176. return c
  6177. }
  6178. // MaxResults sets the optional parameter "max-results": The maximum
  6179. // number of accounts to include in this response.
  6180. func (c *ManagementAccountsListCall) MaxResults(maxResults int64) *ManagementAccountsListCall {
  6181. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6182. return c
  6183. }
  6184. // StartIndex sets the optional parameter "start-index": An index of the
  6185. // first account to retrieve. Use this parameter as a pagination
  6186. // mechanism along with the max-results parameter.
  6187. func (c *ManagementAccountsListCall) StartIndex(startIndex int64) *ManagementAccountsListCall {
  6188. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6189. return c
  6190. }
  6191. // Fields allows partial responses to be retrieved. See
  6192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6193. // for more information.
  6194. func (c *ManagementAccountsListCall) Fields(s ...googleapi.Field) *ManagementAccountsListCall {
  6195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6196. return c
  6197. }
  6198. // IfNoneMatch sets the optional parameter which makes the operation
  6199. // fail if the object's ETag matches the given value. This is useful for
  6200. // getting updates only after the object has changed since the last
  6201. // request. Use googleapi.IsNotModified to check whether the response
  6202. // error from Do is the result of In-None-Match.
  6203. func (c *ManagementAccountsListCall) IfNoneMatch(entityTag string) *ManagementAccountsListCall {
  6204. c.ifNoneMatch_ = entityTag
  6205. return c
  6206. }
  6207. // Context sets the context to be used in this call's Do method. Any
  6208. // pending HTTP request will be aborted if the provided context is
  6209. // canceled.
  6210. func (c *ManagementAccountsListCall) Context(ctx context.Context) *ManagementAccountsListCall {
  6211. c.ctx_ = ctx
  6212. return c
  6213. }
  6214. // Header returns an http.Header that can be modified by the caller to
  6215. // add HTTP headers to the request.
  6216. func (c *ManagementAccountsListCall) Header() http.Header {
  6217. if c.header_ == nil {
  6218. c.header_ = make(http.Header)
  6219. }
  6220. return c.header_
  6221. }
  6222. func (c *ManagementAccountsListCall) doRequest(alt string) (*http.Response, error) {
  6223. reqHeaders := make(http.Header)
  6224. for k, v := range c.header_ {
  6225. reqHeaders[k] = v
  6226. }
  6227. reqHeaders.Set("User-Agent", c.s.userAgent())
  6228. if c.ifNoneMatch_ != "" {
  6229. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6230. }
  6231. var body io.Reader = nil
  6232. c.urlParams_.Set("alt", alt)
  6233. c.urlParams_.Set("prettyPrint", "false")
  6234. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts")
  6235. urls += "?" + c.urlParams_.Encode()
  6236. req, err := http.NewRequest("GET", urls, body)
  6237. if err != nil {
  6238. return nil, err
  6239. }
  6240. req.Header = reqHeaders
  6241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6242. }
  6243. // Do executes the "analytics.management.accounts.list" call.
  6244. // Exactly one of *Accounts or error will be non-nil. Any non-2xx status
  6245. // code is an error. Response headers are in either
  6246. // *Accounts.ServerResponse.Header or (if a response was returned at
  6247. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6248. // to check whether the returned error was because
  6249. // http.StatusNotModified was returned.
  6250. func (c *ManagementAccountsListCall) Do(opts ...googleapi.CallOption) (*Accounts, error) {
  6251. gensupport.SetOptions(c.urlParams_, opts...)
  6252. res, err := c.doRequest("json")
  6253. if res != nil && res.StatusCode == http.StatusNotModified {
  6254. if res.Body != nil {
  6255. res.Body.Close()
  6256. }
  6257. return nil, &googleapi.Error{
  6258. Code: res.StatusCode,
  6259. Header: res.Header,
  6260. }
  6261. }
  6262. if err != nil {
  6263. return nil, err
  6264. }
  6265. defer googleapi.CloseBody(res)
  6266. if err := googleapi.CheckResponse(res); err != nil {
  6267. return nil, err
  6268. }
  6269. ret := &Accounts{
  6270. ServerResponse: googleapi.ServerResponse{
  6271. Header: res.Header,
  6272. HTTPStatusCode: res.StatusCode,
  6273. },
  6274. }
  6275. target := &ret
  6276. if err := gensupport.DecodeResponse(target, res); err != nil {
  6277. return nil, err
  6278. }
  6279. return ret, nil
  6280. // {
  6281. // "description": "Lists all accounts to which the user has access.",
  6282. // "httpMethod": "GET",
  6283. // "id": "analytics.management.accounts.list",
  6284. // "parameters": {
  6285. // "max-results": {
  6286. // "description": "The maximum number of accounts to include in this response.",
  6287. // "format": "int32",
  6288. // "location": "query",
  6289. // "type": "integer"
  6290. // },
  6291. // "start-index": {
  6292. // "description": "An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  6293. // "format": "int32",
  6294. // "location": "query",
  6295. // "minimum": "1",
  6296. // "type": "integer"
  6297. // }
  6298. // },
  6299. // "path": "management/accounts",
  6300. // "response": {
  6301. // "$ref": "Accounts"
  6302. // },
  6303. // "scopes": [
  6304. // "https://www.googleapis.com/auth/analytics",
  6305. // "https://www.googleapis.com/auth/analytics.edit",
  6306. // "https://www.googleapis.com/auth/analytics.readonly"
  6307. // ]
  6308. // }
  6309. }
  6310. // method id "analytics.management.clientId.hashClientId":
  6311. type ManagementClientIdHashClientIdCall struct {
  6312. s *Service
  6313. hashclientidrequest *HashClientIdRequest
  6314. urlParams_ gensupport.URLParams
  6315. ctx_ context.Context
  6316. header_ http.Header
  6317. }
  6318. // HashClientId: Hashes the given Client ID.
  6319. func (r *ManagementClientIdService) HashClientId(hashclientidrequest *HashClientIdRequest) *ManagementClientIdHashClientIdCall {
  6320. c := &ManagementClientIdHashClientIdCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6321. c.hashclientidrequest = hashclientidrequest
  6322. return c
  6323. }
  6324. // Fields allows partial responses to be retrieved. See
  6325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6326. // for more information.
  6327. func (c *ManagementClientIdHashClientIdCall) Fields(s ...googleapi.Field) *ManagementClientIdHashClientIdCall {
  6328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6329. return c
  6330. }
  6331. // Context sets the context to be used in this call's Do method. Any
  6332. // pending HTTP request will be aborted if the provided context is
  6333. // canceled.
  6334. func (c *ManagementClientIdHashClientIdCall) Context(ctx context.Context) *ManagementClientIdHashClientIdCall {
  6335. c.ctx_ = ctx
  6336. return c
  6337. }
  6338. // Header returns an http.Header that can be modified by the caller to
  6339. // add HTTP headers to the request.
  6340. func (c *ManagementClientIdHashClientIdCall) Header() http.Header {
  6341. if c.header_ == nil {
  6342. c.header_ = make(http.Header)
  6343. }
  6344. return c.header_
  6345. }
  6346. func (c *ManagementClientIdHashClientIdCall) doRequest(alt string) (*http.Response, error) {
  6347. reqHeaders := make(http.Header)
  6348. for k, v := range c.header_ {
  6349. reqHeaders[k] = v
  6350. }
  6351. reqHeaders.Set("User-Agent", c.s.userAgent())
  6352. var body io.Reader = nil
  6353. body, err := googleapi.WithoutDataWrapper.JSONReader(c.hashclientidrequest)
  6354. if err != nil {
  6355. return nil, err
  6356. }
  6357. reqHeaders.Set("Content-Type", "application/json")
  6358. c.urlParams_.Set("alt", alt)
  6359. c.urlParams_.Set("prettyPrint", "false")
  6360. urls := googleapi.ResolveRelative(c.s.BasePath, "management/clientId:hashClientId")
  6361. urls += "?" + c.urlParams_.Encode()
  6362. req, err := http.NewRequest("POST", urls, body)
  6363. if err != nil {
  6364. return nil, err
  6365. }
  6366. req.Header = reqHeaders
  6367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6368. }
  6369. // Do executes the "analytics.management.clientId.hashClientId" call.
  6370. // Exactly one of *HashClientIdResponse or error will be non-nil. Any
  6371. // non-2xx status code is an error. Response headers are in either
  6372. // *HashClientIdResponse.ServerResponse.Header or (if a response was
  6373. // returned at all) in error.(*googleapi.Error).Header. Use
  6374. // googleapi.IsNotModified to check whether the returned error was
  6375. // because http.StatusNotModified was returned.
  6376. func (c *ManagementClientIdHashClientIdCall) Do(opts ...googleapi.CallOption) (*HashClientIdResponse, error) {
  6377. gensupport.SetOptions(c.urlParams_, opts...)
  6378. res, err := c.doRequest("json")
  6379. if res != nil && res.StatusCode == http.StatusNotModified {
  6380. if res.Body != nil {
  6381. res.Body.Close()
  6382. }
  6383. return nil, &googleapi.Error{
  6384. Code: res.StatusCode,
  6385. Header: res.Header,
  6386. }
  6387. }
  6388. if err != nil {
  6389. return nil, err
  6390. }
  6391. defer googleapi.CloseBody(res)
  6392. if err := googleapi.CheckResponse(res); err != nil {
  6393. return nil, err
  6394. }
  6395. ret := &HashClientIdResponse{
  6396. ServerResponse: googleapi.ServerResponse{
  6397. Header: res.Header,
  6398. HTTPStatusCode: res.StatusCode,
  6399. },
  6400. }
  6401. target := &ret
  6402. if err := gensupport.DecodeResponse(target, res); err != nil {
  6403. return nil, err
  6404. }
  6405. return ret, nil
  6406. // {
  6407. // "description": "Hashes the given Client ID.",
  6408. // "httpMethod": "POST",
  6409. // "id": "analytics.management.clientId.hashClientId",
  6410. // "path": "management/clientId:hashClientId",
  6411. // "request": {
  6412. // "$ref": "HashClientIdRequest"
  6413. // },
  6414. // "response": {
  6415. // "$ref": "HashClientIdResponse"
  6416. // },
  6417. // "scopes": [
  6418. // "https://www.googleapis.com/auth/analytics.edit",
  6419. // "https://www.googleapis.com/auth/analytics.readonly"
  6420. // ]
  6421. // }
  6422. }
  6423. // method id "analytics.management.customDataSources.list":
  6424. type ManagementCustomDataSourcesListCall struct {
  6425. s *Service
  6426. accountId string
  6427. webPropertyId string
  6428. urlParams_ gensupport.URLParams
  6429. ifNoneMatch_ string
  6430. ctx_ context.Context
  6431. header_ http.Header
  6432. }
  6433. // List: List custom data sources to which the user has access.
  6434. func (r *ManagementCustomDataSourcesService) List(accountId string, webPropertyId string) *ManagementCustomDataSourcesListCall {
  6435. c := &ManagementCustomDataSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6436. c.accountId = accountId
  6437. c.webPropertyId = webPropertyId
  6438. return c
  6439. }
  6440. // MaxResults sets the optional parameter "max-results": The maximum
  6441. // number of custom data sources to include in this response.
  6442. func (c *ManagementCustomDataSourcesListCall) MaxResults(maxResults int64) *ManagementCustomDataSourcesListCall {
  6443. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6444. return c
  6445. }
  6446. // StartIndex sets the optional parameter "start-index": A 1-based index
  6447. // of the first custom data source to retrieve. Use this parameter as a
  6448. // pagination mechanism along with the max-results parameter.
  6449. func (c *ManagementCustomDataSourcesListCall) StartIndex(startIndex int64) *ManagementCustomDataSourcesListCall {
  6450. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6451. return c
  6452. }
  6453. // Fields allows partial responses to be retrieved. See
  6454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6455. // for more information.
  6456. func (c *ManagementCustomDataSourcesListCall) Fields(s ...googleapi.Field) *ManagementCustomDataSourcesListCall {
  6457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6458. return c
  6459. }
  6460. // IfNoneMatch sets the optional parameter which makes the operation
  6461. // fail if the object's ETag matches the given value. This is useful for
  6462. // getting updates only after the object has changed since the last
  6463. // request. Use googleapi.IsNotModified to check whether the response
  6464. // error from Do is the result of In-None-Match.
  6465. func (c *ManagementCustomDataSourcesListCall) IfNoneMatch(entityTag string) *ManagementCustomDataSourcesListCall {
  6466. c.ifNoneMatch_ = entityTag
  6467. return c
  6468. }
  6469. // Context sets the context to be used in this call's Do method. Any
  6470. // pending HTTP request will be aborted if the provided context is
  6471. // canceled.
  6472. func (c *ManagementCustomDataSourcesListCall) Context(ctx context.Context) *ManagementCustomDataSourcesListCall {
  6473. c.ctx_ = ctx
  6474. return c
  6475. }
  6476. // Header returns an http.Header that can be modified by the caller to
  6477. // add HTTP headers to the request.
  6478. func (c *ManagementCustomDataSourcesListCall) Header() http.Header {
  6479. if c.header_ == nil {
  6480. c.header_ = make(http.Header)
  6481. }
  6482. return c.header_
  6483. }
  6484. func (c *ManagementCustomDataSourcesListCall) doRequest(alt string) (*http.Response, error) {
  6485. reqHeaders := make(http.Header)
  6486. for k, v := range c.header_ {
  6487. reqHeaders[k] = v
  6488. }
  6489. reqHeaders.Set("User-Agent", c.s.userAgent())
  6490. if c.ifNoneMatch_ != "" {
  6491. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6492. }
  6493. var body io.Reader = nil
  6494. c.urlParams_.Set("alt", alt)
  6495. c.urlParams_.Set("prettyPrint", "false")
  6496. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources")
  6497. urls += "?" + c.urlParams_.Encode()
  6498. req, err := http.NewRequest("GET", urls, body)
  6499. if err != nil {
  6500. return nil, err
  6501. }
  6502. req.Header = reqHeaders
  6503. googleapi.Expand(req.URL, map[string]string{
  6504. "accountId": c.accountId,
  6505. "webPropertyId": c.webPropertyId,
  6506. })
  6507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6508. }
  6509. // Do executes the "analytics.management.customDataSources.list" call.
  6510. // Exactly one of *CustomDataSources or error will be non-nil. Any
  6511. // non-2xx status code is an error. Response headers are in either
  6512. // *CustomDataSources.ServerResponse.Header or (if a response was
  6513. // returned at all) in error.(*googleapi.Error).Header. Use
  6514. // googleapi.IsNotModified to check whether the returned error was
  6515. // because http.StatusNotModified was returned.
  6516. func (c *ManagementCustomDataSourcesListCall) Do(opts ...googleapi.CallOption) (*CustomDataSources, error) {
  6517. gensupport.SetOptions(c.urlParams_, opts...)
  6518. res, err := c.doRequest("json")
  6519. if res != nil && res.StatusCode == http.StatusNotModified {
  6520. if res.Body != nil {
  6521. res.Body.Close()
  6522. }
  6523. return nil, &googleapi.Error{
  6524. Code: res.StatusCode,
  6525. Header: res.Header,
  6526. }
  6527. }
  6528. if err != nil {
  6529. return nil, err
  6530. }
  6531. defer googleapi.CloseBody(res)
  6532. if err := googleapi.CheckResponse(res); err != nil {
  6533. return nil, err
  6534. }
  6535. ret := &CustomDataSources{
  6536. ServerResponse: googleapi.ServerResponse{
  6537. Header: res.Header,
  6538. HTTPStatusCode: res.StatusCode,
  6539. },
  6540. }
  6541. target := &ret
  6542. if err := gensupport.DecodeResponse(target, res); err != nil {
  6543. return nil, err
  6544. }
  6545. return ret, nil
  6546. // {
  6547. // "description": "List custom data sources to which the user has access.",
  6548. // "httpMethod": "GET",
  6549. // "id": "analytics.management.customDataSources.list",
  6550. // "parameterOrder": [
  6551. // "accountId",
  6552. // "webPropertyId"
  6553. // ],
  6554. // "parameters": {
  6555. // "accountId": {
  6556. // "description": "Account Id for the custom data sources to retrieve.",
  6557. // "location": "path",
  6558. // "pattern": "\\d+",
  6559. // "required": true,
  6560. // "type": "string"
  6561. // },
  6562. // "max-results": {
  6563. // "description": "The maximum number of custom data sources to include in this response.",
  6564. // "format": "int32",
  6565. // "location": "query",
  6566. // "minimum": "1",
  6567. // "type": "integer"
  6568. // },
  6569. // "start-index": {
  6570. // "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.",
  6571. // "format": "int32",
  6572. // "location": "query",
  6573. // "minimum": "1",
  6574. // "type": "integer"
  6575. // },
  6576. // "webPropertyId": {
  6577. // "description": "Web property Id for the custom data sources to retrieve.",
  6578. // "location": "path",
  6579. // "pattern": "UA-(\\d+)-(\\d+)",
  6580. // "required": true,
  6581. // "type": "string"
  6582. // }
  6583. // },
  6584. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources",
  6585. // "response": {
  6586. // "$ref": "CustomDataSources"
  6587. // },
  6588. // "scopes": [
  6589. // "https://www.googleapis.com/auth/analytics",
  6590. // "https://www.googleapis.com/auth/analytics.edit",
  6591. // "https://www.googleapis.com/auth/analytics.readonly"
  6592. // ]
  6593. // }
  6594. }
  6595. // method id "analytics.management.customDimensions.get":
  6596. type ManagementCustomDimensionsGetCall struct {
  6597. s *Service
  6598. accountId string
  6599. webPropertyId string
  6600. customDimensionId string
  6601. urlParams_ gensupport.URLParams
  6602. ifNoneMatch_ string
  6603. ctx_ context.Context
  6604. header_ http.Header
  6605. }
  6606. // Get: Get a custom dimension to which the user has access.
  6607. func (r *ManagementCustomDimensionsService) Get(accountId string, webPropertyId string, customDimensionId string) *ManagementCustomDimensionsGetCall {
  6608. c := &ManagementCustomDimensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6609. c.accountId = accountId
  6610. c.webPropertyId = webPropertyId
  6611. c.customDimensionId = customDimensionId
  6612. return c
  6613. }
  6614. // Fields allows partial responses to be retrieved. See
  6615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6616. // for more information.
  6617. func (c *ManagementCustomDimensionsGetCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsGetCall {
  6618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6619. return c
  6620. }
  6621. // IfNoneMatch sets the optional parameter which makes the operation
  6622. // fail if the object's ETag matches the given value. This is useful for
  6623. // getting updates only after the object has changed since the last
  6624. // request. Use googleapi.IsNotModified to check whether the response
  6625. // error from Do is the result of In-None-Match.
  6626. func (c *ManagementCustomDimensionsGetCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsGetCall {
  6627. c.ifNoneMatch_ = entityTag
  6628. return c
  6629. }
  6630. // Context sets the context to be used in this call's Do method. Any
  6631. // pending HTTP request will be aborted if the provided context is
  6632. // canceled.
  6633. func (c *ManagementCustomDimensionsGetCall) Context(ctx context.Context) *ManagementCustomDimensionsGetCall {
  6634. c.ctx_ = ctx
  6635. return c
  6636. }
  6637. // Header returns an http.Header that can be modified by the caller to
  6638. // add HTTP headers to the request.
  6639. func (c *ManagementCustomDimensionsGetCall) Header() http.Header {
  6640. if c.header_ == nil {
  6641. c.header_ = make(http.Header)
  6642. }
  6643. return c.header_
  6644. }
  6645. func (c *ManagementCustomDimensionsGetCall) doRequest(alt string) (*http.Response, error) {
  6646. reqHeaders := make(http.Header)
  6647. for k, v := range c.header_ {
  6648. reqHeaders[k] = v
  6649. }
  6650. reqHeaders.Set("User-Agent", c.s.userAgent())
  6651. if c.ifNoneMatch_ != "" {
  6652. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6653. }
  6654. var body io.Reader = nil
  6655. c.urlParams_.Set("alt", alt)
  6656. c.urlParams_.Set("prettyPrint", "false")
  6657. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  6658. urls += "?" + c.urlParams_.Encode()
  6659. req, err := http.NewRequest("GET", urls, body)
  6660. if err != nil {
  6661. return nil, err
  6662. }
  6663. req.Header = reqHeaders
  6664. googleapi.Expand(req.URL, map[string]string{
  6665. "accountId": c.accountId,
  6666. "webPropertyId": c.webPropertyId,
  6667. "customDimensionId": c.customDimensionId,
  6668. })
  6669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6670. }
  6671. // Do executes the "analytics.management.customDimensions.get" call.
  6672. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  6673. // status code is an error. Response headers are in either
  6674. // *CustomDimension.ServerResponse.Header or (if a response was returned
  6675. // at all) in error.(*googleapi.Error).Header. Use
  6676. // googleapi.IsNotModified to check whether the returned error was
  6677. // because http.StatusNotModified was returned.
  6678. func (c *ManagementCustomDimensionsGetCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  6679. gensupport.SetOptions(c.urlParams_, opts...)
  6680. res, err := c.doRequest("json")
  6681. if res != nil && res.StatusCode == http.StatusNotModified {
  6682. if res.Body != nil {
  6683. res.Body.Close()
  6684. }
  6685. return nil, &googleapi.Error{
  6686. Code: res.StatusCode,
  6687. Header: res.Header,
  6688. }
  6689. }
  6690. if err != nil {
  6691. return nil, err
  6692. }
  6693. defer googleapi.CloseBody(res)
  6694. if err := googleapi.CheckResponse(res); err != nil {
  6695. return nil, err
  6696. }
  6697. ret := &CustomDimension{
  6698. ServerResponse: googleapi.ServerResponse{
  6699. Header: res.Header,
  6700. HTTPStatusCode: res.StatusCode,
  6701. },
  6702. }
  6703. target := &ret
  6704. if err := gensupport.DecodeResponse(target, res); err != nil {
  6705. return nil, err
  6706. }
  6707. return ret, nil
  6708. // {
  6709. // "description": "Get a custom dimension to which the user has access.",
  6710. // "httpMethod": "GET",
  6711. // "id": "analytics.management.customDimensions.get",
  6712. // "parameterOrder": [
  6713. // "accountId",
  6714. // "webPropertyId",
  6715. // "customDimensionId"
  6716. // ],
  6717. // "parameters": {
  6718. // "accountId": {
  6719. // "description": "Account ID for the custom dimension to retrieve.",
  6720. // "location": "path",
  6721. // "required": true,
  6722. // "type": "string"
  6723. // },
  6724. // "customDimensionId": {
  6725. // "description": "The ID of the custom dimension to retrieve.",
  6726. // "location": "path",
  6727. // "required": true,
  6728. // "type": "string"
  6729. // },
  6730. // "webPropertyId": {
  6731. // "description": "Web property ID for the custom dimension to retrieve.",
  6732. // "location": "path",
  6733. // "required": true,
  6734. // "type": "string"
  6735. // }
  6736. // },
  6737. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  6738. // "response": {
  6739. // "$ref": "CustomDimension"
  6740. // },
  6741. // "scopes": [
  6742. // "https://www.googleapis.com/auth/analytics.edit",
  6743. // "https://www.googleapis.com/auth/analytics.readonly"
  6744. // ]
  6745. // }
  6746. }
  6747. // method id "analytics.management.customDimensions.insert":
  6748. type ManagementCustomDimensionsInsertCall struct {
  6749. s *Service
  6750. accountId string
  6751. webPropertyId string
  6752. customdimension *CustomDimension
  6753. urlParams_ gensupport.URLParams
  6754. ctx_ context.Context
  6755. header_ http.Header
  6756. }
  6757. // Insert: Create a new custom dimension.
  6758. func (r *ManagementCustomDimensionsService) Insert(accountId string, webPropertyId string, customdimension *CustomDimension) *ManagementCustomDimensionsInsertCall {
  6759. c := &ManagementCustomDimensionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6760. c.accountId = accountId
  6761. c.webPropertyId = webPropertyId
  6762. c.customdimension = customdimension
  6763. return c
  6764. }
  6765. // Fields allows partial responses to be retrieved. See
  6766. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6767. // for more information.
  6768. func (c *ManagementCustomDimensionsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsInsertCall {
  6769. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6770. return c
  6771. }
  6772. // Context sets the context to be used in this call's Do method. Any
  6773. // pending HTTP request will be aborted if the provided context is
  6774. // canceled.
  6775. func (c *ManagementCustomDimensionsInsertCall) Context(ctx context.Context) *ManagementCustomDimensionsInsertCall {
  6776. c.ctx_ = ctx
  6777. return c
  6778. }
  6779. // Header returns an http.Header that can be modified by the caller to
  6780. // add HTTP headers to the request.
  6781. func (c *ManagementCustomDimensionsInsertCall) Header() http.Header {
  6782. if c.header_ == nil {
  6783. c.header_ = make(http.Header)
  6784. }
  6785. return c.header_
  6786. }
  6787. func (c *ManagementCustomDimensionsInsertCall) doRequest(alt string) (*http.Response, error) {
  6788. reqHeaders := make(http.Header)
  6789. for k, v := range c.header_ {
  6790. reqHeaders[k] = v
  6791. }
  6792. reqHeaders.Set("User-Agent", c.s.userAgent())
  6793. var body io.Reader = nil
  6794. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  6795. if err != nil {
  6796. return nil, err
  6797. }
  6798. reqHeaders.Set("Content-Type", "application/json")
  6799. c.urlParams_.Set("alt", alt)
  6800. c.urlParams_.Set("prettyPrint", "false")
  6801. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions")
  6802. urls += "?" + c.urlParams_.Encode()
  6803. req, err := http.NewRequest("POST", urls, body)
  6804. if err != nil {
  6805. return nil, err
  6806. }
  6807. req.Header = reqHeaders
  6808. googleapi.Expand(req.URL, map[string]string{
  6809. "accountId": c.accountId,
  6810. "webPropertyId": c.webPropertyId,
  6811. })
  6812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6813. }
  6814. // Do executes the "analytics.management.customDimensions.insert" call.
  6815. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  6816. // status code is an error. Response headers are in either
  6817. // *CustomDimension.ServerResponse.Header or (if a response was returned
  6818. // at all) in error.(*googleapi.Error).Header. Use
  6819. // googleapi.IsNotModified to check whether the returned error was
  6820. // because http.StatusNotModified was returned.
  6821. func (c *ManagementCustomDimensionsInsertCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  6822. gensupport.SetOptions(c.urlParams_, opts...)
  6823. res, err := c.doRequest("json")
  6824. if res != nil && res.StatusCode == http.StatusNotModified {
  6825. if res.Body != nil {
  6826. res.Body.Close()
  6827. }
  6828. return nil, &googleapi.Error{
  6829. Code: res.StatusCode,
  6830. Header: res.Header,
  6831. }
  6832. }
  6833. if err != nil {
  6834. return nil, err
  6835. }
  6836. defer googleapi.CloseBody(res)
  6837. if err := googleapi.CheckResponse(res); err != nil {
  6838. return nil, err
  6839. }
  6840. ret := &CustomDimension{
  6841. ServerResponse: googleapi.ServerResponse{
  6842. Header: res.Header,
  6843. HTTPStatusCode: res.StatusCode,
  6844. },
  6845. }
  6846. target := &ret
  6847. if err := gensupport.DecodeResponse(target, res); err != nil {
  6848. return nil, err
  6849. }
  6850. return ret, nil
  6851. // {
  6852. // "description": "Create a new custom dimension.",
  6853. // "httpMethod": "POST",
  6854. // "id": "analytics.management.customDimensions.insert",
  6855. // "parameterOrder": [
  6856. // "accountId",
  6857. // "webPropertyId"
  6858. // ],
  6859. // "parameters": {
  6860. // "accountId": {
  6861. // "description": "Account ID for the custom dimension to create.",
  6862. // "location": "path",
  6863. // "required": true,
  6864. // "type": "string"
  6865. // },
  6866. // "webPropertyId": {
  6867. // "description": "Web property ID for the custom dimension to create.",
  6868. // "location": "path",
  6869. // "required": true,
  6870. // "type": "string"
  6871. // }
  6872. // },
  6873. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions",
  6874. // "request": {
  6875. // "$ref": "CustomDimension"
  6876. // },
  6877. // "response": {
  6878. // "$ref": "CustomDimension"
  6879. // },
  6880. // "scopes": [
  6881. // "https://www.googleapis.com/auth/analytics.edit"
  6882. // ]
  6883. // }
  6884. }
  6885. // method id "analytics.management.customDimensions.list":
  6886. type ManagementCustomDimensionsListCall struct {
  6887. s *Service
  6888. accountId string
  6889. webPropertyId string
  6890. urlParams_ gensupport.URLParams
  6891. ifNoneMatch_ string
  6892. ctx_ context.Context
  6893. header_ http.Header
  6894. }
  6895. // List: Lists custom dimensions to which the user has access.
  6896. func (r *ManagementCustomDimensionsService) List(accountId string, webPropertyId string) *ManagementCustomDimensionsListCall {
  6897. c := &ManagementCustomDimensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6898. c.accountId = accountId
  6899. c.webPropertyId = webPropertyId
  6900. return c
  6901. }
  6902. // MaxResults sets the optional parameter "max-results": The maximum
  6903. // number of custom dimensions to include in this response.
  6904. func (c *ManagementCustomDimensionsListCall) MaxResults(maxResults int64) *ManagementCustomDimensionsListCall {
  6905. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6906. return c
  6907. }
  6908. // StartIndex sets the optional parameter "start-index": An index of the
  6909. // first entity to retrieve. Use this parameter as a pagination
  6910. // mechanism along with the max-results parameter.
  6911. func (c *ManagementCustomDimensionsListCall) StartIndex(startIndex int64) *ManagementCustomDimensionsListCall {
  6912. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6913. return c
  6914. }
  6915. // Fields allows partial responses to be retrieved. See
  6916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6917. // for more information.
  6918. func (c *ManagementCustomDimensionsListCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsListCall {
  6919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6920. return c
  6921. }
  6922. // IfNoneMatch sets the optional parameter which makes the operation
  6923. // fail if the object's ETag matches the given value. This is useful for
  6924. // getting updates only after the object has changed since the last
  6925. // request. Use googleapi.IsNotModified to check whether the response
  6926. // error from Do is the result of In-None-Match.
  6927. func (c *ManagementCustomDimensionsListCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsListCall {
  6928. c.ifNoneMatch_ = entityTag
  6929. return c
  6930. }
  6931. // Context sets the context to be used in this call's Do method. Any
  6932. // pending HTTP request will be aborted if the provided context is
  6933. // canceled.
  6934. func (c *ManagementCustomDimensionsListCall) Context(ctx context.Context) *ManagementCustomDimensionsListCall {
  6935. c.ctx_ = ctx
  6936. return c
  6937. }
  6938. // Header returns an http.Header that can be modified by the caller to
  6939. // add HTTP headers to the request.
  6940. func (c *ManagementCustomDimensionsListCall) Header() http.Header {
  6941. if c.header_ == nil {
  6942. c.header_ = make(http.Header)
  6943. }
  6944. return c.header_
  6945. }
  6946. func (c *ManagementCustomDimensionsListCall) doRequest(alt string) (*http.Response, error) {
  6947. reqHeaders := make(http.Header)
  6948. for k, v := range c.header_ {
  6949. reqHeaders[k] = v
  6950. }
  6951. reqHeaders.Set("User-Agent", c.s.userAgent())
  6952. if c.ifNoneMatch_ != "" {
  6953. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6954. }
  6955. var body io.Reader = nil
  6956. c.urlParams_.Set("alt", alt)
  6957. c.urlParams_.Set("prettyPrint", "false")
  6958. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions")
  6959. urls += "?" + c.urlParams_.Encode()
  6960. req, err := http.NewRequest("GET", urls, body)
  6961. if err != nil {
  6962. return nil, err
  6963. }
  6964. req.Header = reqHeaders
  6965. googleapi.Expand(req.URL, map[string]string{
  6966. "accountId": c.accountId,
  6967. "webPropertyId": c.webPropertyId,
  6968. })
  6969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6970. }
  6971. // Do executes the "analytics.management.customDimensions.list" call.
  6972. // Exactly one of *CustomDimensions or error will be non-nil. Any
  6973. // non-2xx status code is an error. Response headers are in either
  6974. // *CustomDimensions.ServerResponse.Header or (if a response was
  6975. // returned at all) in error.(*googleapi.Error).Header. Use
  6976. // googleapi.IsNotModified to check whether the returned error was
  6977. // because http.StatusNotModified was returned.
  6978. func (c *ManagementCustomDimensionsListCall) Do(opts ...googleapi.CallOption) (*CustomDimensions, error) {
  6979. gensupport.SetOptions(c.urlParams_, opts...)
  6980. res, err := c.doRequest("json")
  6981. if res != nil && res.StatusCode == http.StatusNotModified {
  6982. if res.Body != nil {
  6983. res.Body.Close()
  6984. }
  6985. return nil, &googleapi.Error{
  6986. Code: res.StatusCode,
  6987. Header: res.Header,
  6988. }
  6989. }
  6990. if err != nil {
  6991. return nil, err
  6992. }
  6993. defer googleapi.CloseBody(res)
  6994. if err := googleapi.CheckResponse(res); err != nil {
  6995. return nil, err
  6996. }
  6997. ret := &CustomDimensions{
  6998. ServerResponse: googleapi.ServerResponse{
  6999. Header: res.Header,
  7000. HTTPStatusCode: res.StatusCode,
  7001. },
  7002. }
  7003. target := &ret
  7004. if err := gensupport.DecodeResponse(target, res); err != nil {
  7005. return nil, err
  7006. }
  7007. return ret, nil
  7008. // {
  7009. // "description": "Lists custom dimensions to which the user has access.",
  7010. // "httpMethod": "GET",
  7011. // "id": "analytics.management.customDimensions.list",
  7012. // "parameterOrder": [
  7013. // "accountId",
  7014. // "webPropertyId"
  7015. // ],
  7016. // "parameters": {
  7017. // "accountId": {
  7018. // "description": "Account ID for the custom dimensions to retrieve.",
  7019. // "location": "path",
  7020. // "required": true,
  7021. // "type": "string"
  7022. // },
  7023. // "max-results": {
  7024. // "description": "The maximum number of custom dimensions to include in this response.",
  7025. // "format": "int32",
  7026. // "location": "query",
  7027. // "type": "integer"
  7028. // },
  7029. // "start-index": {
  7030. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  7031. // "format": "int32",
  7032. // "location": "query",
  7033. // "minimum": "1",
  7034. // "type": "integer"
  7035. // },
  7036. // "webPropertyId": {
  7037. // "description": "Web property ID for the custom dimensions to retrieve.",
  7038. // "location": "path",
  7039. // "required": true,
  7040. // "type": "string"
  7041. // }
  7042. // },
  7043. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions",
  7044. // "response": {
  7045. // "$ref": "CustomDimensions"
  7046. // },
  7047. // "scopes": [
  7048. // "https://www.googleapis.com/auth/analytics",
  7049. // "https://www.googleapis.com/auth/analytics.readonly"
  7050. // ]
  7051. // }
  7052. }
  7053. // method id "analytics.management.customDimensions.patch":
  7054. type ManagementCustomDimensionsPatchCall struct {
  7055. s *Service
  7056. accountId string
  7057. webPropertyId string
  7058. customDimensionId string
  7059. customdimension *CustomDimension
  7060. urlParams_ gensupport.URLParams
  7061. ctx_ context.Context
  7062. header_ http.Header
  7063. }
  7064. // Patch: Updates an existing custom dimension. This method supports
  7065. // patch semantics.
  7066. func (r *ManagementCustomDimensionsService) Patch(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsPatchCall {
  7067. c := &ManagementCustomDimensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7068. c.accountId = accountId
  7069. c.webPropertyId = webPropertyId
  7070. c.customDimensionId = customDimensionId
  7071. c.customdimension = customdimension
  7072. return c
  7073. }
  7074. // IgnoreCustomDataSourceLinks sets the optional parameter
  7075. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  7076. // warnings related to the custom dimension being linked to a custom
  7077. // data source / data set.
  7078. func (c *ManagementCustomDimensionsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsPatchCall {
  7079. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  7080. return c
  7081. }
  7082. // Fields allows partial responses to be retrieved. See
  7083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7084. // for more information.
  7085. func (c *ManagementCustomDimensionsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsPatchCall {
  7086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7087. return c
  7088. }
  7089. // Context sets the context to be used in this call's Do method. Any
  7090. // pending HTTP request will be aborted if the provided context is
  7091. // canceled.
  7092. func (c *ManagementCustomDimensionsPatchCall) Context(ctx context.Context) *ManagementCustomDimensionsPatchCall {
  7093. c.ctx_ = ctx
  7094. return c
  7095. }
  7096. // Header returns an http.Header that can be modified by the caller to
  7097. // add HTTP headers to the request.
  7098. func (c *ManagementCustomDimensionsPatchCall) Header() http.Header {
  7099. if c.header_ == nil {
  7100. c.header_ = make(http.Header)
  7101. }
  7102. return c.header_
  7103. }
  7104. func (c *ManagementCustomDimensionsPatchCall) doRequest(alt string) (*http.Response, error) {
  7105. reqHeaders := make(http.Header)
  7106. for k, v := range c.header_ {
  7107. reqHeaders[k] = v
  7108. }
  7109. reqHeaders.Set("User-Agent", c.s.userAgent())
  7110. var body io.Reader = nil
  7111. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  7112. if err != nil {
  7113. return nil, err
  7114. }
  7115. reqHeaders.Set("Content-Type", "application/json")
  7116. c.urlParams_.Set("alt", alt)
  7117. c.urlParams_.Set("prettyPrint", "false")
  7118. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  7119. urls += "?" + c.urlParams_.Encode()
  7120. req, err := http.NewRequest("PATCH", urls, body)
  7121. if err != nil {
  7122. return nil, err
  7123. }
  7124. req.Header = reqHeaders
  7125. googleapi.Expand(req.URL, map[string]string{
  7126. "accountId": c.accountId,
  7127. "webPropertyId": c.webPropertyId,
  7128. "customDimensionId": c.customDimensionId,
  7129. })
  7130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7131. }
  7132. // Do executes the "analytics.management.customDimensions.patch" call.
  7133. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  7134. // status code is an error. Response headers are in either
  7135. // *CustomDimension.ServerResponse.Header or (if a response was returned
  7136. // at all) in error.(*googleapi.Error).Header. Use
  7137. // googleapi.IsNotModified to check whether the returned error was
  7138. // because http.StatusNotModified was returned.
  7139. func (c *ManagementCustomDimensionsPatchCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  7140. gensupport.SetOptions(c.urlParams_, opts...)
  7141. res, err := c.doRequest("json")
  7142. if res != nil && res.StatusCode == http.StatusNotModified {
  7143. if res.Body != nil {
  7144. res.Body.Close()
  7145. }
  7146. return nil, &googleapi.Error{
  7147. Code: res.StatusCode,
  7148. Header: res.Header,
  7149. }
  7150. }
  7151. if err != nil {
  7152. return nil, err
  7153. }
  7154. defer googleapi.CloseBody(res)
  7155. if err := googleapi.CheckResponse(res); err != nil {
  7156. return nil, err
  7157. }
  7158. ret := &CustomDimension{
  7159. ServerResponse: googleapi.ServerResponse{
  7160. Header: res.Header,
  7161. HTTPStatusCode: res.StatusCode,
  7162. },
  7163. }
  7164. target := &ret
  7165. if err := gensupport.DecodeResponse(target, res); err != nil {
  7166. return nil, err
  7167. }
  7168. return ret, nil
  7169. // {
  7170. // "description": "Updates an existing custom dimension. This method supports patch semantics.",
  7171. // "httpMethod": "PATCH",
  7172. // "id": "analytics.management.customDimensions.patch",
  7173. // "parameterOrder": [
  7174. // "accountId",
  7175. // "webPropertyId",
  7176. // "customDimensionId"
  7177. // ],
  7178. // "parameters": {
  7179. // "accountId": {
  7180. // "description": "Account ID for the custom dimension to update.",
  7181. // "location": "path",
  7182. // "required": true,
  7183. // "type": "string"
  7184. // },
  7185. // "customDimensionId": {
  7186. // "description": "Custom dimension ID for the custom dimension to update.",
  7187. // "location": "path",
  7188. // "required": true,
  7189. // "type": "string"
  7190. // },
  7191. // "ignoreCustomDataSourceLinks": {
  7192. // "default": "false",
  7193. // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.",
  7194. // "location": "query",
  7195. // "type": "boolean"
  7196. // },
  7197. // "webPropertyId": {
  7198. // "description": "Web property ID for the custom dimension to update.",
  7199. // "location": "path",
  7200. // "required": true,
  7201. // "type": "string"
  7202. // }
  7203. // },
  7204. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  7205. // "request": {
  7206. // "$ref": "CustomDimension"
  7207. // },
  7208. // "response": {
  7209. // "$ref": "CustomDimension"
  7210. // },
  7211. // "scopes": [
  7212. // "https://www.googleapis.com/auth/analytics.edit"
  7213. // ]
  7214. // }
  7215. }
  7216. // method id "analytics.management.customDimensions.update":
  7217. type ManagementCustomDimensionsUpdateCall struct {
  7218. s *Service
  7219. accountId string
  7220. webPropertyId string
  7221. customDimensionId string
  7222. customdimension *CustomDimension
  7223. urlParams_ gensupport.URLParams
  7224. ctx_ context.Context
  7225. header_ http.Header
  7226. }
  7227. // Update: Updates an existing custom dimension.
  7228. func (r *ManagementCustomDimensionsService) Update(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsUpdateCall {
  7229. c := &ManagementCustomDimensionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7230. c.accountId = accountId
  7231. c.webPropertyId = webPropertyId
  7232. c.customDimensionId = customDimensionId
  7233. c.customdimension = customdimension
  7234. return c
  7235. }
  7236. // IgnoreCustomDataSourceLinks sets the optional parameter
  7237. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  7238. // warnings related to the custom dimension being linked to a custom
  7239. // data source / data set.
  7240. func (c *ManagementCustomDimensionsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsUpdateCall {
  7241. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  7242. return c
  7243. }
  7244. // Fields allows partial responses to be retrieved. See
  7245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7246. // for more information.
  7247. func (c *ManagementCustomDimensionsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsUpdateCall {
  7248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7249. return c
  7250. }
  7251. // Context sets the context to be used in this call's Do method. Any
  7252. // pending HTTP request will be aborted if the provided context is
  7253. // canceled.
  7254. func (c *ManagementCustomDimensionsUpdateCall) Context(ctx context.Context) *ManagementCustomDimensionsUpdateCall {
  7255. c.ctx_ = ctx
  7256. return c
  7257. }
  7258. // Header returns an http.Header that can be modified by the caller to
  7259. // add HTTP headers to the request.
  7260. func (c *ManagementCustomDimensionsUpdateCall) Header() http.Header {
  7261. if c.header_ == nil {
  7262. c.header_ = make(http.Header)
  7263. }
  7264. return c.header_
  7265. }
  7266. func (c *ManagementCustomDimensionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7267. reqHeaders := make(http.Header)
  7268. for k, v := range c.header_ {
  7269. reqHeaders[k] = v
  7270. }
  7271. reqHeaders.Set("User-Agent", c.s.userAgent())
  7272. var body io.Reader = nil
  7273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  7274. if err != nil {
  7275. return nil, err
  7276. }
  7277. reqHeaders.Set("Content-Type", "application/json")
  7278. c.urlParams_.Set("alt", alt)
  7279. c.urlParams_.Set("prettyPrint", "false")
  7280. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  7281. urls += "?" + c.urlParams_.Encode()
  7282. req, err := http.NewRequest("PUT", urls, body)
  7283. if err != nil {
  7284. return nil, err
  7285. }
  7286. req.Header = reqHeaders
  7287. googleapi.Expand(req.URL, map[string]string{
  7288. "accountId": c.accountId,
  7289. "webPropertyId": c.webPropertyId,
  7290. "customDimensionId": c.customDimensionId,
  7291. })
  7292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7293. }
  7294. // Do executes the "analytics.management.customDimensions.update" call.
  7295. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  7296. // status code is an error. Response headers are in either
  7297. // *CustomDimension.ServerResponse.Header or (if a response was returned
  7298. // at all) in error.(*googleapi.Error).Header. Use
  7299. // googleapi.IsNotModified to check whether the returned error was
  7300. // because http.StatusNotModified was returned.
  7301. func (c *ManagementCustomDimensionsUpdateCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  7302. gensupport.SetOptions(c.urlParams_, opts...)
  7303. res, err := c.doRequest("json")
  7304. if res != nil && res.StatusCode == http.StatusNotModified {
  7305. if res.Body != nil {
  7306. res.Body.Close()
  7307. }
  7308. return nil, &googleapi.Error{
  7309. Code: res.StatusCode,
  7310. Header: res.Header,
  7311. }
  7312. }
  7313. if err != nil {
  7314. return nil, err
  7315. }
  7316. defer googleapi.CloseBody(res)
  7317. if err := googleapi.CheckResponse(res); err != nil {
  7318. return nil, err
  7319. }
  7320. ret := &CustomDimension{
  7321. ServerResponse: googleapi.ServerResponse{
  7322. Header: res.Header,
  7323. HTTPStatusCode: res.StatusCode,
  7324. },
  7325. }
  7326. target := &ret
  7327. if err := gensupport.DecodeResponse(target, res); err != nil {
  7328. return nil, err
  7329. }
  7330. return ret, nil
  7331. // {
  7332. // "description": "Updates an existing custom dimension.",
  7333. // "httpMethod": "PUT",
  7334. // "id": "analytics.management.customDimensions.update",
  7335. // "parameterOrder": [
  7336. // "accountId",
  7337. // "webPropertyId",
  7338. // "customDimensionId"
  7339. // ],
  7340. // "parameters": {
  7341. // "accountId": {
  7342. // "description": "Account ID for the custom dimension to update.",
  7343. // "location": "path",
  7344. // "required": true,
  7345. // "type": "string"
  7346. // },
  7347. // "customDimensionId": {
  7348. // "description": "Custom dimension ID for the custom dimension to update.",
  7349. // "location": "path",
  7350. // "required": true,
  7351. // "type": "string"
  7352. // },
  7353. // "ignoreCustomDataSourceLinks": {
  7354. // "default": "false",
  7355. // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.",
  7356. // "location": "query",
  7357. // "type": "boolean"
  7358. // },
  7359. // "webPropertyId": {
  7360. // "description": "Web property ID for the custom dimension to update.",
  7361. // "location": "path",
  7362. // "required": true,
  7363. // "type": "string"
  7364. // }
  7365. // },
  7366. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  7367. // "request": {
  7368. // "$ref": "CustomDimension"
  7369. // },
  7370. // "response": {
  7371. // "$ref": "CustomDimension"
  7372. // },
  7373. // "scopes": [
  7374. // "https://www.googleapis.com/auth/analytics.edit"
  7375. // ]
  7376. // }
  7377. }
  7378. // method id "analytics.management.customMetrics.get":
  7379. type ManagementCustomMetricsGetCall struct {
  7380. s *Service
  7381. accountId string
  7382. webPropertyId string
  7383. customMetricId string
  7384. urlParams_ gensupport.URLParams
  7385. ifNoneMatch_ string
  7386. ctx_ context.Context
  7387. header_ http.Header
  7388. }
  7389. // Get: Get a custom metric to which the user has access.
  7390. func (r *ManagementCustomMetricsService) Get(accountId string, webPropertyId string, customMetricId string) *ManagementCustomMetricsGetCall {
  7391. c := &ManagementCustomMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7392. c.accountId = accountId
  7393. c.webPropertyId = webPropertyId
  7394. c.customMetricId = customMetricId
  7395. return c
  7396. }
  7397. // Fields allows partial responses to be retrieved. See
  7398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7399. // for more information.
  7400. func (c *ManagementCustomMetricsGetCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsGetCall {
  7401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7402. return c
  7403. }
  7404. // IfNoneMatch sets the optional parameter which makes the operation
  7405. // fail if the object's ETag matches the given value. This is useful for
  7406. // getting updates only after the object has changed since the last
  7407. // request. Use googleapi.IsNotModified to check whether the response
  7408. // error from Do is the result of In-None-Match.
  7409. func (c *ManagementCustomMetricsGetCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsGetCall {
  7410. c.ifNoneMatch_ = entityTag
  7411. return c
  7412. }
  7413. // Context sets the context to be used in this call's Do method. Any
  7414. // pending HTTP request will be aborted if the provided context is
  7415. // canceled.
  7416. func (c *ManagementCustomMetricsGetCall) Context(ctx context.Context) *ManagementCustomMetricsGetCall {
  7417. c.ctx_ = ctx
  7418. return c
  7419. }
  7420. // Header returns an http.Header that can be modified by the caller to
  7421. // add HTTP headers to the request.
  7422. func (c *ManagementCustomMetricsGetCall) Header() http.Header {
  7423. if c.header_ == nil {
  7424. c.header_ = make(http.Header)
  7425. }
  7426. return c.header_
  7427. }
  7428. func (c *ManagementCustomMetricsGetCall) doRequest(alt string) (*http.Response, error) {
  7429. reqHeaders := make(http.Header)
  7430. for k, v := range c.header_ {
  7431. reqHeaders[k] = v
  7432. }
  7433. reqHeaders.Set("User-Agent", c.s.userAgent())
  7434. if c.ifNoneMatch_ != "" {
  7435. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7436. }
  7437. var body io.Reader = nil
  7438. c.urlParams_.Set("alt", alt)
  7439. c.urlParams_.Set("prettyPrint", "false")
  7440. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  7441. urls += "?" + c.urlParams_.Encode()
  7442. req, err := http.NewRequest("GET", urls, body)
  7443. if err != nil {
  7444. return nil, err
  7445. }
  7446. req.Header = reqHeaders
  7447. googleapi.Expand(req.URL, map[string]string{
  7448. "accountId": c.accountId,
  7449. "webPropertyId": c.webPropertyId,
  7450. "customMetricId": c.customMetricId,
  7451. })
  7452. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7453. }
  7454. // Do executes the "analytics.management.customMetrics.get" call.
  7455. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7456. // status code is an error. Response headers are in either
  7457. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7458. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7459. // to check whether the returned error was because
  7460. // http.StatusNotModified was returned.
  7461. func (c *ManagementCustomMetricsGetCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7462. gensupport.SetOptions(c.urlParams_, opts...)
  7463. res, err := c.doRequest("json")
  7464. if res != nil && res.StatusCode == http.StatusNotModified {
  7465. if res.Body != nil {
  7466. res.Body.Close()
  7467. }
  7468. return nil, &googleapi.Error{
  7469. Code: res.StatusCode,
  7470. Header: res.Header,
  7471. }
  7472. }
  7473. if err != nil {
  7474. return nil, err
  7475. }
  7476. defer googleapi.CloseBody(res)
  7477. if err := googleapi.CheckResponse(res); err != nil {
  7478. return nil, err
  7479. }
  7480. ret := &CustomMetric{
  7481. ServerResponse: googleapi.ServerResponse{
  7482. Header: res.Header,
  7483. HTTPStatusCode: res.StatusCode,
  7484. },
  7485. }
  7486. target := &ret
  7487. if err := gensupport.DecodeResponse(target, res); err != nil {
  7488. return nil, err
  7489. }
  7490. return ret, nil
  7491. // {
  7492. // "description": "Get a custom metric to which the user has access.",
  7493. // "httpMethod": "GET",
  7494. // "id": "analytics.management.customMetrics.get",
  7495. // "parameterOrder": [
  7496. // "accountId",
  7497. // "webPropertyId",
  7498. // "customMetricId"
  7499. // ],
  7500. // "parameters": {
  7501. // "accountId": {
  7502. // "description": "Account ID for the custom metric to retrieve.",
  7503. // "location": "path",
  7504. // "required": true,
  7505. // "type": "string"
  7506. // },
  7507. // "customMetricId": {
  7508. // "description": "The ID of the custom metric to retrieve.",
  7509. // "location": "path",
  7510. // "required": true,
  7511. // "type": "string"
  7512. // },
  7513. // "webPropertyId": {
  7514. // "description": "Web property ID for the custom metric to retrieve.",
  7515. // "location": "path",
  7516. // "required": true,
  7517. // "type": "string"
  7518. // }
  7519. // },
  7520. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  7521. // "response": {
  7522. // "$ref": "CustomMetric"
  7523. // },
  7524. // "scopes": [
  7525. // "https://www.googleapis.com/auth/analytics.edit",
  7526. // "https://www.googleapis.com/auth/analytics.readonly"
  7527. // ]
  7528. // }
  7529. }
  7530. // method id "analytics.management.customMetrics.insert":
  7531. type ManagementCustomMetricsInsertCall struct {
  7532. s *Service
  7533. accountId string
  7534. webPropertyId string
  7535. custommetric *CustomMetric
  7536. urlParams_ gensupport.URLParams
  7537. ctx_ context.Context
  7538. header_ http.Header
  7539. }
  7540. // Insert: Create a new custom metric.
  7541. func (r *ManagementCustomMetricsService) Insert(accountId string, webPropertyId string, custommetric *CustomMetric) *ManagementCustomMetricsInsertCall {
  7542. c := &ManagementCustomMetricsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7543. c.accountId = accountId
  7544. c.webPropertyId = webPropertyId
  7545. c.custommetric = custommetric
  7546. return c
  7547. }
  7548. // Fields allows partial responses to be retrieved. See
  7549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7550. // for more information.
  7551. func (c *ManagementCustomMetricsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsInsertCall {
  7552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7553. return c
  7554. }
  7555. // Context sets the context to be used in this call's Do method. Any
  7556. // pending HTTP request will be aborted if the provided context is
  7557. // canceled.
  7558. func (c *ManagementCustomMetricsInsertCall) Context(ctx context.Context) *ManagementCustomMetricsInsertCall {
  7559. c.ctx_ = ctx
  7560. return c
  7561. }
  7562. // Header returns an http.Header that can be modified by the caller to
  7563. // add HTTP headers to the request.
  7564. func (c *ManagementCustomMetricsInsertCall) Header() http.Header {
  7565. if c.header_ == nil {
  7566. c.header_ = make(http.Header)
  7567. }
  7568. return c.header_
  7569. }
  7570. func (c *ManagementCustomMetricsInsertCall) doRequest(alt string) (*http.Response, error) {
  7571. reqHeaders := make(http.Header)
  7572. for k, v := range c.header_ {
  7573. reqHeaders[k] = v
  7574. }
  7575. reqHeaders.Set("User-Agent", c.s.userAgent())
  7576. var body io.Reader = nil
  7577. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  7578. if err != nil {
  7579. return nil, err
  7580. }
  7581. reqHeaders.Set("Content-Type", "application/json")
  7582. c.urlParams_.Set("alt", alt)
  7583. c.urlParams_.Set("prettyPrint", "false")
  7584. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics")
  7585. urls += "?" + c.urlParams_.Encode()
  7586. req, err := http.NewRequest("POST", urls, body)
  7587. if err != nil {
  7588. return nil, err
  7589. }
  7590. req.Header = reqHeaders
  7591. googleapi.Expand(req.URL, map[string]string{
  7592. "accountId": c.accountId,
  7593. "webPropertyId": c.webPropertyId,
  7594. })
  7595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7596. }
  7597. // Do executes the "analytics.management.customMetrics.insert" call.
  7598. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7599. // status code is an error. Response headers are in either
  7600. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7602. // to check whether the returned error was because
  7603. // http.StatusNotModified was returned.
  7604. func (c *ManagementCustomMetricsInsertCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7605. gensupport.SetOptions(c.urlParams_, opts...)
  7606. res, err := c.doRequest("json")
  7607. if res != nil && res.StatusCode == http.StatusNotModified {
  7608. if res.Body != nil {
  7609. res.Body.Close()
  7610. }
  7611. return nil, &googleapi.Error{
  7612. Code: res.StatusCode,
  7613. Header: res.Header,
  7614. }
  7615. }
  7616. if err != nil {
  7617. return nil, err
  7618. }
  7619. defer googleapi.CloseBody(res)
  7620. if err := googleapi.CheckResponse(res); err != nil {
  7621. return nil, err
  7622. }
  7623. ret := &CustomMetric{
  7624. ServerResponse: googleapi.ServerResponse{
  7625. Header: res.Header,
  7626. HTTPStatusCode: res.StatusCode,
  7627. },
  7628. }
  7629. target := &ret
  7630. if err := gensupport.DecodeResponse(target, res); err != nil {
  7631. return nil, err
  7632. }
  7633. return ret, nil
  7634. // {
  7635. // "description": "Create a new custom metric.",
  7636. // "httpMethod": "POST",
  7637. // "id": "analytics.management.customMetrics.insert",
  7638. // "parameterOrder": [
  7639. // "accountId",
  7640. // "webPropertyId"
  7641. // ],
  7642. // "parameters": {
  7643. // "accountId": {
  7644. // "description": "Account ID for the custom metric to create.",
  7645. // "location": "path",
  7646. // "required": true,
  7647. // "type": "string"
  7648. // },
  7649. // "webPropertyId": {
  7650. // "description": "Web property ID for the custom dimension to create.",
  7651. // "location": "path",
  7652. // "required": true,
  7653. // "type": "string"
  7654. // }
  7655. // },
  7656. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics",
  7657. // "request": {
  7658. // "$ref": "CustomMetric"
  7659. // },
  7660. // "response": {
  7661. // "$ref": "CustomMetric"
  7662. // },
  7663. // "scopes": [
  7664. // "https://www.googleapis.com/auth/analytics.edit"
  7665. // ]
  7666. // }
  7667. }
  7668. // method id "analytics.management.customMetrics.list":
  7669. type ManagementCustomMetricsListCall struct {
  7670. s *Service
  7671. accountId string
  7672. webPropertyId string
  7673. urlParams_ gensupport.URLParams
  7674. ifNoneMatch_ string
  7675. ctx_ context.Context
  7676. header_ http.Header
  7677. }
  7678. // List: Lists custom metrics to which the user has access.
  7679. func (r *ManagementCustomMetricsService) List(accountId string, webPropertyId string) *ManagementCustomMetricsListCall {
  7680. c := &ManagementCustomMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7681. c.accountId = accountId
  7682. c.webPropertyId = webPropertyId
  7683. return c
  7684. }
  7685. // MaxResults sets the optional parameter "max-results": The maximum
  7686. // number of custom metrics to include in this response.
  7687. func (c *ManagementCustomMetricsListCall) MaxResults(maxResults int64) *ManagementCustomMetricsListCall {
  7688. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  7689. return c
  7690. }
  7691. // StartIndex sets the optional parameter "start-index": An index of the
  7692. // first entity to retrieve. Use this parameter as a pagination
  7693. // mechanism along with the max-results parameter.
  7694. func (c *ManagementCustomMetricsListCall) StartIndex(startIndex int64) *ManagementCustomMetricsListCall {
  7695. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  7696. return c
  7697. }
  7698. // Fields allows partial responses to be retrieved. See
  7699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7700. // for more information.
  7701. func (c *ManagementCustomMetricsListCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsListCall {
  7702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7703. return c
  7704. }
  7705. // IfNoneMatch sets the optional parameter which makes the operation
  7706. // fail if the object's ETag matches the given value. This is useful for
  7707. // getting updates only after the object has changed since the last
  7708. // request. Use googleapi.IsNotModified to check whether the response
  7709. // error from Do is the result of In-None-Match.
  7710. func (c *ManagementCustomMetricsListCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsListCall {
  7711. c.ifNoneMatch_ = entityTag
  7712. return c
  7713. }
  7714. // Context sets the context to be used in this call's Do method. Any
  7715. // pending HTTP request will be aborted if the provided context is
  7716. // canceled.
  7717. func (c *ManagementCustomMetricsListCall) Context(ctx context.Context) *ManagementCustomMetricsListCall {
  7718. c.ctx_ = ctx
  7719. return c
  7720. }
  7721. // Header returns an http.Header that can be modified by the caller to
  7722. // add HTTP headers to the request.
  7723. func (c *ManagementCustomMetricsListCall) Header() http.Header {
  7724. if c.header_ == nil {
  7725. c.header_ = make(http.Header)
  7726. }
  7727. return c.header_
  7728. }
  7729. func (c *ManagementCustomMetricsListCall) doRequest(alt string) (*http.Response, error) {
  7730. reqHeaders := make(http.Header)
  7731. for k, v := range c.header_ {
  7732. reqHeaders[k] = v
  7733. }
  7734. reqHeaders.Set("User-Agent", c.s.userAgent())
  7735. if c.ifNoneMatch_ != "" {
  7736. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7737. }
  7738. var body io.Reader = nil
  7739. c.urlParams_.Set("alt", alt)
  7740. c.urlParams_.Set("prettyPrint", "false")
  7741. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics")
  7742. urls += "?" + c.urlParams_.Encode()
  7743. req, err := http.NewRequest("GET", urls, body)
  7744. if err != nil {
  7745. return nil, err
  7746. }
  7747. req.Header = reqHeaders
  7748. googleapi.Expand(req.URL, map[string]string{
  7749. "accountId": c.accountId,
  7750. "webPropertyId": c.webPropertyId,
  7751. })
  7752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7753. }
  7754. // Do executes the "analytics.management.customMetrics.list" call.
  7755. // Exactly one of *CustomMetrics or error will be non-nil. Any non-2xx
  7756. // status code is an error. Response headers are in either
  7757. // *CustomMetrics.ServerResponse.Header or (if a response was returned
  7758. // at all) in error.(*googleapi.Error).Header. Use
  7759. // googleapi.IsNotModified to check whether the returned error was
  7760. // because http.StatusNotModified was returned.
  7761. func (c *ManagementCustomMetricsListCall) Do(opts ...googleapi.CallOption) (*CustomMetrics, error) {
  7762. gensupport.SetOptions(c.urlParams_, opts...)
  7763. res, err := c.doRequest("json")
  7764. if res != nil && res.StatusCode == http.StatusNotModified {
  7765. if res.Body != nil {
  7766. res.Body.Close()
  7767. }
  7768. return nil, &googleapi.Error{
  7769. Code: res.StatusCode,
  7770. Header: res.Header,
  7771. }
  7772. }
  7773. if err != nil {
  7774. return nil, err
  7775. }
  7776. defer googleapi.CloseBody(res)
  7777. if err := googleapi.CheckResponse(res); err != nil {
  7778. return nil, err
  7779. }
  7780. ret := &CustomMetrics{
  7781. ServerResponse: googleapi.ServerResponse{
  7782. Header: res.Header,
  7783. HTTPStatusCode: res.StatusCode,
  7784. },
  7785. }
  7786. target := &ret
  7787. if err := gensupport.DecodeResponse(target, res); err != nil {
  7788. return nil, err
  7789. }
  7790. return ret, nil
  7791. // {
  7792. // "description": "Lists custom metrics to which the user has access.",
  7793. // "httpMethod": "GET",
  7794. // "id": "analytics.management.customMetrics.list",
  7795. // "parameterOrder": [
  7796. // "accountId",
  7797. // "webPropertyId"
  7798. // ],
  7799. // "parameters": {
  7800. // "accountId": {
  7801. // "description": "Account ID for the custom metrics to retrieve.",
  7802. // "location": "path",
  7803. // "required": true,
  7804. // "type": "string"
  7805. // },
  7806. // "max-results": {
  7807. // "description": "The maximum number of custom metrics to include in this response.",
  7808. // "format": "int32",
  7809. // "location": "query",
  7810. // "type": "integer"
  7811. // },
  7812. // "start-index": {
  7813. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  7814. // "format": "int32",
  7815. // "location": "query",
  7816. // "minimum": "1",
  7817. // "type": "integer"
  7818. // },
  7819. // "webPropertyId": {
  7820. // "description": "Web property ID for the custom metrics to retrieve.",
  7821. // "location": "path",
  7822. // "required": true,
  7823. // "type": "string"
  7824. // }
  7825. // },
  7826. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics",
  7827. // "response": {
  7828. // "$ref": "CustomMetrics"
  7829. // },
  7830. // "scopes": [
  7831. // "https://www.googleapis.com/auth/analytics",
  7832. // "https://www.googleapis.com/auth/analytics.readonly"
  7833. // ]
  7834. // }
  7835. }
  7836. // method id "analytics.management.customMetrics.patch":
  7837. type ManagementCustomMetricsPatchCall struct {
  7838. s *Service
  7839. accountId string
  7840. webPropertyId string
  7841. customMetricId string
  7842. custommetric *CustomMetric
  7843. urlParams_ gensupport.URLParams
  7844. ctx_ context.Context
  7845. header_ http.Header
  7846. }
  7847. // Patch: Updates an existing custom metric. This method supports patch
  7848. // semantics.
  7849. func (r *ManagementCustomMetricsService) Patch(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsPatchCall {
  7850. c := &ManagementCustomMetricsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7851. c.accountId = accountId
  7852. c.webPropertyId = webPropertyId
  7853. c.customMetricId = customMetricId
  7854. c.custommetric = custommetric
  7855. return c
  7856. }
  7857. // IgnoreCustomDataSourceLinks sets the optional parameter
  7858. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  7859. // warnings related to the custom metric being linked to a custom data
  7860. // source / data set.
  7861. func (c *ManagementCustomMetricsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsPatchCall {
  7862. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  7863. return c
  7864. }
  7865. // Fields allows partial responses to be retrieved. See
  7866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7867. // for more information.
  7868. func (c *ManagementCustomMetricsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsPatchCall {
  7869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7870. return c
  7871. }
  7872. // Context sets the context to be used in this call's Do method. Any
  7873. // pending HTTP request will be aborted if the provided context is
  7874. // canceled.
  7875. func (c *ManagementCustomMetricsPatchCall) Context(ctx context.Context) *ManagementCustomMetricsPatchCall {
  7876. c.ctx_ = ctx
  7877. return c
  7878. }
  7879. // Header returns an http.Header that can be modified by the caller to
  7880. // add HTTP headers to the request.
  7881. func (c *ManagementCustomMetricsPatchCall) Header() http.Header {
  7882. if c.header_ == nil {
  7883. c.header_ = make(http.Header)
  7884. }
  7885. return c.header_
  7886. }
  7887. func (c *ManagementCustomMetricsPatchCall) doRequest(alt string) (*http.Response, error) {
  7888. reqHeaders := make(http.Header)
  7889. for k, v := range c.header_ {
  7890. reqHeaders[k] = v
  7891. }
  7892. reqHeaders.Set("User-Agent", c.s.userAgent())
  7893. var body io.Reader = nil
  7894. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  7895. if err != nil {
  7896. return nil, err
  7897. }
  7898. reqHeaders.Set("Content-Type", "application/json")
  7899. c.urlParams_.Set("alt", alt)
  7900. c.urlParams_.Set("prettyPrint", "false")
  7901. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  7902. urls += "?" + c.urlParams_.Encode()
  7903. req, err := http.NewRequest("PATCH", urls, body)
  7904. if err != nil {
  7905. return nil, err
  7906. }
  7907. req.Header = reqHeaders
  7908. googleapi.Expand(req.URL, map[string]string{
  7909. "accountId": c.accountId,
  7910. "webPropertyId": c.webPropertyId,
  7911. "customMetricId": c.customMetricId,
  7912. })
  7913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7914. }
  7915. // Do executes the "analytics.management.customMetrics.patch" call.
  7916. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7917. // status code is an error. Response headers are in either
  7918. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7919. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7920. // to check whether the returned error was because
  7921. // http.StatusNotModified was returned.
  7922. func (c *ManagementCustomMetricsPatchCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7923. gensupport.SetOptions(c.urlParams_, opts...)
  7924. res, err := c.doRequest("json")
  7925. if res != nil && res.StatusCode == http.StatusNotModified {
  7926. if res.Body != nil {
  7927. res.Body.Close()
  7928. }
  7929. return nil, &googleapi.Error{
  7930. Code: res.StatusCode,
  7931. Header: res.Header,
  7932. }
  7933. }
  7934. if err != nil {
  7935. return nil, err
  7936. }
  7937. defer googleapi.CloseBody(res)
  7938. if err := googleapi.CheckResponse(res); err != nil {
  7939. return nil, err
  7940. }
  7941. ret := &CustomMetric{
  7942. ServerResponse: googleapi.ServerResponse{
  7943. Header: res.Header,
  7944. HTTPStatusCode: res.StatusCode,
  7945. },
  7946. }
  7947. target := &ret
  7948. if err := gensupport.DecodeResponse(target, res); err != nil {
  7949. return nil, err
  7950. }
  7951. return ret, nil
  7952. // {
  7953. // "description": "Updates an existing custom metric. This method supports patch semantics.",
  7954. // "httpMethod": "PATCH",
  7955. // "id": "analytics.management.customMetrics.patch",
  7956. // "parameterOrder": [
  7957. // "accountId",
  7958. // "webPropertyId",
  7959. // "customMetricId"
  7960. // ],
  7961. // "parameters": {
  7962. // "accountId": {
  7963. // "description": "Account ID for the custom metric to update.",
  7964. // "location": "path",
  7965. // "required": true,
  7966. // "type": "string"
  7967. // },
  7968. // "customMetricId": {
  7969. // "description": "Custom metric ID for the custom metric to update.",
  7970. // "location": "path",
  7971. // "required": true,
  7972. // "type": "string"
  7973. // },
  7974. // "ignoreCustomDataSourceLinks": {
  7975. // "default": "false",
  7976. // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.",
  7977. // "location": "query",
  7978. // "type": "boolean"
  7979. // },
  7980. // "webPropertyId": {
  7981. // "description": "Web property ID for the custom metric to update.",
  7982. // "location": "path",
  7983. // "required": true,
  7984. // "type": "string"
  7985. // }
  7986. // },
  7987. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  7988. // "request": {
  7989. // "$ref": "CustomMetric"
  7990. // },
  7991. // "response": {
  7992. // "$ref": "CustomMetric"
  7993. // },
  7994. // "scopes": [
  7995. // "https://www.googleapis.com/auth/analytics.edit"
  7996. // ]
  7997. // }
  7998. }
  7999. // method id "analytics.management.customMetrics.update":
  8000. type ManagementCustomMetricsUpdateCall struct {
  8001. s *Service
  8002. accountId string
  8003. webPropertyId string
  8004. customMetricId string
  8005. custommetric *CustomMetric
  8006. urlParams_ gensupport.URLParams
  8007. ctx_ context.Context
  8008. header_ http.Header
  8009. }
  8010. // Update: Updates an existing custom metric.
  8011. func (r *ManagementCustomMetricsService) Update(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsUpdateCall {
  8012. c := &ManagementCustomMetricsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8013. c.accountId = accountId
  8014. c.webPropertyId = webPropertyId
  8015. c.customMetricId = customMetricId
  8016. c.custommetric = custommetric
  8017. return c
  8018. }
  8019. // IgnoreCustomDataSourceLinks sets the optional parameter
  8020. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  8021. // warnings related to the custom metric being linked to a custom data
  8022. // source / data set.
  8023. func (c *ManagementCustomMetricsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsUpdateCall {
  8024. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  8025. return c
  8026. }
  8027. // Fields allows partial responses to be retrieved. See
  8028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8029. // for more information.
  8030. func (c *ManagementCustomMetricsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsUpdateCall {
  8031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8032. return c
  8033. }
  8034. // Context sets the context to be used in this call's Do method. Any
  8035. // pending HTTP request will be aborted if the provided context is
  8036. // canceled.
  8037. func (c *ManagementCustomMetricsUpdateCall) Context(ctx context.Context) *ManagementCustomMetricsUpdateCall {
  8038. c.ctx_ = ctx
  8039. return c
  8040. }
  8041. // Header returns an http.Header that can be modified by the caller to
  8042. // add HTTP headers to the request.
  8043. func (c *ManagementCustomMetricsUpdateCall) Header() http.Header {
  8044. if c.header_ == nil {
  8045. c.header_ = make(http.Header)
  8046. }
  8047. return c.header_
  8048. }
  8049. func (c *ManagementCustomMetricsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8050. reqHeaders := make(http.Header)
  8051. for k, v := range c.header_ {
  8052. reqHeaders[k] = v
  8053. }
  8054. reqHeaders.Set("User-Agent", c.s.userAgent())
  8055. var body io.Reader = nil
  8056. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  8057. if err != nil {
  8058. return nil, err
  8059. }
  8060. reqHeaders.Set("Content-Type", "application/json")
  8061. c.urlParams_.Set("alt", alt)
  8062. c.urlParams_.Set("prettyPrint", "false")
  8063. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  8064. urls += "?" + c.urlParams_.Encode()
  8065. req, err := http.NewRequest("PUT", urls, body)
  8066. if err != nil {
  8067. return nil, err
  8068. }
  8069. req.Header = reqHeaders
  8070. googleapi.Expand(req.URL, map[string]string{
  8071. "accountId": c.accountId,
  8072. "webPropertyId": c.webPropertyId,
  8073. "customMetricId": c.customMetricId,
  8074. })
  8075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8076. }
  8077. // Do executes the "analytics.management.customMetrics.update" call.
  8078. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  8079. // status code is an error. Response headers are in either
  8080. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  8081. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8082. // to check whether the returned error was because
  8083. // http.StatusNotModified was returned.
  8084. func (c *ManagementCustomMetricsUpdateCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  8085. gensupport.SetOptions(c.urlParams_, opts...)
  8086. res, err := c.doRequest("json")
  8087. if res != nil && res.StatusCode == http.StatusNotModified {
  8088. if res.Body != nil {
  8089. res.Body.Close()
  8090. }
  8091. return nil, &googleapi.Error{
  8092. Code: res.StatusCode,
  8093. Header: res.Header,
  8094. }
  8095. }
  8096. if err != nil {
  8097. return nil, err
  8098. }
  8099. defer googleapi.CloseBody(res)
  8100. if err := googleapi.CheckResponse(res); err != nil {
  8101. return nil, err
  8102. }
  8103. ret := &CustomMetric{
  8104. ServerResponse: googleapi.ServerResponse{
  8105. Header: res.Header,
  8106. HTTPStatusCode: res.StatusCode,
  8107. },
  8108. }
  8109. target := &ret
  8110. if err := gensupport.DecodeResponse(target, res); err != nil {
  8111. return nil, err
  8112. }
  8113. return ret, nil
  8114. // {
  8115. // "description": "Updates an existing custom metric.",
  8116. // "httpMethod": "PUT",
  8117. // "id": "analytics.management.customMetrics.update",
  8118. // "parameterOrder": [
  8119. // "accountId",
  8120. // "webPropertyId",
  8121. // "customMetricId"
  8122. // ],
  8123. // "parameters": {
  8124. // "accountId": {
  8125. // "description": "Account ID for the custom metric to update.",
  8126. // "location": "path",
  8127. // "required": true,
  8128. // "type": "string"
  8129. // },
  8130. // "customMetricId": {
  8131. // "description": "Custom metric ID for the custom metric to update.",
  8132. // "location": "path",
  8133. // "required": true,
  8134. // "type": "string"
  8135. // },
  8136. // "ignoreCustomDataSourceLinks": {
  8137. // "default": "false",
  8138. // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.",
  8139. // "location": "query",
  8140. // "type": "boolean"
  8141. // },
  8142. // "webPropertyId": {
  8143. // "description": "Web property ID for the custom metric to update.",
  8144. // "location": "path",
  8145. // "required": true,
  8146. // "type": "string"
  8147. // }
  8148. // },
  8149. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  8150. // "request": {
  8151. // "$ref": "CustomMetric"
  8152. // },
  8153. // "response": {
  8154. // "$ref": "CustomMetric"
  8155. // },
  8156. // "scopes": [
  8157. // "https://www.googleapis.com/auth/analytics.edit"
  8158. // ]
  8159. // }
  8160. }
  8161. // method id "analytics.management.experiments.delete":
  8162. type ManagementExperimentsDeleteCall struct {
  8163. s *Service
  8164. accountId string
  8165. webPropertyId string
  8166. profileId string
  8167. experimentId string
  8168. urlParams_ gensupport.URLParams
  8169. ctx_ context.Context
  8170. header_ http.Header
  8171. }
  8172. // Delete: Delete an experiment.
  8173. func (r *ManagementExperimentsService) Delete(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsDeleteCall {
  8174. c := &ManagementExperimentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8175. c.accountId = accountId
  8176. c.webPropertyId = webPropertyId
  8177. c.profileId = profileId
  8178. c.experimentId = experimentId
  8179. return c
  8180. }
  8181. // Fields allows partial responses to be retrieved. See
  8182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8183. // for more information.
  8184. func (c *ManagementExperimentsDeleteCall) Fields(s ...googleapi.Field) *ManagementExperimentsDeleteCall {
  8185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8186. return c
  8187. }
  8188. // Context sets the context to be used in this call's Do method. Any
  8189. // pending HTTP request will be aborted if the provided context is
  8190. // canceled.
  8191. func (c *ManagementExperimentsDeleteCall) Context(ctx context.Context) *ManagementExperimentsDeleteCall {
  8192. c.ctx_ = ctx
  8193. return c
  8194. }
  8195. // Header returns an http.Header that can be modified by the caller to
  8196. // add HTTP headers to the request.
  8197. func (c *ManagementExperimentsDeleteCall) Header() http.Header {
  8198. if c.header_ == nil {
  8199. c.header_ = make(http.Header)
  8200. }
  8201. return c.header_
  8202. }
  8203. func (c *ManagementExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8204. reqHeaders := make(http.Header)
  8205. for k, v := range c.header_ {
  8206. reqHeaders[k] = v
  8207. }
  8208. reqHeaders.Set("User-Agent", c.s.userAgent())
  8209. var body io.Reader = nil
  8210. c.urlParams_.Set("alt", alt)
  8211. c.urlParams_.Set("prettyPrint", "false")
  8212. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8213. urls += "?" + c.urlParams_.Encode()
  8214. req, err := http.NewRequest("DELETE", urls, body)
  8215. if err != nil {
  8216. return nil, err
  8217. }
  8218. req.Header = reqHeaders
  8219. googleapi.Expand(req.URL, map[string]string{
  8220. "accountId": c.accountId,
  8221. "webPropertyId": c.webPropertyId,
  8222. "profileId": c.profileId,
  8223. "experimentId": c.experimentId,
  8224. })
  8225. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8226. }
  8227. // Do executes the "analytics.management.experiments.delete" call.
  8228. func (c *ManagementExperimentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8229. gensupport.SetOptions(c.urlParams_, opts...)
  8230. res, err := c.doRequest("json")
  8231. if err != nil {
  8232. return err
  8233. }
  8234. defer googleapi.CloseBody(res)
  8235. if err := googleapi.CheckResponse(res); err != nil {
  8236. return err
  8237. }
  8238. return nil
  8239. // {
  8240. // "description": "Delete an experiment.",
  8241. // "httpMethod": "DELETE",
  8242. // "id": "analytics.management.experiments.delete",
  8243. // "parameterOrder": [
  8244. // "accountId",
  8245. // "webPropertyId",
  8246. // "profileId",
  8247. // "experimentId"
  8248. // ],
  8249. // "parameters": {
  8250. // "accountId": {
  8251. // "description": "Account ID to which the experiment belongs",
  8252. // "location": "path",
  8253. // "required": true,
  8254. // "type": "string"
  8255. // },
  8256. // "experimentId": {
  8257. // "description": "ID of the experiment to delete",
  8258. // "location": "path",
  8259. // "required": true,
  8260. // "type": "string"
  8261. // },
  8262. // "profileId": {
  8263. // "description": "View (Profile) ID to which the experiment belongs",
  8264. // "location": "path",
  8265. // "required": true,
  8266. // "type": "string"
  8267. // },
  8268. // "webPropertyId": {
  8269. // "description": "Web property ID to which the experiment belongs",
  8270. // "location": "path",
  8271. // "required": true,
  8272. // "type": "string"
  8273. // }
  8274. // },
  8275. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8276. // "scopes": [
  8277. // "https://www.googleapis.com/auth/analytics",
  8278. // "https://www.googleapis.com/auth/analytics.edit"
  8279. // ]
  8280. // }
  8281. }
  8282. // method id "analytics.management.experiments.get":
  8283. type ManagementExperimentsGetCall struct {
  8284. s *Service
  8285. accountId string
  8286. webPropertyId string
  8287. profileId string
  8288. experimentId string
  8289. urlParams_ gensupport.URLParams
  8290. ifNoneMatch_ string
  8291. ctx_ context.Context
  8292. header_ http.Header
  8293. }
  8294. // Get: Returns an experiment to which the user has access.
  8295. func (r *ManagementExperimentsService) Get(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsGetCall {
  8296. c := &ManagementExperimentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8297. c.accountId = accountId
  8298. c.webPropertyId = webPropertyId
  8299. c.profileId = profileId
  8300. c.experimentId = experimentId
  8301. return c
  8302. }
  8303. // Fields allows partial responses to be retrieved. See
  8304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8305. // for more information.
  8306. func (c *ManagementExperimentsGetCall) Fields(s ...googleapi.Field) *ManagementExperimentsGetCall {
  8307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8308. return c
  8309. }
  8310. // IfNoneMatch sets the optional parameter which makes the operation
  8311. // fail if the object's ETag matches the given value. This is useful for
  8312. // getting updates only after the object has changed since the last
  8313. // request. Use googleapi.IsNotModified to check whether the response
  8314. // error from Do is the result of In-None-Match.
  8315. func (c *ManagementExperimentsGetCall) IfNoneMatch(entityTag string) *ManagementExperimentsGetCall {
  8316. c.ifNoneMatch_ = entityTag
  8317. return c
  8318. }
  8319. // Context sets the context to be used in this call's Do method. Any
  8320. // pending HTTP request will be aborted if the provided context is
  8321. // canceled.
  8322. func (c *ManagementExperimentsGetCall) Context(ctx context.Context) *ManagementExperimentsGetCall {
  8323. c.ctx_ = ctx
  8324. return c
  8325. }
  8326. // Header returns an http.Header that can be modified by the caller to
  8327. // add HTTP headers to the request.
  8328. func (c *ManagementExperimentsGetCall) Header() http.Header {
  8329. if c.header_ == nil {
  8330. c.header_ = make(http.Header)
  8331. }
  8332. return c.header_
  8333. }
  8334. func (c *ManagementExperimentsGetCall) doRequest(alt string) (*http.Response, error) {
  8335. reqHeaders := make(http.Header)
  8336. for k, v := range c.header_ {
  8337. reqHeaders[k] = v
  8338. }
  8339. reqHeaders.Set("User-Agent", c.s.userAgent())
  8340. if c.ifNoneMatch_ != "" {
  8341. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8342. }
  8343. var body io.Reader = nil
  8344. c.urlParams_.Set("alt", alt)
  8345. c.urlParams_.Set("prettyPrint", "false")
  8346. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8347. urls += "?" + c.urlParams_.Encode()
  8348. req, err := http.NewRequest("GET", urls, body)
  8349. if err != nil {
  8350. return nil, err
  8351. }
  8352. req.Header = reqHeaders
  8353. googleapi.Expand(req.URL, map[string]string{
  8354. "accountId": c.accountId,
  8355. "webPropertyId": c.webPropertyId,
  8356. "profileId": c.profileId,
  8357. "experimentId": c.experimentId,
  8358. })
  8359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8360. }
  8361. // Do executes the "analytics.management.experiments.get" call.
  8362. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8363. // status code is an error. Response headers are in either
  8364. // *Experiment.ServerResponse.Header or (if a response was returned at
  8365. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8366. // to check whether the returned error was because
  8367. // http.StatusNotModified was returned.
  8368. func (c *ManagementExperimentsGetCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8369. gensupport.SetOptions(c.urlParams_, opts...)
  8370. res, err := c.doRequest("json")
  8371. if res != nil && res.StatusCode == http.StatusNotModified {
  8372. if res.Body != nil {
  8373. res.Body.Close()
  8374. }
  8375. return nil, &googleapi.Error{
  8376. Code: res.StatusCode,
  8377. Header: res.Header,
  8378. }
  8379. }
  8380. if err != nil {
  8381. return nil, err
  8382. }
  8383. defer googleapi.CloseBody(res)
  8384. if err := googleapi.CheckResponse(res); err != nil {
  8385. return nil, err
  8386. }
  8387. ret := &Experiment{
  8388. ServerResponse: googleapi.ServerResponse{
  8389. Header: res.Header,
  8390. HTTPStatusCode: res.StatusCode,
  8391. },
  8392. }
  8393. target := &ret
  8394. if err := gensupport.DecodeResponse(target, res); err != nil {
  8395. return nil, err
  8396. }
  8397. return ret, nil
  8398. // {
  8399. // "description": "Returns an experiment to which the user has access.",
  8400. // "httpMethod": "GET",
  8401. // "id": "analytics.management.experiments.get",
  8402. // "parameterOrder": [
  8403. // "accountId",
  8404. // "webPropertyId",
  8405. // "profileId",
  8406. // "experimentId"
  8407. // ],
  8408. // "parameters": {
  8409. // "accountId": {
  8410. // "description": "Account ID to retrieve the experiment for.",
  8411. // "location": "path",
  8412. // "required": true,
  8413. // "type": "string"
  8414. // },
  8415. // "experimentId": {
  8416. // "description": "Experiment ID to retrieve the experiment for.",
  8417. // "location": "path",
  8418. // "required": true,
  8419. // "type": "string"
  8420. // },
  8421. // "profileId": {
  8422. // "description": "View (Profile) ID to retrieve the experiment for.",
  8423. // "location": "path",
  8424. // "required": true,
  8425. // "type": "string"
  8426. // },
  8427. // "webPropertyId": {
  8428. // "description": "Web property ID to retrieve the experiment for.",
  8429. // "location": "path",
  8430. // "required": true,
  8431. // "type": "string"
  8432. // }
  8433. // },
  8434. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8435. // "response": {
  8436. // "$ref": "Experiment"
  8437. // },
  8438. // "scopes": [
  8439. // "https://www.googleapis.com/auth/analytics",
  8440. // "https://www.googleapis.com/auth/analytics.edit",
  8441. // "https://www.googleapis.com/auth/analytics.readonly"
  8442. // ]
  8443. // }
  8444. }
  8445. // method id "analytics.management.experiments.insert":
  8446. type ManagementExperimentsInsertCall struct {
  8447. s *Service
  8448. accountId string
  8449. webPropertyId string
  8450. profileId string
  8451. experiment *Experiment
  8452. urlParams_ gensupport.URLParams
  8453. ctx_ context.Context
  8454. header_ http.Header
  8455. }
  8456. // Insert: Create a new experiment.
  8457. func (r *ManagementExperimentsService) Insert(accountId string, webPropertyId string, profileId string, experiment *Experiment) *ManagementExperimentsInsertCall {
  8458. c := &ManagementExperimentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8459. c.accountId = accountId
  8460. c.webPropertyId = webPropertyId
  8461. c.profileId = profileId
  8462. c.experiment = experiment
  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 *ManagementExperimentsInsertCall) Fields(s ...googleapi.Field) *ManagementExperimentsInsertCall {
  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 *ManagementExperimentsInsertCall) Context(ctx context.Context) *ManagementExperimentsInsertCall {
  8476. c.ctx_ = ctx
  8477. return c
  8478. }
  8479. // Header returns an http.Header that can be modified by the caller to
  8480. // add HTTP headers to the request.
  8481. func (c *ManagementExperimentsInsertCall) Header() http.Header {
  8482. if c.header_ == nil {
  8483. c.header_ = make(http.Header)
  8484. }
  8485. return c.header_
  8486. }
  8487. func (c *ManagementExperimentsInsertCall) doRequest(alt string) (*http.Response, error) {
  8488. reqHeaders := make(http.Header)
  8489. for k, v := range c.header_ {
  8490. reqHeaders[k] = v
  8491. }
  8492. reqHeaders.Set("User-Agent", c.s.userAgent())
  8493. var body io.Reader = nil
  8494. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  8495. if err != nil {
  8496. return nil, err
  8497. }
  8498. reqHeaders.Set("Content-Type", "application/json")
  8499. c.urlParams_.Set("alt", alt)
  8500. c.urlParams_.Set("prettyPrint", "false")
  8501. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments")
  8502. urls += "?" + c.urlParams_.Encode()
  8503. req, err := http.NewRequest("POST", urls, body)
  8504. if err != nil {
  8505. return nil, err
  8506. }
  8507. req.Header = reqHeaders
  8508. googleapi.Expand(req.URL, map[string]string{
  8509. "accountId": c.accountId,
  8510. "webPropertyId": c.webPropertyId,
  8511. "profileId": c.profileId,
  8512. })
  8513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8514. }
  8515. // Do executes the "analytics.management.experiments.insert" call.
  8516. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8517. // status code is an error. Response headers are in either
  8518. // *Experiment.ServerResponse.Header or (if a response was returned at
  8519. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8520. // to check whether the returned error was because
  8521. // http.StatusNotModified was returned.
  8522. func (c *ManagementExperimentsInsertCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8523. gensupport.SetOptions(c.urlParams_, opts...)
  8524. res, err := c.doRequest("json")
  8525. if res != nil && res.StatusCode == http.StatusNotModified {
  8526. if res.Body != nil {
  8527. res.Body.Close()
  8528. }
  8529. return nil, &googleapi.Error{
  8530. Code: res.StatusCode,
  8531. Header: res.Header,
  8532. }
  8533. }
  8534. if err != nil {
  8535. return nil, err
  8536. }
  8537. defer googleapi.CloseBody(res)
  8538. if err := googleapi.CheckResponse(res); err != nil {
  8539. return nil, err
  8540. }
  8541. ret := &Experiment{
  8542. ServerResponse: googleapi.ServerResponse{
  8543. Header: res.Header,
  8544. HTTPStatusCode: res.StatusCode,
  8545. },
  8546. }
  8547. target := &ret
  8548. if err := gensupport.DecodeResponse(target, res); err != nil {
  8549. return nil, err
  8550. }
  8551. return ret, nil
  8552. // {
  8553. // "description": "Create a new experiment.",
  8554. // "httpMethod": "POST",
  8555. // "id": "analytics.management.experiments.insert",
  8556. // "parameterOrder": [
  8557. // "accountId",
  8558. // "webPropertyId",
  8559. // "profileId"
  8560. // ],
  8561. // "parameters": {
  8562. // "accountId": {
  8563. // "description": "Account ID to create the experiment for.",
  8564. // "location": "path",
  8565. // "required": true,
  8566. // "type": "string"
  8567. // },
  8568. // "profileId": {
  8569. // "description": "View (Profile) ID to create the experiment for.",
  8570. // "location": "path",
  8571. // "required": true,
  8572. // "type": "string"
  8573. // },
  8574. // "webPropertyId": {
  8575. // "description": "Web property ID to create the experiment for.",
  8576. // "location": "path",
  8577. // "required": true,
  8578. // "type": "string"
  8579. // }
  8580. // },
  8581. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments",
  8582. // "request": {
  8583. // "$ref": "Experiment"
  8584. // },
  8585. // "response": {
  8586. // "$ref": "Experiment"
  8587. // },
  8588. // "scopes": [
  8589. // "https://www.googleapis.com/auth/analytics",
  8590. // "https://www.googleapis.com/auth/analytics.edit"
  8591. // ]
  8592. // }
  8593. }
  8594. // method id "analytics.management.experiments.list":
  8595. type ManagementExperimentsListCall struct {
  8596. s *Service
  8597. accountId string
  8598. webPropertyId string
  8599. profileId string
  8600. urlParams_ gensupport.URLParams
  8601. ifNoneMatch_ string
  8602. ctx_ context.Context
  8603. header_ http.Header
  8604. }
  8605. // List: Lists experiments to which the user has access.
  8606. func (r *ManagementExperimentsService) List(accountId string, webPropertyId string, profileId string) *ManagementExperimentsListCall {
  8607. c := &ManagementExperimentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8608. c.accountId = accountId
  8609. c.webPropertyId = webPropertyId
  8610. c.profileId = profileId
  8611. return c
  8612. }
  8613. // MaxResults sets the optional parameter "max-results": The maximum
  8614. // number of experiments to include in this response.
  8615. func (c *ManagementExperimentsListCall) MaxResults(maxResults int64) *ManagementExperimentsListCall {
  8616. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  8617. return c
  8618. }
  8619. // StartIndex sets the optional parameter "start-index": An index of the
  8620. // first experiment to retrieve. Use this parameter as a pagination
  8621. // mechanism along with the max-results parameter.
  8622. func (c *ManagementExperimentsListCall) StartIndex(startIndex int64) *ManagementExperimentsListCall {
  8623. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  8624. return c
  8625. }
  8626. // Fields allows partial responses to be retrieved. See
  8627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8628. // for more information.
  8629. func (c *ManagementExperimentsListCall) Fields(s ...googleapi.Field) *ManagementExperimentsListCall {
  8630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8631. return c
  8632. }
  8633. // IfNoneMatch sets the optional parameter which makes the operation
  8634. // fail if the object's ETag matches the given value. This is useful for
  8635. // getting updates only after the object has changed since the last
  8636. // request. Use googleapi.IsNotModified to check whether the response
  8637. // error from Do is the result of In-None-Match.
  8638. func (c *ManagementExperimentsListCall) IfNoneMatch(entityTag string) *ManagementExperimentsListCall {
  8639. c.ifNoneMatch_ = entityTag
  8640. return c
  8641. }
  8642. // Context sets the context to be used in this call's Do method. Any
  8643. // pending HTTP request will be aborted if the provided context is
  8644. // canceled.
  8645. func (c *ManagementExperimentsListCall) Context(ctx context.Context) *ManagementExperimentsListCall {
  8646. c.ctx_ = ctx
  8647. return c
  8648. }
  8649. // Header returns an http.Header that can be modified by the caller to
  8650. // add HTTP headers to the request.
  8651. func (c *ManagementExperimentsListCall) Header() http.Header {
  8652. if c.header_ == nil {
  8653. c.header_ = make(http.Header)
  8654. }
  8655. return c.header_
  8656. }
  8657. func (c *ManagementExperimentsListCall) doRequest(alt string) (*http.Response, error) {
  8658. reqHeaders := make(http.Header)
  8659. for k, v := range c.header_ {
  8660. reqHeaders[k] = v
  8661. }
  8662. reqHeaders.Set("User-Agent", c.s.userAgent())
  8663. if c.ifNoneMatch_ != "" {
  8664. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8665. }
  8666. var body io.Reader = nil
  8667. c.urlParams_.Set("alt", alt)
  8668. c.urlParams_.Set("prettyPrint", "false")
  8669. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments")
  8670. urls += "?" + c.urlParams_.Encode()
  8671. req, err := http.NewRequest("GET", urls, body)
  8672. if err != nil {
  8673. return nil, err
  8674. }
  8675. req.Header = reqHeaders
  8676. googleapi.Expand(req.URL, map[string]string{
  8677. "accountId": c.accountId,
  8678. "webPropertyId": c.webPropertyId,
  8679. "profileId": c.profileId,
  8680. })
  8681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8682. }
  8683. // Do executes the "analytics.management.experiments.list" call.
  8684. // Exactly one of *Experiments or error will be non-nil. Any non-2xx
  8685. // status code is an error. Response headers are in either
  8686. // *Experiments.ServerResponse.Header or (if a response was returned at
  8687. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8688. // to check whether the returned error was because
  8689. // http.StatusNotModified was returned.
  8690. func (c *ManagementExperimentsListCall) Do(opts ...googleapi.CallOption) (*Experiments, error) {
  8691. gensupport.SetOptions(c.urlParams_, opts...)
  8692. res, err := c.doRequest("json")
  8693. if res != nil && res.StatusCode == http.StatusNotModified {
  8694. if res.Body != nil {
  8695. res.Body.Close()
  8696. }
  8697. return nil, &googleapi.Error{
  8698. Code: res.StatusCode,
  8699. Header: res.Header,
  8700. }
  8701. }
  8702. if err != nil {
  8703. return nil, err
  8704. }
  8705. defer googleapi.CloseBody(res)
  8706. if err := googleapi.CheckResponse(res); err != nil {
  8707. return nil, err
  8708. }
  8709. ret := &Experiments{
  8710. ServerResponse: googleapi.ServerResponse{
  8711. Header: res.Header,
  8712. HTTPStatusCode: res.StatusCode,
  8713. },
  8714. }
  8715. target := &ret
  8716. if err := gensupport.DecodeResponse(target, res); err != nil {
  8717. return nil, err
  8718. }
  8719. return ret, nil
  8720. // {
  8721. // "description": "Lists experiments to which the user has access.",
  8722. // "httpMethod": "GET",
  8723. // "id": "analytics.management.experiments.list",
  8724. // "parameterOrder": [
  8725. // "accountId",
  8726. // "webPropertyId",
  8727. // "profileId"
  8728. // ],
  8729. // "parameters": {
  8730. // "accountId": {
  8731. // "description": "Account ID to retrieve experiments for.",
  8732. // "location": "path",
  8733. // "pattern": "\\d+",
  8734. // "required": true,
  8735. // "type": "string"
  8736. // },
  8737. // "max-results": {
  8738. // "description": "The maximum number of experiments to include in this response.",
  8739. // "format": "int32",
  8740. // "location": "query",
  8741. // "type": "integer"
  8742. // },
  8743. // "profileId": {
  8744. // "description": "View (Profile) ID to retrieve experiments for.",
  8745. // "location": "path",
  8746. // "pattern": "\\d+",
  8747. // "required": true,
  8748. // "type": "string"
  8749. // },
  8750. // "start-index": {
  8751. // "description": "An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  8752. // "format": "int32",
  8753. // "location": "query",
  8754. // "minimum": "1",
  8755. // "type": "integer"
  8756. // },
  8757. // "webPropertyId": {
  8758. // "description": "Web property ID to retrieve experiments for.",
  8759. // "location": "path",
  8760. // "pattern": "UA-(\\d+)-(\\d+)",
  8761. // "required": true,
  8762. // "type": "string"
  8763. // }
  8764. // },
  8765. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments",
  8766. // "response": {
  8767. // "$ref": "Experiments"
  8768. // },
  8769. // "scopes": [
  8770. // "https://www.googleapis.com/auth/analytics",
  8771. // "https://www.googleapis.com/auth/analytics.edit",
  8772. // "https://www.googleapis.com/auth/analytics.readonly"
  8773. // ]
  8774. // }
  8775. }
  8776. // method id "analytics.management.experiments.patch":
  8777. type ManagementExperimentsPatchCall struct {
  8778. s *Service
  8779. accountId string
  8780. webPropertyId string
  8781. profileId string
  8782. experimentId string
  8783. experiment *Experiment
  8784. urlParams_ gensupport.URLParams
  8785. ctx_ context.Context
  8786. header_ http.Header
  8787. }
  8788. // Patch: Update an existing experiment. This method supports patch
  8789. // semantics.
  8790. func (r *ManagementExperimentsService) Patch(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsPatchCall {
  8791. c := &ManagementExperimentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8792. c.accountId = accountId
  8793. c.webPropertyId = webPropertyId
  8794. c.profileId = profileId
  8795. c.experimentId = experimentId
  8796. c.experiment = experiment
  8797. return c
  8798. }
  8799. // Fields allows partial responses to be retrieved. See
  8800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8801. // for more information.
  8802. func (c *ManagementExperimentsPatchCall) Fields(s ...googleapi.Field) *ManagementExperimentsPatchCall {
  8803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8804. return c
  8805. }
  8806. // Context sets the context to be used in this call's Do method. Any
  8807. // pending HTTP request will be aborted if the provided context is
  8808. // canceled.
  8809. func (c *ManagementExperimentsPatchCall) Context(ctx context.Context) *ManagementExperimentsPatchCall {
  8810. c.ctx_ = ctx
  8811. return c
  8812. }
  8813. // Header returns an http.Header that can be modified by the caller to
  8814. // add HTTP headers to the request.
  8815. func (c *ManagementExperimentsPatchCall) Header() http.Header {
  8816. if c.header_ == nil {
  8817. c.header_ = make(http.Header)
  8818. }
  8819. return c.header_
  8820. }
  8821. func (c *ManagementExperimentsPatchCall) doRequest(alt string) (*http.Response, error) {
  8822. reqHeaders := make(http.Header)
  8823. for k, v := range c.header_ {
  8824. reqHeaders[k] = v
  8825. }
  8826. reqHeaders.Set("User-Agent", c.s.userAgent())
  8827. var body io.Reader = nil
  8828. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  8829. if err != nil {
  8830. return nil, err
  8831. }
  8832. reqHeaders.Set("Content-Type", "application/json")
  8833. c.urlParams_.Set("alt", alt)
  8834. c.urlParams_.Set("prettyPrint", "false")
  8835. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8836. urls += "?" + c.urlParams_.Encode()
  8837. req, err := http.NewRequest("PATCH", urls, body)
  8838. if err != nil {
  8839. return nil, err
  8840. }
  8841. req.Header = reqHeaders
  8842. googleapi.Expand(req.URL, map[string]string{
  8843. "accountId": c.accountId,
  8844. "webPropertyId": c.webPropertyId,
  8845. "profileId": c.profileId,
  8846. "experimentId": c.experimentId,
  8847. })
  8848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8849. }
  8850. // Do executes the "analytics.management.experiments.patch" call.
  8851. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8852. // status code is an error. Response headers are in either
  8853. // *Experiment.ServerResponse.Header or (if a response was returned at
  8854. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8855. // to check whether the returned error was because
  8856. // http.StatusNotModified was returned.
  8857. func (c *ManagementExperimentsPatchCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8858. gensupport.SetOptions(c.urlParams_, opts...)
  8859. res, err := c.doRequest("json")
  8860. if res != nil && res.StatusCode == http.StatusNotModified {
  8861. if res.Body != nil {
  8862. res.Body.Close()
  8863. }
  8864. return nil, &googleapi.Error{
  8865. Code: res.StatusCode,
  8866. Header: res.Header,
  8867. }
  8868. }
  8869. if err != nil {
  8870. return nil, err
  8871. }
  8872. defer googleapi.CloseBody(res)
  8873. if err := googleapi.CheckResponse(res); err != nil {
  8874. return nil, err
  8875. }
  8876. ret := &Experiment{
  8877. ServerResponse: googleapi.ServerResponse{
  8878. Header: res.Header,
  8879. HTTPStatusCode: res.StatusCode,
  8880. },
  8881. }
  8882. target := &ret
  8883. if err := gensupport.DecodeResponse(target, res); err != nil {
  8884. return nil, err
  8885. }
  8886. return ret, nil
  8887. // {
  8888. // "description": "Update an existing experiment. This method supports patch semantics.",
  8889. // "httpMethod": "PATCH",
  8890. // "id": "analytics.management.experiments.patch",
  8891. // "parameterOrder": [
  8892. // "accountId",
  8893. // "webPropertyId",
  8894. // "profileId",
  8895. // "experimentId"
  8896. // ],
  8897. // "parameters": {
  8898. // "accountId": {
  8899. // "description": "Account ID of the experiment to update.",
  8900. // "location": "path",
  8901. // "required": true,
  8902. // "type": "string"
  8903. // },
  8904. // "experimentId": {
  8905. // "description": "Experiment ID of the experiment to update.",
  8906. // "location": "path",
  8907. // "required": true,
  8908. // "type": "string"
  8909. // },
  8910. // "profileId": {
  8911. // "description": "View (Profile) ID of the experiment to update.",
  8912. // "location": "path",
  8913. // "required": true,
  8914. // "type": "string"
  8915. // },
  8916. // "webPropertyId": {
  8917. // "description": "Web property ID of the experiment to update.",
  8918. // "location": "path",
  8919. // "required": true,
  8920. // "type": "string"
  8921. // }
  8922. // },
  8923. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8924. // "request": {
  8925. // "$ref": "Experiment"
  8926. // },
  8927. // "response": {
  8928. // "$ref": "Experiment"
  8929. // },
  8930. // "scopes": [
  8931. // "https://www.googleapis.com/auth/analytics",
  8932. // "https://www.googleapis.com/auth/analytics.edit"
  8933. // ]
  8934. // }
  8935. }
  8936. // method id "analytics.management.experiments.update":
  8937. type ManagementExperimentsUpdateCall struct {
  8938. s *Service
  8939. accountId string
  8940. webPropertyId string
  8941. profileId string
  8942. experimentId string
  8943. experiment *Experiment
  8944. urlParams_ gensupport.URLParams
  8945. ctx_ context.Context
  8946. header_ http.Header
  8947. }
  8948. // Update: Update an existing experiment.
  8949. func (r *ManagementExperimentsService) Update(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsUpdateCall {
  8950. c := &ManagementExperimentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8951. c.accountId = accountId
  8952. c.webPropertyId = webPropertyId
  8953. c.profileId = profileId
  8954. c.experimentId = experimentId
  8955. c.experiment = experiment
  8956. return c
  8957. }
  8958. // Fields allows partial responses to be retrieved. See
  8959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8960. // for more information.
  8961. func (c *ManagementExperimentsUpdateCall) Fields(s ...googleapi.Field) *ManagementExperimentsUpdateCall {
  8962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8963. return c
  8964. }
  8965. // Context sets the context to be used in this call's Do method. Any
  8966. // pending HTTP request will be aborted if the provided context is
  8967. // canceled.
  8968. func (c *ManagementExperimentsUpdateCall) Context(ctx context.Context) *ManagementExperimentsUpdateCall {
  8969. c.ctx_ = ctx
  8970. return c
  8971. }
  8972. // Header returns an http.Header that can be modified by the caller to
  8973. // add HTTP headers to the request.
  8974. func (c *ManagementExperimentsUpdateCall) Header() http.Header {
  8975. if c.header_ == nil {
  8976. c.header_ = make(http.Header)
  8977. }
  8978. return c.header_
  8979. }
  8980. func (c *ManagementExperimentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8981. reqHeaders := make(http.Header)
  8982. for k, v := range c.header_ {
  8983. reqHeaders[k] = v
  8984. }
  8985. reqHeaders.Set("User-Agent", c.s.userAgent())
  8986. var body io.Reader = nil
  8987. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  8988. if err != nil {
  8989. return nil, err
  8990. }
  8991. reqHeaders.Set("Content-Type", "application/json")
  8992. c.urlParams_.Set("alt", alt)
  8993. c.urlParams_.Set("prettyPrint", "false")
  8994. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8995. urls += "?" + c.urlParams_.Encode()
  8996. req, err := http.NewRequest("PUT", urls, body)
  8997. if err != nil {
  8998. return nil, err
  8999. }
  9000. req.Header = reqHeaders
  9001. googleapi.Expand(req.URL, map[string]string{
  9002. "accountId": c.accountId,
  9003. "webPropertyId": c.webPropertyId,
  9004. "profileId": c.profileId,
  9005. "experimentId": c.experimentId,
  9006. })
  9007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9008. }
  9009. // Do executes the "analytics.management.experiments.update" call.
  9010. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  9011. // status code is an error. Response headers are in either
  9012. // *Experiment.ServerResponse.Header or (if a response was returned at
  9013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9014. // to check whether the returned error was because
  9015. // http.StatusNotModified was returned.
  9016. func (c *ManagementExperimentsUpdateCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  9017. gensupport.SetOptions(c.urlParams_, opts...)
  9018. res, err := c.doRequest("json")
  9019. if res != nil && res.StatusCode == http.StatusNotModified {
  9020. if res.Body != nil {
  9021. res.Body.Close()
  9022. }
  9023. return nil, &googleapi.Error{
  9024. Code: res.StatusCode,
  9025. Header: res.Header,
  9026. }
  9027. }
  9028. if err != nil {
  9029. return nil, err
  9030. }
  9031. defer googleapi.CloseBody(res)
  9032. if err := googleapi.CheckResponse(res); err != nil {
  9033. return nil, err
  9034. }
  9035. ret := &Experiment{
  9036. ServerResponse: googleapi.ServerResponse{
  9037. Header: res.Header,
  9038. HTTPStatusCode: res.StatusCode,
  9039. },
  9040. }
  9041. target := &ret
  9042. if err := gensupport.DecodeResponse(target, res); err != nil {
  9043. return nil, err
  9044. }
  9045. return ret, nil
  9046. // {
  9047. // "description": "Update an existing experiment.",
  9048. // "httpMethod": "PUT",
  9049. // "id": "analytics.management.experiments.update",
  9050. // "parameterOrder": [
  9051. // "accountId",
  9052. // "webPropertyId",
  9053. // "profileId",
  9054. // "experimentId"
  9055. // ],
  9056. // "parameters": {
  9057. // "accountId": {
  9058. // "description": "Account ID of the experiment to update.",
  9059. // "location": "path",
  9060. // "required": true,
  9061. // "type": "string"
  9062. // },
  9063. // "experimentId": {
  9064. // "description": "Experiment ID of the experiment to update.",
  9065. // "location": "path",
  9066. // "required": true,
  9067. // "type": "string"
  9068. // },
  9069. // "profileId": {
  9070. // "description": "View (Profile) ID of the experiment to update.",
  9071. // "location": "path",
  9072. // "required": true,
  9073. // "type": "string"
  9074. // },
  9075. // "webPropertyId": {
  9076. // "description": "Web property ID of the experiment to update.",
  9077. // "location": "path",
  9078. // "required": true,
  9079. // "type": "string"
  9080. // }
  9081. // },
  9082. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  9083. // "request": {
  9084. // "$ref": "Experiment"
  9085. // },
  9086. // "response": {
  9087. // "$ref": "Experiment"
  9088. // },
  9089. // "scopes": [
  9090. // "https://www.googleapis.com/auth/analytics",
  9091. // "https://www.googleapis.com/auth/analytics.edit"
  9092. // ]
  9093. // }
  9094. }
  9095. // method id "analytics.management.filters.delete":
  9096. type ManagementFiltersDeleteCall struct {
  9097. s *Service
  9098. accountId string
  9099. filterId string
  9100. urlParams_ gensupport.URLParams
  9101. ctx_ context.Context
  9102. header_ http.Header
  9103. }
  9104. // Delete: Delete a filter.
  9105. func (r *ManagementFiltersService) Delete(accountId string, filterId string) *ManagementFiltersDeleteCall {
  9106. c := &ManagementFiltersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9107. c.accountId = accountId
  9108. c.filterId = filterId
  9109. return c
  9110. }
  9111. // Fields allows partial responses to be retrieved. See
  9112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9113. // for more information.
  9114. func (c *ManagementFiltersDeleteCall) Fields(s ...googleapi.Field) *ManagementFiltersDeleteCall {
  9115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9116. return c
  9117. }
  9118. // Context sets the context to be used in this call's Do method. Any
  9119. // pending HTTP request will be aborted if the provided context is
  9120. // canceled.
  9121. func (c *ManagementFiltersDeleteCall) Context(ctx context.Context) *ManagementFiltersDeleteCall {
  9122. c.ctx_ = ctx
  9123. return c
  9124. }
  9125. // Header returns an http.Header that can be modified by the caller to
  9126. // add HTTP headers to the request.
  9127. func (c *ManagementFiltersDeleteCall) Header() http.Header {
  9128. if c.header_ == nil {
  9129. c.header_ = make(http.Header)
  9130. }
  9131. return c.header_
  9132. }
  9133. func (c *ManagementFiltersDeleteCall) doRequest(alt string) (*http.Response, error) {
  9134. reqHeaders := make(http.Header)
  9135. for k, v := range c.header_ {
  9136. reqHeaders[k] = v
  9137. }
  9138. reqHeaders.Set("User-Agent", c.s.userAgent())
  9139. var body io.Reader = nil
  9140. c.urlParams_.Set("alt", alt)
  9141. c.urlParams_.Set("prettyPrint", "false")
  9142. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9143. urls += "?" + c.urlParams_.Encode()
  9144. req, err := http.NewRequest("DELETE", urls, body)
  9145. if err != nil {
  9146. return nil, err
  9147. }
  9148. req.Header = reqHeaders
  9149. googleapi.Expand(req.URL, map[string]string{
  9150. "accountId": c.accountId,
  9151. "filterId": c.filterId,
  9152. })
  9153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9154. }
  9155. // Do executes the "analytics.management.filters.delete" call.
  9156. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9157. // code is an error. Response headers are in either
  9158. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9159. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9160. // check whether the returned error was because http.StatusNotModified
  9161. // was returned.
  9162. func (c *ManagementFiltersDeleteCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9163. gensupport.SetOptions(c.urlParams_, opts...)
  9164. res, err := c.doRequest("json")
  9165. if res != nil && res.StatusCode == http.StatusNotModified {
  9166. if res.Body != nil {
  9167. res.Body.Close()
  9168. }
  9169. return nil, &googleapi.Error{
  9170. Code: res.StatusCode,
  9171. Header: res.Header,
  9172. }
  9173. }
  9174. if err != nil {
  9175. return nil, err
  9176. }
  9177. defer googleapi.CloseBody(res)
  9178. if err := googleapi.CheckResponse(res); err != nil {
  9179. return nil, err
  9180. }
  9181. ret := &Filter{
  9182. ServerResponse: googleapi.ServerResponse{
  9183. Header: res.Header,
  9184. HTTPStatusCode: res.StatusCode,
  9185. },
  9186. }
  9187. target := &ret
  9188. if err := gensupport.DecodeResponse(target, res); err != nil {
  9189. return nil, err
  9190. }
  9191. return ret, nil
  9192. // {
  9193. // "description": "Delete a filter.",
  9194. // "httpMethod": "DELETE",
  9195. // "id": "analytics.management.filters.delete",
  9196. // "parameterOrder": [
  9197. // "accountId",
  9198. // "filterId"
  9199. // ],
  9200. // "parameters": {
  9201. // "accountId": {
  9202. // "description": "Account ID to delete the filter for.",
  9203. // "location": "path",
  9204. // "required": true,
  9205. // "type": "string"
  9206. // },
  9207. // "filterId": {
  9208. // "description": "ID of the filter to be deleted.",
  9209. // "location": "path",
  9210. // "required": true,
  9211. // "type": "string"
  9212. // }
  9213. // },
  9214. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9215. // "response": {
  9216. // "$ref": "Filter"
  9217. // },
  9218. // "scopes": [
  9219. // "https://www.googleapis.com/auth/analytics.edit"
  9220. // ]
  9221. // }
  9222. }
  9223. // method id "analytics.management.filters.get":
  9224. type ManagementFiltersGetCall struct {
  9225. s *Service
  9226. accountId string
  9227. filterId string
  9228. urlParams_ gensupport.URLParams
  9229. ifNoneMatch_ string
  9230. ctx_ context.Context
  9231. header_ http.Header
  9232. }
  9233. // Get: Returns a filters to which the user has access.
  9234. func (r *ManagementFiltersService) Get(accountId string, filterId string) *ManagementFiltersGetCall {
  9235. c := &ManagementFiltersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9236. c.accountId = accountId
  9237. c.filterId = filterId
  9238. return c
  9239. }
  9240. // Fields allows partial responses to be retrieved. See
  9241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9242. // for more information.
  9243. func (c *ManagementFiltersGetCall) Fields(s ...googleapi.Field) *ManagementFiltersGetCall {
  9244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9245. return c
  9246. }
  9247. // IfNoneMatch sets the optional parameter which makes the operation
  9248. // fail if the object's ETag matches the given value. This is useful for
  9249. // getting updates only after the object has changed since the last
  9250. // request. Use googleapi.IsNotModified to check whether the response
  9251. // error from Do is the result of In-None-Match.
  9252. func (c *ManagementFiltersGetCall) IfNoneMatch(entityTag string) *ManagementFiltersGetCall {
  9253. c.ifNoneMatch_ = entityTag
  9254. return c
  9255. }
  9256. // Context sets the context to be used in this call's Do method. Any
  9257. // pending HTTP request will be aborted if the provided context is
  9258. // canceled.
  9259. func (c *ManagementFiltersGetCall) Context(ctx context.Context) *ManagementFiltersGetCall {
  9260. c.ctx_ = ctx
  9261. return c
  9262. }
  9263. // Header returns an http.Header that can be modified by the caller to
  9264. // add HTTP headers to the request.
  9265. func (c *ManagementFiltersGetCall) Header() http.Header {
  9266. if c.header_ == nil {
  9267. c.header_ = make(http.Header)
  9268. }
  9269. return c.header_
  9270. }
  9271. func (c *ManagementFiltersGetCall) doRequest(alt string) (*http.Response, error) {
  9272. reqHeaders := make(http.Header)
  9273. for k, v := range c.header_ {
  9274. reqHeaders[k] = v
  9275. }
  9276. reqHeaders.Set("User-Agent", c.s.userAgent())
  9277. if c.ifNoneMatch_ != "" {
  9278. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9279. }
  9280. var body io.Reader = nil
  9281. c.urlParams_.Set("alt", alt)
  9282. c.urlParams_.Set("prettyPrint", "false")
  9283. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9284. urls += "?" + c.urlParams_.Encode()
  9285. req, err := http.NewRequest("GET", urls, body)
  9286. if err != nil {
  9287. return nil, err
  9288. }
  9289. req.Header = reqHeaders
  9290. googleapi.Expand(req.URL, map[string]string{
  9291. "accountId": c.accountId,
  9292. "filterId": c.filterId,
  9293. })
  9294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9295. }
  9296. // Do executes the "analytics.management.filters.get" call.
  9297. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9298. // code is an error. Response headers are in either
  9299. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9300. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9301. // check whether the returned error was because http.StatusNotModified
  9302. // was returned.
  9303. func (c *ManagementFiltersGetCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9304. gensupport.SetOptions(c.urlParams_, opts...)
  9305. res, err := c.doRequest("json")
  9306. if res != nil && res.StatusCode == http.StatusNotModified {
  9307. if res.Body != nil {
  9308. res.Body.Close()
  9309. }
  9310. return nil, &googleapi.Error{
  9311. Code: res.StatusCode,
  9312. Header: res.Header,
  9313. }
  9314. }
  9315. if err != nil {
  9316. return nil, err
  9317. }
  9318. defer googleapi.CloseBody(res)
  9319. if err := googleapi.CheckResponse(res); err != nil {
  9320. return nil, err
  9321. }
  9322. ret := &Filter{
  9323. ServerResponse: googleapi.ServerResponse{
  9324. Header: res.Header,
  9325. HTTPStatusCode: res.StatusCode,
  9326. },
  9327. }
  9328. target := &ret
  9329. if err := gensupport.DecodeResponse(target, res); err != nil {
  9330. return nil, err
  9331. }
  9332. return ret, nil
  9333. // {
  9334. // "description": "Returns a filters to which the user has access.",
  9335. // "httpMethod": "GET",
  9336. // "id": "analytics.management.filters.get",
  9337. // "parameterOrder": [
  9338. // "accountId",
  9339. // "filterId"
  9340. // ],
  9341. // "parameters": {
  9342. // "accountId": {
  9343. // "description": "Account ID to retrieve filters for.",
  9344. // "location": "path",
  9345. // "required": true,
  9346. // "type": "string"
  9347. // },
  9348. // "filterId": {
  9349. // "description": "Filter ID to retrieve filters for.",
  9350. // "location": "path",
  9351. // "required": true,
  9352. // "type": "string"
  9353. // }
  9354. // },
  9355. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9356. // "response": {
  9357. // "$ref": "Filter"
  9358. // },
  9359. // "scopes": [
  9360. // "https://www.googleapis.com/auth/analytics.edit",
  9361. // "https://www.googleapis.com/auth/analytics.readonly"
  9362. // ]
  9363. // }
  9364. }
  9365. // method id "analytics.management.filters.insert":
  9366. type ManagementFiltersInsertCall struct {
  9367. s *Service
  9368. accountId string
  9369. filter *Filter
  9370. urlParams_ gensupport.URLParams
  9371. ctx_ context.Context
  9372. header_ http.Header
  9373. }
  9374. // Insert: Create a new filter.
  9375. func (r *ManagementFiltersService) Insert(accountId string, filter *Filter) *ManagementFiltersInsertCall {
  9376. c := &ManagementFiltersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9377. c.accountId = accountId
  9378. c.filter = filter
  9379. return c
  9380. }
  9381. // Fields allows partial responses to be retrieved. See
  9382. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9383. // for more information.
  9384. func (c *ManagementFiltersInsertCall) Fields(s ...googleapi.Field) *ManagementFiltersInsertCall {
  9385. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9386. return c
  9387. }
  9388. // Context sets the context to be used in this call's Do method. Any
  9389. // pending HTTP request will be aborted if the provided context is
  9390. // canceled.
  9391. func (c *ManagementFiltersInsertCall) Context(ctx context.Context) *ManagementFiltersInsertCall {
  9392. c.ctx_ = ctx
  9393. return c
  9394. }
  9395. // Header returns an http.Header that can be modified by the caller to
  9396. // add HTTP headers to the request.
  9397. func (c *ManagementFiltersInsertCall) Header() http.Header {
  9398. if c.header_ == nil {
  9399. c.header_ = make(http.Header)
  9400. }
  9401. return c.header_
  9402. }
  9403. func (c *ManagementFiltersInsertCall) doRequest(alt string) (*http.Response, error) {
  9404. reqHeaders := make(http.Header)
  9405. for k, v := range c.header_ {
  9406. reqHeaders[k] = v
  9407. }
  9408. reqHeaders.Set("User-Agent", c.s.userAgent())
  9409. var body io.Reader = nil
  9410. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  9411. if err != nil {
  9412. return nil, err
  9413. }
  9414. reqHeaders.Set("Content-Type", "application/json")
  9415. c.urlParams_.Set("alt", alt)
  9416. c.urlParams_.Set("prettyPrint", "false")
  9417. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters")
  9418. urls += "?" + c.urlParams_.Encode()
  9419. req, err := http.NewRequest("POST", urls, body)
  9420. if err != nil {
  9421. return nil, err
  9422. }
  9423. req.Header = reqHeaders
  9424. googleapi.Expand(req.URL, map[string]string{
  9425. "accountId": c.accountId,
  9426. })
  9427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9428. }
  9429. // Do executes the "analytics.management.filters.insert" call.
  9430. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9431. // code is an error. Response headers are in either
  9432. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9433. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9434. // check whether the returned error was because http.StatusNotModified
  9435. // was returned.
  9436. func (c *ManagementFiltersInsertCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9437. gensupport.SetOptions(c.urlParams_, opts...)
  9438. res, err := c.doRequest("json")
  9439. if res != nil && res.StatusCode == http.StatusNotModified {
  9440. if res.Body != nil {
  9441. res.Body.Close()
  9442. }
  9443. return nil, &googleapi.Error{
  9444. Code: res.StatusCode,
  9445. Header: res.Header,
  9446. }
  9447. }
  9448. if err != nil {
  9449. return nil, err
  9450. }
  9451. defer googleapi.CloseBody(res)
  9452. if err := googleapi.CheckResponse(res); err != nil {
  9453. return nil, err
  9454. }
  9455. ret := &Filter{
  9456. ServerResponse: googleapi.ServerResponse{
  9457. Header: res.Header,
  9458. HTTPStatusCode: res.StatusCode,
  9459. },
  9460. }
  9461. target := &ret
  9462. if err := gensupport.DecodeResponse(target, res); err != nil {
  9463. return nil, err
  9464. }
  9465. return ret, nil
  9466. // {
  9467. // "description": "Create a new filter.",
  9468. // "httpMethod": "POST",
  9469. // "id": "analytics.management.filters.insert",
  9470. // "parameterOrder": [
  9471. // "accountId"
  9472. // ],
  9473. // "parameters": {
  9474. // "accountId": {
  9475. // "description": "Account ID to create filter for.",
  9476. // "location": "path",
  9477. // "required": true,
  9478. // "type": "string"
  9479. // }
  9480. // },
  9481. // "path": "management/accounts/{accountId}/filters",
  9482. // "request": {
  9483. // "$ref": "Filter"
  9484. // },
  9485. // "response": {
  9486. // "$ref": "Filter"
  9487. // },
  9488. // "scopes": [
  9489. // "https://www.googleapis.com/auth/analytics.edit"
  9490. // ]
  9491. // }
  9492. }
  9493. // method id "analytics.management.filters.list":
  9494. type ManagementFiltersListCall struct {
  9495. s *Service
  9496. accountId string
  9497. urlParams_ gensupport.URLParams
  9498. ifNoneMatch_ string
  9499. ctx_ context.Context
  9500. header_ http.Header
  9501. }
  9502. // List: Lists all filters for an account
  9503. func (r *ManagementFiltersService) List(accountId string) *ManagementFiltersListCall {
  9504. c := &ManagementFiltersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9505. c.accountId = accountId
  9506. return c
  9507. }
  9508. // MaxResults sets the optional parameter "max-results": The maximum
  9509. // number of filters to include in this response.
  9510. func (c *ManagementFiltersListCall) MaxResults(maxResults int64) *ManagementFiltersListCall {
  9511. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  9512. return c
  9513. }
  9514. // StartIndex sets the optional parameter "start-index": An index of the
  9515. // first entity to retrieve. Use this parameter as a pagination
  9516. // mechanism along with the max-results parameter.
  9517. func (c *ManagementFiltersListCall) StartIndex(startIndex int64) *ManagementFiltersListCall {
  9518. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  9519. return c
  9520. }
  9521. // Fields allows partial responses to be retrieved. See
  9522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9523. // for more information.
  9524. func (c *ManagementFiltersListCall) Fields(s ...googleapi.Field) *ManagementFiltersListCall {
  9525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9526. return c
  9527. }
  9528. // IfNoneMatch sets the optional parameter which makes the operation
  9529. // fail if the object's ETag matches the given value. This is useful for
  9530. // getting updates only after the object has changed since the last
  9531. // request. Use googleapi.IsNotModified to check whether the response
  9532. // error from Do is the result of In-None-Match.
  9533. func (c *ManagementFiltersListCall) IfNoneMatch(entityTag string) *ManagementFiltersListCall {
  9534. c.ifNoneMatch_ = entityTag
  9535. return c
  9536. }
  9537. // Context sets the context to be used in this call's Do method. Any
  9538. // pending HTTP request will be aborted if the provided context is
  9539. // canceled.
  9540. func (c *ManagementFiltersListCall) Context(ctx context.Context) *ManagementFiltersListCall {
  9541. c.ctx_ = ctx
  9542. return c
  9543. }
  9544. // Header returns an http.Header that can be modified by the caller to
  9545. // add HTTP headers to the request.
  9546. func (c *ManagementFiltersListCall) Header() http.Header {
  9547. if c.header_ == nil {
  9548. c.header_ = make(http.Header)
  9549. }
  9550. return c.header_
  9551. }
  9552. func (c *ManagementFiltersListCall) doRequest(alt string) (*http.Response, error) {
  9553. reqHeaders := make(http.Header)
  9554. for k, v := range c.header_ {
  9555. reqHeaders[k] = v
  9556. }
  9557. reqHeaders.Set("User-Agent", c.s.userAgent())
  9558. if c.ifNoneMatch_ != "" {
  9559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9560. }
  9561. var body io.Reader = nil
  9562. c.urlParams_.Set("alt", alt)
  9563. c.urlParams_.Set("prettyPrint", "false")
  9564. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters")
  9565. urls += "?" + c.urlParams_.Encode()
  9566. req, err := http.NewRequest("GET", urls, body)
  9567. if err != nil {
  9568. return nil, err
  9569. }
  9570. req.Header = reqHeaders
  9571. googleapi.Expand(req.URL, map[string]string{
  9572. "accountId": c.accountId,
  9573. })
  9574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9575. }
  9576. // Do executes the "analytics.management.filters.list" call.
  9577. // Exactly one of *Filters or error will be non-nil. Any non-2xx status
  9578. // code is an error. Response headers are in either
  9579. // *Filters.ServerResponse.Header or (if a response was returned at all)
  9580. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9581. // check whether the returned error was because http.StatusNotModified
  9582. // was returned.
  9583. func (c *ManagementFiltersListCall) Do(opts ...googleapi.CallOption) (*Filters, error) {
  9584. gensupport.SetOptions(c.urlParams_, opts...)
  9585. res, err := c.doRequest("json")
  9586. if res != nil && res.StatusCode == http.StatusNotModified {
  9587. if res.Body != nil {
  9588. res.Body.Close()
  9589. }
  9590. return nil, &googleapi.Error{
  9591. Code: res.StatusCode,
  9592. Header: res.Header,
  9593. }
  9594. }
  9595. if err != nil {
  9596. return nil, err
  9597. }
  9598. defer googleapi.CloseBody(res)
  9599. if err := googleapi.CheckResponse(res); err != nil {
  9600. return nil, err
  9601. }
  9602. ret := &Filters{
  9603. ServerResponse: googleapi.ServerResponse{
  9604. Header: res.Header,
  9605. HTTPStatusCode: res.StatusCode,
  9606. },
  9607. }
  9608. target := &ret
  9609. if err := gensupport.DecodeResponse(target, res); err != nil {
  9610. return nil, err
  9611. }
  9612. return ret, nil
  9613. // {
  9614. // "description": "Lists all filters for an account",
  9615. // "httpMethod": "GET",
  9616. // "id": "analytics.management.filters.list",
  9617. // "parameterOrder": [
  9618. // "accountId"
  9619. // ],
  9620. // "parameters": {
  9621. // "accountId": {
  9622. // "description": "Account ID to retrieve filters for.",
  9623. // "location": "path",
  9624. // "pattern": "\\d+",
  9625. // "required": true,
  9626. // "type": "string"
  9627. // },
  9628. // "max-results": {
  9629. // "description": "The maximum number of filters to include in this response.",
  9630. // "format": "int32",
  9631. // "location": "query",
  9632. // "type": "integer"
  9633. // },
  9634. // "start-index": {
  9635. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  9636. // "format": "int32",
  9637. // "location": "query",
  9638. // "minimum": "1",
  9639. // "type": "integer"
  9640. // }
  9641. // },
  9642. // "path": "management/accounts/{accountId}/filters",
  9643. // "response": {
  9644. // "$ref": "Filters"
  9645. // },
  9646. // "scopes": [
  9647. // "https://www.googleapis.com/auth/analytics.edit",
  9648. // "https://www.googleapis.com/auth/analytics.readonly"
  9649. // ]
  9650. // }
  9651. }
  9652. // method id "analytics.management.filters.patch":
  9653. type ManagementFiltersPatchCall struct {
  9654. s *Service
  9655. accountId string
  9656. filterId string
  9657. filter *Filter
  9658. urlParams_ gensupport.URLParams
  9659. ctx_ context.Context
  9660. header_ http.Header
  9661. }
  9662. // Patch: Updates an existing filter. This method supports patch
  9663. // semantics.
  9664. func (r *ManagementFiltersService) Patch(accountId string, filterId string, filter *Filter) *ManagementFiltersPatchCall {
  9665. c := &ManagementFiltersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9666. c.accountId = accountId
  9667. c.filterId = filterId
  9668. c.filter = filter
  9669. return c
  9670. }
  9671. // Fields allows partial responses to be retrieved. See
  9672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9673. // for more information.
  9674. func (c *ManagementFiltersPatchCall) Fields(s ...googleapi.Field) *ManagementFiltersPatchCall {
  9675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9676. return c
  9677. }
  9678. // Context sets the context to be used in this call's Do method. Any
  9679. // pending HTTP request will be aborted if the provided context is
  9680. // canceled.
  9681. func (c *ManagementFiltersPatchCall) Context(ctx context.Context) *ManagementFiltersPatchCall {
  9682. c.ctx_ = ctx
  9683. return c
  9684. }
  9685. // Header returns an http.Header that can be modified by the caller to
  9686. // add HTTP headers to the request.
  9687. func (c *ManagementFiltersPatchCall) Header() http.Header {
  9688. if c.header_ == nil {
  9689. c.header_ = make(http.Header)
  9690. }
  9691. return c.header_
  9692. }
  9693. func (c *ManagementFiltersPatchCall) doRequest(alt string) (*http.Response, error) {
  9694. reqHeaders := make(http.Header)
  9695. for k, v := range c.header_ {
  9696. reqHeaders[k] = v
  9697. }
  9698. reqHeaders.Set("User-Agent", c.s.userAgent())
  9699. var body io.Reader = nil
  9700. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  9701. if err != nil {
  9702. return nil, err
  9703. }
  9704. reqHeaders.Set("Content-Type", "application/json")
  9705. c.urlParams_.Set("alt", alt)
  9706. c.urlParams_.Set("prettyPrint", "false")
  9707. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9708. urls += "?" + c.urlParams_.Encode()
  9709. req, err := http.NewRequest("PATCH", urls, body)
  9710. if err != nil {
  9711. return nil, err
  9712. }
  9713. req.Header = reqHeaders
  9714. googleapi.Expand(req.URL, map[string]string{
  9715. "accountId": c.accountId,
  9716. "filterId": c.filterId,
  9717. })
  9718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9719. }
  9720. // Do executes the "analytics.management.filters.patch" call.
  9721. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9722. // code is an error. Response headers are in either
  9723. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9724. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9725. // check whether the returned error was because http.StatusNotModified
  9726. // was returned.
  9727. func (c *ManagementFiltersPatchCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9728. gensupport.SetOptions(c.urlParams_, opts...)
  9729. res, err := c.doRequest("json")
  9730. if res != nil && res.StatusCode == http.StatusNotModified {
  9731. if res.Body != nil {
  9732. res.Body.Close()
  9733. }
  9734. return nil, &googleapi.Error{
  9735. Code: res.StatusCode,
  9736. Header: res.Header,
  9737. }
  9738. }
  9739. if err != nil {
  9740. return nil, err
  9741. }
  9742. defer googleapi.CloseBody(res)
  9743. if err := googleapi.CheckResponse(res); err != nil {
  9744. return nil, err
  9745. }
  9746. ret := &Filter{
  9747. ServerResponse: googleapi.ServerResponse{
  9748. Header: res.Header,
  9749. HTTPStatusCode: res.StatusCode,
  9750. },
  9751. }
  9752. target := &ret
  9753. if err := gensupport.DecodeResponse(target, res); err != nil {
  9754. return nil, err
  9755. }
  9756. return ret, nil
  9757. // {
  9758. // "description": "Updates an existing filter. This method supports patch semantics.",
  9759. // "httpMethod": "PATCH",
  9760. // "id": "analytics.management.filters.patch",
  9761. // "parameterOrder": [
  9762. // "accountId",
  9763. // "filterId"
  9764. // ],
  9765. // "parameters": {
  9766. // "accountId": {
  9767. // "description": "Account ID to which the filter belongs.",
  9768. // "location": "path",
  9769. // "required": true,
  9770. // "type": "string"
  9771. // },
  9772. // "filterId": {
  9773. // "description": "ID of the filter to be updated.",
  9774. // "location": "path",
  9775. // "required": true,
  9776. // "type": "string"
  9777. // }
  9778. // },
  9779. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9780. // "request": {
  9781. // "$ref": "Filter"
  9782. // },
  9783. // "response": {
  9784. // "$ref": "Filter"
  9785. // },
  9786. // "scopes": [
  9787. // "https://www.googleapis.com/auth/analytics.edit"
  9788. // ]
  9789. // }
  9790. }
  9791. // method id "analytics.management.filters.update":
  9792. type ManagementFiltersUpdateCall struct {
  9793. s *Service
  9794. accountId string
  9795. filterId string
  9796. filter *Filter
  9797. urlParams_ gensupport.URLParams
  9798. ctx_ context.Context
  9799. header_ http.Header
  9800. }
  9801. // Update: Updates an existing filter.
  9802. func (r *ManagementFiltersService) Update(accountId string, filterId string, filter *Filter) *ManagementFiltersUpdateCall {
  9803. c := &ManagementFiltersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9804. c.accountId = accountId
  9805. c.filterId = filterId
  9806. c.filter = filter
  9807. return c
  9808. }
  9809. // Fields allows partial responses to be retrieved. See
  9810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9811. // for more information.
  9812. func (c *ManagementFiltersUpdateCall) Fields(s ...googleapi.Field) *ManagementFiltersUpdateCall {
  9813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9814. return c
  9815. }
  9816. // Context sets the context to be used in this call's Do method. Any
  9817. // pending HTTP request will be aborted if the provided context is
  9818. // canceled.
  9819. func (c *ManagementFiltersUpdateCall) Context(ctx context.Context) *ManagementFiltersUpdateCall {
  9820. c.ctx_ = ctx
  9821. return c
  9822. }
  9823. // Header returns an http.Header that can be modified by the caller to
  9824. // add HTTP headers to the request.
  9825. func (c *ManagementFiltersUpdateCall) Header() http.Header {
  9826. if c.header_ == nil {
  9827. c.header_ = make(http.Header)
  9828. }
  9829. return c.header_
  9830. }
  9831. func (c *ManagementFiltersUpdateCall) doRequest(alt string) (*http.Response, error) {
  9832. reqHeaders := make(http.Header)
  9833. for k, v := range c.header_ {
  9834. reqHeaders[k] = v
  9835. }
  9836. reqHeaders.Set("User-Agent", c.s.userAgent())
  9837. var body io.Reader = nil
  9838. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  9839. if err != nil {
  9840. return nil, err
  9841. }
  9842. reqHeaders.Set("Content-Type", "application/json")
  9843. c.urlParams_.Set("alt", alt)
  9844. c.urlParams_.Set("prettyPrint", "false")
  9845. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9846. urls += "?" + c.urlParams_.Encode()
  9847. req, err := http.NewRequest("PUT", urls, body)
  9848. if err != nil {
  9849. return nil, err
  9850. }
  9851. req.Header = reqHeaders
  9852. googleapi.Expand(req.URL, map[string]string{
  9853. "accountId": c.accountId,
  9854. "filterId": c.filterId,
  9855. })
  9856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9857. }
  9858. // Do executes the "analytics.management.filters.update" call.
  9859. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9860. // code is an error. Response headers are in either
  9861. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9862. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9863. // check whether the returned error was because http.StatusNotModified
  9864. // was returned.
  9865. func (c *ManagementFiltersUpdateCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9866. gensupport.SetOptions(c.urlParams_, opts...)
  9867. res, err := c.doRequest("json")
  9868. if res != nil && res.StatusCode == http.StatusNotModified {
  9869. if res.Body != nil {
  9870. res.Body.Close()
  9871. }
  9872. return nil, &googleapi.Error{
  9873. Code: res.StatusCode,
  9874. Header: res.Header,
  9875. }
  9876. }
  9877. if err != nil {
  9878. return nil, err
  9879. }
  9880. defer googleapi.CloseBody(res)
  9881. if err := googleapi.CheckResponse(res); err != nil {
  9882. return nil, err
  9883. }
  9884. ret := &Filter{
  9885. ServerResponse: googleapi.ServerResponse{
  9886. Header: res.Header,
  9887. HTTPStatusCode: res.StatusCode,
  9888. },
  9889. }
  9890. target := &ret
  9891. if err := gensupport.DecodeResponse(target, res); err != nil {
  9892. return nil, err
  9893. }
  9894. return ret, nil
  9895. // {
  9896. // "description": "Updates an existing filter.",
  9897. // "httpMethod": "PUT",
  9898. // "id": "analytics.management.filters.update",
  9899. // "parameterOrder": [
  9900. // "accountId",
  9901. // "filterId"
  9902. // ],
  9903. // "parameters": {
  9904. // "accountId": {
  9905. // "description": "Account ID to which the filter belongs.",
  9906. // "location": "path",
  9907. // "required": true,
  9908. // "type": "string"
  9909. // },
  9910. // "filterId": {
  9911. // "description": "ID of the filter to be updated.",
  9912. // "location": "path",
  9913. // "required": true,
  9914. // "type": "string"
  9915. // }
  9916. // },
  9917. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9918. // "request": {
  9919. // "$ref": "Filter"
  9920. // },
  9921. // "response": {
  9922. // "$ref": "Filter"
  9923. // },
  9924. // "scopes": [
  9925. // "https://www.googleapis.com/auth/analytics.edit"
  9926. // ]
  9927. // }
  9928. }
  9929. // method id "analytics.management.goals.get":
  9930. type ManagementGoalsGetCall struct {
  9931. s *Service
  9932. accountId string
  9933. webPropertyId string
  9934. profileId string
  9935. goalId string
  9936. urlParams_ gensupport.URLParams
  9937. ifNoneMatch_ string
  9938. ctx_ context.Context
  9939. header_ http.Header
  9940. }
  9941. // Get: Gets a goal to which the user has access.
  9942. func (r *ManagementGoalsService) Get(accountId string, webPropertyId string, profileId string, goalId string) *ManagementGoalsGetCall {
  9943. c := &ManagementGoalsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9944. c.accountId = accountId
  9945. c.webPropertyId = webPropertyId
  9946. c.profileId = profileId
  9947. c.goalId = goalId
  9948. return c
  9949. }
  9950. // Fields allows partial responses to be retrieved. See
  9951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9952. // for more information.
  9953. func (c *ManagementGoalsGetCall) Fields(s ...googleapi.Field) *ManagementGoalsGetCall {
  9954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9955. return c
  9956. }
  9957. // IfNoneMatch sets the optional parameter which makes the operation
  9958. // fail if the object's ETag matches the given value. This is useful for
  9959. // getting updates only after the object has changed since the last
  9960. // request. Use googleapi.IsNotModified to check whether the response
  9961. // error from Do is the result of In-None-Match.
  9962. func (c *ManagementGoalsGetCall) IfNoneMatch(entityTag string) *ManagementGoalsGetCall {
  9963. c.ifNoneMatch_ = entityTag
  9964. return c
  9965. }
  9966. // Context sets the context to be used in this call's Do method. Any
  9967. // pending HTTP request will be aborted if the provided context is
  9968. // canceled.
  9969. func (c *ManagementGoalsGetCall) Context(ctx context.Context) *ManagementGoalsGetCall {
  9970. c.ctx_ = ctx
  9971. return c
  9972. }
  9973. // Header returns an http.Header that can be modified by the caller to
  9974. // add HTTP headers to the request.
  9975. func (c *ManagementGoalsGetCall) Header() http.Header {
  9976. if c.header_ == nil {
  9977. c.header_ = make(http.Header)
  9978. }
  9979. return c.header_
  9980. }
  9981. func (c *ManagementGoalsGetCall) doRequest(alt string) (*http.Response, error) {
  9982. reqHeaders := make(http.Header)
  9983. for k, v := range c.header_ {
  9984. reqHeaders[k] = v
  9985. }
  9986. reqHeaders.Set("User-Agent", c.s.userAgent())
  9987. if c.ifNoneMatch_ != "" {
  9988. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9989. }
  9990. var body io.Reader = nil
  9991. c.urlParams_.Set("alt", alt)
  9992. c.urlParams_.Set("prettyPrint", "false")
  9993. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  9994. urls += "?" + c.urlParams_.Encode()
  9995. req, err := http.NewRequest("GET", urls, body)
  9996. if err != nil {
  9997. return nil, err
  9998. }
  9999. req.Header = reqHeaders
  10000. googleapi.Expand(req.URL, map[string]string{
  10001. "accountId": c.accountId,
  10002. "webPropertyId": c.webPropertyId,
  10003. "profileId": c.profileId,
  10004. "goalId": c.goalId,
  10005. })
  10006. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10007. }
  10008. // Do executes the "analytics.management.goals.get" call.
  10009. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10010. // code is an error. Response headers are in either
  10011. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10012. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10013. // whether the returned error was because http.StatusNotModified was
  10014. // returned.
  10015. func (c *ManagementGoalsGetCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10016. gensupport.SetOptions(c.urlParams_, opts...)
  10017. res, err := c.doRequest("json")
  10018. if res != nil && res.StatusCode == http.StatusNotModified {
  10019. if res.Body != nil {
  10020. res.Body.Close()
  10021. }
  10022. return nil, &googleapi.Error{
  10023. Code: res.StatusCode,
  10024. Header: res.Header,
  10025. }
  10026. }
  10027. if err != nil {
  10028. return nil, err
  10029. }
  10030. defer googleapi.CloseBody(res)
  10031. if err := googleapi.CheckResponse(res); err != nil {
  10032. return nil, err
  10033. }
  10034. ret := &Goal{
  10035. ServerResponse: googleapi.ServerResponse{
  10036. Header: res.Header,
  10037. HTTPStatusCode: res.StatusCode,
  10038. },
  10039. }
  10040. target := &ret
  10041. if err := gensupport.DecodeResponse(target, res); err != nil {
  10042. return nil, err
  10043. }
  10044. return ret, nil
  10045. // {
  10046. // "description": "Gets a goal to which the user has access.",
  10047. // "httpMethod": "GET",
  10048. // "id": "analytics.management.goals.get",
  10049. // "parameterOrder": [
  10050. // "accountId",
  10051. // "webPropertyId",
  10052. // "profileId",
  10053. // "goalId"
  10054. // ],
  10055. // "parameters": {
  10056. // "accountId": {
  10057. // "description": "Account ID to retrieve the goal for.",
  10058. // "location": "path",
  10059. // "required": true,
  10060. // "type": "string"
  10061. // },
  10062. // "goalId": {
  10063. // "description": "Goal ID to retrieve the goal for.",
  10064. // "location": "path",
  10065. // "required": true,
  10066. // "type": "string"
  10067. // },
  10068. // "profileId": {
  10069. // "description": "View (Profile) ID to retrieve the goal for.",
  10070. // "location": "path",
  10071. // "required": true,
  10072. // "type": "string"
  10073. // },
  10074. // "webPropertyId": {
  10075. // "description": "Web property ID to retrieve the goal for.",
  10076. // "location": "path",
  10077. // "required": true,
  10078. // "type": "string"
  10079. // }
  10080. // },
  10081. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  10082. // "response": {
  10083. // "$ref": "Goal"
  10084. // },
  10085. // "scopes": [
  10086. // "https://www.googleapis.com/auth/analytics.edit",
  10087. // "https://www.googleapis.com/auth/analytics.readonly"
  10088. // ]
  10089. // }
  10090. }
  10091. // method id "analytics.management.goals.insert":
  10092. type ManagementGoalsInsertCall struct {
  10093. s *Service
  10094. accountId string
  10095. webPropertyId string
  10096. profileId string
  10097. goal *Goal
  10098. urlParams_ gensupport.URLParams
  10099. ctx_ context.Context
  10100. header_ http.Header
  10101. }
  10102. // Insert: Create a new goal.
  10103. func (r *ManagementGoalsService) Insert(accountId string, webPropertyId string, profileId string, goal *Goal) *ManagementGoalsInsertCall {
  10104. c := &ManagementGoalsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10105. c.accountId = accountId
  10106. c.webPropertyId = webPropertyId
  10107. c.profileId = profileId
  10108. c.goal = goal
  10109. return c
  10110. }
  10111. // Fields allows partial responses to be retrieved. See
  10112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10113. // for more information.
  10114. func (c *ManagementGoalsInsertCall) Fields(s ...googleapi.Field) *ManagementGoalsInsertCall {
  10115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10116. return c
  10117. }
  10118. // Context sets the context to be used in this call's Do method. Any
  10119. // pending HTTP request will be aborted if the provided context is
  10120. // canceled.
  10121. func (c *ManagementGoalsInsertCall) Context(ctx context.Context) *ManagementGoalsInsertCall {
  10122. c.ctx_ = ctx
  10123. return c
  10124. }
  10125. // Header returns an http.Header that can be modified by the caller to
  10126. // add HTTP headers to the request.
  10127. func (c *ManagementGoalsInsertCall) Header() http.Header {
  10128. if c.header_ == nil {
  10129. c.header_ = make(http.Header)
  10130. }
  10131. return c.header_
  10132. }
  10133. func (c *ManagementGoalsInsertCall) doRequest(alt string) (*http.Response, error) {
  10134. reqHeaders := make(http.Header)
  10135. for k, v := range c.header_ {
  10136. reqHeaders[k] = v
  10137. }
  10138. reqHeaders.Set("User-Agent", c.s.userAgent())
  10139. var body io.Reader = nil
  10140. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  10141. if err != nil {
  10142. return nil, err
  10143. }
  10144. reqHeaders.Set("Content-Type", "application/json")
  10145. c.urlParams_.Set("alt", alt)
  10146. c.urlParams_.Set("prettyPrint", "false")
  10147. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals")
  10148. urls += "?" + c.urlParams_.Encode()
  10149. req, err := http.NewRequest("POST", urls, body)
  10150. if err != nil {
  10151. return nil, err
  10152. }
  10153. req.Header = reqHeaders
  10154. googleapi.Expand(req.URL, map[string]string{
  10155. "accountId": c.accountId,
  10156. "webPropertyId": c.webPropertyId,
  10157. "profileId": c.profileId,
  10158. })
  10159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10160. }
  10161. // Do executes the "analytics.management.goals.insert" call.
  10162. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10163. // code is an error. Response headers are in either
  10164. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10165. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10166. // whether the returned error was because http.StatusNotModified was
  10167. // returned.
  10168. func (c *ManagementGoalsInsertCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10169. gensupport.SetOptions(c.urlParams_, opts...)
  10170. res, err := c.doRequest("json")
  10171. if res != nil && res.StatusCode == http.StatusNotModified {
  10172. if res.Body != nil {
  10173. res.Body.Close()
  10174. }
  10175. return nil, &googleapi.Error{
  10176. Code: res.StatusCode,
  10177. Header: res.Header,
  10178. }
  10179. }
  10180. if err != nil {
  10181. return nil, err
  10182. }
  10183. defer googleapi.CloseBody(res)
  10184. if err := googleapi.CheckResponse(res); err != nil {
  10185. return nil, err
  10186. }
  10187. ret := &Goal{
  10188. ServerResponse: googleapi.ServerResponse{
  10189. Header: res.Header,
  10190. HTTPStatusCode: res.StatusCode,
  10191. },
  10192. }
  10193. target := &ret
  10194. if err := gensupport.DecodeResponse(target, res); err != nil {
  10195. return nil, err
  10196. }
  10197. return ret, nil
  10198. // {
  10199. // "description": "Create a new goal.",
  10200. // "httpMethod": "POST",
  10201. // "id": "analytics.management.goals.insert",
  10202. // "parameterOrder": [
  10203. // "accountId",
  10204. // "webPropertyId",
  10205. // "profileId"
  10206. // ],
  10207. // "parameters": {
  10208. // "accountId": {
  10209. // "description": "Account ID to create the goal for.",
  10210. // "location": "path",
  10211. // "required": true,
  10212. // "type": "string"
  10213. // },
  10214. // "profileId": {
  10215. // "description": "View (Profile) ID to create the goal for.",
  10216. // "location": "path",
  10217. // "required": true,
  10218. // "type": "string"
  10219. // },
  10220. // "webPropertyId": {
  10221. // "description": "Web property ID to create the goal for.",
  10222. // "location": "path",
  10223. // "required": true,
  10224. // "type": "string"
  10225. // }
  10226. // },
  10227. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
  10228. // "request": {
  10229. // "$ref": "Goal"
  10230. // },
  10231. // "response": {
  10232. // "$ref": "Goal"
  10233. // },
  10234. // "scopes": [
  10235. // "https://www.googleapis.com/auth/analytics.edit"
  10236. // ]
  10237. // }
  10238. }
  10239. // method id "analytics.management.goals.list":
  10240. type ManagementGoalsListCall struct {
  10241. s *Service
  10242. accountId string
  10243. webPropertyId string
  10244. profileId string
  10245. urlParams_ gensupport.URLParams
  10246. ifNoneMatch_ string
  10247. ctx_ context.Context
  10248. header_ http.Header
  10249. }
  10250. // List: Lists goals to which the user has access.
  10251. func (r *ManagementGoalsService) List(accountId string, webPropertyId string, profileId string) *ManagementGoalsListCall {
  10252. c := &ManagementGoalsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10253. c.accountId = accountId
  10254. c.webPropertyId = webPropertyId
  10255. c.profileId = profileId
  10256. return c
  10257. }
  10258. // MaxResults sets the optional parameter "max-results": The maximum
  10259. // number of goals to include in this response.
  10260. func (c *ManagementGoalsListCall) MaxResults(maxResults int64) *ManagementGoalsListCall {
  10261. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  10262. return c
  10263. }
  10264. // StartIndex sets the optional parameter "start-index": An index of the
  10265. // first goal to retrieve. Use this parameter as a pagination mechanism
  10266. // along with the max-results parameter.
  10267. func (c *ManagementGoalsListCall) StartIndex(startIndex int64) *ManagementGoalsListCall {
  10268. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  10269. return c
  10270. }
  10271. // Fields allows partial responses to be retrieved. See
  10272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10273. // for more information.
  10274. func (c *ManagementGoalsListCall) Fields(s ...googleapi.Field) *ManagementGoalsListCall {
  10275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10276. return c
  10277. }
  10278. // IfNoneMatch sets the optional parameter which makes the operation
  10279. // fail if the object's ETag matches the given value. This is useful for
  10280. // getting updates only after the object has changed since the last
  10281. // request. Use googleapi.IsNotModified to check whether the response
  10282. // error from Do is the result of In-None-Match.
  10283. func (c *ManagementGoalsListCall) IfNoneMatch(entityTag string) *ManagementGoalsListCall {
  10284. c.ifNoneMatch_ = entityTag
  10285. return c
  10286. }
  10287. // Context sets the context to be used in this call's Do method. Any
  10288. // pending HTTP request will be aborted if the provided context is
  10289. // canceled.
  10290. func (c *ManagementGoalsListCall) Context(ctx context.Context) *ManagementGoalsListCall {
  10291. c.ctx_ = ctx
  10292. return c
  10293. }
  10294. // Header returns an http.Header that can be modified by the caller to
  10295. // add HTTP headers to the request.
  10296. func (c *ManagementGoalsListCall) Header() http.Header {
  10297. if c.header_ == nil {
  10298. c.header_ = make(http.Header)
  10299. }
  10300. return c.header_
  10301. }
  10302. func (c *ManagementGoalsListCall) doRequest(alt string) (*http.Response, error) {
  10303. reqHeaders := make(http.Header)
  10304. for k, v := range c.header_ {
  10305. reqHeaders[k] = v
  10306. }
  10307. reqHeaders.Set("User-Agent", c.s.userAgent())
  10308. if c.ifNoneMatch_ != "" {
  10309. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10310. }
  10311. var body io.Reader = nil
  10312. c.urlParams_.Set("alt", alt)
  10313. c.urlParams_.Set("prettyPrint", "false")
  10314. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals")
  10315. urls += "?" + c.urlParams_.Encode()
  10316. req, err := http.NewRequest("GET", urls, body)
  10317. if err != nil {
  10318. return nil, err
  10319. }
  10320. req.Header = reqHeaders
  10321. googleapi.Expand(req.URL, map[string]string{
  10322. "accountId": c.accountId,
  10323. "webPropertyId": c.webPropertyId,
  10324. "profileId": c.profileId,
  10325. })
  10326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10327. }
  10328. // Do executes the "analytics.management.goals.list" call.
  10329. // Exactly one of *Goals or error will be non-nil. Any non-2xx status
  10330. // code is an error. Response headers are in either
  10331. // *Goals.ServerResponse.Header or (if a response was returned at all)
  10332. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10333. // check whether the returned error was because http.StatusNotModified
  10334. // was returned.
  10335. func (c *ManagementGoalsListCall) Do(opts ...googleapi.CallOption) (*Goals, error) {
  10336. gensupport.SetOptions(c.urlParams_, opts...)
  10337. res, err := c.doRequest("json")
  10338. if res != nil && res.StatusCode == http.StatusNotModified {
  10339. if res.Body != nil {
  10340. res.Body.Close()
  10341. }
  10342. return nil, &googleapi.Error{
  10343. Code: res.StatusCode,
  10344. Header: res.Header,
  10345. }
  10346. }
  10347. if err != nil {
  10348. return nil, err
  10349. }
  10350. defer googleapi.CloseBody(res)
  10351. if err := googleapi.CheckResponse(res); err != nil {
  10352. return nil, err
  10353. }
  10354. ret := &Goals{
  10355. ServerResponse: googleapi.ServerResponse{
  10356. Header: res.Header,
  10357. HTTPStatusCode: res.StatusCode,
  10358. },
  10359. }
  10360. target := &ret
  10361. if err := gensupport.DecodeResponse(target, res); err != nil {
  10362. return nil, err
  10363. }
  10364. return ret, nil
  10365. // {
  10366. // "description": "Lists goals to which the user has access.",
  10367. // "httpMethod": "GET",
  10368. // "id": "analytics.management.goals.list",
  10369. // "parameterOrder": [
  10370. // "accountId",
  10371. // "webPropertyId",
  10372. // "profileId"
  10373. // ],
  10374. // "parameters": {
  10375. // "accountId": {
  10376. // "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.",
  10377. // "location": "path",
  10378. // "required": true,
  10379. // "type": "string"
  10380. // },
  10381. // "max-results": {
  10382. // "description": "The maximum number of goals to include in this response.",
  10383. // "format": "int32",
  10384. // "location": "query",
  10385. // "type": "integer"
  10386. // },
  10387. // "profileId": {
  10388. // "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.",
  10389. // "location": "path",
  10390. // "required": true,
  10391. // "type": "string"
  10392. // },
  10393. // "start-index": {
  10394. // "description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  10395. // "format": "int32",
  10396. // "location": "query",
  10397. // "minimum": "1",
  10398. // "type": "integer"
  10399. // },
  10400. // "webPropertyId": {
  10401. // "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.",
  10402. // "location": "path",
  10403. // "required": true,
  10404. // "type": "string"
  10405. // }
  10406. // },
  10407. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
  10408. // "response": {
  10409. // "$ref": "Goals"
  10410. // },
  10411. // "scopes": [
  10412. // "https://www.googleapis.com/auth/analytics",
  10413. // "https://www.googleapis.com/auth/analytics.edit",
  10414. // "https://www.googleapis.com/auth/analytics.readonly"
  10415. // ]
  10416. // }
  10417. }
  10418. // method id "analytics.management.goals.patch":
  10419. type ManagementGoalsPatchCall struct {
  10420. s *Service
  10421. accountId string
  10422. webPropertyId string
  10423. profileId string
  10424. goalId string
  10425. goal *Goal
  10426. urlParams_ gensupport.URLParams
  10427. ctx_ context.Context
  10428. header_ http.Header
  10429. }
  10430. // Patch: Updates an existing goal. This method supports patch
  10431. // semantics.
  10432. func (r *ManagementGoalsService) Patch(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsPatchCall {
  10433. c := &ManagementGoalsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10434. c.accountId = accountId
  10435. c.webPropertyId = webPropertyId
  10436. c.profileId = profileId
  10437. c.goalId = goalId
  10438. c.goal = goal
  10439. return c
  10440. }
  10441. // Fields allows partial responses to be retrieved. See
  10442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10443. // for more information.
  10444. func (c *ManagementGoalsPatchCall) Fields(s ...googleapi.Field) *ManagementGoalsPatchCall {
  10445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10446. return c
  10447. }
  10448. // Context sets the context to be used in this call's Do method. Any
  10449. // pending HTTP request will be aborted if the provided context is
  10450. // canceled.
  10451. func (c *ManagementGoalsPatchCall) Context(ctx context.Context) *ManagementGoalsPatchCall {
  10452. c.ctx_ = ctx
  10453. return c
  10454. }
  10455. // Header returns an http.Header that can be modified by the caller to
  10456. // add HTTP headers to the request.
  10457. func (c *ManagementGoalsPatchCall) Header() http.Header {
  10458. if c.header_ == nil {
  10459. c.header_ = make(http.Header)
  10460. }
  10461. return c.header_
  10462. }
  10463. func (c *ManagementGoalsPatchCall) doRequest(alt string) (*http.Response, error) {
  10464. reqHeaders := make(http.Header)
  10465. for k, v := range c.header_ {
  10466. reqHeaders[k] = v
  10467. }
  10468. reqHeaders.Set("User-Agent", c.s.userAgent())
  10469. var body io.Reader = nil
  10470. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  10471. if err != nil {
  10472. return nil, err
  10473. }
  10474. reqHeaders.Set("Content-Type", "application/json")
  10475. c.urlParams_.Set("alt", alt)
  10476. c.urlParams_.Set("prettyPrint", "false")
  10477. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  10478. urls += "?" + c.urlParams_.Encode()
  10479. req, err := http.NewRequest("PATCH", urls, body)
  10480. if err != nil {
  10481. return nil, err
  10482. }
  10483. req.Header = reqHeaders
  10484. googleapi.Expand(req.URL, map[string]string{
  10485. "accountId": c.accountId,
  10486. "webPropertyId": c.webPropertyId,
  10487. "profileId": c.profileId,
  10488. "goalId": c.goalId,
  10489. })
  10490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10491. }
  10492. // Do executes the "analytics.management.goals.patch" call.
  10493. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10494. // code is an error. Response headers are in either
  10495. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10496. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10497. // whether the returned error was because http.StatusNotModified was
  10498. // returned.
  10499. func (c *ManagementGoalsPatchCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10500. gensupport.SetOptions(c.urlParams_, opts...)
  10501. res, err := c.doRequest("json")
  10502. if res != nil && res.StatusCode == http.StatusNotModified {
  10503. if res.Body != nil {
  10504. res.Body.Close()
  10505. }
  10506. return nil, &googleapi.Error{
  10507. Code: res.StatusCode,
  10508. Header: res.Header,
  10509. }
  10510. }
  10511. if err != nil {
  10512. return nil, err
  10513. }
  10514. defer googleapi.CloseBody(res)
  10515. if err := googleapi.CheckResponse(res); err != nil {
  10516. return nil, err
  10517. }
  10518. ret := &Goal{
  10519. ServerResponse: googleapi.ServerResponse{
  10520. Header: res.Header,
  10521. HTTPStatusCode: res.StatusCode,
  10522. },
  10523. }
  10524. target := &ret
  10525. if err := gensupport.DecodeResponse(target, res); err != nil {
  10526. return nil, err
  10527. }
  10528. return ret, nil
  10529. // {
  10530. // "description": "Updates an existing goal. This method supports patch semantics.",
  10531. // "httpMethod": "PATCH",
  10532. // "id": "analytics.management.goals.patch",
  10533. // "parameterOrder": [
  10534. // "accountId",
  10535. // "webPropertyId",
  10536. // "profileId",
  10537. // "goalId"
  10538. // ],
  10539. // "parameters": {
  10540. // "accountId": {
  10541. // "description": "Account ID to update the goal.",
  10542. // "location": "path",
  10543. // "required": true,
  10544. // "type": "string"
  10545. // },
  10546. // "goalId": {
  10547. // "description": "Index of the goal to be updated.",
  10548. // "location": "path",
  10549. // "required": true,
  10550. // "type": "string"
  10551. // },
  10552. // "profileId": {
  10553. // "description": "View (Profile) ID to update the goal.",
  10554. // "location": "path",
  10555. // "required": true,
  10556. // "type": "string"
  10557. // },
  10558. // "webPropertyId": {
  10559. // "description": "Web property ID to update the goal.",
  10560. // "location": "path",
  10561. // "required": true,
  10562. // "type": "string"
  10563. // }
  10564. // },
  10565. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  10566. // "request": {
  10567. // "$ref": "Goal"
  10568. // },
  10569. // "response": {
  10570. // "$ref": "Goal"
  10571. // },
  10572. // "scopes": [
  10573. // "https://www.googleapis.com/auth/analytics.edit"
  10574. // ]
  10575. // }
  10576. }
  10577. // method id "analytics.management.goals.update":
  10578. type ManagementGoalsUpdateCall struct {
  10579. s *Service
  10580. accountId string
  10581. webPropertyId string
  10582. profileId string
  10583. goalId string
  10584. goal *Goal
  10585. urlParams_ gensupport.URLParams
  10586. ctx_ context.Context
  10587. header_ http.Header
  10588. }
  10589. // Update: Updates an existing goal.
  10590. func (r *ManagementGoalsService) Update(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsUpdateCall {
  10591. c := &ManagementGoalsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10592. c.accountId = accountId
  10593. c.webPropertyId = webPropertyId
  10594. c.profileId = profileId
  10595. c.goalId = goalId
  10596. c.goal = goal
  10597. return c
  10598. }
  10599. // Fields allows partial responses to be retrieved. See
  10600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10601. // for more information.
  10602. func (c *ManagementGoalsUpdateCall) Fields(s ...googleapi.Field) *ManagementGoalsUpdateCall {
  10603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10604. return c
  10605. }
  10606. // Context sets the context to be used in this call's Do method. Any
  10607. // pending HTTP request will be aborted if the provided context is
  10608. // canceled.
  10609. func (c *ManagementGoalsUpdateCall) Context(ctx context.Context) *ManagementGoalsUpdateCall {
  10610. c.ctx_ = ctx
  10611. return c
  10612. }
  10613. // Header returns an http.Header that can be modified by the caller to
  10614. // add HTTP headers to the request.
  10615. func (c *ManagementGoalsUpdateCall) Header() http.Header {
  10616. if c.header_ == nil {
  10617. c.header_ = make(http.Header)
  10618. }
  10619. return c.header_
  10620. }
  10621. func (c *ManagementGoalsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10622. reqHeaders := make(http.Header)
  10623. for k, v := range c.header_ {
  10624. reqHeaders[k] = v
  10625. }
  10626. reqHeaders.Set("User-Agent", c.s.userAgent())
  10627. var body io.Reader = nil
  10628. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  10629. if err != nil {
  10630. return nil, err
  10631. }
  10632. reqHeaders.Set("Content-Type", "application/json")
  10633. c.urlParams_.Set("alt", alt)
  10634. c.urlParams_.Set("prettyPrint", "false")
  10635. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  10636. urls += "?" + c.urlParams_.Encode()
  10637. req, err := http.NewRequest("PUT", urls, body)
  10638. if err != nil {
  10639. return nil, err
  10640. }
  10641. req.Header = reqHeaders
  10642. googleapi.Expand(req.URL, map[string]string{
  10643. "accountId": c.accountId,
  10644. "webPropertyId": c.webPropertyId,
  10645. "profileId": c.profileId,
  10646. "goalId": c.goalId,
  10647. })
  10648. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10649. }
  10650. // Do executes the "analytics.management.goals.update" call.
  10651. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10652. // code is an error. Response headers are in either
  10653. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10654. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10655. // whether the returned error was because http.StatusNotModified was
  10656. // returned.
  10657. func (c *ManagementGoalsUpdateCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10658. gensupport.SetOptions(c.urlParams_, opts...)
  10659. res, err := c.doRequest("json")
  10660. if res != nil && res.StatusCode == http.StatusNotModified {
  10661. if res.Body != nil {
  10662. res.Body.Close()
  10663. }
  10664. return nil, &googleapi.Error{
  10665. Code: res.StatusCode,
  10666. Header: res.Header,
  10667. }
  10668. }
  10669. if err != nil {
  10670. return nil, err
  10671. }
  10672. defer googleapi.CloseBody(res)
  10673. if err := googleapi.CheckResponse(res); err != nil {
  10674. return nil, err
  10675. }
  10676. ret := &Goal{
  10677. ServerResponse: googleapi.ServerResponse{
  10678. Header: res.Header,
  10679. HTTPStatusCode: res.StatusCode,
  10680. },
  10681. }
  10682. target := &ret
  10683. if err := gensupport.DecodeResponse(target, res); err != nil {
  10684. return nil, err
  10685. }
  10686. return ret, nil
  10687. // {
  10688. // "description": "Updates an existing goal.",
  10689. // "httpMethod": "PUT",
  10690. // "id": "analytics.management.goals.update",
  10691. // "parameterOrder": [
  10692. // "accountId",
  10693. // "webPropertyId",
  10694. // "profileId",
  10695. // "goalId"
  10696. // ],
  10697. // "parameters": {
  10698. // "accountId": {
  10699. // "description": "Account ID to update the goal.",
  10700. // "location": "path",
  10701. // "required": true,
  10702. // "type": "string"
  10703. // },
  10704. // "goalId": {
  10705. // "description": "Index of the goal to be updated.",
  10706. // "location": "path",
  10707. // "required": true,
  10708. // "type": "string"
  10709. // },
  10710. // "profileId": {
  10711. // "description": "View (Profile) ID to update the goal.",
  10712. // "location": "path",
  10713. // "required": true,
  10714. // "type": "string"
  10715. // },
  10716. // "webPropertyId": {
  10717. // "description": "Web property ID to update the goal.",
  10718. // "location": "path",
  10719. // "required": true,
  10720. // "type": "string"
  10721. // }
  10722. // },
  10723. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  10724. // "request": {
  10725. // "$ref": "Goal"
  10726. // },
  10727. // "response": {
  10728. // "$ref": "Goal"
  10729. // },
  10730. // "scopes": [
  10731. // "https://www.googleapis.com/auth/analytics.edit"
  10732. // ]
  10733. // }
  10734. }
  10735. // method id "analytics.management.profileFilterLinks.delete":
  10736. type ManagementProfileFilterLinksDeleteCall struct {
  10737. s *Service
  10738. accountId string
  10739. webPropertyId string
  10740. profileId string
  10741. linkId string
  10742. urlParams_ gensupport.URLParams
  10743. ctx_ context.Context
  10744. header_ http.Header
  10745. }
  10746. // Delete: Delete a profile filter link.
  10747. func (r *ManagementProfileFilterLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksDeleteCall {
  10748. c := &ManagementProfileFilterLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10749. c.accountId = accountId
  10750. c.webPropertyId = webPropertyId
  10751. c.profileId = profileId
  10752. c.linkId = linkId
  10753. return c
  10754. }
  10755. // Fields allows partial responses to be retrieved. See
  10756. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10757. // for more information.
  10758. func (c *ManagementProfileFilterLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksDeleteCall {
  10759. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10760. return c
  10761. }
  10762. // Context sets the context to be used in this call's Do method. Any
  10763. // pending HTTP request will be aborted if the provided context is
  10764. // canceled.
  10765. func (c *ManagementProfileFilterLinksDeleteCall) Context(ctx context.Context) *ManagementProfileFilterLinksDeleteCall {
  10766. c.ctx_ = ctx
  10767. return c
  10768. }
  10769. // Header returns an http.Header that can be modified by the caller to
  10770. // add HTTP headers to the request.
  10771. func (c *ManagementProfileFilterLinksDeleteCall) Header() http.Header {
  10772. if c.header_ == nil {
  10773. c.header_ = make(http.Header)
  10774. }
  10775. return c.header_
  10776. }
  10777. func (c *ManagementProfileFilterLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  10778. reqHeaders := make(http.Header)
  10779. for k, v := range c.header_ {
  10780. reqHeaders[k] = v
  10781. }
  10782. reqHeaders.Set("User-Agent", c.s.userAgent())
  10783. var body io.Reader = nil
  10784. c.urlParams_.Set("alt", alt)
  10785. c.urlParams_.Set("prettyPrint", "false")
  10786. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  10787. urls += "?" + c.urlParams_.Encode()
  10788. req, err := http.NewRequest("DELETE", urls, body)
  10789. if err != nil {
  10790. return nil, err
  10791. }
  10792. req.Header = reqHeaders
  10793. googleapi.Expand(req.URL, map[string]string{
  10794. "accountId": c.accountId,
  10795. "webPropertyId": c.webPropertyId,
  10796. "profileId": c.profileId,
  10797. "linkId": c.linkId,
  10798. })
  10799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10800. }
  10801. // Do executes the "analytics.management.profileFilterLinks.delete" call.
  10802. func (c *ManagementProfileFilterLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  10803. gensupport.SetOptions(c.urlParams_, opts...)
  10804. res, err := c.doRequest("json")
  10805. if err != nil {
  10806. return err
  10807. }
  10808. defer googleapi.CloseBody(res)
  10809. if err := googleapi.CheckResponse(res); err != nil {
  10810. return err
  10811. }
  10812. return nil
  10813. // {
  10814. // "description": "Delete a profile filter link.",
  10815. // "httpMethod": "DELETE",
  10816. // "id": "analytics.management.profileFilterLinks.delete",
  10817. // "parameterOrder": [
  10818. // "accountId",
  10819. // "webPropertyId",
  10820. // "profileId",
  10821. // "linkId"
  10822. // ],
  10823. // "parameters": {
  10824. // "accountId": {
  10825. // "description": "Account ID to which the profile filter link belongs.",
  10826. // "location": "path",
  10827. // "pattern": "\\d+",
  10828. // "required": true,
  10829. // "type": "string"
  10830. // },
  10831. // "linkId": {
  10832. // "description": "ID of the profile filter link to delete.",
  10833. // "location": "path",
  10834. // "pattern": "\\d+:\\d+",
  10835. // "required": true,
  10836. // "type": "string"
  10837. // },
  10838. // "profileId": {
  10839. // "description": "Profile ID to which the filter link belongs.",
  10840. // "location": "path",
  10841. // "pattern": "\\d+",
  10842. // "required": true,
  10843. // "type": "string"
  10844. // },
  10845. // "webPropertyId": {
  10846. // "description": "Web property Id to which the profile filter link belongs.",
  10847. // "location": "path",
  10848. // "pattern": "UA-(\\d+)-(\\d+)",
  10849. // "required": true,
  10850. // "type": "string"
  10851. // }
  10852. // },
  10853. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  10854. // "scopes": [
  10855. // "https://www.googleapis.com/auth/analytics.edit"
  10856. // ]
  10857. // }
  10858. }
  10859. // method id "analytics.management.profileFilterLinks.get":
  10860. type ManagementProfileFilterLinksGetCall struct {
  10861. s *Service
  10862. accountId string
  10863. webPropertyId string
  10864. profileId string
  10865. linkId string
  10866. urlParams_ gensupport.URLParams
  10867. ifNoneMatch_ string
  10868. ctx_ context.Context
  10869. header_ http.Header
  10870. }
  10871. // Get: Returns a single profile filter link.
  10872. func (r *ManagementProfileFilterLinksService) Get(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksGetCall {
  10873. c := &ManagementProfileFilterLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10874. c.accountId = accountId
  10875. c.webPropertyId = webPropertyId
  10876. c.profileId = profileId
  10877. c.linkId = linkId
  10878. return c
  10879. }
  10880. // Fields allows partial responses to be retrieved. See
  10881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10882. // for more information.
  10883. func (c *ManagementProfileFilterLinksGetCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksGetCall {
  10884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10885. return c
  10886. }
  10887. // IfNoneMatch sets the optional parameter which makes the operation
  10888. // fail if the object's ETag matches the given value. This is useful for
  10889. // getting updates only after the object has changed since the last
  10890. // request. Use googleapi.IsNotModified to check whether the response
  10891. // error from Do is the result of In-None-Match.
  10892. func (c *ManagementProfileFilterLinksGetCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksGetCall {
  10893. c.ifNoneMatch_ = entityTag
  10894. return c
  10895. }
  10896. // Context sets the context to be used in this call's Do method. Any
  10897. // pending HTTP request will be aborted if the provided context is
  10898. // canceled.
  10899. func (c *ManagementProfileFilterLinksGetCall) Context(ctx context.Context) *ManagementProfileFilterLinksGetCall {
  10900. c.ctx_ = ctx
  10901. return c
  10902. }
  10903. // Header returns an http.Header that can be modified by the caller to
  10904. // add HTTP headers to the request.
  10905. func (c *ManagementProfileFilterLinksGetCall) Header() http.Header {
  10906. if c.header_ == nil {
  10907. c.header_ = make(http.Header)
  10908. }
  10909. return c.header_
  10910. }
  10911. func (c *ManagementProfileFilterLinksGetCall) doRequest(alt string) (*http.Response, error) {
  10912. reqHeaders := make(http.Header)
  10913. for k, v := range c.header_ {
  10914. reqHeaders[k] = v
  10915. }
  10916. reqHeaders.Set("User-Agent", c.s.userAgent())
  10917. if c.ifNoneMatch_ != "" {
  10918. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10919. }
  10920. var body io.Reader = nil
  10921. c.urlParams_.Set("alt", alt)
  10922. c.urlParams_.Set("prettyPrint", "false")
  10923. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  10924. urls += "?" + c.urlParams_.Encode()
  10925. req, err := http.NewRequest("GET", urls, body)
  10926. if err != nil {
  10927. return nil, err
  10928. }
  10929. req.Header = reqHeaders
  10930. googleapi.Expand(req.URL, map[string]string{
  10931. "accountId": c.accountId,
  10932. "webPropertyId": c.webPropertyId,
  10933. "profileId": c.profileId,
  10934. "linkId": c.linkId,
  10935. })
  10936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10937. }
  10938. // Do executes the "analytics.management.profileFilterLinks.get" call.
  10939. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  10940. // non-2xx status code is an error. Response headers are in either
  10941. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  10942. // returned at all) in error.(*googleapi.Error).Header. Use
  10943. // googleapi.IsNotModified to check whether the returned error was
  10944. // because http.StatusNotModified was returned.
  10945. func (c *ManagementProfileFilterLinksGetCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  10946. gensupport.SetOptions(c.urlParams_, opts...)
  10947. res, err := c.doRequest("json")
  10948. if res != nil && res.StatusCode == http.StatusNotModified {
  10949. if res.Body != nil {
  10950. res.Body.Close()
  10951. }
  10952. return nil, &googleapi.Error{
  10953. Code: res.StatusCode,
  10954. Header: res.Header,
  10955. }
  10956. }
  10957. if err != nil {
  10958. return nil, err
  10959. }
  10960. defer googleapi.CloseBody(res)
  10961. if err := googleapi.CheckResponse(res); err != nil {
  10962. return nil, err
  10963. }
  10964. ret := &ProfileFilterLink{
  10965. ServerResponse: googleapi.ServerResponse{
  10966. Header: res.Header,
  10967. HTTPStatusCode: res.StatusCode,
  10968. },
  10969. }
  10970. target := &ret
  10971. if err := gensupport.DecodeResponse(target, res); err != nil {
  10972. return nil, err
  10973. }
  10974. return ret, nil
  10975. // {
  10976. // "description": "Returns a single profile filter link.",
  10977. // "httpMethod": "GET",
  10978. // "id": "analytics.management.profileFilterLinks.get",
  10979. // "parameterOrder": [
  10980. // "accountId",
  10981. // "webPropertyId",
  10982. // "profileId",
  10983. // "linkId"
  10984. // ],
  10985. // "parameters": {
  10986. // "accountId": {
  10987. // "description": "Account ID to retrieve profile filter link for.",
  10988. // "location": "path",
  10989. // "pattern": "\\d+",
  10990. // "required": true,
  10991. // "type": "string"
  10992. // },
  10993. // "linkId": {
  10994. // "description": "ID of the profile filter link.",
  10995. // "location": "path",
  10996. // "pattern": "\\d+:\\d+",
  10997. // "required": true,
  10998. // "type": "string"
  10999. // },
  11000. // "profileId": {
  11001. // "description": "Profile ID to retrieve filter link for.",
  11002. // "location": "path",
  11003. // "pattern": "\\d+",
  11004. // "required": true,
  11005. // "type": "string"
  11006. // },
  11007. // "webPropertyId": {
  11008. // "description": "Web property Id to retrieve profile filter link for.",
  11009. // "location": "path",
  11010. // "pattern": "UA-(\\d+)-(\\d+)",
  11011. // "required": true,
  11012. // "type": "string"
  11013. // }
  11014. // },
  11015. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  11016. // "response": {
  11017. // "$ref": "ProfileFilterLink"
  11018. // },
  11019. // "scopes": [
  11020. // "https://www.googleapis.com/auth/analytics.edit",
  11021. // "https://www.googleapis.com/auth/analytics.readonly"
  11022. // ]
  11023. // }
  11024. }
  11025. // method id "analytics.management.profileFilterLinks.insert":
  11026. type ManagementProfileFilterLinksInsertCall struct {
  11027. s *Service
  11028. accountId string
  11029. webPropertyId string
  11030. profileId string
  11031. profilefilterlink *ProfileFilterLink
  11032. urlParams_ gensupport.URLParams
  11033. ctx_ context.Context
  11034. header_ http.Header
  11035. }
  11036. // Insert: Create a new profile filter link.
  11037. func (r *ManagementProfileFilterLinksService) Insert(accountId string, webPropertyId string, profileId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksInsertCall {
  11038. c := &ManagementProfileFilterLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11039. c.accountId = accountId
  11040. c.webPropertyId = webPropertyId
  11041. c.profileId = profileId
  11042. c.profilefilterlink = profilefilterlink
  11043. return c
  11044. }
  11045. // Fields allows partial responses to be retrieved. See
  11046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11047. // for more information.
  11048. func (c *ManagementProfileFilterLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksInsertCall {
  11049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11050. return c
  11051. }
  11052. // Context sets the context to be used in this call's Do method. Any
  11053. // pending HTTP request will be aborted if the provided context is
  11054. // canceled.
  11055. func (c *ManagementProfileFilterLinksInsertCall) Context(ctx context.Context) *ManagementProfileFilterLinksInsertCall {
  11056. c.ctx_ = ctx
  11057. return c
  11058. }
  11059. // Header returns an http.Header that can be modified by the caller to
  11060. // add HTTP headers to the request.
  11061. func (c *ManagementProfileFilterLinksInsertCall) Header() http.Header {
  11062. if c.header_ == nil {
  11063. c.header_ = make(http.Header)
  11064. }
  11065. return c.header_
  11066. }
  11067. func (c *ManagementProfileFilterLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  11068. reqHeaders := make(http.Header)
  11069. for k, v := range c.header_ {
  11070. reqHeaders[k] = v
  11071. }
  11072. reqHeaders.Set("User-Agent", c.s.userAgent())
  11073. var body io.Reader = nil
  11074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  11075. if err != nil {
  11076. return nil, err
  11077. }
  11078. reqHeaders.Set("Content-Type", "application/json")
  11079. c.urlParams_.Set("alt", alt)
  11080. c.urlParams_.Set("prettyPrint", "false")
  11081. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks")
  11082. urls += "?" + c.urlParams_.Encode()
  11083. req, err := http.NewRequest("POST", urls, body)
  11084. if err != nil {
  11085. return nil, err
  11086. }
  11087. req.Header = reqHeaders
  11088. googleapi.Expand(req.URL, map[string]string{
  11089. "accountId": c.accountId,
  11090. "webPropertyId": c.webPropertyId,
  11091. "profileId": c.profileId,
  11092. })
  11093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11094. }
  11095. // Do executes the "analytics.management.profileFilterLinks.insert" call.
  11096. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  11097. // non-2xx status code is an error. Response headers are in either
  11098. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  11099. // returned at all) in error.(*googleapi.Error).Header. Use
  11100. // googleapi.IsNotModified to check whether the returned error was
  11101. // because http.StatusNotModified was returned.
  11102. func (c *ManagementProfileFilterLinksInsertCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  11103. gensupport.SetOptions(c.urlParams_, opts...)
  11104. res, err := c.doRequest("json")
  11105. if res != nil && res.StatusCode == http.StatusNotModified {
  11106. if res.Body != nil {
  11107. res.Body.Close()
  11108. }
  11109. return nil, &googleapi.Error{
  11110. Code: res.StatusCode,
  11111. Header: res.Header,
  11112. }
  11113. }
  11114. if err != nil {
  11115. return nil, err
  11116. }
  11117. defer googleapi.CloseBody(res)
  11118. if err := googleapi.CheckResponse(res); err != nil {
  11119. return nil, err
  11120. }
  11121. ret := &ProfileFilterLink{
  11122. ServerResponse: googleapi.ServerResponse{
  11123. Header: res.Header,
  11124. HTTPStatusCode: res.StatusCode,
  11125. },
  11126. }
  11127. target := &ret
  11128. if err := gensupport.DecodeResponse(target, res); err != nil {
  11129. return nil, err
  11130. }
  11131. return ret, nil
  11132. // {
  11133. // "description": "Create a new profile filter link.",
  11134. // "httpMethod": "POST",
  11135. // "id": "analytics.management.profileFilterLinks.insert",
  11136. // "parameterOrder": [
  11137. // "accountId",
  11138. // "webPropertyId",
  11139. // "profileId"
  11140. // ],
  11141. // "parameters": {
  11142. // "accountId": {
  11143. // "description": "Account ID to create profile filter link for.",
  11144. // "location": "path",
  11145. // "pattern": "\\d+",
  11146. // "required": true,
  11147. // "type": "string"
  11148. // },
  11149. // "profileId": {
  11150. // "description": "Profile ID to create filter link for.",
  11151. // "location": "path",
  11152. // "pattern": "\\d+",
  11153. // "required": true,
  11154. // "type": "string"
  11155. // },
  11156. // "webPropertyId": {
  11157. // "description": "Web property Id to create profile filter link for.",
  11158. // "location": "path",
  11159. // "pattern": "UA-(\\d+)-(\\d+)",
  11160. // "required": true,
  11161. // "type": "string"
  11162. // }
  11163. // },
  11164. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks",
  11165. // "request": {
  11166. // "$ref": "ProfileFilterLink"
  11167. // },
  11168. // "response": {
  11169. // "$ref": "ProfileFilterLink"
  11170. // },
  11171. // "scopes": [
  11172. // "https://www.googleapis.com/auth/analytics.edit"
  11173. // ]
  11174. // }
  11175. }
  11176. // method id "analytics.management.profileFilterLinks.list":
  11177. type ManagementProfileFilterLinksListCall struct {
  11178. s *Service
  11179. accountId string
  11180. webPropertyId string
  11181. profileId string
  11182. urlParams_ gensupport.URLParams
  11183. ifNoneMatch_ string
  11184. ctx_ context.Context
  11185. header_ http.Header
  11186. }
  11187. // List: Lists all profile filter links for a profile.
  11188. func (r *ManagementProfileFilterLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileFilterLinksListCall {
  11189. c := &ManagementProfileFilterLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11190. c.accountId = accountId
  11191. c.webPropertyId = webPropertyId
  11192. c.profileId = profileId
  11193. return c
  11194. }
  11195. // MaxResults sets the optional parameter "max-results": The maximum
  11196. // number of profile filter links to include in this response.
  11197. func (c *ManagementProfileFilterLinksListCall) MaxResults(maxResults int64) *ManagementProfileFilterLinksListCall {
  11198. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  11199. return c
  11200. }
  11201. // StartIndex sets the optional parameter "start-index": An index of the
  11202. // first entity to retrieve. Use this parameter as a pagination
  11203. // mechanism along with the max-results parameter.
  11204. func (c *ManagementProfileFilterLinksListCall) StartIndex(startIndex int64) *ManagementProfileFilterLinksListCall {
  11205. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  11206. return c
  11207. }
  11208. // Fields allows partial responses to be retrieved. See
  11209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11210. // for more information.
  11211. func (c *ManagementProfileFilterLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksListCall {
  11212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11213. return c
  11214. }
  11215. // IfNoneMatch sets the optional parameter which makes the operation
  11216. // fail if the object's ETag matches the given value. This is useful for
  11217. // getting updates only after the object has changed since the last
  11218. // request. Use googleapi.IsNotModified to check whether the response
  11219. // error from Do is the result of In-None-Match.
  11220. func (c *ManagementProfileFilterLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksListCall {
  11221. c.ifNoneMatch_ = entityTag
  11222. return c
  11223. }
  11224. // Context sets the context to be used in this call's Do method. Any
  11225. // pending HTTP request will be aborted if the provided context is
  11226. // canceled.
  11227. func (c *ManagementProfileFilterLinksListCall) Context(ctx context.Context) *ManagementProfileFilterLinksListCall {
  11228. c.ctx_ = ctx
  11229. return c
  11230. }
  11231. // Header returns an http.Header that can be modified by the caller to
  11232. // add HTTP headers to the request.
  11233. func (c *ManagementProfileFilterLinksListCall) Header() http.Header {
  11234. if c.header_ == nil {
  11235. c.header_ = make(http.Header)
  11236. }
  11237. return c.header_
  11238. }
  11239. func (c *ManagementProfileFilterLinksListCall) doRequest(alt string) (*http.Response, error) {
  11240. reqHeaders := make(http.Header)
  11241. for k, v := range c.header_ {
  11242. reqHeaders[k] = v
  11243. }
  11244. reqHeaders.Set("User-Agent", c.s.userAgent())
  11245. if c.ifNoneMatch_ != "" {
  11246. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11247. }
  11248. var body io.Reader = nil
  11249. c.urlParams_.Set("alt", alt)
  11250. c.urlParams_.Set("prettyPrint", "false")
  11251. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks")
  11252. urls += "?" + c.urlParams_.Encode()
  11253. req, err := http.NewRequest("GET", urls, body)
  11254. if err != nil {
  11255. return nil, err
  11256. }
  11257. req.Header = reqHeaders
  11258. googleapi.Expand(req.URL, map[string]string{
  11259. "accountId": c.accountId,
  11260. "webPropertyId": c.webPropertyId,
  11261. "profileId": c.profileId,
  11262. })
  11263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11264. }
  11265. // Do executes the "analytics.management.profileFilterLinks.list" call.
  11266. // Exactly one of *ProfileFilterLinks or error will be non-nil. Any
  11267. // non-2xx status code is an error. Response headers are in either
  11268. // *ProfileFilterLinks.ServerResponse.Header or (if a response was
  11269. // returned at all) in error.(*googleapi.Error).Header. Use
  11270. // googleapi.IsNotModified to check whether the returned error was
  11271. // because http.StatusNotModified was returned.
  11272. func (c *ManagementProfileFilterLinksListCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLinks, error) {
  11273. gensupport.SetOptions(c.urlParams_, opts...)
  11274. res, err := c.doRequest("json")
  11275. if res != nil && res.StatusCode == http.StatusNotModified {
  11276. if res.Body != nil {
  11277. res.Body.Close()
  11278. }
  11279. return nil, &googleapi.Error{
  11280. Code: res.StatusCode,
  11281. Header: res.Header,
  11282. }
  11283. }
  11284. if err != nil {
  11285. return nil, err
  11286. }
  11287. defer googleapi.CloseBody(res)
  11288. if err := googleapi.CheckResponse(res); err != nil {
  11289. return nil, err
  11290. }
  11291. ret := &ProfileFilterLinks{
  11292. ServerResponse: googleapi.ServerResponse{
  11293. Header: res.Header,
  11294. HTTPStatusCode: res.StatusCode,
  11295. },
  11296. }
  11297. target := &ret
  11298. if err := gensupport.DecodeResponse(target, res); err != nil {
  11299. return nil, err
  11300. }
  11301. return ret, nil
  11302. // {
  11303. // "description": "Lists all profile filter links for a profile.",
  11304. // "httpMethod": "GET",
  11305. // "id": "analytics.management.profileFilterLinks.list",
  11306. // "parameterOrder": [
  11307. // "accountId",
  11308. // "webPropertyId",
  11309. // "profileId"
  11310. // ],
  11311. // "parameters": {
  11312. // "accountId": {
  11313. // "description": "Account ID to retrieve profile filter links for.",
  11314. // "location": "path",
  11315. // "pattern": "\\d+",
  11316. // "required": true,
  11317. // "type": "string"
  11318. // },
  11319. // "max-results": {
  11320. // "description": "The maximum number of profile filter links to include in this response.",
  11321. // "format": "int32",
  11322. // "location": "query",
  11323. // "type": "integer"
  11324. // },
  11325. // "profileId": {
  11326. // "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.",
  11327. // "location": "path",
  11328. // "required": true,
  11329. // "type": "string"
  11330. // },
  11331. // "start-index": {
  11332. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  11333. // "format": "int32",
  11334. // "location": "query",
  11335. // "minimum": "1",
  11336. // "type": "integer"
  11337. // },
  11338. // "webPropertyId": {
  11339. // "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.",
  11340. // "location": "path",
  11341. // "required": true,
  11342. // "type": "string"
  11343. // }
  11344. // },
  11345. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks",
  11346. // "response": {
  11347. // "$ref": "ProfileFilterLinks"
  11348. // },
  11349. // "scopes": [
  11350. // "https://www.googleapis.com/auth/analytics.edit",
  11351. // "https://www.googleapis.com/auth/analytics.readonly"
  11352. // ]
  11353. // }
  11354. }
  11355. // method id "analytics.management.profileFilterLinks.patch":
  11356. type ManagementProfileFilterLinksPatchCall struct {
  11357. s *Service
  11358. accountId string
  11359. webPropertyId string
  11360. profileId string
  11361. linkId string
  11362. profilefilterlink *ProfileFilterLink
  11363. urlParams_ gensupport.URLParams
  11364. ctx_ context.Context
  11365. header_ http.Header
  11366. }
  11367. // Patch: Update an existing profile filter link. This method supports
  11368. // patch semantics.
  11369. func (r *ManagementProfileFilterLinksService) Patch(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksPatchCall {
  11370. c := &ManagementProfileFilterLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11371. c.accountId = accountId
  11372. c.webPropertyId = webPropertyId
  11373. c.profileId = profileId
  11374. c.linkId = linkId
  11375. c.profilefilterlink = profilefilterlink
  11376. return c
  11377. }
  11378. // Fields allows partial responses to be retrieved. See
  11379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11380. // for more information.
  11381. func (c *ManagementProfileFilterLinksPatchCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksPatchCall {
  11382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11383. return c
  11384. }
  11385. // Context sets the context to be used in this call's Do method. Any
  11386. // pending HTTP request will be aborted if the provided context is
  11387. // canceled.
  11388. func (c *ManagementProfileFilterLinksPatchCall) Context(ctx context.Context) *ManagementProfileFilterLinksPatchCall {
  11389. c.ctx_ = ctx
  11390. return c
  11391. }
  11392. // Header returns an http.Header that can be modified by the caller to
  11393. // add HTTP headers to the request.
  11394. func (c *ManagementProfileFilterLinksPatchCall) Header() http.Header {
  11395. if c.header_ == nil {
  11396. c.header_ = make(http.Header)
  11397. }
  11398. return c.header_
  11399. }
  11400. func (c *ManagementProfileFilterLinksPatchCall) doRequest(alt string) (*http.Response, error) {
  11401. reqHeaders := make(http.Header)
  11402. for k, v := range c.header_ {
  11403. reqHeaders[k] = v
  11404. }
  11405. reqHeaders.Set("User-Agent", c.s.userAgent())
  11406. var body io.Reader = nil
  11407. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  11408. if err != nil {
  11409. return nil, err
  11410. }
  11411. reqHeaders.Set("Content-Type", "application/json")
  11412. c.urlParams_.Set("alt", alt)
  11413. c.urlParams_.Set("prettyPrint", "false")
  11414. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  11415. urls += "?" + c.urlParams_.Encode()
  11416. req, err := http.NewRequest("PATCH", urls, body)
  11417. if err != nil {
  11418. return nil, err
  11419. }
  11420. req.Header = reqHeaders
  11421. googleapi.Expand(req.URL, map[string]string{
  11422. "accountId": c.accountId,
  11423. "webPropertyId": c.webPropertyId,
  11424. "profileId": c.profileId,
  11425. "linkId": c.linkId,
  11426. })
  11427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11428. }
  11429. // Do executes the "analytics.management.profileFilterLinks.patch" call.
  11430. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  11431. // non-2xx status code is an error. Response headers are in either
  11432. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  11433. // returned at all) in error.(*googleapi.Error).Header. Use
  11434. // googleapi.IsNotModified to check whether the returned error was
  11435. // because http.StatusNotModified was returned.
  11436. func (c *ManagementProfileFilterLinksPatchCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  11437. gensupport.SetOptions(c.urlParams_, opts...)
  11438. res, err := c.doRequest("json")
  11439. if res != nil && res.StatusCode == http.StatusNotModified {
  11440. if res.Body != nil {
  11441. res.Body.Close()
  11442. }
  11443. return nil, &googleapi.Error{
  11444. Code: res.StatusCode,
  11445. Header: res.Header,
  11446. }
  11447. }
  11448. if err != nil {
  11449. return nil, err
  11450. }
  11451. defer googleapi.CloseBody(res)
  11452. if err := googleapi.CheckResponse(res); err != nil {
  11453. return nil, err
  11454. }
  11455. ret := &ProfileFilterLink{
  11456. ServerResponse: googleapi.ServerResponse{
  11457. Header: res.Header,
  11458. HTTPStatusCode: res.StatusCode,
  11459. },
  11460. }
  11461. target := &ret
  11462. if err := gensupport.DecodeResponse(target, res); err != nil {
  11463. return nil, err
  11464. }
  11465. return ret, nil
  11466. // {
  11467. // "description": "Update an existing profile filter link. This method supports patch semantics.",
  11468. // "httpMethod": "PATCH",
  11469. // "id": "analytics.management.profileFilterLinks.patch",
  11470. // "parameterOrder": [
  11471. // "accountId",
  11472. // "webPropertyId",
  11473. // "profileId",
  11474. // "linkId"
  11475. // ],
  11476. // "parameters": {
  11477. // "accountId": {
  11478. // "description": "Account ID to which profile filter link belongs.",
  11479. // "location": "path",
  11480. // "pattern": "\\d+",
  11481. // "required": true,
  11482. // "type": "string"
  11483. // },
  11484. // "linkId": {
  11485. // "description": "ID of the profile filter link to be updated.",
  11486. // "location": "path",
  11487. // "pattern": "\\d+:\\d+",
  11488. // "required": true,
  11489. // "type": "string"
  11490. // },
  11491. // "profileId": {
  11492. // "description": "Profile ID to which filter link belongs",
  11493. // "location": "path",
  11494. // "pattern": "\\d+",
  11495. // "required": true,
  11496. // "type": "string"
  11497. // },
  11498. // "webPropertyId": {
  11499. // "description": "Web property Id to which profile filter link belongs",
  11500. // "location": "path",
  11501. // "pattern": "UA-(\\d+)-(\\d+)",
  11502. // "required": true,
  11503. // "type": "string"
  11504. // }
  11505. // },
  11506. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  11507. // "request": {
  11508. // "$ref": "ProfileFilterLink"
  11509. // },
  11510. // "response": {
  11511. // "$ref": "ProfileFilterLink"
  11512. // },
  11513. // "scopes": [
  11514. // "https://www.googleapis.com/auth/analytics.edit"
  11515. // ]
  11516. // }
  11517. }
  11518. // method id "analytics.management.profileFilterLinks.update":
  11519. type ManagementProfileFilterLinksUpdateCall struct {
  11520. s *Service
  11521. accountId string
  11522. webPropertyId string
  11523. profileId string
  11524. linkId string
  11525. profilefilterlink *ProfileFilterLink
  11526. urlParams_ gensupport.URLParams
  11527. ctx_ context.Context
  11528. header_ http.Header
  11529. }
  11530. // Update: Update an existing profile filter link.
  11531. func (r *ManagementProfileFilterLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksUpdateCall {
  11532. c := &ManagementProfileFilterLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11533. c.accountId = accountId
  11534. c.webPropertyId = webPropertyId
  11535. c.profileId = profileId
  11536. c.linkId = linkId
  11537. c.profilefilterlink = profilefilterlink
  11538. return c
  11539. }
  11540. // Fields allows partial responses to be retrieved. See
  11541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11542. // for more information.
  11543. func (c *ManagementProfileFilterLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksUpdateCall {
  11544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11545. return c
  11546. }
  11547. // Context sets the context to be used in this call's Do method. Any
  11548. // pending HTTP request will be aborted if the provided context is
  11549. // canceled.
  11550. func (c *ManagementProfileFilterLinksUpdateCall) Context(ctx context.Context) *ManagementProfileFilterLinksUpdateCall {
  11551. c.ctx_ = ctx
  11552. return c
  11553. }
  11554. // Header returns an http.Header that can be modified by the caller to
  11555. // add HTTP headers to the request.
  11556. func (c *ManagementProfileFilterLinksUpdateCall) Header() http.Header {
  11557. if c.header_ == nil {
  11558. c.header_ = make(http.Header)
  11559. }
  11560. return c.header_
  11561. }
  11562. func (c *ManagementProfileFilterLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  11563. reqHeaders := make(http.Header)
  11564. for k, v := range c.header_ {
  11565. reqHeaders[k] = v
  11566. }
  11567. reqHeaders.Set("User-Agent", c.s.userAgent())
  11568. var body io.Reader = nil
  11569. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  11570. if err != nil {
  11571. return nil, err
  11572. }
  11573. reqHeaders.Set("Content-Type", "application/json")
  11574. c.urlParams_.Set("alt", alt)
  11575. c.urlParams_.Set("prettyPrint", "false")
  11576. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  11577. urls += "?" + c.urlParams_.Encode()
  11578. req, err := http.NewRequest("PUT", urls, body)
  11579. if err != nil {
  11580. return nil, err
  11581. }
  11582. req.Header = reqHeaders
  11583. googleapi.Expand(req.URL, map[string]string{
  11584. "accountId": c.accountId,
  11585. "webPropertyId": c.webPropertyId,
  11586. "profileId": c.profileId,
  11587. "linkId": c.linkId,
  11588. })
  11589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11590. }
  11591. // Do executes the "analytics.management.profileFilterLinks.update" call.
  11592. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  11593. // non-2xx status code is an error. Response headers are in either
  11594. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  11595. // returned at all) in error.(*googleapi.Error).Header. Use
  11596. // googleapi.IsNotModified to check whether the returned error was
  11597. // because http.StatusNotModified was returned.
  11598. func (c *ManagementProfileFilterLinksUpdateCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  11599. gensupport.SetOptions(c.urlParams_, opts...)
  11600. res, err := c.doRequest("json")
  11601. if res != nil && res.StatusCode == http.StatusNotModified {
  11602. if res.Body != nil {
  11603. res.Body.Close()
  11604. }
  11605. return nil, &googleapi.Error{
  11606. Code: res.StatusCode,
  11607. Header: res.Header,
  11608. }
  11609. }
  11610. if err != nil {
  11611. return nil, err
  11612. }
  11613. defer googleapi.CloseBody(res)
  11614. if err := googleapi.CheckResponse(res); err != nil {
  11615. return nil, err
  11616. }
  11617. ret := &ProfileFilterLink{
  11618. ServerResponse: googleapi.ServerResponse{
  11619. Header: res.Header,
  11620. HTTPStatusCode: res.StatusCode,
  11621. },
  11622. }
  11623. target := &ret
  11624. if err := gensupport.DecodeResponse(target, res); err != nil {
  11625. return nil, err
  11626. }
  11627. return ret, nil
  11628. // {
  11629. // "description": "Update an existing profile filter link.",
  11630. // "httpMethod": "PUT",
  11631. // "id": "analytics.management.profileFilterLinks.update",
  11632. // "parameterOrder": [
  11633. // "accountId",
  11634. // "webPropertyId",
  11635. // "profileId",
  11636. // "linkId"
  11637. // ],
  11638. // "parameters": {
  11639. // "accountId": {
  11640. // "description": "Account ID to which profile filter link belongs.",
  11641. // "location": "path",
  11642. // "pattern": "\\d+",
  11643. // "required": true,
  11644. // "type": "string"
  11645. // },
  11646. // "linkId": {
  11647. // "description": "ID of the profile filter link to be updated.",
  11648. // "location": "path",
  11649. // "pattern": "\\d+:\\d+",
  11650. // "required": true,
  11651. // "type": "string"
  11652. // },
  11653. // "profileId": {
  11654. // "description": "Profile ID to which filter link belongs",
  11655. // "location": "path",
  11656. // "pattern": "\\d+",
  11657. // "required": true,
  11658. // "type": "string"
  11659. // },
  11660. // "webPropertyId": {
  11661. // "description": "Web property Id to which profile filter link belongs",
  11662. // "location": "path",
  11663. // "pattern": "UA-(\\d+)-(\\d+)",
  11664. // "required": true,
  11665. // "type": "string"
  11666. // }
  11667. // },
  11668. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  11669. // "request": {
  11670. // "$ref": "ProfileFilterLink"
  11671. // },
  11672. // "response": {
  11673. // "$ref": "ProfileFilterLink"
  11674. // },
  11675. // "scopes": [
  11676. // "https://www.googleapis.com/auth/analytics.edit"
  11677. // ]
  11678. // }
  11679. }
  11680. // method id "analytics.management.profileUserLinks.delete":
  11681. type ManagementProfileUserLinksDeleteCall struct {
  11682. s *Service
  11683. accountId string
  11684. webPropertyId string
  11685. profileId string
  11686. linkId string
  11687. urlParams_ gensupport.URLParams
  11688. ctx_ context.Context
  11689. header_ http.Header
  11690. }
  11691. // Delete: Removes a user from the given view (profile).
  11692. func (r *ManagementProfileUserLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileUserLinksDeleteCall {
  11693. c := &ManagementProfileUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11694. c.accountId = accountId
  11695. c.webPropertyId = webPropertyId
  11696. c.profileId = profileId
  11697. c.linkId = linkId
  11698. return c
  11699. }
  11700. // Fields allows partial responses to be retrieved. See
  11701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11702. // for more information.
  11703. func (c *ManagementProfileUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksDeleteCall {
  11704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11705. return c
  11706. }
  11707. // Context sets the context to be used in this call's Do method. Any
  11708. // pending HTTP request will be aborted if the provided context is
  11709. // canceled.
  11710. func (c *ManagementProfileUserLinksDeleteCall) Context(ctx context.Context) *ManagementProfileUserLinksDeleteCall {
  11711. c.ctx_ = ctx
  11712. return c
  11713. }
  11714. // Header returns an http.Header that can be modified by the caller to
  11715. // add HTTP headers to the request.
  11716. func (c *ManagementProfileUserLinksDeleteCall) Header() http.Header {
  11717. if c.header_ == nil {
  11718. c.header_ = make(http.Header)
  11719. }
  11720. return c.header_
  11721. }
  11722. func (c *ManagementProfileUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  11723. reqHeaders := make(http.Header)
  11724. for k, v := range c.header_ {
  11725. reqHeaders[k] = v
  11726. }
  11727. reqHeaders.Set("User-Agent", c.s.userAgent())
  11728. var body io.Reader = nil
  11729. c.urlParams_.Set("alt", alt)
  11730. c.urlParams_.Set("prettyPrint", "false")
  11731. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}")
  11732. urls += "?" + c.urlParams_.Encode()
  11733. req, err := http.NewRequest("DELETE", urls, body)
  11734. if err != nil {
  11735. return nil, err
  11736. }
  11737. req.Header = reqHeaders
  11738. googleapi.Expand(req.URL, map[string]string{
  11739. "accountId": c.accountId,
  11740. "webPropertyId": c.webPropertyId,
  11741. "profileId": c.profileId,
  11742. "linkId": c.linkId,
  11743. })
  11744. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11745. }
  11746. // Do executes the "analytics.management.profileUserLinks.delete" call.
  11747. func (c *ManagementProfileUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  11748. gensupport.SetOptions(c.urlParams_, opts...)
  11749. res, err := c.doRequest("json")
  11750. if err != nil {
  11751. return err
  11752. }
  11753. defer googleapi.CloseBody(res)
  11754. if err := googleapi.CheckResponse(res); err != nil {
  11755. return err
  11756. }
  11757. return nil
  11758. // {
  11759. // "description": "Removes a user from the given view (profile).",
  11760. // "httpMethod": "DELETE",
  11761. // "id": "analytics.management.profileUserLinks.delete",
  11762. // "parameterOrder": [
  11763. // "accountId",
  11764. // "webPropertyId",
  11765. // "profileId",
  11766. // "linkId"
  11767. // ],
  11768. // "parameters": {
  11769. // "accountId": {
  11770. // "description": "Account ID to delete the user link for.",
  11771. // "location": "path",
  11772. // "required": true,
  11773. // "type": "string"
  11774. // },
  11775. // "linkId": {
  11776. // "description": "Link ID to delete the user link for.",
  11777. // "location": "path",
  11778. // "required": true,
  11779. // "type": "string"
  11780. // },
  11781. // "profileId": {
  11782. // "description": "View (Profile) ID to delete the user link for.",
  11783. // "location": "path",
  11784. // "required": true,
  11785. // "type": "string"
  11786. // },
  11787. // "webPropertyId": {
  11788. // "description": "Web Property ID to delete the user link for.",
  11789. // "location": "path",
  11790. // "required": true,
  11791. // "type": "string"
  11792. // }
  11793. // },
  11794. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}",
  11795. // "scopes": [
  11796. // "https://www.googleapis.com/auth/analytics.manage.users"
  11797. // ]
  11798. // }
  11799. }
  11800. // method id "analytics.management.profileUserLinks.insert":
  11801. type ManagementProfileUserLinksInsertCall struct {
  11802. s *Service
  11803. accountId string
  11804. webPropertyId string
  11805. profileId string
  11806. entityuserlink *EntityUserLink
  11807. urlParams_ gensupport.URLParams
  11808. ctx_ context.Context
  11809. header_ http.Header
  11810. }
  11811. // Insert: Adds a new user to the given view (profile).
  11812. func (r *ManagementProfileUserLinksService) Insert(accountId string, webPropertyId string, profileId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksInsertCall {
  11813. c := &ManagementProfileUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11814. c.accountId = accountId
  11815. c.webPropertyId = webPropertyId
  11816. c.profileId = profileId
  11817. c.entityuserlink = entityuserlink
  11818. return c
  11819. }
  11820. // Fields allows partial responses to be retrieved. See
  11821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11822. // for more information.
  11823. func (c *ManagementProfileUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksInsertCall {
  11824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11825. return c
  11826. }
  11827. // Context sets the context to be used in this call's Do method. Any
  11828. // pending HTTP request will be aborted if the provided context is
  11829. // canceled.
  11830. func (c *ManagementProfileUserLinksInsertCall) Context(ctx context.Context) *ManagementProfileUserLinksInsertCall {
  11831. c.ctx_ = ctx
  11832. return c
  11833. }
  11834. // Header returns an http.Header that can be modified by the caller to
  11835. // add HTTP headers to the request.
  11836. func (c *ManagementProfileUserLinksInsertCall) Header() http.Header {
  11837. if c.header_ == nil {
  11838. c.header_ = make(http.Header)
  11839. }
  11840. return c.header_
  11841. }
  11842. func (c *ManagementProfileUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  11843. reqHeaders := make(http.Header)
  11844. for k, v := range c.header_ {
  11845. reqHeaders[k] = v
  11846. }
  11847. reqHeaders.Set("User-Agent", c.s.userAgent())
  11848. var body io.Reader = nil
  11849. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  11850. if err != nil {
  11851. return nil, err
  11852. }
  11853. reqHeaders.Set("Content-Type", "application/json")
  11854. c.urlParams_.Set("alt", alt)
  11855. c.urlParams_.Set("prettyPrint", "false")
  11856. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks")
  11857. urls += "?" + c.urlParams_.Encode()
  11858. req, err := http.NewRequest("POST", urls, body)
  11859. if err != nil {
  11860. return nil, err
  11861. }
  11862. req.Header = reqHeaders
  11863. googleapi.Expand(req.URL, map[string]string{
  11864. "accountId": c.accountId,
  11865. "webPropertyId": c.webPropertyId,
  11866. "profileId": c.profileId,
  11867. })
  11868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11869. }
  11870. // Do executes the "analytics.management.profileUserLinks.insert" call.
  11871. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  11872. // status code is an error. Response headers are in either
  11873. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  11874. // at all) in error.(*googleapi.Error).Header. Use
  11875. // googleapi.IsNotModified to check whether the returned error was
  11876. // because http.StatusNotModified was returned.
  11877. func (c *ManagementProfileUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  11878. gensupport.SetOptions(c.urlParams_, opts...)
  11879. res, err := c.doRequest("json")
  11880. if res != nil && res.StatusCode == http.StatusNotModified {
  11881. if res.Body != nil {
  11882. res.Body.Close()
  11883. }
  11884. return nil, &googleapi.Error{
  11885. Code: res.StatusCode,
  11886. Header: res.Header,
  11887. }
  11888. }
  11889. if err != nil {
  11890. return nil, err
  11891. }
  11892. defer googleapi.CloseBody(res)
  11893. if err := googleapi.CheckResponse(res); err != nil {
  11894. return nil, err
  11895. }
  11896. ret := &EntityUserLink{
  11897. ServerResponse: googleapi.ServerResponse{
  11898. Header: res.Header,
  11899. HTTPStatusCode: res.StatusCode,
  11900. },
  11901. }
  11902. target := &ret
  11903. if err := gensupport.DecodeResponse(target, res); err != nil {
  11904. return nil, err
  11905. }
  11906. return ret, nil
  11907. // {
  11908. // "description": "Adds a new user to the given view (profile).",
  11909. // "httpMethod": "POST",
  11910. // "id": "analytics.management.profileUserLinks.insert",
  11911. // "parameterOrder": [
  11912. // "accountId",
  11913. // "webPropertyId",
  11914. // "profileId"
  11915. // ],
  11916. // "parameters": {
  11917. // "accountId": {
  11918. // "description": "Account ID to create the user link for.",
  11919. // "location": "path",
  11920. // "required": true,
  11921. // "type": "string"
  11922. // },
  11923. // "profileId": {
  11924. // "description": "View (Profile) ID to create the user link for.",
  11925. // "location": "path",
  11926. // "required": true,
  11927. // "type": "string"
  11928. // },
  11929. // "webPropertyId": {
  11930. // "description": "Web Property ID to create the user link for.",
  11931. // "location": "path",
  11932. // "required": true,
  11933. // "type": "string"
  11934. // }
  11935. // },
  11936. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks",
  11937. // "request": {
  11938. // "$ref": "EntityUserLink"
  11939. // },
  11940. // "response": {
  11941. // "$ref": "EntityUserLink"
  11942. // },
  11943. // "scopes": [
  11944. // "https://www.googleapis.com/auth/analytics.manage.users"
  11945. // ]
  11946. // }
  11947. }
  11948. // method id "analytics.management.profileUserLinks.list":
  11949. type ManagementProfileUserLinksListCall struct {
  11950. s *Service
  11951. accountId string
  11952. webPropertyId string
  11953. profileId string
  11954. urlParams_ gensupport.URLParams
  11955. ifNoneMatch_ string
  11956. ctx_ context.Context
  11957. header_ http.Header
  11958. }
  11959. // List: Lists profile-user links for a given view (profile).
  11960. func (r *ManagementProfileUserLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileUserLinksListCall {
  11961. c := &ManagementProfileUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11962. c.accountId = accountId
  11963. c.webPropertyId = webPropertyId
  11964. c.profileId = profileId
  11965. return c
  11966. }
  11967. // MaxResults sets the optional parameter "max-results": The maximum
  11968. // number of profile-user links to include in this response.
  11969. func (c *ManagementProfileUserLinksListCall) MaxResults(maxResults int64) *ManagementProfileUserLinksListCall {
  11970. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  11971. return c
  11972. }
  11973. // StartIndex sets the optional parameter "start-index": An index of the
  11974. // first profile-user link to retrieve. Use this parameter as a
  11975. // pagination mechanism along with the max-results parameter.
  11976. func (c *ManagementProfileUserLinksListCall) StartIndex(startIndex int64) *ManagementProfileUserLinksListCall {
  11977. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  11978. return c
  11979. }
  11980. // Fields allows partial responses to be retrieved. See
  11981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11982. // for more information.
  11983. func (c *ManagementProfileUserLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksListCall {
  11984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11985. return c
  11986. }
  11987. // IfNoneMatch sets the optional parameter which makes the operation
  11988. // fail if the object's ETag matches the given value. This is useful for
  11989. // getting updates only after the object has changed since the last
  11990. // request. Use googleapi.IsNotModified to check whether the response
  11991. // error from Do is the result of In-None-Match.
  11992. func (c *ManagementProfileUserLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileUserLinksListCall {
  11993. c.ifNoneMatch_ = entityTag
  11994. return c
  11995. }
  11996. // Context sets the context to be used in this call's Do method. Any
  11997. // pending HTTP request will be aborted if the provided context is
  11998. // canceled.
  11999. func (c *ManagementProfileUserLinksListCall) Context(ctx context.Context) *ManagementProfileUserLinksListCall {
  12000. c.ctx_ = ctx
  12001. return c
  12002. }
  12003. // Header returns an http.Header that can be modified by the caller to
  12004. // add HTTP headers to the request.
  12005. func (c *ManagementProfileUserLinksListCall) Header() http.Header {
  12006. if c.header_ == nil {
  12007. c.header_ = make(http.Header)
  12008. }
  12009. return c.header_
  12010. }
  12011. func (c *ManagementProfileUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  12012. reqHeaders := make(http.Header)
  12013. for k, v := range c.header_ {
  12014. reqHeaders[k] = v
  12015. }
  12016. reqHeaders.Set("User-Agent", c.s.userAgent())
  12017. if c.ifNoneMatch_ != "" {
  12018. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12019. }
  12020. var body io.Reader = nil
  12021. c.urlParams_.Set("alt", alt)
  12022. c.urlParams_.Set("prettyPrint", "false")
  12023. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks")
  12024. urls += "?" + c.urlParams_.Encode()
  12025. req, err := http.NewRequest("GET", urls, body)
  12026. if err != nil {
  12027. return nil, err
  12028. }
  12029. req.Header = reqHeaders
  12030. googleapi.Expand(req.URL, map[string]string{
  12031. "accountId": c.accountId,
  12032. "webPropertyId": c.webPropertyId,
  12033. "profileId": c.profileId,
  12034. })
  12035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12036. }
  12037. // Do executes the "analytics.management.profileUserLinks.list" call.
  12038. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  12039. // status code is an error. Response headers are in either
  12040. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  12041. // at all) in error.(*googleapi.Error).Header. Use
  12042. // googleapi.IsNotModified to check whether the returned error was
  12043. // because http.StatusNotModified was returned.
  12044. func (c *ManagementProfileUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  12045. gensupport.SetOptions(c.urlParams_, opts...)
  12046. res, err := c.doRequest("json")
  12047. if res != nil && res.StatusCode == http.StatusNotModified {
  12048. if res.Body != nil {
  12049. res.Body.Close()
  12050. }
  12051. return nil, &googleapi.Error{
  12052. Code: res.StatusCode,
  12053. Header: res.Header,
  12054. }
  12055. }
  12056. if err != nil {
  12057. return nil, err
  12058. }
  12059. defer googleapi.CloseBody(res)
  12060. if err := googleapi.CheckResponse(res); err != nil {
  12061. return nil, err
  12062. }
  12063. ret := &EntityUserLinks{
  12064. ServerResponse: googleapi.ServerResponse{
  12065. Header: res.Header,
  12066. HTTPStatusCode: res.StatusCode,
  12067. },
  12068. }
  12069. target := &ret
  12070. if err := gensupport.DecodeResponse(target, res); err != nil {
  12071. return nil, err
  12072. }
  12073. return ret, nil
  12074. // {
  12075. // "description": "Lists profile-user links for a given view (profile).",
  12076. // "httpMethod": "GET",
  12077. // "id": "analytics.management.profileUserLinks.list",
  12078. // "parameterOrder": [
  12079. // "accountId",
  12080. // "webPropertyId",
  12081. // "profileId"
  12082. // ],
  12083. // "parameters": {
  12084. // "accountId": {
  12085. // "description": "Account ID which the given view (profile) belongs to.",
  12086. // "location": "path",
  12087. // "required": true,
  12088. // "type": "string"
  12089. // },
  12090. // "max-results": {
  12091. // "description": "The maximum number of profile-user links to include in this response.",
  12092. // "format": "int32",
  12093. // "location": "query",
  12094. // "type": "integer"
  12095. // },
  12096. // "profileId": {
  12097. // "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.",
  12098. // "location": "path",
  12099. // "required": true,
  12100. // "type": "string"
  12101. // },
  12102. // "start-index": {
  12103. // "description": "An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  12104. // "format": "int32",
  12105. // "location": "query",
  12106. // "minimum": "1",
  12107. // "type": "integer"
  12108. // },
  12109. // "webPropertyId": {
  12110. // "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.",
  12111. // "location": "path",
  12112. // "required": true,
  12113. // "type": "string"
  12114. // }
  12115. // },
  12116. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks",
  12117. // "response": {
  12118. // "$ref": "EntityUserLinks"
  12119. // },
  12120. // "scopes": [
  12121. // "https://www.googleapis.com/auth/analytics.manage.users",
  12122. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  12123. // ]
  12124. // }
  12125. }
  12126. // method id "analytics.management.profileUserLinks.update":
  12127. type ManagementProfileUserLinksUpdateCall struct {
  12128. s *Service
  12129. accountId string
  12130. webPropertyId string
  12131. profileId string
  12132. linkId string
  12133. entityuserlink *EntityUserLink
  12134. urlParams_ gensupport.URLParams
  12135. ctx_ context.Context
  12136. header_ http.Header
  12137. }
  12138. // Update: Updates permissions for an existing user on the given view
  12139. // (profile).
  12140. func (r *ManagementProfileUserLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksUpdateCall {
  12141. c := &ManagementProfileUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12142. c.accountId = accountId
  12143. c.webPropertyId = webPropertyId
  12144. c.profileId = profileId
  12145. c.linkId = linkId
  12146. c.entityuserlink = entityuserlink
  12147. return c
  12148. }
  12149. // Fields allows partial responses to be retrieved. See
  12150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12151. // for more information.
  12152. func (c *ManagementProfileUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksUpdateCall {
  12153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12154. return c
  12155. }
  12156. // Context sets the context to be used in this call's Do method. Any
  12157. // pending HTTP request will be aborted if the provided context is
  12158. // canceled.
  12159. func (c *ManagementProfileUserLinksUpdateCall) Context(ctx context.Context) *ManagementProfileUserLinksUpdateCall {
  12160. c.ctx_ = ctx
  12161. return c
  12162. }
  12163. // Header returns an http.Header that can be modified by the caller to
  12164. // add HTTP headers to the request.
  12165. func (c *ManagementProfileUserLinksUpdateCall) Header() http.Header {
  12166. if c.header_ == nil {
  12167. c.header_ = make(http.Header)
  12168. }
  12169. return c.header_
  12170. }
  12171. func (c *ManagementProfileUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  12172. reqHeaders := make(http.Header)
  12173. for k, v := range c.header_ {
  12174. reqHeaders[k] = v
  12175. }
  12176. reqHeaders.Set("User-Agent", c.s.userAgent())
  12177. var body io.Reader = nil
  12178. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  12179. if err != nil {
  12180. return nil, err
  12181. }
  12182. reqHeaders.Set("Content-Type", "application/json")
  12183. c.urlParams_.Set("alt", alt)
  12184. c.urlParams_.Set("prettyPrint", "false")
  12185. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}")
  12186. urls += "?" + c.urlParams_.Encode()
  12187. req, err := http.NewRequest("PUT", urls, body)
  12188. if err != nil {
  12189. return nil, err
  12190. }
  12191. req.Header = reqHeaders
  12192. googleapi.Expand(req.URL, map[string]string{
  12193. "accountId": c.accountId,
  12194. "webPropertyId": c.webPropertyId,
  12195. "profileId": c.profileId,
  12196. "linkId": c.linkId,
  12197. })
  12198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12199. }
  12200. // Do executes the "analytics.management.profileUserLinks.update" call.
  12201. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  12202. // status code is an error. Response headers are in either
  12203. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  12204. // at all) in error.(*googleapi.Error).Header. Use
  12205. // googleapi.IsNotModified to check whether the returned error was
  12206. // because http.StatusNotModified was returned.
  12207. func (c *ManagementProfileUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  12208. gensupport.SetOptions(c.urlParams_, opts...)
  12209. res, err := c.doRequest("json")
  12210. if res != nil && res.StatusCode == http.StatusNotModified {
  12211. if res.Body != nil {
  12212. res.Body.Close()
  12213. }
  12214. return nil, &googleapi.Error{
  12215. Code: res.StatusCode,
  12216. Header: res.Header,
  12217. }
  12218. }
  12219. if err != nil {
  12220. return nil, err
  12221. }
  12222. defer googleapi.CloseBody(res)
  12223. if err := googleapi.CheckResponse(res); err != nil {
  12224. return nil, err
  12225. }
  12226. ret := &EntityUserLink{
  12227. ServerResponse: googleapi.ServerResponse{
  12228. Header: res.Header,
  12229. HTTPStatusCode: res.StatusCode,
  12230. },
  12231. }
  12232. target := &ret
  12233. if err := gensupport.DecodeResponse(target, res); err != nil {
  12234. return nil, err
  12235. }
  12236. return ret, nil
  12237. // {
  12238. // "description": "Updates permissions for an existing user on the given view (profile).",
  12239. // "httpMethod": "PUT",
  12240. // "id": "analytics.management.profileUserLinks.update",
  12241. // "parameterOrder": [
  12242. // "accountId",
  12243. // "webPropertyId",
  12244. // "profileId",
  12245. // "linkId"
  12246. // ],
  12247. // "parameters": {
  12248. // "accountId": {
  12249. // "description": "Account ID to update the user link for.",
  12250. // "location": "path",
  12251. // "required": true,
  12252. // "type": "string"
  12253. // },
  12254. // "linkId": {
  12255. // "description": "Link ID to update the user link for.",
  12256. // "location": "path",
  12257. // "required": true,
  12258. // "type": "string"
  12259. // },
  12260. // "profileId": {
  12261. // "description": "View (Profile ID) to update the user link for.",
  12262. // "location": "path",
  12263. // "required": true,
  12264. // "type": "string"
  12265. // },
  12266. // "webPropertyId": {
  12267. // "description": "Web Property ID to update the user link for.",
  12268. // "location": "path",
  12269. // "required": true,
  12270. // "type": "string"
  12271. // }
  12272. // },
  12273. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}",
  12274. // "request": {
  12275. // "$ref": "EntityUserLink"
  12276. // },
  12277. // "response": {
  12278. // "$ref": "EntityUserLink"
  12279. // },
  12280. // "scopes": [
  12281. // "https://www.googleapis.com/auth/analytics.manage.users"
  12282. // ]
  12283. // }
  12284. }
  12285. // method id "analytics.management.profiles.delete":
  12286. type ManagementProfilesDeleteCall struct {
  12287. s *Service
  12288. accountId string
  12289. webPropertyId string
  12290. profileId string
  12291. urlParams_ gensupport.URLParams
  12292. ctx_ context.Context
  12293. header_ http.Header
  12294. }
  12295. // Delete: Deletes a view (profile).
  12296. func (r *ManagementProfilesService) Delete(accountId string, webPropertyId string, profileId string) *ManagementProfilesDeleteCall {
  12297. c := &ManagementProfilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12298. c.accountId = accountId
  12299. c.webPropertyId = webPropertyId
  12300. c.profileId = profileId
  12301. return c
  12302. }
  12303. // Fields allows partial responses to be retrieved. See
  12304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12305. // for more information.
  12306. func (c *ManagementProfilesDeleteCall) Fields(s ...googleapi.Field) *ManagementProfilesDeleteCall {
  12307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12308. return c
  12309. }
  12310. // Context sets the context to be used in this call's Do method. Any
  12311. // pending HTTP request will be aborted if the provided context is
  12312. // canceled.
  12313. func (c *ManagementProfilesDeleteCall) Context(ctx context.Context) *ManagementProfilesDeleteCall {
  12314. c.ctx_ = ctx
  12315. return c
  12316. }
  12317. // Header returns an http.Header that can be modified by the caller to
  12318. // add HTTP headers to the request.
  12319. func (c *ManagementProfilesDeleteCall) Header() http.Header {
  12320. if c.header_ == nil {
  12321. c.header_ = make(http.Header)
  12322. }
  12323. return c.header_
  12324. }
  12325. func (c *ManagementProfilesDeleteCall) doRequest(alt string) (*http.Response, error) {
  12326. reqHeaders := make(http.Header)
  12327. for k, v := range c.header_ {
  12328. reqHeaders[k] = v
  12329. }
  12330. reqHeaders.Set("User-Agent", c.s.userAgent())
  12331. var body io.Reader = nil
  12332. c.urlParams_.Set("alt", alt)
  12333. c.urlParams_.Set("prettyPrint", "false")
  12334. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  12335. urls += "?" + c.urlParams_.Encode()
  12336. req, err := http.NewRequest("DELETE", urls, body)
  12337. if err != nil {
  12338. return nil, err
  12339. }
  12340. req.Header = reqHeaders
  12341. googleapi.Expand(req.URL, map[string]string{
  12342. "accountId": c.accountId,
  12343. "webPropertyId": c.webPropertyId,
  12344. "profileId": c.profileId,
  12345. })
  12346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12347. }
  12348. // Do executes the "analytics.management.profiles.delete" call.
  12349. func (c *ManagementProfilesDeleteCall) Do(opts ...googleapi.CallOption) error {
  12350. gensupport.SetOptions(c.urlParams_, opts...)
  12351. res, err := c.doRequest("json")
  12352. if err != nil {
  12353. return err
  12354. }
  12355. defer googleapi.CloseBody(res)
  12356. if err := googleapi.CheckResponse(res); err != nil {
  12357. return err
  12358. }
  12359. return nil
  12360. // {
  12361. // "description": "Deletes a view (profile).",
  12362. // "httpMethod": "DELETE",
  12363. // "id": "analytics.management.profiles.delete",
  12364. // "parameterOrder": [
  12365. // "accountId",
  12366. // "webPropertyId",
  12367. // "profileId"
  12368. // ],
  12369. // "parameters": {
  12370. // "accountId": {
  12371. // "description": "Account ID to delete the view (profile) for.",
  12372. // "location": "path",
  12373. // "required": true,
  12374. // "type": "string"
  12375. // },
  12376. // "profileId": {
  12377. // "description": "ID of the view (profile) to be deleted.",
  12378. // "location": "path",
  12379. // "required": true,
  12380. // "type": "string"
  12381. // },
  12382. // "webPropertyId": {
  12383. // "description": "Web property ID to delete the view (profile) for.",
  12384. // "location": "path",
  12385. // "required": true,
  12386. // "type": "string"
  12387. // }
  12388. // },
  12389. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12390. // "scopes": [
  12391. // "https://www.googleapis.com/auth/analytics.edit"
  12392. // ]
  12393. // }
  12394. }
  12395. // method id "analytics.management.profiles.get":
  12396. type ManagementProfilesGetCall struct {
  12397. s *Service
  12398. accountId string
  12399. webPropertyId string
  12400. profileId string
  12401. urlParams_ gensupport.URLParams
  12402. ifNoneMatch_ string
  12403. ctx_ context.Context
  12404. header_ http.Header
  12405. }
  12406. // Get: Gets a view (profile) to which the user has access.
  12407. func (r *ManagementProfilesService) Get(accountId string, webPropertyId string, profileId string) *ManagementProfilesGetCall {
  12408. c := &ManagementProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12409. c.accountId = accountId
  12410. c.webPropertyId = webPropertyId
  12411. c.profileId = profileId
  12412. return c
  12413. }
  12414. // Fields allows partial responses to be retrieved. See
  12415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12416. // for more information.
  12417. func (c *ManagementProfilesGetCall) Fields(s ...googleapi.Field) *ManagementProfilesGetCall {
  12418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12419. return c
  12420. }
  12421. // IfNoneMatch sets the optional parameter which makes the operation
  12422. // fail if the object's ETag matches the given value. This is useful for
  12423. // getting updates only after the object has changed since the last
  12424. // request. Use googleapi.IsNotModified to check whether the response
  12425. // error from Do is the result of In-None-Match.
  12426. func (c *ManagementProfilesGetCall) IfNoneMatch(entityTag string) *ManagementProfilesGetCall {
  12427. c.ifNoneMatch_ = entityTag
  12428. return c
  12429. }
  12430. // Context sets the context to be used in this call's Do method. Any
  12431. // pending HTTP request will be aborted if the provided context is
  12432. // canceled.
  12433. func (c *ManagementProfilesGetCall) Context(ctx context.Context) *ManagementProfilesGetCall {
  12434. c.ctx_ = ctx
  12435. return c
  12436. }
  12437. // Header returns an http.Header that can be modified by the caller to
  12438. // add HTTP headers to the request.
  12439. func (c *ManagementProfilesGetCall) Header() http.Header {
  12440. if c.header_ == nil {
  12441. c.header_ = make(http.Header)
  12442. }
  12443. return c.header_
  12444. }
  12445. func (c *ManagementProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12446. reqHeaders := make(http.Header)
  12447. for k, v := range c.header_ {
  12448. reqHeaders[k] = v
  12449. }
  12450. reqHeaders.Set("User-Agent", c.s.userAgent())
  12451. if c.ifNoneMatch_ != "" {
  12452. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12453. }
  12454. var body io.Reader = nil
  12455. c.urlParams_.Set("alt", alt)
  12456. c.urlParams_.Set("prettyPrint", "false")
  12457. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  12458. urls += "?" + c.urlParams_.Encode()
  12459. req, err := http.NewRequest("GET", urls, body)
  12460. if err != nil {
  12461. return nil, err
  12462. }
  12463. req.Header = reqHeaders
  12464. googleapi.Expand(req.URL, map[string]string{
  12465. "accountId": c.accountId,
  12466. "webPropertyId": c.webPropertyId,
  12467. "profileId": c.profileId,
  12468. })
  12469. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12470. }
  12471. // Do executes the "analytics.management.profiles.get" call.
  12472. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12473. // code is an error. Response headers are in either
  12474. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12475. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12476. // check whether the returned error was because http.StatusNotModified
  12477. // was returned.
  12478. func (c *ManagementProfilesGetCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12479. gensupport.SetOptions(c.urlParams_, opts...)
  12480. res, err := c.doRequest("json")
  12481. if res != nil && res.StatusCode == http.StatusNotModified {
  12482. if res.Body != nil {
  12483. res.Body.Close()
  12484. }
  12485. return nil, &googleapi.Error{
  12486. Code: res.StatusCode,
  12487. Header: res.Header,
  12488. }
  12489. }
  12490. if err != nil {
  12491. return nil, err
  12492. }
  12493. defer googleapi.CloseBody(res)
  12494. if err := googleapi.CheckResponse(res); err != nil {
  12495. return nil, err
  12496. }
  12497. ret := &Profile{
  12498. ServerResponse: googleapi.ServerResponse{
  12499. Header: res.Header,
  12500. HTTPStatusCode: res.StatusCode,
  12501. },
  12502. }
  12503. target := &ret
  12504. if err := gensupport.DecodeResponse(target, res); err != nil {
  12505. return nil, err
  12506. }
  12507. return ret, nil
  12508. // {
  12509. // "description": "Gets a view (profile) to which the user has access.",
  12510. // "httpMethod": "GET",
  12511. // "id": "analytics.management.profiles.get",
  12512. // "parameterOrder": [
  12513. // "accountId",
  12514. // "webPropertyId",
  12515. // "profileId"
  12516. // ],
  12517. // "parameters": {
  12518. // "accountId": {
  12519. // "description": "Account ID to retrieve the view (profile) for.",
  12520. // "location": "path",
  12521. // "pattern": "[0-9]+",
  12522. // "required": true,
  12523. // "type": "string"
  12524. // },
  12525. // "profileId": {
  12526. // "description": "View (Profile) ID to retrieve the view (profile) for.",
  12527. // "location": "path",
  12528. // "pattern": "[0-9]+",
  12529. // "required": true,
  12530. // "type": "string"
  12531. // },
  12532. // "webPropertyId": {
  12533. // "description": "Web property ID to retrieve the view (profile) for.",
  12534. // "location": "path",
  12535. // "pattern": "UA-[0-9]+-[0-9]+",
  12536. // "required": true,
  12537. // "type": "string"
  12538. // }
  12539. // },
  12540. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12541. // "response": {
  12542. // "$ref": "Profile"
  12543. // },
  12544. // "scopes": [
  12545. // "https://www.googleapis.com/auth/analytics.edit",
  12546. // "https://www.googleapis.com/auth/analytics.readonly"
  12547. // ]
  12548. // }
  12549. }
  12550. // method id "analytics.management.profiles.insert":
  12551. type ManagementProfilesInsertCall struct {
  12552. s *Service
  12553. accountId string
  12554. webPropertyId string
  12555. profile *Profile
  12556. urlParams_ gensupport.URLParams
  12557. ctx_ context.Context
  12558. header_ http.Header
  12559. }
  12560. // Insert: Create a new view (profile).
  12561. func (r *ManagementProfilesService) Insert(accountId string, webPropertyId string, profile *Profile) *ManagementProfilesInsertCall {
  12562. c := &ManagementProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12563. c.accountId = accountId
  12564. c.webPropertyId = webPropertyId
  12565. c.profile = profile
  12566. return c
  12567. }
  12568. // Fields allows partial responses to be retrieved. See
  12569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12570. // for more information.
  12571. func (c *ManagementProfilesInsertCall) Fields(s ...googleapi.Field) *ManagementProfilesInsertCall {
  12572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12573. return c
  12574. }
  12575. // Context sets the context to be used in this call's Do method. Any
  12576. // pending HTTP request will be aborted if the provided context is
  12577. // canceled.
  12578. func (c *ManagementProfilesInsertCall) Context(ctx context.Context) *ManagementProfilesInsertCall {
  12579. c.ctx_ = ctx
  12580. return c
  12581. }
  12582. // Header returns an http.Header that can be modified by the caller to
  12583. // add HTTP headers to the request.
  12584. func (c *ManagementProfilesInsertCall) Header() http.Header {
  12585. if c.header_ == nil {
  12586. c.header_ = make(http.Header)
  12587. }
  12588. return c.header_
  12589. }
  12590. func (c *ManagementProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12591. reqHeaders := make(http.Header)
  12592. for k, v := range c.header_ {
  12593. reqHeaders[k] = v
  12594. }
  12595. reqHeaders.Set("User-Agent", c.s.userAgent())
  12596. var body io.Reader = nil
  12597. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  12598. if err != nil {
  12599. return nil, err
  12600. }
  12601. reqHeaders.Set("Content-Type", "application/json")
  12602. c.urlParams_.Set("alt", alt)
  12603. c.urlParams_.Set("prettyPrint", "false")
  12604. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles")
  12605. urls += "?" + c.urlParams_.Encode()
  12606. req, err := http.NewRequest("POST", urls, body)
  12607. if err != nil {
  12608. return nil, err
  12609. }
  12610. req.Header = reqHeaders
  12611. googleapi.Expand(req.URL, map[string]string{
  12612. "accountId": c.accountId,
  12613. "webPropertyId": c.webPropertyId,
  12614. })
  12615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12616. }
  12617. // Do executes the "analytics.management.profiles.insert" call.
  12618. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12619. // code is an error. Response headers are in either
  12620. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12621. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12622. // check whether the returned error was because http.StatusNotModified
  12623. // was returned.
  12624. func (c *ManagementProfilesInsertCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12625. gensupport.SetOptions(c.urlParams_, opts...)
  12626. res, err := c.doRequest("json")
  12627. if res != nil && res.StatusCode == http.StatusNotModified {
  12628. if res.Body != nil {
  12629. res.Body.Close()
  12630. }
  12631. return nil, &googleapi.Error{
  12632. Code: res.StatusCode,
  12633. Header: res.Header,
  12634. }
  12635. }
  12636. if err != nil {
  12637. return nil, err
  12638. }
  12639. defer googleapi.CloseBody(res)
  12640. if err := googleapi.CheckResponse(res); err != nil {
  12641. return nil, err
  12642. }
  12643. ret := &Profile{
  12644. ServerResponse: googleapi.ServerResponse{
  12645. Header: res.Header,
  12646. HTTPStatusCode: res.StatusCode,
  12647. },
  12648. }
  12649. target := &ret
  12650. if err := gensupport.DecodeResponse(target, res); err != nil {
  12651. return nil, err
  12652. }
  12653. return ret, nil
  12654. // {
  12655. // "description": "Create a new view (profile).",
  12656. // "httpMethod": "POST",
  12657. // "id": "analytics.management.profiles.insert",
  12658. // "parameterOrder": [
  12659. // "accountId",
  12660. // "webPropertyId"
  12661. // ],
  12662. // "parameters": {
  12663. // "accountId": {
  12664. // "description": "Account ID to create the view (profile) for.",
  12665. // "location": "path",
  12666. // "required": true,
  12667. // "type": "string"
  12668. // },
  12669. // "webPropertyId": {
  12670. // "description": "Web property ID to create the view (profile) for.",
  12671. // "location": "path",
  12672. // "required": true,
  12673. // "type": "string"
  12674. // }
  12675. // },
  12676. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles",
  12677. // "request": {
  12678. // "$ref": "Profile"
  12679. // },
  12680. // "response": {
  12681. // "$ref": "Profile"
  12682. // },
  12683. // "scopes": [
  12684. // "https://www.googleapis.com/auth/analytics.edit"
  12685. // ]
  12686. // }
  12687. }
  12688. // method id "analytics.management.profiles.list":
  12689. type ManagementProfilesListCall struct {
  12690. s *Service
  12691. accountId string
  12692. webPropertyId string
  12693. urlParams_ gensupport.URLParams
  12694. ifNoneMatch_ string
  12695. ctx_ context.Context
  12696. header_ http.Header
  12697. }
  12698. // List: Lists views (profiles) to which the user has access.
  12699. func (r *ManagementProfilesService) List(accountId string, webPropertyId string) *ManagementProfilesListCall {
  12700. c := &ManagementProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12701. c.accountId = accountId
  12702. c.webPropertyId = webPropertyId
  12703. return c
  12704. }
  12705. // MaxResults sets the optional parameter "max-results": The maximum
  12706. // number of views (profiles) to include in this response.
  12707. func (c *ManagementProfilesListCall) MaxResults(maxResults int64) *ManagementProfilesListCall {
  12708. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  12709. return c
  12710. }
  12711. // StartIndex sets the optional parameter "start-index": An index of the
  12712. // first entity to retrieve. Use this parameter as a pagination
  12713. // mechanism along with the max-results parameter.
  12714. func (c *ManagementProfilesListCall) StartIndex(startIndex int64) *ManagementProfilesListCall {
  12715. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  12716. return c
  12717. }
  12718. // Fields allows partial responses to be retrieved. See
  12719. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12720. // for more information.
  12721. func (c *ManagementProfilesListCall) Fields(s ...googleapi.Field) *ManagementProfilesListCall {
  12722. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12723. return c
  12724. }
  12725. // IfNoneMatch sets the optional parameter which makes the operation
  12726. // fail if the object's ETag matches the given value. This is useful for
  12727. // getting updates only after the object has changed since the last
  12728. // request. Use googleapi.IsNotModified to check whether the response
  12729. // error from Do is the result of In-None-Match.
  12730. func (c *ManagementProfilesListCall) IfNoneMatch(entityTag string) *ManagementProfilesListCall {
  12731. c.ifNoneMatch_ = entityTag
  12732. return c
  12733. }
  12734. // Context sets the context to be used in this call's Do method. Any
  12735. // pending HTTP request will be aborted if the provided context is
  12736. // canceled.
  12737. func (c *ManagementProfilesListCall) Context(ctx context.Context) *ManagementProfilesListCall {
  12738. c.ctx_ = ctx
  12739. return c
  12740. }
  12741. // Header returns an http.Header that can be modified by the caller to
  12742. // add HTTP headers to the request.
  12743. func (c *ManagementProfilesListCall) Header() http.Header {
  12744. if c.header_ == nil {
  12745. c.header_ = make(http.Header)
  12746. }
  12747. return c.header_
  12748. }
  12749. func (c *ManagementProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12750. reqHeaders := make(http.Header)
  12751. for k, v := range c.header_ {
  12752. reqHeaders[k] = v
  12753. }
  12754. reqHeaders.Set("User-Agent", c.s.userAgent())
  12755. if c.ifNoneMatch_ != "" {
  12756. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12757. }
  12758. var body io.Reader = nil
  12759. c.urlParams_.Set("alt", alt)
  12760. c.urlParams_.Set("prettyPrint", "false")
  12761. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles")
  12762. urls += "?" + c.urlParams_.Encode()
  12763. req, err := http.NewRequest("GET", urls, body)
  12764. if err != nil {
  12765. return nil, err
  12766. }
  12767. req.Header = reqHeaders
  12768. googleapi.Expand(req.URL, map[string]string{
  12769. "accountId": c.accountId,
  12770. "webPropertyId": c.webPropertyId,
  12771. })
  12772. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12773. }
  12774. // Do executes the "analytics.management.profiles.list" call.
  12775. // Exactly one of *Profiles or error will be non-nil. Any non-2xx status
  12776. // code is an error. Response headers are in either
  12777. // *Profiles.ServerResponse.Header or (if a response was returned at
  12778. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12779. // to check whether the returned error was because
  12780. // http.StatusNotModified was returned.
  12781. func (c *ManagementProfilesListCall) Do(opts ...googleapi.CallOption) (*Profiles, error) {
  12782. gensupport.SetOptions(c.urlParams_, opts...)
  12783. res, err := c.doRequest("json")
  12784. if res != nil && res.StatusCode == http.StatusNotModified {
  12785. if res.Body != nil {
  12786. res.Body.Close()
  12787. }
  12788. return nil, &googleapi.Error{
  12789. Code: res.StatusCode,
  12790. Header: res.Header,
  12791. }
  12792. }
  12793. if err != nil {
  12794. return nil, err
  12795. }
  12796. defer googleapi.CloseBody(res)
  12797. if err := googleapi.CheckResponse(res); err != nil {
  12798. return nil, err
  12799. }
  12800. ret := &Profiles{
  12801. ServerResponse: googleapi.ServerResponse{
  12802. Header: res.Header,
  12803. HTTPStatusCode: res.StatusCode,
  12804. },
  12805. }
  12806. target := &ret
  12807. if err := gensupport.DecodeResponse(target, res); err != nil {
  12808. return nil, err
  12809. }
  12810. return ret, nil
  12811. // {
  12812. // "description": "Lists views (profiles) to which the user has access.",
  12813. // "httpMethod": "GET",
  12814. // "id": "analytics.management.profiles.list",
  12815. // "parameterOrder": [
  12816. // "accountId",
  12817. // "webPropertyId"
  12818. // ],
  12819. // "parameters": {
  12820. // "accountId": {
  12821. // "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.",
  12822. // "location": "path",
  12823. // "required": true,
  12824. // "type": "string"
  12825. // },
  12826. // "max-results": {
  12827. // "description": "The maximum number of views (profiles) to include in this response.",
  12828. // "format": "int32",
  12829. // "location": "query",
  12830. // "type": "integer"
  12831. // },
  12832. // "start-index": {
  12833. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  12834. // "format": "int32",
  12835. // "location": "query",
  12836. // "minimum": "1",
  12837. // "type": "integer"
  12838. // },
  12839. // "webPropertyId": {
  12840. // "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.",
  12841. // "location": "path",
  12842. // "required": true,
  12843. // "type": "string"
  12844. // }
  12845. // },
  12846. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles",
  12847. // "response": {
  12848. // "$ref": "Profiles"
  12849. // },
  12850. // "scopes": [
  12851. // "https://www.googleapis.com/auth/analytics",
  12852. // "https://www.googleapis.com/auth/analytics.edit",
  12853. // "https://www.googleapis.com/auth/analytics.readonly"
  12854. // ]
  12855. // }
  12856. }
  12857. // method id "analytics.management.profiles.patch":
  12858. type ManagementProfilesPatchCall struct {
  12859. s *Service
  12860. accountId string
  12861. webPropertyId string
  12862. profileId string
  12863. profile *Profile
  12864. urlParams_ gensupport.URLParams
  12865. ctx_ context.Context
  12866. header_ http.Header
  12867. }
  12868. // Patch: Updates an existing view (profile). This method supports patch
  12869. // semantics.
  12870. func (r *ManagementProfilesService) Patch(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesPatchCall {
  12871. c := &ManagementProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12872. c.accountId = accountId
  12873. c.webPropertyId = webPropertyId
  12874. c.profileId = profileId
  12875. c.profile = profile
  12876. return c
  12877. }
  12878. // Fields allows partial responses to be retrieved. See
  12879. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12880. // for more information.
  12881. func (c *ManagementProfilesPatchCall) Fields(s ...googleapi.Field) *ManagementProfilesPatchCall {
  12882. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12883. return c
  12884. }
  12885. // Context sets the context to be used in this call's Do method. Any
  12886. // pending HTTP request will be aborted if the provided context is
  12887. // canceled.
  12888. func (c *ManagementProfilesPatchCall) Context(ctx context.Context) *ManagementProfilesPatchCall {
  12889. c.ctx_ = ctx
  12890. return c
  12891. }
  12892. // Header returns an http.Header that can be modified by the caller to
  12893. // add HTTP headers to the request.
  12894. func (c *ManagementProfilesPatchCall) Header() http.Header {
  12895. if c.header_ == nil {
  12896. c.header_ = make(http.Header)
  12897. }
  12898. return c.header_
  12899. }
  12900. func (c *ManagementProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  12901. reqHeaders := make(http.Header)
  12902. for k, v := range c.header_ {
  12903. reqHeaders[k] = v
  12904. }
  12905. reqHeaders.Set("User-Agent", c.s.userAgent())
  12906. var body io.Reader = nil
  12907. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  12908. if err != nil {
  12909. return nil, err
  12910. }
  12911. reqHeaders.Set("Content-Type", "application/json")
  12912. c.urlParams_.Set("alt", alt)
  12913. c.urlParams_.Set("prettyPrint", "false")
  12914. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  12915. urls += "?" + c.urlParams_.Encode()
  12916. req, err := http.NewRequest("PATCH", urls, body)
  12917. if err != nil {
  12918. return nil, err
  12919. }
  12920. req.Header = reqHeaders
  12921. googleapi.Expand(req.URL, map[string]string{
  12922. "accountId": c.accountId,
  12923. "webPropertyId": c.webPropertyId,
  12924. "profileId": c.profileId,
  12925. })
  12926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12927. }
  12928. // Do executes the "analytics.management.profiles.patch" call.
  12929. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12930. // code is an error. Response headers are in either
  12931. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12932. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12933. // check whether the returned error was because http.StatusNotModified
  12934. // was returned.
  12935. func (c *ManagementProfilesPatchCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12936. gensupport.SetOptions(c.urlParams_, opts...)
  12937. res, err := c.doRequest("json")
  12938. if res != nil && res.StatusCode == http.StatusNotModified {
  12939. if res.Body != nil {
  12940. res.Body.Close()
  12941. }
  12942. return nil, &googleapi.Error{
  12943. Code: res.StatusCode,
  12944. Header: res.Header,
  12945. }
  12946. }
  12947. if err != nil {
  12948. return nil, err
  12949. }
  12950. defer googleapi.CloseBody(res)
  12951. if err := googleapi.CheckResponse(res); err != nil {
  12952. return nil, err
  12953. }
  12954. ret := &Profile{
  12955. ServerResponse: googleapi.ServerResponse{
  12956. Header: res.Header,
  12957. HTTPStatusCode: res.StatusCode,
  12958. },
  12959. }
  12960. target := &ret
  12961. if err := gensupport.DecodeResponse(target, res); err != nil {
  12962. return nil, err
  12963. }
  12964. return ret, nil
  12965. // {
  12966. // "description": "Updates an existing view (profile). This method supports patch semantics.",
  12967. // "httpMethod": "PATCH",
  12968. // "id": "analytics.management.profiles.patch",
  12969. // "parameterOrder": [
  12970. // "accountId",
  12971. // "webPropertyId",
  12972. // "profileId"
  12973. // ],
  12974. // "parameters": {
  12975. // "accountId": {
  12976. // "description": "Account ID to which the view (profile) belongs",
  12977. // "location": "path",
  12978. // "required": true,
  12979. // "type": "string"
  12980. // },
  12981. // "profileId": {
  12982. // "description": "ID of the view (profile) to be updated.",
  12983. // "location": "path",
  12984. // "required": true,
  12985. // "type": "string"
  12986. // },
  12987. // "webPropertyId": {
  12988. // "description": "Web property ID to which the view (profile) belongs",
  12989. // "location": "path",
  12990. // "required": true,
  12991. // "type": "string"
  12992. // }
  12993. // },
  12994. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12995. // "request": {
  12996. // "$ref": "Profile"
  12997. // },
  12998. // "response": {
  12999. // "$ref": "Profile"
  13000. // },
  13001. // "scopes": [
  13002. // "https://www.googleapis.com/auth/analytics.edit"
  13003. // ]
  13004. // }
  13005. }
  13006. // method id "analytics.management.profiles.update":
  13007. type ManagementProfilesUpdateCall struct {
  13008. s *Service
  13009. accountId string
  13010. webPropertyId string
  13011. profileId string
  13012. profile *Profile
  13013. urlParams_ gensupport.URLParams
  13014. ctx_ context.Context
  13015. header_ http.Header
  13016. }
  13017. // Update: Updates an existing view (profile).
  13018. func (r *ManagementProfilesService) Update(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesUpdateCall {
  13019. c := &ManagementProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13020. c.accountId = accountId
  13021. c.webPropertyId = webPropertyId
  13022. c.profileId = profileId
  13023. c.profile = profile
  13024. return c
  13025. }
  13026. // Fields allows partial responses to be retrieved. See
  13027. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13028. // for more information.
  13029. func (c *ManagementProfilesUpdateCall) Fields(s ...googleapi.Field) *ManagementProfilesUpdateCall {
  13030. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13031. return c
  13032. }
  13033. // Context sets the context to be used in this call's Do method. Any
  13034. // pending HTTP request will be aborted if the provided context is
  13035. // canceled.
  13036. func (c *ManagementProfilesUpdateCall) Context(ctx context.Context) *ManagementProfilesUpdateCall {
  13037. c.ctx_ = ctx
  13038. return c
  13039. }
  13040. // Header returns an http.Header that can be modified by the caller to
  13041. // add HTTP headers to the request.
  13042. func (c *ManagementProfilesUpdateCall) Header() http.Header {
  13043. if c.header_ == nil {
  13044. c.header_ = make(http.Header)
  13045. }
  13046. return c.header_
  13047. }
  13048. func (c *ManagementProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  13049. reqHeaders := make(http.Header)
  13050. for k, v := range c.header_ {
  13051. reqHeaders[k] = v
  13052. }
  13053. reqHeaders.Set("User-Agent", c.s.userAgent())
  13054. var body io.Reader = nil
  13055. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  13056. if err != nil {
  13057. return nil, err
  13058. }
  13059. reqHeaders.Set("Content-Type", "application/json")
  13060. c.urlParams_.Set("alt", alt)
  13061. c.urlParams_.Set("prettyPrint", "false")
  13062. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  13063. urls += "?" + c.urlParams_.Encode()
  13064. req, err := http.NewRequest("PUT", urls, body)
  13065. if err != nil {
  13066. return nil, err
  13067. }
  13068. req.Header = reqHeaders
  13069. googleapi.Expand(req.URL, map[string]string{
  13070. "accountId": c.accountId,
  13071. "webPropertyId": c.webPropertyId,
  13072. "profileId": c.profileId,
  13073. })
  13074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13075. }
  13076. // Do executes the "analytics.management.profiles.update" call.
  13077. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  13078. // code is an error. Response headers are in either
  13079. // *Profile.ServerResponse.Header or (if a response was returned at all)
  13080. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13081. // check whether the returned error was because http.StatusNotModified
  13082. // was returned.
  13083. func (c *ManagementProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  13084. gensupport.SetOptions(c.urlParams_, opts...)
  13085. res, err := c.doRequest("json")
  13086. if res != nil && res.StatusCode == http.StatusNotModified {
  13087. if res.Body != nil {
  13088. res.Body.Close()
  13089. }
  13090. return nil, &googleapi.Error{
  13091. Code: res.StatusCode,
  13092. Header: res.Header,
  13093. }
  13094. }
  13095. if err != nil {
  13096. return nil, err
  13097. }
  13098. defer googleapi.CloseBody(res)
  13099. if err := googleapi.CheckResponse(res); err != nil {
  13100. return nil, err
  13101. }
  13102. ret := &Profile{
  13103. ServerResponse: googleapi.ServerResponse{
  13104. Header: res.Header,
  13105. HTTPStatusCode: res.StatusCode,
  13106. },
  13107. }
  13108. target := &ret
  13109. if err := gensupport.DecodeResponse(target, res); err != nil {
  13110. return nil, err
  13111. }
  13112. return ret, nil
  13113. // {
  13114. // "description": "Updates an existing view (profile).",
  13115. // "httpMethod": "PUT",
  13116. // "id": "analytics.management.profiles.update",
  13117. // "parameterOrder": [
  13118. // "accountId",
  13119. // "webPropertyId",
  13120. // "profileId"
  13121. // ],
  13122. // "parameters": {
  13123. // "accountId": {
  13124. // "description": "Account ID to which the view (profile) belongs",
  13125. // "location": "path",
  13126. // "required": true,
  13127. // "type": "string"
  13128. // },
  13129. // "profileId": {
  13130. // "description": "ID of the view (profile) to be updated.",
  13131. // "location": "path",
  13132. // "required": true,
  13133. // "type": "string"
  13134. // },
  13135. // "webPropertyId": {
  13136. // "description": "Web property ID to which the view (profile) belongs",
  13137. // "location": "path",
  13138. // "required": true,
  13139. // "type": "string"
  13140. // }
  13141. // },
  13142. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  13143. // "request": {
  13144. // "$ref": "Profile"
  13145. // },
  13146. // "response": {
  13147. // "$ref": "Profile"
  13148. // },
  13149. // "scopes": [
  13150. // "https://www.googleapis.com/auth/analytics.edit"
  13151. // ]
  13152. // }
  13153. }
  13154. // method id "analytics.management.remarketingAudience.delete":
  13155. type ManagementRemarketingAudienceDeleteCall struct {
  13156. s *Service
  13157. accountId string
  13158. webPropertyId string
  13159. remarketingAudienceId string
  13160. urlParams_ gensupport.URLParams
  13161. ctx_ context.Context
  13162. header_ http.Header
  13163. }
  13164. // Delete: Delete a remarketing audience.
  13165. func (r *ManagementRemarketingAudienceService) Delete(accountId string, webPropertyId string, remarketingAudienceId string) *ManagementRemarketingAudienceDeleteCall {
  13166. c := &ManagementRemarketingAudienceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13167. c.accountId = accountId
  13168. c.webPropertyId = webPropertyId
  13169. c.remarketingAudienceId = remarketingAudienceId
  13170. return c
  13171. }
  13172. // Fields allows partial responses to be retrieved. See
  13173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13174. // for more information.
  13175. func (c *ManagementRemarketingAudienceDeleteCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceDeleteCall {
  13176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13177. return c
  13178. }
  13179. // Context sets the context to be used in this call's Do method. Any
  13180. // pending HTTP request will be aborted if the provided context is
  13181. // canceled.
  13182. func (c *ManagementRemarketingAudienceDeleteCall) Context(ctx context.Context) *ManagementRemarketingAudienceDeleteCall {
  13183. c.ctx_ = ctx
  13184. return c
  13185. }
  13186. // Header returns an http.Header that can be modified by the caller to
  13187. // add HTTP headers to the request.
  13188. func (c *ManagementRemarketingAudienceDeleteCall) Header() http.Header {
  13189. if c.header_ == nil {
  13190. c.header_ = make(http.Header)
  13191. }
  13192. return c.header_
  13193. }
  13194. func (c *ManagementRemarketingAudienceDeleteCall) doRequest(alt string) (*http.Response, error) {
  13195. reqHeaders := make(http.Header)
  13196. for k, v := range c.header_ {
  13197. reqHeaders[k] = v
  13198. }
  13199. reqHeaders.Set("User-Agent", c.s.userAgent())
  13200. var body io.Reader = nil
  13201. c.urlParams_.Set("alt", alt)
  13202. c.urlParams_.Set("prettyPrint", "false")
  13203. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13204. urls += "?" + c.urlParams_.Encode()
  13205. req, err := http.NewRequest("DELETE", urls, body)
  13206. if err != nil {
  13207. return nil, err
  13208. }
  13209. req.Header = reqHeaders
  13210. googleapi.Expand(req.URL, map[string]string{
  13211. "accountId": c.accountId,
  13212. "webPropertyId": c.webPropertyId,
  13213. "remarketingAudienceId": c.remarketingAudienceId,
  13214. })
  13215. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13216. }
  13217. // Do executes the "analytics.management.remarketingAudience.delete" call.
  13218. func (c *ManagementRemarketingAudienceDeleteCall) Do(opts ...googleapi.CallOption) error {
  13219. gensupport.SetOptions(c.urlParams_, opts...)
  13220. res, err := c.doRequest("json")
  13221. if err != nil {
  13222. return err
  13223. }
  13224. defer googleapi.CloseBody(res)
  13225. if err := googleapi.CheckResponse(res); err != nil {
  13226. return err
  13227. }
  13228. return nil
  13229. // {
  13230. // "description": "Delete a remarketing audience.",
  13231. // "httpMethod": "DELETE",
  13232. // "id": "analytics.management.remarketingAudience.delete",
  13233. // "parameterOrder": [
  13234. // "accountId",
  13235. // "webPropertyId",
  13236. // "remarketingAudienceId"
  13237. // ],
  13238. // "parameters": {
  13239. // "accountId": {
  13240. // "description": "Account ID to which the remarketing audience belongs.",
  13241. // "location": "path",
  13242. // "required": true,
  13243. // "type": "string"
  13244. // },
  13245. // "remarketingAudienceId": {
  13246. // "description": "The ID of the remarketing audience to delete.",
  13247. // "location": "path",
  13248. // "required": true,
  13249. // "type": "string"
  13250. // },
  13251. // "webPropertyId": {
  13252. // "description": "Web property ID to which the remarketing audience belongs.",
  13253. // "location": "path",
  13254. // "required": true,
  13255. // "type": "string"
  13256. // }
  13257. // },
  13258. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  13259. // "scopes": [
  13260. // "https://www.googleapis.com/auth/analytics.edit"
  13261. // ]
  13262. // }
  13263. }
  13264. // method id "analytics.management.remarketingAudience.get":
  13265. type ManagementRemarketingAudienceGetCall struct {
  13266. s *Service
  13267. accountId string
  13268. webPropertyId string
  13269. remarketingAudienceId string
  13270. urlParams_ gensupport.URLParams
  13271. ifNoneMatch_ string
  13272. ctx_ context.Context
  13273. header_ http.Header
  13274. }
  13275. // Get: Gets a remarketing audience to which the user has access.
  13276. func (r *ManagementRemarketingAudienceService) Get(accountId string, webPropertyId string, remarketingAudienceId string) *ManagementRemarketingAudienceGetCall {
  13277. c := &ManagementRemarketingAudienceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13278. c.accountId = accountId
  13279. c.webPropertyId = webPropertyId
  13280. c.remarketingAudienceId = remarketingAudienceId
  13281. return c
  13282. }
  13283. // Fields allows partial responses to be retrieved. See
  13284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13285. // for more information.
  13286. func (c *ManagementRemarketingAudienceGetCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceGetCall {
  13287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13288. return c
  13289. }
  13290. // IfNoneMatch sets the optional parameter which makes the operation
  13291. // fail if the object's ETag matches the given value. This is useful for
  13292. // getting updates only after the object has changed since the last
  13293. // request. Use googleapi.IsNotModified to check whether the response
  13294. // error from Do is the result of In-None-Match.
  13295. func (c *ManagementRemarketingAudienceGetCall) IfNoneMatch(entityTag string) *ManagementRemarketingAudienceGetCall {
  13296. c.ifNoneMatch_ = entityTag
  13297. return c
  13298. }
  13299. // Context sets the context to be used in this call's Do method. Any
  13300. // pending HTTP request will be aborted if the provided context is
  13301. // canceled.
  13302. func (c *ManagementRemarketingAudienceGetCall) Context(ctx context.Context) *ManagementRemarketingAudienceGetCall {
  13303. c.ctx_ = ctx
  13304. return c
  13305. }
  13306. // Header returns an http.Header that can be modified by the caller to
  13307. // add HTTP headers to the request.
  13308. func (c *ManagementRemarketingAudienceGetCall) Header() http.Header {
  13309. if c.header_ == nil {
  13310. c.header_ = make(http.Header)
  13311. }
  13312. return c.header_
  13313. }
  13314. func (c *ManagementRemarketingAudienceGetCall) doRequest(alt string) (*http.Response, error) {
  13315. reqHeaders := make(http.Header)
  13316. for k, v := range c.header_ {
  13317. reqHeaders[k] = v
  13318. }
  13319. reqHeaders.Set("User-Agent", c.s.userAgent())
  13320. if c.ifNoneMatch_ != "" {
  13321. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13322. }
  13323. var body io.Reader = nil
  13324. c.urlParams_.Set("alt", alt)
  13325. c.urlParams_.Set("prettyPrint", "false")
  13326. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13327. urls += "?" + c.urlParams_.Encode()
  13328. req, err := http.NewRequest("GET", urls, body)
  13329. if err != nil {
  13330. return nil, err
  13331. }
  13332. req.Header = reqHeaders
  13333. googleapi.Expand(req.URL, map[string]string{
  13334. "accountId": c.accountId,
  13335. "webPropertyId": c.webPropertyId,
  13336. "remarketingAudienceId": c.remarketingAudienceId,
  13337. })
  13338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13339. }
  13340. // Do executes the "analytics.management.remarketingAudience.get" call.
  13341. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13342. // non-2xx status code is an error. Response headers are in either
  13343. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13344. // returned at all) in error.(*googleapi.Error).Header. Use
  13345. // googleapi.IsNotModified to check whether the returned error was
  13346. // because http.StatusNotModified was returned.
  13347. func (c *ManagementRemarketingAudienceGetCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13348. gensupport.SetOptions(c.urlParams_, opts...)
  13349. res, err := c.doRequest("json")
  13350. if res != nil && res.StatusCode == http.StatusNotModified {
  13351. if res.Body != nil {
  13352. res.Body.Close()
  13353. }
  13354. return nil, &googleapi.Error{
  13355. Code: res.StatusCode,
  13356. Header: res.Header,
  13357. }
  13358. }
  13359. if err != nil {
  13360. return nil, err
  13361. }
  13362. defer googleapi.CloseBody(res)
  13363. if err := googleapi.CheckResponse(res); err != nil {
  13364. return nil, err
  13365. }
  13366. ret := &RemarketingAudience{
  13367. ServerResponse: googleapi.ServerResponse{
  13368. Header: res.Header,
  13369. HTTPStatusCode: res.StatusCode,
  13370. },
  13371. }
  13372. target := &ret
  13373. if err := gensupport.DecodeResponse(target, res); err != nil {
  13374. return nil, err
  13375. }
  13376. return ret, nil
  13377. // {
  13378. // "description": "Gets a remarketing audience to which the user has access.",
  13379. // "httpMethod": "GET",
  13380. // "id": "analytics.management.remarketingAudience.get",
  13381. // "parameterOrder": [
  13382. // "accountId",
  13383. // "webPropertyId",
  13384. // "remarketingAudienceId"
  13385. // ],
  13386. // "parameters": {
  13387. // "accountId": {
  13388. // "description": "The account ID of the remarketing audience to retrieve.",
  13389. // "location": "path",
  13390. // "required": true,
  13391. // "type": "string"
  13392. // },
  13393. // "remarketingAudienceId": {
  13394. // "description": "The ID of the remarketing audience to retrieve.",
  13395. // "location": "path",
  13396. // "required": true,
  13397. // "type": "string"
  13398. // },
  13399. // "webPropertyId": {
  13400. // "description": "The web property ID of the remarketing audience to retrieve.",
  13401. // "location": "path",
  13402. // "required": true,
  13403. // "type": "string"
  13404. // }
  13405. // },
  13406. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  13407. // "response": {
  13408. // "$ref": "RemarketingAudience"
  13409. // },
  13410. // "scopes": [
  13411. // "https://www.googleapis.com/auth/analytics.edit",
  13412. // "https://www.googleapis.com/auth/analytics.readonly"
  13413. // ]
  13414. // }
  13415. }
  13416. // method id "analytics.management.remarketingAudience.insert":
  13417. type ManagementRemarketingAudienceInsertCall struct {
  13418. s *Service
  13419. accountId string
  13420. webPropertyId string
  13421. remarketingaudience *RemarketingAudience
  13422. urlParams_ gensupport.URLParams
  13423. ctx_ context.Context
  13424. header_ http.Header
  13425. }
  13426. // Insert: Creates a new remarketing audience.
  13427. func (r *ManagementRemarketingAudienceService) Insert(accountId string, webPropertyId string, remarketingaudience *RemarketingAudience) *ManagementRemarketingAudienceInsertCall {
  13428. c := &ManagementRemarketingAudienceInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13429. c.accountId = accountId
  13430. c.webPropertyId = webPropertyId
  13431. c.remarketingaudience = remarketingaudience
  13432. return c
  13433. }
  13434. // Fields allows partial responses to be retrieved. See
  13435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13436. // for more information.
  13437. func (c *ManagementRemarketingAudienceInsertCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceInsertCall {
  13438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13439. return c
  13440. }
  13441. // Context sets the context to be used in this call's Do method. Any
  13442. // pending HTTP request will be aborted if the provided context is
  13443. // canceled.
  13444. func (c *ManagementRemarketingAudienceInsertCall) Context(ctx context.Context) *ManagementRemarketingAudienceInsertCall {
  13445. c.ctx_ = ctx
  13446. return c
  13447. }
  13448. // Header returns an http.Header that can be modified by the caller to
  13449. // add HTTP headers to the request.
  13450. func (c *ManagementRemarketingAudienceInsertCall) Header() http.Header {
  13451. if c.header_ == nil {
  13452. c.header_ = make(http.Header)
  13453. }
  13454. return c.header_
  13455. }
  13456. func (c *ManagementRemarketingAudienceInsertCall) doRequest(alt string) (*http.Response, error) {
  13457. reqHeaders := make(http.Header)
  13458. for k, v := range c.header_ {
  13459. reqHeaders[k] = v
  13460. }
  13461. reqHeaders.Set("User-Agent", c.s.userAgent())
  13462. var body io.Reader = nil
  13463. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience)
  13464. if err != nil {
  13465. return nil, err
  13466. }
  13467. reqHeaders.Set("Content-Type", "application/json")
  13468. c.urlParams_.Set("alt", alt)
  13469. c.urlParams_.Set("prettyPrint", "false")
  13470. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences")
  13471. urls += "?" + c.urlParams_.Encode()
  13472. req, err := http.NewRequest("POST", urls, body)
  13473. if err != nil {
  13474. return nil, err
  13475. }
  13476. req.Header = reqHeaders
  13477. googleapi.Expand(req.URL, map[string]string{
  13478. "accountId": c.accountId,
  13479. "webPropertyId": c.webPropertyId,
  13480. })
  13481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13482. }
  13483. // Do executes the "analytics.management.remarketingAudience.insert" call.
  13484. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13485. // non-2xx status code is an error. Response headers are in either
  13486. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13487. // returned at all) in error.(*googleapi.Error).Header. Use
  13488. // googleapi.IsNotModified to check whether the returned error was
  13489. // because http.StatusNotModified was returned.
  13490. func (c *ManagementRemarketingAudienceInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13491. gensupport.SetOptions(c.urlParams_, opts...)
  13492. res, err := c.doRequest("json")
  13493. if res != nil && res.StatusCode == http.StatusNotModified {
  13494. if res.Body != nil {
  13495. res.Body.Close()
  13496. }
  13497. return nil, &googleapi.Error{
  13498. Code: res.StatusCode,
  13499. Header: res.Header,
  13500. }
  13501. }
  13502. if err != nil {
  13503. return nil, err
  13504. }
  13505. defer googleapi.CloseBody(res)
  13506. if err := googleapi.CheckResponse(res); err != nil {
  13507. return nil, err
  13508. }
  13509. ret := &RemarketingAudience{
  13510. ServerResponse: googleapi.ServerResponse{
  13511. Header: res.Header,
  13512. HTTPStatusCode: res.StatusCode,
  13513. },
  13514. }
  13515. target := &ret
  13516. if err := gensupport.DecodeResponse(target, res); err != nil {
  13517. return nil, err
  13518. }
  13519. return ret, nil
  13520. // {
  13521. // "description": "Creates a new remarketing audience.",
  13522. // "httpMethod": "POST",
  13523. // "id": "analytics.management.remarketingAudience.insert",
  13524. // "parameterOrder": [
  13525. // "accountId",
  13526. // "webPropertyId"
  13527. // ],
  13528. // "parameters": {
  13529. // "accountId": {
  13530. // "description": "The account ID for which to create the remarketing audience.",
  13531. // "location": "path",
  13532. // "required": true,
  13533. // "type": "string"
  13534. // },
  13535. // "webPropertyId": {
  13536. // "description": "Web property ID for which to create the remarketing audience.",
  13537. // "location": "path",
  13538. // "required": true,
  13539. // "type": "string"
  13540. // }
  13541. // },
  13542. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences",
  13543. // "request": {
  13544. // "$ref": "RemarketingAudience"
  13545. // },
  13546. // "response": {
  13547. // "$ref": "RemarketingAudience"
  13548. // },
  13549. // "scopes": [
  13550. // "https://www.googleapis.com/auth/analytics.edit"
  13551. // ]
  13552. // }
  13553. }
  13554. // method id "analytics.management.remarketingAudience.list":
  13555. type ManagementRemarketingAudienceListCall struct {
  13556. s *Service
  13557. accountId string
  13558. webPropertyId string
  13559. urlParams_ gensupport.URLParams
  13560. ifNoneMatch_ string
  13561. ctx_ context.Context
  13562. header_ http.Header
  13563. }
  13564. // List: Lists remarketing audiences to which the user has access.
  13565. func (r *ManagementRemarketingAudienceService) List(accountId string, webPropertyId string) *ManagementRemarketingAudienceListCall {
  13566. c := &ManagementRemarketingAudienceListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13567. c.accountId = accountId
  13568. c.webPropertyId = webPropertyId
  13569. return c
  13570. }
  13571. // MaxResults sets the optional parameter "max-results": The maximum
  13572. // number of remarketing audiences to include in this response.
  13573. func (c *ManagementRemarketingAudienceListCall) MaxResults(maxResults int64) *ManagementRemarketingAudienceListCall {
  13574. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  13575. return c
  13576. }
  13577. // StartIndex sets the optional parameter "start-index": An index of the
  13578. // first entity to retrieve. Use this parameter as a pagination
  13579. // mechanism along with the max-results parameter.
  13580. func (c *ManagementRemarketingAudienceListCall) StartIndex(startIndex int64) *ManagementRemarketingAudienceListCall {
  13581. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  13582. return c
  13583. }
  13584. // Type sets the optional parameter "type":
  13585. func (c *ManagementRemarketingAudienceListCall) Type(type_ string) *ManagementRemarketingAudienceListCall {
  13586. c.urlParams_.Set("type", type_)
  13587. return c
  13588. }
  13589. // Fields allows partial responses to be retrieved. See
  13590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13591. // for more information.
  13592. func (c *ManagementRemarketingAudienceListCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceListCall {
  13593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13594. return c
  13595. }
  13596. // IfNoneMatch sets the optional parameter which makes the operation
  13597. // fail if the object's ETag matches the given value. This is useful for
  13598. // getting updates only after the object has changed since the last
  13599. // request. Use googleapi.IsNotModified to check whether the response
  13600. // error from Do is the result of In-None-Match.
  13601. func (c *ManagementRemarketingAudienceListCall) IfNoneMatch(entityTag string) *ManagementRemarketingAudienceListCall {
  13602. c.ifNoneMatch_ = entityTag
  13603. return c
  13604. }
  13605. // Context sets the context to be used in this call's Do method. Any
  13606. // pending HTTP request will be aborted if the provided context is
  13607. // canceled.
  13608. func (c *ManagementRemarketingAudienceListCall) Context(ctx context.Context) *ManagementRemarketingAudienceListCall {
  13609. c.ctx_ = ctx
  13610. return c
  13611. }
  13612. // Header returns an http.Header that can be modified by the caller to
  13613. // add HTTP headers to the request.
  13614. func (c *ManagementRemarketingAudienceListCall) Header() http.Header {
  13615. if c.header_ == nil {
  13616. c.header_ = make(http.Header)
  13617. }
  13618. return c.header_
  13619. }
  13620. func (c *ManagementRemarketingAudienceListCall) doRequest(alt string) (*http.Response, error) {
  13621. reqHeaders := make(http.Header)
  13622. for k, v := range c.header_ {
  13623. reqHeaders[k] = v
  13624. }
  13625. reqHeaders.Set("User-Agent", c.s.userAgent())
  13626. if c.ifNoneMatch_ != "" {
  13627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13628. }
  13629. var body io.Reader = nil
  13630. c.urlParams_.Set("alt", alt)
  13631. c.urlParams_.Set("prettyPrint", "false")
  13632. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences")
  13633. urls += "?" + c.urlParams_.Encode()
  13634. req, err := http.NewRequest("GET", urls, body)
  13635. if err != nil {
  13636. return nil, err
  13637. }
  13638. req.Header = reqHeaders
  13639. googleapi.Expand(req.URL, map[string]string{
  13640. "accountId": c.accountId,
  13641. "webPropertyId": c.webPropertyId,
  13642. })
  13643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13644. }
  13645. // Do executes the "analytics.management.remarketingAudience.list" call.
  13646. // Exactly one of *RemarketingAudiences or error will be non-nil. Any
  13647. // non-2xx status code is an error. Response headers are in either
  13648. // *RemarketingAudiences.ServerResponse.Header or (if a response was
  13649. // returned at all) in error.(*googleapi.Error).Header. Use
  13650. // googleapi.IsNotModified to check whether the returned error was
  13651. // because http.StatusNotModified was returned.
  13652. func (c *ManagementRemarketingAudienceListCall) Do(opts ...googleapi.CallOption) (*RemarketingAudiences, error) {
  13653. gensupport.SetOptions(c.urlParams_, opts...)
  13654. res, err := c.doRequest("json")
  13655. if res != nil && res.StatusCode == http.StatusNotModified {
  13656. if res.Body != nil {
  13657. res.Body.Close()
  13658. }
  13659. return nil, &googleapi.Error{
  13660. Code: res.StatusCode,
  13661. Header: res.Header,
  13662. }
  13663. }
  13664. if err != nil {
  13665. return nil, err
  13666. }
  13667. defer googleapi.CloseBody(res)
  13668. if err := googleapi.CheckResponse(res); err != nil {
  13669. return nil, err
  13670. }
  13671. ret := &RemarketingAudiences{
  13672. ServerResponse: googleapi.ServerResponse{
  13673. Header: res.Header,
  13674. HTTPStatusCode: res.StatusCode,
  13675. },
  13676. }
  13677. target := &ret
  13678. if err := gensupport.DecodeResponse(target, res); err != nil {
  13679. return nil, err
  13680. }
  13681. return ret, nil
  13682. // {
  13683. // "description": "Lists remarketing audiences to which the user has access.",
  13684. // "httpMethod": "GET",
  13685. // "id": "analytics.management.remarketingAudience.list",
  13686. // "parameterOrder": [
  13687. // "accountId",
  13688. // "webPropertyId"
  13689. // ],
  13690. // "parameters": {
  13691. // "accountId": {
  13692. // "description": "The account ID of the remarketing audiences to retrieve.",
  13693. // "location": "path",
  13694. // "required": true,
  13695. // "type": "string"
  13696. // },
  13697. // "max-results": {
  13698. // "description": "The maximum number of remarketing audiences to include in this response.",
  13699. // "format": "int32",
  13700. // "location": "query",
  13701. // "type": "integer"
  13702. // },
  13703. // "start-index": {
  13704. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  13705. // "format": "int32",
  13706. // "location": "query",
  13707. // "minimum": "1",
  13708. // "type": "integer"
  13709. // },
  13710. // "type": {
  13711. // "default": "all",
  13712. // "location": "query",
  13713. // "type": "string"
  13714. // },
  13715. // "webPropertyId": {
  13716. // "description": "The web property ID of the remarketing audiences to retrieve.",
  13717. // "location": "path",
  13718. // "required": true,
  13719. // "type": "string"
  13720. // }
  13721. // },
  13722. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences",
  13723. // "response": {
  13724. // "$ref": "RemarketingAudiences"
  13725. // },
  13726. // "scopes": [
  13727. // "https://www.googleapis.com/auth/analytics.edit",
  13728. // "https://www.googleapis.com/auth/analytics.readonly"
  13729. // ]
  13730. // }
  13731. }
  13732. // method id "analytics.management.remarketingAudience.patch":
  13733. type ManagementRemarketingAudiencePatchCall struct {
  13734. s *Service
  13735. accountId string
  13736. webPropertyId string
  13737. remarketingAudienceId string
  13738. remarketingaudience *RemarketingAudience
  13739. urlParams_ gensupport.URLParams
  13740. ctx_ context.Context
  13741. header_ http.Header
  13742. }
  13743. // Patch: Updates an existing remarketing audience. This method supports
  13744. // patch semantics.
  13745. func (r *ManagementRemarketingAudienceService) Patch(accountId string, webPropertyId string, remarketingAudienceId string, remarketingaudience *RemarketingAudience) *ManagementRemarketingAudiencePatchCall {
  13746. c := &ManagementRemarketingAudiencePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13747. c.accountId = accountId
  13748. c.webPropertyId = webPropertyId
  13749. c.remarketingAudienceId = remarketingAudienceId
  13750. c.remarketingaudience = remarketingaudience
  13751. return c
  13752. }
  13753. // Fields allows partial responses to be retrieved. See
  13754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13755. // for more information.
  13756. func (c *ManagementRemarketingAudiencePatchCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudiencePatchCall {
  13757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13758. return c
  13759. }
  13760. // Context sets the context to be used in this call's Do method. Any
  13761. // pending HTTP request will be aborted if the provided context is
  13762. // canceled.
  13763. func (c *ManagementRemarketingAudiencePatchCall) Context(ctx context.Context) *ManagementRemarketingAudiencePatchCall {
  13764. c.ctx_ = ctx
  13765. return c
  13766. }
  13767. // Header returns an http.Header that can be modified by the caller to
  13768. // add HTTP headers to the request.
  13769. func (c *ManagementRemarketingAudiencePatchCall) Header() http.Header {
  13770. if c.header_ == nil {
  13771. c.header_ = make(http.Header)
  13772. }
  13773. return c.header_
  13774. }
  13775. func (c *ManagementRemarketingAudiencePatchCall) doRequest(alt string) (*http.Response, error) {
  13776. reqHeaders := make(http.Header)
  13777. for k, v := range c.header_ {
  13778. reqHeaders[k] = v
  13779. }
  13780. reqHeaders.Set("User-Agent", c.s.userAgent())
  13781. var body io.Reader = nil
  13782. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience)
  13783. if err != nil {
  13784. return nil, err
  13785. }
  13786. reqHeaders.Set("Content-Type", "application/json")
  13787. c.urlParams_.Set("alt", alt)
  13788. c.urlParams_.Set("prettyPrint", "false")
  13789. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13790. urls += "?" + c.urlParams_.Encode()
  13791. req, err := http.NewRequest("PATCH", urls, body)
  13792. if err != nil {
  13793. return nil, err
  13794. }
  13795. req.Header = reqHeaders
  13796. googleapi.Expand(req.URL, map[string]string{
  13797. "accountId": c.accountId,
  13798. "webPropertyId": c.webPropertyId,
  13799. "remarketingAudienceId": c.remarketingAudienceId,
  13800. })
  13801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13802. }
  13803. // Do executes the "analytics.management.remarketingAudience.patch" call.
  13804. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13805. // non-2xx status code is an error. Response headers are in either
  13806. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13807. // returned 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 *ManagementRemarketingAudiencePatchCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, 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 := &RemarketingAudience{
  13830. ServerResponse: googleapi.ServerResponse{
  13831. Header: res.Header,
  13832. HTTPStatusCode: res.StatusCode,
  13833. },
  13834. }
  13835. target := &ret
  13836. if err := gensupport.DecodeResponse(target, res); err != nil {
  13837. return nil, err
  13838. }
  13839. return ret, nil
  13840. // {
  13841. // "description": "Updates an existing remarketing audience. This method supports patch semantics.",
  13842. // "httpMethod": "PATCH",
  13843. // "id": "analytics.management.remarketingAudience.patch",
  13844. // "parameterOrder": [
  13845. // "accountId",
  13846. // "webPropertyId",
  13847. // "remarketingAudienceId"
  13848. // ],
  13849. // "parameters": {
  13850. // "accountId": {
  13851. // "description": "The account ID of the remarketing audience to update.",
  13852. // "location": "path",
  13853. // "required": true,
  13854. // "type": "string"
  13855. // },
  13856. // "remarketingAudienceId": {
  13857. // "description": "The ID of the remarketing audience to update.",
  13858. // "location": "path",
  13859. // "required": true,
  13860. // "type": "string"
  13861. // },
  13862. // "webPropertyId": {
  13863. // "description": "The web property ID of the remarketing audience to update.",
  13864. // "location": "path",
  13865. // "required": true,
  13866. // "type": "string"
  13867. // }
  13868. // },
  13869. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  13870. // "request": {
  13871. // "$ref": "RemarketingAudience"
  13872. // },
  13873. // "response": {
  13874. // "$ref": "RemarketingAudience"
  13875. // },
  13876. // "scopes": [
  13877. // "https://www.googleapis.com/auth/analytics.edit"
  13878. // ]
  13879. // }
  13880. }
  13881. // method id "analytics.management.remarketingAudience.update":
  13882. type ManagementRemarketingAudienceUpdateCall struct {
  13883. s *Service
  13884. accountId string
  13885. webPropertyId string
  13886. remarketingAudienceId string
  13887. remarketingaudience *RemarketingAudience
  13888. urlParams_ gensupport.URLParams
  13889. ctx_ context.Context
  13890. header_ http.Header
  13891. }
  13892. // Update: Updates an existing remarketing audience.
  13893. func (r *ManagementRemarketingAudienceService) Update(accountId string, webPropertyId string, remarketingAudienceId string, remarketingaudience *RemarketingAudience) *ManagementRemarketingAudienceUpdateCall {
  13894. c := &ManagementRemarketingAudienceUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13895. c.accountId = accountId
  13896. c.webPropertyId = webPropertyId
  13897. c.remarketingAudienceId = remarketingAudienceId
  13898. c.remarketingaudience = remarketingaudience
  13899. return c
  13900. }
  13901. // Fields allows partial responses to be retrieved. See
  13902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13903. // for more information.
  13904. func (c *ManagementRemarketingAudienceUpdateCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceUpdateCall {
  13905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13906. return c
  13907. }
  13908. // Context sets the context to be used in this call's Do method. Any
  13909. // pending HTTP request will be aborted if the provided context is
  13910. // canceled.
  13911. func (c *ManagementRemarketingAudienceUpdateCall) Context(ctx context.Context) *ManagementRemarketingAudienceUpdateCall {
  13912. c.ctx_ = ctx
  13913. return c
  13914. }
  13915. // Header returns an http.Header that can be modified by the caller to
  13916. // add HTTP headers to the request.
  13917. func (c *ManagementRemarketingAudienceUpdateCall) Header() http.Header {
  13918. if c.header_ == nil {
  13919. c.header_ = make(http.Header)
  13920. }
  13921. return c.header_
  13922. }
  13923. func (c *ManagementRemarketingAudienceUpdateCall) doRequest(alt string) (*http.Response, error) {
  13924. reqHeaders := make(http.Header)
  13925. for k, v := range c.header_ {
  13926. reqHeaders[k] = v
  13927. }
  13928. reqHeaders.Set("User-Agent", c.s.userAgent())
  13929. var body io.Reader = nil
  13930. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience)
  13931. if err != nil {
  13932. return nil, err
  13933. }
  13934. reqHeaders.Set("Content-Type", "application/json")
  13935. c.urlParams_.Set("alt", alt)
  13936. c.urlParams_.Set("prettyPrint", "false")
  13937. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13938. urls += "?" + c.urlParams_.Encode()
  13939. req, err := http.NewRequest("PUT", urls, body)
  13940. if err != nil {
  13941. return nil, err
  13942. }
  13943. req.Header = reqHeaders
  13944. googleapi.Expand(req.URL, map[string]string{
  13945. "accountId": c.accountId,
  13946. "webPropertyId": c.webPropertyId,
  13947. "remarketingAudienceId": c.remarketingAudienceId,
  13948. })
  13949. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13950. }
  13951. // Do executes the "analytics.management.remarketingAudience.update" call.
  13952. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13953. // non-2xx status code is an error. Response headers are in either
  13954. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13955. // returned at all) in error.(*googleapi.Error).Header. Use
  13956. // googleapi.IsNotModified to check whether the returned error was
  13957. // because http.StatusNotModified was returned.
  13958. func (c *ManagementRemarketingAudienceUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13959. gensupport.SetOptions(c.urlParams_, opts...)
  13960. res, err := c.doRequest("json")
  13961. if res != nil && res.StatusCode == http.StatusNotModified {
  13962. if res.Body != nil {
  13963. res.Body.Close()
  13964. }
  13965. return nil, &googleapi.Error{
  13966. Code: res.StatusCode,
  13967. Header: res.Header,
  13968. }
  13969. }
  13970. if err != nil {
  13971. return nil, err
  13972. }
  13973. defer googleapi.CloseBody(res)
  13974. if err := googleapi.CheckResponse(res); err != nil {
  13975. return nil, err
  13976. }
  13977. ret := &RemarketingAudience{
  13978. ServerResponse: googleapi.ServerResponse{
  13979. Header: res.Header,
  13980. HTTPStatusCode: res.StatusCode,
  13981. },
  13982. }
  13983. target := &ret
  13984. if err := gensupport.DecodeResponse(target, res); err != nil {
  13985. return nil, err
  13986. }
  13987. return ret, nil
  13988. // {
  13989. // "description": "Updates an existing remarketing audience.",
  13990. // "httpMethod": "PUT",
  13991. // "id": "analytics.management.remarketingAudience.update",
  13992. // "parameterOrder": [
  13993. // "accountId",
  13994. // "webPropertyId",
  13995. // "remarketingAudienceId"
  13996. // ],
  13997. // "parameters": {
  13998. // "accountId": {
  13999. // "description": "The account ID of the remarketing audience to update.",
  14000. // "location": "path",
  14001. // "required": true,
  14002. // "type": "string"
  14003. // },
  14004. // "remarketingAudienceId": {
  14005. // "description": "The ID of the remarketing audience to update.",
  14006. // "location": "path",
  14007. // "required": true,
  14008. // "type": "string"
  14009. // },
  14010. // "webPropertyId": {
  14011. // "description": "The web property ID of the remarketing audience to update.",
  14012. // "location": "path",
  14013. // "required": true,
  14014. // "type": "string"
  14015. // }
  14016. // },
  14017. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  14018. // "request": {
  14019. // "$ref": "RemarketingAudience"
  14020. // },
  14021. // "response": {
  14022. // "$ref": "RemarketingAudience"
  14023. // },
  14024. // "scopes": [
  14025. // "https://www.googleapis.com/auth/analytics.edit"
  14026. // ]
  14027. // }
  14028. }
  14029. // method id "analytics.management.segments.list":
  14030. type ManagementSegmentsListCall struct {
  14031. s *Service
  14032. urlParams_ gensupport.URLParams
  14033. ifNoneMatch_ string
  14034. ctx_ context.Context
  14035. header_ http.Header
  14036. }
  14037. // List: Lists segments to which the user has access.
  14038. func (r *ManagementSegmentsService) List() *ManagementSegmentsListCall {
  14039. c := &ManagementSegmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14040. return c
  14041. }
  14042. // MaxResults sets the optional parameter "max-results": The maximum
  14043. // number of segments to include in this response.
  14044. func (c *ManagementSegmentsListCall) MaxResults(maxResults int64) *ManagementSegmentsListCall {
  14045. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  14046. return c
  14047. }
  14048. // StartIndex sets the optional parameter "start-index": An index of the
  14049. // first segment to retrieve. Use this parameter as a pagination
  14050. // mechanism along with the max-results parameter.
  14051. func (c *ManagementSegmentsListCall) StartIndex(startIndex int64) *ManagementSegmentsListCall {
  14052. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  14053. return c
  14054. }
  14055. // Fields allows partial responses to be retrieved. See
  14056. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14057. // for more information.
  14058. func (c *ManagementSegmentsListCall) Fields(s ...googleapi.Field) *ManagementSegmentsListCall {
  14059. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14060. return c
  14061. }
  14062. // IfNoneMatch sets the optional parameter which makes the operation
  14063. // fail if the object's ETag matches the given value. This is useful for
  14064. // getting updates only after the object has changed since the last
  14065. // request. Use googleapi.IsNotModified to check whether the response
  14066. // error from Do is the result of In-None-Match.
  14067. func (c *ManagementSegmentsListCall) IfNoneMatch(entityTag string) *ManagementSegmentsListCall {
  14068. c.ifNoneMatch_ = entityTag
  14069. return c
  14070. }
  14071. // Context sets the context to be used in this call's Do method. Any
  14072. // pending HTTP request will be aborted if the provided context is
  14073. // canceled.
  14074. func (c *ManagementSegmentsListCall) Context(ctx context.Context) *ManagementSegmentsListCall {
  14075. c.ctx_ = ctx
  14076. return c
  14077. }
  14078. // Header returns an http.Header that can be modified by the caller to
  14079. // add HTTP headers to the request.
  14080. func (c *ManagementSegmentsListCall) Header() http.Header {
  14081. if c.header_ == nil {
  14082. c.header_ = make(http.Header)
  14083. }
  14084. return c.header_
  14085. }
  14086. func (c *ManagementSegmentsListCall) doRequest(alt string) (*http.Response, error) {
  14087. reqHeaders := make(http.Header)
  14088. for k, v := range c.header_ {
  14089. reqHeaders[k] = v
  14090. }
  14091. reqHeaders.Set("User-Agent", c.s.userAgent())
  14092. if c.ifNoneMatch_ != "" {
  14093. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14094. }
  14095. var body io.Reader = nil
  14096. c.urlParams_.Set("alt", alt)
  14097. c.urlParams_.Set("prettyPrint", "false")
  14098. urls := googleapi.ResolveRelative(c.s.BasePath, "management/segments")
  14099. urls += "?" + c.urlParams_.Encode()
  14100. req, err := http.NewRequest("GET", urls, body)
  14101. if err != nil {
  14102. return nil, err
  14103. }
  14104. req.Header = reqHeaders
  14105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14106. }
  14107. // Do executes the "analytics.management.segments.list" call.
  14108. // Exactly one of *Segments or error will be non-nil. Any non-2xx status
  14109. // code is an error. Response headers are in either
  14110. // *Segments.ServerResponse.Header or (if a response was returned at
  14111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14112. // to check whether the returned error was because
  14113. // http.StatusNotModified was returned.
  14114. func (c *ManagementSegmentsListCall) Do(opts ...googleapi.CallOption) (*Segments, error) {
  14115. gensupport.SetOptions(c.urlParams_, opts...)
  14116. res, err := c.doRequest("json")
  14117. if res != nil && res.StatusCode == http.StatusNotModified {
  14118. if res.Body != nil {
  14119. res.Body.Close()
  14120. }
  14121. return nil, &googleapi.Error{
  14122. Code: res.StatusCode,
  14123. Header: res.Header,
  14124. }
  14125. }
  14126. if err != nil {
  14127. return nil, err
  14128. }
  14129. defer googleapi.CloseBody(res)
  14130. if err := googleapi.CheckResponse(res); err != nil {
  14131. return nil, err
  14132. }
  14133. ret := &Segments{
  14134. ServerResponse: googleapi.ServerResponse{
  14135. Header: res.Header,
  14136. HTTPStatusCode: res.StatusCode,
  14137. },
  14138. }
  14139. target := &ret
  14140. if err := gensupport.DecodeResponse(target, res); err != nil {
  14141. return nil, err
  14142. }
  14143. return ret, nil
  14144. // {
  14145. // "description": "Lists segments to which the user has access.",
  14146. // "httpMethod": "GET",
  14147. // "id": "analytics.management.segments.list",
  14148. // "parameters": {
  14149. // "max-results": {
  14150. // "description": "The maximum number of segments to include in this response.",
  14151. // "format": "int32",
  14152. // "location": "query",
  14153. // "type": "integer"
  14154. // },
  14155. // "start-index": {
  14156. // "description": "An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  14157. // "format": "int32",
  14158. // "location": "query",
  14159. // "minimum": "1",
  14160. // "type": "integer"
  14161. // }
  14162. // },
  14163. // "path": "management/segments",
  14164. // "response": {
  14165. // "$ref": "Segments"
  14166. // },
  14167. // "scopes": [
  14168. // "https://www.googleapis.com/auth/analytics",
  14169. // "https://www.googleapis.com/auth/analytics.edit",
  14170. // "https://www.googleapis.com/auth/analytics.readonly"
  14171. // ]
  14172. // }
  14173. }
  14174. // method id "analytics.management.unsampledReports.delete":
  14175. type ManagementUnsampledReportsDeleteCall struct {
  14176. s *Service
  14177. accountId string
  14178. webPropertyId string
  14179. profileId string
  14180. unsampledReportId string
  14181. urlParams_ gensupport.URLParams
  14182. ctx_ context.Context
  14183. header_ http.Header
  14184. }
  14185. // Delete: Deletes an unsampled report.
  14186. func (r *ManagementUnsampledReportsService) Delete(accountId string, webPropertyId string, profileId string, unsampledReportId string) *ManagementUnsampledReportsDeleteCall {
  14187. c := &ManagementUnsampledReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14188. c.accountId = accountId
  14189. c.webPropertyId = webPropertyId
  14190. c.profileId = profileId
  14191. c.unsampledReportId = unsampledReportId
  14192. return c
  14193. }
  14194. // Fields allows partial responses to be retrieved. See
  14195. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14196. // for more information.
  14197. func (c *ManagementUnsampledReportsDeleteCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsDeleteCall {
  14198. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14199. return c
  14200. }
  14201. // Context sets the context to be used in this call's Do method. Any
  14202. // pending HTTP request will be aborted if the provided context is
  14203. // canceled.
  14204. func (c *ManagementUnsampledReportsDeleteCall) Context(ctx context.Context) *ManagementUnsampledReportsDeleteCall {
  14205. c.ctx_ = ctx
  14206. return c
  14207. }
  14208. // Header returns an http.Header that can be modified by the caller to
  14209. // add HTTP headers to the request.
  14210. func (c *ManagementUnsampledReportsDeleteCall) Header() http.Header {
  14211. if c.header_ == nil {
  14212. c.header_ = make(http.Header)
  14213. }
  14214. return c.header_
  14215. }
  14216. func (c *ManagementUnsampledReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14217. reqHeaders := make(http.Header)
  14218. for k, v := range c.header_ {
  14219. reqHeaders[k] = v
  14220. }
  14221. reqHeaders.Set("User-Agent", c.s.userAgent())
  14222. var body io.Reader = nil
  14223. c.urlParams_.Set("alt", alt)
  14224. c.urlParams_.Set("prettyPrint", "false")
  14225. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}")
  14226. urls += "?" + c.urlParams_.Encode()
  14227. req, err := http.NewRequest("DELETE", urls, body)
  14228. if err != nil {
  14229. return nil, err
  14230. }
  14231. req.Header = reqHeaders
  14232. googleapi.Expand(req.URL, map[string]string{
  14233. "accountId": c.accountId,
  14234. "webPropertyId": c.webPropertyId,
  14235. "profileId": c.profileId,
  14236. "unsampledReportId": c.unsampledReportId,
  14237. })
  14238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14239. }
  14240. // Do executes the "analytics.management.unsampledReports.delete" call.
  14241. func (c *ManagementUnsampledReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  14242. gensupport.SetOptions(c.urlParams_, opts...)
  14243. res, err := c.doRequest("json")
  14244. if err != nil {
  14245. return err
  14246. }
  14247. defer googleapi.CloseBody(res)
  14248. if err := googleapi.CheckResponse(res); err != nil {
  14249. return err
  14250. }
  14251. return nil
  14252. // {
  14253. // "description": "Deletes an unsampled report.",
  14254. // "httpMethod": "DELETE",
  14255. // "id": "analytics.management.unsampledReports.delete",
  14256. // "parameterOrder": [
  14257. // "accountId",
  14258. // "webPropertyId",
  14259. // "profileId",
  14260. // "unsampledReportId"
  14261. // ],
  14262. // "parameters": {
  14263. // "accountId": {
  14264. // "description": "Account ID to delete the unsampled report for.",
  14265. // "location": "path",
  14266. // "required": true,
  14267. // "type": "string"
  14268. // },
  14269. // "profileId": {
  14270. // "description": "View (Profile) ID to delete the unsampled report for.",
  14271. // "location": "path",
  14272. // "required": true,
  14273. // "type": "string"
  14274. // },
  14275. // "unsampledReportId": {
  14276. // "description": "ID of the unsampled report to be deleted.",
  14277. // "location": "path",
  14278. // "required": true,
  14279. // "type": "string"
  14280. // },
  14281. // "webPropertyId": {
  14282. // "description": "Web property ID to delete the unsampled reports for.",
  14283. // "location": "path",
  14284. // "required": true,
  14285. // "type": "string"
  14286. // }
  14287. // },
  14288. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}",
  14289. // "scopes": [
  14290. // "https://www.googleapis.com/auth/analytics.edit"
  14291. // ]
  14292. // }
  14293. }
  14294. // method id "analytics.management.unsampledReports.get":
  14295. type ManagementUnsampledReportsGetCall struct {
  14296. s *Service
  14297. accountId string
  14298. webPropertyId string
  14299. profileId string
  14300. unsampledReportId string
  14301. urlParams_ gensupport.URLParams
  14302. ifNoneMatch_ string
  14303. ctx_ context.Context
  14304. header_ http.Header
  14305. }
  14306. // Get: Returns a single unsampled report.
  14307. func (r *ManagementUnsampledReportsService) Get(accountId string, webPropertyId string, profileId string, unsampledReportId string) *ManagementUnsampledReportsGetCall {
  14308. c := &ManagementUnsampledReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14309. c.accountId = accountId
  14310. c.webPropertyId = webPropertyId
  14311. c.profileId = profileId
  14312. c.unsampledReportId = unsampledReportId
  14313. return c
  14314. }
  14315. // Fields allows partial responses to be retrieved. See
  14316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14317. // for more information.
  14318. func (c *ManagementUnsampledReportsGetCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsGetCall {
  14319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14320. return c
  14321. }
  14322. // IfNoneMatch sets the optional parameter which makes the operation
  14323. // fail if the object's ETag matches the given value. This is useful for
  14324. // getting updates only after the object has changed since the last
  14325. // request. Use googleapi.IsNotModified to check whether the response
  14326. // error from Do is the result of In-None-Match.
  14327. func (c *ManagementUnsampledReportsGetCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsGetCall {
  14328. c.ifNoneMatch_ = entityTag
  14329. return c
  14330. }
  14331. // Context sets the context to be used in this call's Do method. Any
  14332. // pending HTTP request will be aborted if the provided context is
  14333. // canceled.
  14334. func (c *ManagementUnsampledReportsGetCall) Context(ctx context.Context) *ManagementUnsampledReportsGetCall {
  14335. c.ctx_ = ctx
  14336. return c
  14337. }
  14338. // Header returns an http.Header that can be modified by the caller to
  14339. // add HTTP headers to the request.
  14340. func (c *ManagementUnsampledReportsGetCall) Header() http.Header {
  14341. if c.header_ == nil {
  14342. c.header_ = make(http.Header)
  14343. }
  14344. return c.header_
  14345. }
  14346. func (c *ManagementUnsampledReportsGetCall) doRequest(alt string) (*http.Response, error) {
  14347. reqHeaders := make(http.Header)
  14348. for k, v := range c.header_ {
  14349. reqHeaders[k] = v
  14350. }
  14351. reqHeaders.Set("User-Agent", c.s.userAgent())
  14352. if c.ifNoneMatch_ != "" {
  14353. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14354. }
  14355. var body io.Reader = nil
  14356. c.urlParams_.Set("alt", alt)
  14357. c.urlParams_.Set("prettyPrint", "false")
  14358. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}")
  14359. urls += "?" + c.urlParams_.Encode()
  14360. req, err := http.NewRequest("GET", urls, body)
  14361. if err != nil {
  14362. return nil, err
  14363. }
  14364. req.Header = reqHeaders
  14365. googleapi.Expand(req.URL, map[string]string{
  14366. "accountId": c.accountId,
  14367. "webPropertyId": c.webPropertyId,
  14368. "profileId": c.profileId,
  14369. "unsampledReportId": c.unsampledReportId,
  14370. })
  14371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14372. }
  14373. // Do executes the "analytics.management.unsampledReports.get" call.
  14374. // Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx
  14375. // status code is an error. Response headers are in either
  14376. // *UnsampledReport.ServerResponse.Header or (if a response was returned
  14377. // at all) in error.(*googleapi.Error).Header. Use
  14378. // googleapi.IsNotModified to check whether the returned error was
  14379. // because http.StatusNotModified was returned.
  14380. func (c *ManagementUnsampledReportsGetCall) Do(opts ...googleapi.CallOption) (*UnsampledReport, error) {
  14381. gensupport.SetOptions(c.urlParams_, opts...)
  14382. res, err := c.doRequest("json")
  14383. if res != nil && res.StatusCode == http.StatusNotModified {
  14384. if res.Body != nil {
  14385. res.Body.Close()
  14386. }
  14387. return nil, &googleapi.Error{
  14388. Code: res.StatusCode,
  14389. Header: res.Header,
  14390. }
  14391. }
  14392. if err != nil {
  14393. return nil, err
  14394. }
  14395. defer googleapi.CloseBody(res)
  14396. if err := googleapi.CheckResponse(res); err != nil {
  14397. return nil, err
  14398. }
  14399. ret := &UnsampledReport{
  14400. ServerResponse: googleapi.ServerResponse{
  14401. Header: res.Header,
  14402. HTTPStatusCode: res.StatusCode,
  14403. },
  14404. }
  14405. target := &ret
  14406. if err := gensupport.DecodeResponse(target, res); err != nil {
  14407. return nil, err
  14408. }
  14409. return ret, nil
  14410. // {
  14411. // "description": "Returns a single unsampled report.",
  14412. // "httpMethod": "GET",
  14413. // "id": "analytics.management.unsampledReports.get",
  14414. // "parameterOrder": [
  14415. // "accountId",
  14416. // "webPropertyId",
  14417. // "profileId",
  14418. // "unsampledReportId"
  14419. // ],
  14420. // "parameters": {
  14421. // "accountId": {
  14422. // "description": "Account ID to retrieve unsampled report for.",
  14423. // "location": "path",
  14424. // "required": true,
  14425. // "type": "string"
  14426. // },
  14427. // "profileId": {
  14428. // "description": "View (Profile) ID to retrieve unsampled report for.",
  14429. // "location": "path",
  14430. // "required": true,
  14431. // "type": "string"
  14432. // },
  14433. // "unsampledReportId": {
  14434. // "description": "ID of the unsampled report to retrieve.",
  14435. // "location": "path",
  14436. // "required": true,
  14437. // "type": "string"
  14438. // },
  14439. // "webPropertyId": {
  14440. // "description": "Web property ID to retrieve unsampled reports for.",
  14441. // "location": "path",
  14442. // "required": true,
  14443. // "type": "string"
  14444. // }
  14445. // },
  14446. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}",
  14447. // "response": {
  14448. // "$ref": "UnsampledReport"
  14449. // },
  14450. // "scopes": [
  14451. // "https://www.googleapis.com/auth/analytics",
  14452. // "https://www.googleapis.com/auth/analytics.edit",
  14453. // "https://www.googleapis.com/auth/analytics.readonly"
  14454. // ]
  14455. // }
  14456. }
  14457. // method id "analytics.management.unsampledReports.insert":
  14458. type ManagementUnsampledReportsInsertCall struct {
  14459. s *Service
  14460. accountId string
  14461. webPropertyId string
  14462. profileId string
  14463. unsampledreport *UnsampledReport
  14464. urlParams_ gensupport.URLParams
  14465. ctx_ context.Context
  14466. header_ http.Header
  14467. }
  14468. // Insert: Create a new unsampled report.
  14469. func (r *ManagementUnsampledReportsService) Insert(accountId string, webPropertyId string, profileId string, unsampledreport *UnsampledReport) *ManagementUnsampledReportsInsertCall {
  14470. c := &ManagementUnsampledReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14471. c.accountId = accountId
  14472. c.webPropertyId = webPropertyId
  14473. c.profileId = profileId
  14474. c.unsampledreport = unsampledreport
  14475. return c
  14476. }
  14477. // Fields allows partial responses to be retrieved. See
  14478. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14479. // for more information.
  14480. func (c *ManagementUnsampledReportsInsertCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsInsertCall {
  14481. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14482. return c
  14483. }
  14484. // Context sets the context to be used in this call's Do method. Any
  14485. // pending HTTP request will be aborted if the provided context is
  14486. // canceled.
  14487. func (c *ManagementUnsampledReportsInsertCall) Context(ctx context.Context) *ManagementUnsampledReportsInsertCall {
  14488. c.ctx_ = ctx
  14489. return c
  14490. }
  14491. // Header returns an http.Header that can be modified by the caller to
  14492. // add HTTP headers to the request.
  14493. func (c *ManagementUnsampledReportsInsertCall) Header() http.Header {
  14494. if c.header_ == nil {
  14495. c.header_ = make(http.Header)
  14496. }
  14497. return c.header_
  14498. }
  14499. func (c *ManagementUnsampledReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  14500. reqHeaders := make(http.Header)
  14501. for k, v := range c.header_ {
  14502. reqHeaders[k] = v
  14503. }
  14504. reqHeaders.Set("User-Agent", c.s.userAgent())
  14505. var body io.Reader = nil
  14506. body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsampledreport)
  14507. if err != nil {
  14508. return nil, err
  14509. }
  14510. reqHeaders.Set("Content-Type", "application/json")
  14511. c.urlParams_.Set("alt", alt)
  14512. c.urlParams_.Set("prettyPrint", "false")
  14513. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports")
  14514. urls += "?" + c.urlParams_.Encode()
  14515. req, err := http.NewRequest("POST", urls, body)
  14516. if err != nil {
  14517. return nil, err
  14518. }
  14519. req.Header = reqHeaders
  14520. googleapi.Expand(req.URL, map[string]string{
  14521. "accountId": c.accountId,
  14522. "webPropertyId": c.webPropertyId,
  14523. "profileId": c.profileId,
  14524. })
  14525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14526. }
  14527. // Do executes the "analytics.management.unsampledReports.insert" call.
  14528. // Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx
  14529. // status code is an error. Response headers are in either
  14530. // *UnsampledReport.ServerResponse.Header or (if a response was returned
  14531. // at all) in error.(*googleapi.Error).Header. Use
  14532. // googleapi.IsNotModified to check whether the returned error was
  14533. // because http.StatusNotModified was returned.
  14534. func (c *ManagementUnsampledReportsInsertCall) Do(opts ...googleapi.CallOption) (*UnsampledReport, error) {
  14535. gensupport.SetOptions(c.urlParams_, opts...)
  14536. res, err := c.doRequest("json")
  14537. if res != nil && res.StatusCode == http.StatusNotModified {
  14538. if res.Body != nil {
  14539. res.Body.Close()
  14540. }
  14541. return nil, &googleapi.Error{
  14542. Code: res.StatusCode,
  14543. Header: res.Header,
  14544. }
  14545. }
  14546. if err != nil {
  14547. return nil, err
  14548. }
  14549. defer googleapi.CloseBody(res)
  14550. if err := googleapi.CheckResponse(res); err != nil {
  14551. return nil, err
  14552. }
  14553. ret := &UnsampledReport{
  14554. ServerResponse: googleapi.ServerResponse{
  14555. Header: res.Header,
  14556. HTTPStatusCode: res.StatusCode,
  14557. },
  14558. }
  14559. target := &ret
  14560. if err := gensupport.DecodeResponse(target, res); err != nil {
  14561. return nil, err
  14562. }
  14563. return ret, nil
  14564. // {
  14565. // "description": "Create a new unsampled report.",
  14566. // "httpMethod": "POST",
  14567. // "id": "analytics.management.unsampledReports.insert",
  14568. // "parameterOrder": [
  14569. // "accountId",
  14570. // "webPropertyId",
  14571. // "profileId"
  14572. // ],
  14573. // "parameters": {
  14574. // "accountId": {
  14575. // "description": "Account ID to create the unsampled report for.",
  14576. // "location": "path",
  14577. // "required": true,
  14578. // "type": "string"
  14579. // },
  14580. // "profileId": {
  14581. // "description": "View (Profile) ID to create the unsampled report for.",
  14582. // "location": "path",
  14583. // "required": true,
  14584. // "type": "string"
  14585. // },
  14586. // "webPropertyId": {
  14587. // "description": "Web property ID to create the unsampled report for.",
  14588. // "location": "path",
  14589. // "required": true,
  14590. // "type": "string"
  14591. // }
  14592. // },
  14593. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports",
  14594. // "request": {
  14595. // "$ref": "UnsampledReport"
  14596. // },
  14597. // "response": {
  14598. // "$ref": "UnsampledReport"
  14599. // },
  14600. // "scopes": [
  14601. // "https://www.googleapis.com/auth/analytics",
  14602. // "https://www.googleapis.com/auth/analytics.edit"
  14603. // ]
  14604. // }
  14605. }
  14606. // method id "analytics.management.unsampledReports.list":
  14607. type ManagementUnsampledReportsListCall struct {
  14608. s *Service
  14609. accountId string
  14610. webPropertyId string
  14611. profileId string
  14612. urlParams_ gensupport.URLParams
  14613. ifNoneMatch_ string
  14614. ctx_ context.Context
  14615. header_ http.Header
  14616. }
  14617. // List: Lists unsampled reports to which the user has access.
  14618. func (r *ManagementUnsampledReportsService) List(accountId string, webPropertyId string, profileId string) *ManagementUnsampledReportsListCall {
  14619. c := &ManagementUnsampledReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14620. c.accountId = accountId
  14621. c.webPropertyId = webPropertyId
  14622. c.profileId = profileId
  14623. return c
  14624. }
  14625. // MaxResults sets the optional parameter "max-results": The maximum
  14626. // number of unsampled reports to include in this response.
  14627. func (c *ManagementUnsampledReportsListCall) MaxResults(maxResults int64) *ManagementUnsampledReportsListCall {
  14628. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  14629. return c
  14630. }
  14631. // StartIndex sets the optional parameter "start-index": An index of the
  14632. // first unsampled report to retrieve. Use this parameter as a
  14633. // pagination mechanism along with the max-results parameter.
  14634. func (c *ManagementUnsampledReportsListCall) StartIndex(startIndex int64) *ManagementUnsampledReportsListCall {
  14635. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  14636. return c
  14637. }
  14638. // Fields allows partial responses to be retrieved. See
  14639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14640. // for more information.
  14641. func (c *ManagementUnsampledReportsListCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsListCall {
  14642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14643. return c
  14644. }
  14645. // IfNoneMatch sets the optional parameter which makes the operation
  14646. // fail if the object's ETag matches the given value. This is useful for
  14647. // getting updates only after the object has changed since the last
  14648. // request. Use googleapi.IsNotModified to check whether the response
  14649. // error from Do is the result of In-None-Match.
  14650. func (c *ManagementUnsampledReportsListCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsListCall {
  14651. c.ifNoneMatch_ = entityTag
  14652. return c
  14653. }
  14654. // Context sets the context to be used in this call's Do method. Any
  14655. // pending HTTP request will be aborted if the provided context is
  14656. // canceled.
  14657. func (c *ManagementUnsampledReportsListCall) Context(ctx context.Context) *ManagementUnsampledReportsListCall {
  14658. c.ctx_ = ctx
  14659. return c
  14660. }
  14661. // Header returns an http.Header that can be modified by the caller to
  14662. // add HTTP headers to the request.
  14663. func (c *ManagementUnsampledReportsListCall) Header() http.Header {
  14664. if c.header_ == nil {
  14665. c.header_ = make(http.Header)
  14666. }
  14667. return c.header_
  14668. }
  14669. func (c *ManagementUnsampledReportsListCall) doRequest(alt string) (*http.Response, error) {
  14670. reqHeaders := make(http.Header)
  14671. for k, v := range c.header_ {
  14672. reqHeaders[k] = v
  14673. }
  14674. reqHeaders.Set("User-Agent", c.s.userAgent())
  14675. if c.ifNoneMatch_ != "" {
  14676. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14677. }
  14678. var body io.Reader = nil
  14679. c.urlParams_.Set("alt", alt)
  14680. c.urlParams_.Set("prettyPrint", "false")
  14681. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports")
  14682. urls += "?" + c.urlParams_.Encode()
  14683. req, err := http.NewRequest("GET", urls, body)
  14684. if err != nil {
  14685. return nil, err
  14686. }
  14687. req.Header = reqHeaders
  14688. googleapi.Expand(req.URL, map[string]string{
  14689. "accountId": c.accountId,
  14690. "webPropertyId": c.webPropertyId,
  14691. "profileId": c.profileId,
  14692. })
  14693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14694. }
  14695. // Do executes the "analytics.management.unsampledReports.list" call.
  14696. // Exactly one of *UnsampledReports or error will be non-nil. Any
  14697. // non-2xx status code is an error. Response headers are in either
  14698. // *UnsampledReports.ServerResponse.Header or (if a response was
  14699. // returned at all) in error.(*googleapi.Error).Header. Use
  14700. // googleapi.IsNotModified to check whether the returned error was
  14701. // because http.StatusNotModified was returned.
  14702. func (c *ManagementUnsampledReportsListCall) Do(opts ...googleapi.CallOption) (*UnsampledReports, error) {
  14703. gensupport.SetOptions(c.urlParams_, opts...)
  14704. res, err := c.doRequest("json")
  14705. if res != nil && res.StatusCode == http.StatusNotModified {
  14706. if res.Body != nil {
  14707. res.Body.Close()
  14708. }
  14709. return nil, &googleapi.Error{
  14710. Code: res.StatusCode,
  14711. Header: res.Header,
  14712. }
  14713. }
  14714. if err != nil {
  14715. return nil, err
  14716. }
  14717. defer googleapi.CloseBody(res)
  14718. if err := googleapi.CheckResponse(res); err != nil {
  14719. return nil, err
  14720. }
  14721. ret := &UnsampledReports{
  14722. ServerResponse: googleapi.ServerResponse{
  14723. Header: res.Header,
  14724. HTTPStatusCode: res.StatusCode,
  14725. },
  14726. }
  14727. target := &ret
  14728. if err := gensupport.DecodeResponse(target, res); err != nil {
  14729. return nil, err
  14730. }
  14731. return ret, nil
  14732. // {
  14733. // "description": "Lists unsampled reports to which the user has access.",
  14734. // "httpMethod": "GET",
  14735. // "id": "analytics.management.unsampledReports.list",
  14736. // "parameterOrder": [
  14737. // "accountId",
  14738. // "webPropertyId",
  14739. // "profileId"
  14740. // ],
  14741. // "parameters": {
  14742. // "accountId": {
  14743. // "description": "Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported.",
  14744. // "location": "path",
  14745. // "required": true,
  14746. // "type": "string"
  14747. // },
  14748. // "max-results": {
  14749. // "description": "The maximum number of unsampled reports to include in this response.",
  14750. // "format": "int32",
  14751. // "location": "query",
  14752. // "type": "integer"
  14753. // },
  14754. // "profileId": {
  14755. // "description": "View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported.",
  14756. // "location": "path",
  14757. // "required": true,
  14758. // "type": "string"
  14759. // },
  14760. // "start-index": {
  14761. // "description": "An index of the first unsampled report to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  14762. // "format": "int32",
  14763. // "location": "query",
  14764. // "minimum": "1",
  14765. // "type": "integer"
  14766. // },
  14767. // "webPropertyId": {
  14768. // "description": "Web property ID to retrieve unsampled reports for. Must be a specific web property ID, ~all is not supported.",
  14769. // "location": "path",
  14770. // "required": true,
  14771. // "type": "string"
  14772. // }
  14773. // },
  14774. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports",
  14775. // "response": {
  14776. // "$ref": "UnsampledReports"
  14777. // },
  14778. // "scopes": [
  14779. // "https://www.googleapis.com/auth/analytics",
  14780. // "https://www.googleapis.com/auth/analytics.edit",
  14781. // "https://www.googleapis.com/auth/analytics.readonly"
  14782. // ]
  14783. // }
  14784. }
  14785. // method id "analytics.management.uploads.deleteUploadData":
  14786. type ManagementUploadsDeleteUploadDataCall struct {
  14787. s *Service
  14788. accountId string
  14789. webPropertyId string
  14790. customDataSourceId string
  14791. analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest
  14792. urlParams_ gensupport.URLParams
  14793. ctx_ context.Context
  14794. header_ http.Header
  14795. }
  14796. // DeleteUploadData: Delete data associated with a previous upload.
  14797. func (r *ManagementUploadsService) DeleteUploadData(accountId string, webPropertyId string, customDataSourceId string, analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest) *ManagementUploadsDeleteUploadDataCall {
  14798. c := &ManagementUploadsDeleteUploadDataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14799. c.accountId = accountId
  14800. c.webPropertyId = webPropertyId
  14801. c.customDataSourceId = customDataSourceId
  14802. c.analyticsdataimportdeleteuploaddatarequest = analyticsdataimportdeleteuploaddatarequest
  14803. return c
  14804. }
  14805. // Fields allows partial responses to be retrieved. See
  14806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14807. // for more information.
  14808. func (c *ManagementUploadsDeleteUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsDeleteUploadDataCall {
  14809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14810. return c
  14811. }
  14812. // Context sets the context to be used in this call's Do method. Any
  14813. // pending HTTP request will be aborted if the provided context is
  14814. // canceled.
  14815. func (c *ManagementUploadsDeleteUploadDataCall) Context(ctx context.Context) *ManagementUploadsDeleteUploadDataCall {
  14816. c.ctx_ = ctx
  14817. return c
  14818. }
  14819. // Header returns an http.Header that can be modified by the caller to
  14820. // add HTTP headers to the request.
  14821. func (c *ManagementUploadsDeleteUploadDataCall) Header() http.Header {
  14822. if c.header_ == nil {
  14823. c.header_ = make(http.Header)
  14824. }
  14825. return c.header_
  14826. }
  14827. func (c *ManagementUploadsDeleteUploadDataCall) doRequest(alt string) (*http.Response, error) {
  14828. reqHeaders := make(http.Header)
  14829. for k, v := range c.header_ {
  14830. reqHeaders[k] = v
  14831. }
  14832. reqHeaders.Set("User-Agent", c.s.userAgent())
  14833. var body io.Reader = nil
  14834. body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyticsdataimportdeleteuploaddatarequest)
  14835. if err != nil {
  14836. return nil, err
  14837. }
  14838. reqHeaders.Set("Content-Type", "application/json")
  14839. c.urlParams_.Set("alt", alt)
  14840. c.urlParams_.Set("prettyPrint", "false")
  14841. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData")
  14842. urls += "?" + c.urlParams_.Encode()
  14843. req, err := http.NewRequest("POST", urls, body)
  14844. if err != nil {
  14845. return nil, err
  14846. }
  14847. req.Header = reqHeaders
  14848. googleapi.Expand(req.URL, map[string]string{
  14849. "accountId": c.accountId,
  14850. "webPropertyId": c.webPropertyId,
  14851. "customDataSourceId": c.customDataSourceId,
  14852. })
  14853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14854. }
  14855. // Do executes the "analytics.management.uploads.deleteUploadData" call.
  14856. func (c *ManagementUploadsDeleteUploadDataCall) Do(opts ...googleapi.CallOption) error {
  14857. gensupport.SetOptions(c.urlParams_, opts...)
  14858. res, err := c.doRequest("json")
  14859. if err != nil {
  14860. return err
  14861. }
  14862. defer googleapi.CloseBody(res)
  14863. if err := googleapi.CheckResponse(res); err != nil {
  14864. return err
  14865. }
  14866. return nil
  14867. // {
  14868. // "description": "Delete data associated with a previous upload.",
  14869. // "httpMethod": "POST",
  14870. // "id": "analytics.management.uploads.deleteUploadData",
  14871. // "parameterOrder": [
  14872. // "accountId",
  14873. // "webPropertyId",
  14874. // "customDataSourceId"
  14875. // ],
  14876. // "parameters": {
  14877. // "accountId": {
  14878. // "description": "Account Id for the uploads to be deleted.",
  14879. // "location": "path",
  14880. // "pattern": "\\d+",
  14881. // "required": true,
  14882. // "type": "string"
  14883. // },
  14884. // "customDataSourceId": {
  14885. // "description": "Custom data source Id for the uploads to be deleted.",
  14886. // "location": "path",
  14887. // "pattern": ".{22}",
  14888. // "required": true,
  14889. // "type": "string"
  14890. // },
  14891. // "webPropertyId": {
  14892. // "description": "Web property Id for the uploads to be deleted.",
  14893. // "location": "path",
  14894. // "pattern": "UA-(\\d+)-(\\d+)",
  14895. // "required": true,
  14896. // "type": "string"
  14897. // }
  14898. // },
  14899. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData",
  14900. // "request": {
  14901. // "$ref": "AnalyticsDataimportDeleteUploadDataRequest"
  14902. // },
  14903. // "scopes": [
  14904. // "https://www.googleapis.com/auth/analytics",
  14905. // "https://www.googleapis.com/auth/analytics.edit"
  14906. // ]
  14907. // }
  14908. }
  14909. // method id "analytics.management.uploads.get":
  14910. type ManagementUploadsGetCall struct {
  14911. s *Service
  14912. accountId string
  14913. webPropertyId string
  14914. customDataSourceId string
  14915. uploadId string
  14916. urlParams_ gensupport.URLParams
  14917. ifNoneMatch_ string
  14918. ctx_ context.Context
  14919. header_ http.Header
  14920. }
  14921. // Get: List uploads to which the user has access.
  14922. func (r *ManagementUploadsService) Get(accountId string, webPropertyId string, customDataSourceId string, uploadId string) *ManagementUploadsGetCall {
  14923. c := &ManagementUploadsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14924. c.accountId = accountId
  14925. c.webPropertyId = webPropertyId
  14926. c.customDataSourceId = customDataSourceId
  14927. c.uploadId = uploadId
  14928. return c
  14929. }
  14930. // Fields allows partial responses to be retrieved. See
  14931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14932. // for more information.
  14933. func (c *ManagementUploadsGetCall) Fields(s ...googleapi.Field) *ManagementUploadsGetCall {
  14934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14935. return c
  14936. }
  14937. // IfNoneMatch sets the optional parameter which makes the operation
  14938. // fail if the object's ETag matches the given value. This is useful for
  14939. // getting updates only after the object has changed since the last
  14940. // request. Use googleapi.IsNotModified to check whether the response
  14941. // error from Do is the result of In-None-Match.
  14942. func (c *ManagementUploadsGetCall) IfNoneMatch(entityTag string) *ManagementUploadsGetCall {
  14943. c.ifNoneMatch_ = entityTag
  14944. return c
  14945. }
  14946. // Context sets the context to be used in this call's Do method. Any
  14947. // pending HTTP request will be aborted if the provided context is
  14948. // canceled.
  14949. func (c *ManagementUploadsGetCall) Context(ctx context.Context) *ManagementUploadsGetCall {
  14950. c.ctx_ = ctx
  14951. return c
  14952. }
  14953. // Header returns an http.Header that can be modified by the caller to
  14954. // add HTTP headers to the request.
  14955. func (c *ManagementUploadsGetCall) Header() http.Header {
  14956. if c.header_ == nil {
  14957. c.header_ = make(http.Header)
  14958. }
  14959. return c.header_
  14960. }
  14961. func (c *ManagementUploadsGetCall) doRequest(alt string) (*http.Response, error) {
  14962. reqHeaders := make(http.Header)
  14963. for k, v := range c.header_ {
  14964. reqHeaders[k] = v
  14965. }
  14966. reqHeaders.Set("User-Agent", c.s.userAgent())
  14967. if c.ifNoneMatch_ != "" {
  14968. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14969. }
  14970. var body io.Reader = nil
  14971. c.urlParams_.Set("alt", alt)
  14972. c.urlParams_.Set("prettyPrint", "false")
  14973. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}")
  14974. urls += "?" + c.urlParams_.Encode()
  14975. req, err := http.NewRequest("GET", urls, body)
  14976. if err != nil {
  14977. return nil, err
  14978. }
  14979. req.Header = reqHeaders
  14980. googleapi.Expand(req.URL, map[string]string{
  14981. "accountId": c.accountId,
  14982. "webPropertyId": c.webPropertyId,
  14983. "customDataSourceId": c.customDataSourceId,
  14984. "uploadId": c.uploadId,
  14985. })
  14986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14987. }
  14988. // Do executes the "analytics.management.uploads.get" call.
  14989. // Exactly one of *Upload or error will be non-nil. Any non-2xx status
  14990. // code is an error. Response headers are in either
  14991. // *Upload.ServerResponse.Header or (if a response was returned at all)
  14992. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14993. // check whether the returned error was because http.StatusNotModified
  14994. // was returned.
  14995. func (c *ManagementUploadsGetCall) Do(opts ...googleapi.CallOption) (*Upload, error) {
  14996. gensupport.SetOptions(c.urlParams_, opts...)
  14997. res, err := c.doRequest("json")
  14998. if res != nil && res.StatusCode == http.StatusNotModified {
  14999. if res.Body != nil {
  15000. res.Body.Close()
  15001. }
  15002. return nil, &googleapi.Error{
  15003. Code: res.StatusCode,
  15004. Header: res.Header,
  15005. }
  15006. }
  15007. if err != nil {
  15008. return nil, err
  15009. }
  15010. defer googleapi.CloseBody(res)
  15011. if err := googleapi.CheckResponse(res); err != nil {
  15012. return nil, err
  15013. }
  15014. ret := &Upload{
  15015. ServerResponse: googleapi.ServerResponse{
  15016. Header: res.Header,
  15017. HTTPStatusCode: res.StatusCode,
  15018. },
  15019. }
  15020. target := &ret
  15021. if err := gensupport.DecodeResponse(target, res); err != nil {
  15022. return nil, err
  15023. }
  15024. return ret, nil
  15025. // {
  15026. // "description": "List uploads to which the user has access.",
  15027. // "httpMethod": "GET",
  15028. // "id": "analytics.management.uploads.get",
  15029. // "parameterOrder": [
  15030. // "accountId",
  15031. // "webPropertyId",
  15032. // "customDataSourceId",
  15033. // "uploadId"
  15034. // ],
  15035. // "parameters": {
  15036. // "accountId": {
  15037. // "description": "Account Id for the upload to retrieve.",
  15038. // "location": "path",
  15039. // "pattern": "\\d+",
  15040. // "required": true,
  15041. // "type": "string"
  15042. // },
  15043. // "customDataSourceId": {
  15044. // "description": "Custom data source Id for upload to retrieve.",
  15045. // "location": "path",
  15046. // "pattern": ".{22}",
  15047. // "required": true,
  15048. // "type": "string"
  15049. // },
  15050. // "uploadId": {
  15051. // "description": "Upload Id to retrieve.",
  15052. // "location": "path",
  15053. // "pattern": ".{22}",
  15054. // "required": true,
  15055. // "type": "string"
  15056. // },
  15057. // "webPropertyId": {
  15058. // "description": "Web property Id for the upload to retrieve.",
  15059. // "location": "path",
  15060. // "pattern": "UA-(\\d+)-(\\d+)",
  15061. // "required": true,
  15062. // "type": "string"
  15063. // }
  15064. // },
  15065. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}",
  15066. // "response": {
  15067. // "$ref": "Upload"
  15068. // },
  15069. // "scopes": [
  15070. // "https://www.googleapis.com/auth/analytics",
  15071. // "https://www.googleapis.com/auth/analytics.edit",
  15072. // "https://www.googleapis.com/auth/analytics.readonly"
  15073. // ]
  15074. // }
  15075. }
  15076. // method id "analytics.management.uploads.list":
  15077. type ManagementUploadsListCall struct {
  15078. s *Service
  15079. accountId string
  15080. webPropertyId string
  15081. customDataSourceId string
  15082. urlParams_ gensupport.URLParams
  15083. ifNoneMatch_ string
  15084. ctx_ context.Context
  15085. header_ http.Header
  15086. }
  15087. // List: List uploads to which the user has access.
  15088. func (r *ManagementUploadsService) List(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsListCall {
  15089. c := &ManagementUploadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15090. c.accountId = accountId
  15091. c.webPropertyId = webPropertyId
  15092. c.customDataSourceId = customDataSourceId
  15093. return c
  15094. }
  15095. // MaxResults sets the optional parameter "max-results": The maximum
  15096. // number of uploads to include in this response.
  15097. func (c *ManagementUploadsListCall) MaxResults(maxResults int64) *ManagementUploadsListCall {
  15098. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  15099. return c
  15100. }
  15101. // StartIndex sets the optional parameter "start-index": A 1-based index
  15102. // of the first upload to retrieve. Use this parameter as a pagination
  15103. // mechanism along with the max-results parameter.
  15104. func (c *ManagementUploadsListCall) StartIndex(startIndex int64) *ManagementUploadsListCall {
  15105. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  15106. return c
  15107. }
  15108. // Fields allows partial responses to be retrieved. See
  15109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15110. // for more information.
  15111. func (c *ManagementUploadsListCall) Fields(s ...googleapi.Field) *ManagementUploadsListCall {
  15112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15113. return c
  15114. }
  15115. // IfNoneMatch sets the optional parameter which makes the operation
  15116. // fail if the object's ETag matches the given value. This is useful for
  15117. // getting updates only after the object has changed since the last
  15118. // request. Use googleapi.IsNotModified to check whether the response
  15119. // error from Do is the result of In-None-Match.
  15120. func (c *ManagementUploadsListCall) IfNoneMatch(entityTag string) *ManagementUploadsListCall {
  15121. c.ifNoneMatch_ = entityTag
  15122. return c
  15123. }
  15124. // Context sets the context to be used in this call's Do method. Any
  15125. // pending HTTP request will be aborted if the provided context is
  15126. // canceled.
  15127. func (c *ManagementUploadsListCall) Context(ctx context.Context) *ManagementUploadsListCall {
  15128. c.ctx_ = ctx
  15129. return c
  15130. }
  15131. // Header returns an http.Header that can be modified by the caller to
  15132. // add HTTP headers to the request.
  15133. func (c *ManagementUploadsListCall) Header() http.Header {
  15134. if c.header_ == nil {
  15135. c.header_ = make(http.Header)
  15136. }
  15137. return c.header_
  15138. }
  15139. func (c *ManagementUploadsListCall) doRequest(alt string) (*http.Response, error) {
  15140. reqHeaders := make(http.Header)
  15141. for k, v := range c.header_ {
  15142. reqHeaders[k] = v
  15143. }
  15144. reqHeaders.Set("User-Agent", c.s.userAgent())
  15145. if c.ifNoneMatch_ != "" {
  15146. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15147. }
  15148. var body io.Reader = nil
  15149. c.urlParams_.Set("alt", alt)
  15150. c.urlParams_.Set("prettyPrint", "false")
  15151. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads")
  15152. urls += "?" + c.urlParams_.Encode()
  15153. req, err := http.NewRequest("GET", urls, body)
  15154. if err != nil {
  15155. return nil, err
  15156. }
  15157. req.Header = reqHeaders
  15158. googleapi.Expand(req.URL, map[string]string{
  15159. "accountId": c.accountId,
  15160. "webPropertyId": c.webPropertyId,
  15161. "customDataSourceId": c.customDataSourceId,
  15162. })
  15163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15164. }
  15165. // Do executes the "analytics.management.uploads.list" call.
  15166. // Exactly one of *Uploads or error will be non-nil. Any non-2xx status
  15167. // code is an error. Response headers are in either
  15168. // *Uploads.ServerResponse.Header or (if a response was returned at all)
  15169. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  15170. // check whether the returned error was because http.StatusNotModified
  15171. // was returned.
  15172. func (c *ManagementUploadsListCall) Do(opts ...googleapi.CallOption) (*Uploads, error) {
  15173. gensupport.SetOptions(c.urlParams_, opts...)
  15174. res, err := c.doRequest("json")
  15175. if res != nil && res.StatusCode == http.StatusNotModified {
  15176. if res.Body != nil {
  15177. res.Body.Close()
  15178. }
  15179. return nil, &googleapi.Error{
  15180. Code: res.StatusCode,
  15181. Header: res.Header,
  15182. }
  15183. }
  15184. if err != nil {
  15185. return nil, err
  15186. }
  15187. defer googleapi.CloseBody(res)
  15188. if err := googleapi.CheckResponse(res); err != nil {
  15189. return nil, err
  15190. }
  15191. ret := &Uploads{
  15192. ServerResponse: googleapi.ServerResponse{
  15193. Header: res.Header,
  15194. HTTPStatusCode: res.StatusCode,
  15195. },
  15196. }
  15197. target := &ret
  15198. if err := gensupport.DecodeResponse(target, res); err != nil {
  15199. return nil, err
  15200. }
  15201. return ret, nil
  15202. // {
  15203. // "description": "List uploads to which the user has access.",
  15204. // "httpMethod": "GET",
  15205. // "id": "analytics.management.uploads.list",
  15206. // "parameterOrder": [
  15207. // "accountId",
  15208. // "webPropertyId",
  15209. // "customDataSourceId"
  15210. // ],
  15211. // "parameters": {
  15212. // "accountId": {
  15213. // "description": "Account Id for the uploads to retrieve.",
  15214. // "location": "path",
  15215. // "pattern": "\\d+",
  15216. // "required": true,
  15217. // "type": "string"
  15218. // },
  15219. // "customDataSourceId": {
  15220. // "description": "Custom data source Id for uploads to retrieve.",
  15221. // "location": "path",
  15222. // "pattern": ".{22}",
  15223. // "required": true,
  15224. // "type": "string"
  15225. // },
  15226. // "max-results": {
  15227. // "description": "The maximum number of uploads to include in this response.",
  15228. // "format": "int32",
  15229. // "location": "query",
  15230. // "minimum": "1",
  15231. // "type": "integer"
  15232. // },
  15233. // "start-index": {
  15234. // "description": "A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  15235. // "format": "int32",
  15236. // "location": "query",
  15237. // "minimum": "1",
  15238. // "type": "integer"
  15239. // },
  15240. // "webPropertyId": {
  15241. // "description": "Web property Id for the uploads to retrieve.",
  15242. // "location": "path",
  15243. // "pattern": "UA-(\\d+)-(\\d+)",
  15244. // "required": true,
  15245. // "type": "string"
  15246. // }
  15247. // },
  15248. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads",
  15249. // "response": {
  15250. // "$ref": "Uploads"
  15251. // },
  15252. // "scopes": [
  15253. // "https://www.googleapis.com/auth/analytics",
  15254. // "https://www.googleapis.com/auth/analytics.edit",
  15255. // "https://www.googleapis.com/auth/analytics.readonly"
  15256. // ]
  15257. // }
  15258. }
  15259. // method id "analytics.management.uploads.uploadData":
  15260. type ManagementUploadsUploadDataCall struct {
  15261. s *Service
  15262. accountId string
  15263. webPropertyId string
  15264. customDataSourceId string
  15265. urlParams_ gensupport.URLParams
  15266. mediaInfo_ *gensupport.MediaInfo
  15267. ctx_ context.Context
  15268. header_ http.Header
  15269. }
  15270. // UploadData: Upload data for a custom data source.
  15271. func (r *ManagementUploadsService) UploadData(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsUploadDataCall {
  15272. c := &ManagementUploadsUploadDataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15273. c.accountId = accountId
  15274. c.webPropertyId = webPropertyId
  15275. c.customDataSourceId = customDataSourceId
  15276. return c
  15277. }
  15278. // Media specifies the media to upload in one or more chunks. The chunk
  15279. // size may be controlled by supplying a MediaOption generated by
  15280. // googleapi.ChunkSize. The chunk size defaults to
  15281. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  15282. // upload request will be determined by sniffing the contents of r,
  15283. // unless a MediaOption generated by googleapi.ContentType is
  15284. // supplied.
  15285. // At most one of Media and ResumableMedia may be set.
  15286. func (c *ManagementUploadsUploadDataCall) Media(r io.Reader, options ...googleapi.MediaOption) *ManagementUploadsUploadDataCall {
  15287. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  15288. return c
  15289. }
  15290. // ResumableMedia specifies the media to upload in chunks and can be
  15291. // canceled with ctx.
  15292. //
  15293. // Deprecated: use Media instead.
  15294. //
  15295. // At most one of Media and ResumableMedia may be set. mediaType
  15296. // identifies the MIME media type of the upload, such as "image/png". If
  15297. // mediaType is "", it will be auto-detected. The provided ctx will
  15298. // supersede any context previously provided to the Context method.
  15299. func (c *ManagementUploadsUploadDataCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ManagementUploadsUploadDataCall {
  15300. c.ctx_ = ctx
  15301. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  15302. return c
  15303. }
  15304. // ProgressUpdater provides a callback function that will be called
  15305. // after every chunk. It should be a low-latency function in order to
  15306. // not slow down the upload operation. This should only be called when
  15307. // using ResumableMedia (as opposed to Media).
  15308. func (c *ManagementUploadsUploadDataCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ManagementUploadsUploadDataCall {
  15309. c.mediaInfo_.SetProgressUpdater(pu)
  15310. return c
  15311. }
  15312. // Fields allows partial responses to be retrieved. See
  15313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15314. // for more information.
  15315. func (c *ManagementUploadsUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsUploadDataCall {
  15316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15317. return c
  15318. }
  15319. // Context sets the context to be used in this call's Do method. Any
  15320. // pending HTTP request will be aborted if the provided context is
  15321. // canceled.
  15322. // This context will supersede any context previously provided to the
  15323. // ResumableMedia method.
  15324. func (c *ManagementUploadsUploadDataCall) Context(ctx context.Context) *ManagementUploadsUploadDataCall {
  15325. c.ctx_ = ctx
  15326. return c
  15327. }
  15328. // Header returns an http.Header that can be modified by the caller to
  15329. // add HTTP headers to the request.
  15330. func (c *ManagementUploadsUploadDataCall) Header() http.Header {
  15331. if c.header_ == nil {
  15332. c.header_ = make(http.Header)
  15333. }
  15334. return c.header_
  15335. }
  15336. func (c *ManagementUploadsUploadDataCall) doRequest(alt string) (*http.Response, error) {
  15337. reqHeaders := make(http.Header)
  15338. for k, v := range c.header_ {
  15339. reqHeaders[k] = v
  15340. }
  15341. reqHeaders.Set("User-Agent", c.s.userAgent())
  15342. var body io.Reader = nil
  15343. c.urlParams_.Set("alt", alt)
  15344. c.urlParams_.Set("prettyPrint", "false")
  15345. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads")
  15346. if c.mediaInfo_ != nil {
  15347. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  15348. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  15349. }
  15350. if body == nil {
  15351. body = new(bytes.Buffer)
  15352. reqHeaders.Set("Content-Type", "application/json")
  15353. }
  15354. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  15355. defer cleanup()
  15356. urls += "?" + c.urlParams_.Encode()
  15357. req, err := http.NewRequest("POST", urls, body)
  15358. if err != nil {
  15359. return nil, err
  15360. }
  15361. req.Header = reqHeaders
  15362. req.GetBody = getBody
  15363. googleapi.Expand(req.URL, map[string]string{
  15364. "accountId": c.accountId,
  15365. "webPropertyId": c.webPropertyId,
  15366. "customDataSourceId": c.customDataSourceId,
  15367. })
  15368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15369. }
  15370. // Do executes the "analytics.management.uploads.uploadData" call.
  15371. // Exactly one of *Upload or error will be non-nil. Any non-2xx status
  15372. // code is an error. Response headers are in either
  15373. // *Upload.ServerResponse.Header or (if a response was returned at all)
  15374. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  15375. // check whether the returned error was because http.StatusNotModified
  15376. // was returned.
  15377. func (c *ManagementUploadsUploadDataCall) Do(opts ...googleapi.CallOption) (*Upload, error) {
  15378. gensupport.SetOptions(c.urlParams_, opts...)
  15379. res, err := c.doRequest("json")
  15380. if res != nil && res.StatusCode == http.StatusNotModified {
  15381. if res.Body != nil {
  15382. res.Body.Close()
  15383. }
  15384. return nil, &googleapi.Error{
  15385. Code: res.StatusCode,
  15386. Header: res.Header,
  15387. }
  15388. }
  15389. if err != nil {
  15390. return nil, err
  15391. }
  15392. defer googleapi.CloseBody(res)
  15393. if err := googleapi.CheckResponse(res); err != nil {
  15394. return nil, err
  15395. }
  15396. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  15397. if rx != nil {
  15398. rx.Client = c.s.client
  15399. rx.UserAgent = c.s.userAgent()
  15400. ctx := c.ctx_
  15401. if ctx == nil {
  15402. ctx = context.TODO()
  15403. }
  15404. res, err = rx.Upload(ctx)
  15405. if err != nil {
  15406. return nil, err
  15407. }
  15408. defer res.Body.Close()
  15409. if err := googleapi.CheckResponse(res); err != nil {
  15410. return nil, err
  15411. }
  15412. }
  15413. ret := &Upload{
  15414. ServerResponse: googleapi.ServerResponse{
  15415. Header: res.Header,
  15416. HTTPStatusCode: res.StatusCode,
  15417. },
  15418. }
  15419. target := &ret
  15420. if err := gensupport.DecodeResponse(target, res); err != nil {
  15421. return nil, err
  15422. }
  15423. return ret, nil
  15424. // {
  15425. // "description": "Upload data for a custom data source.",
  15426. // "httpMethod": "POST",
  15427. // "id": "analytics.management.uploads.uploadData",
  15428. // "mediaUpload": {
  15429. // "accept": [
  15430. // "application/octet-stream"
  15431. // ],
  15432. // "maxSize": "1GB",
  15433. // "protocols": {
  15434. // "resumable": {
  15435. // "multipart": true,
  15436. // "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"
  15437. // },
  15438. // "simple": {
  15439. // "multipart": true,
  15440. // "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"
  15441. // }
  15442. // }
  15443. // },
  15444. // "parameterOrder": [
  15445. // "accountId",
  15446. // "webPropertyId",
  15447. // "customDataSourceId"
  15448. // ],
  15449. // "parameters": {
  15450. // "accountId": {
  15451. // "description": "Account Id associated with the upload.",
  15452. // "location": "path",
  15453. // "pattern": "\\d+",
  15454. // "required": true,
  15455. // "type": "string"
  15456. // },
  15457. // "customDataSourceId": {
  15458. // "description": "Custom data source Id to which the data being uploaded belongs.",
  15459. // "location": "path",
  15460. // "required": true,
  15461. // "type": "string"
  15462. // },
  15463. // "webPropertyId": {
  15464. // "description": "Web property UA-string associated with the upload.",
  15465. // "location": "path",
  15466. // "pattern": "UA-\\d+-\\d+",
  15467. // "required": true,
  15468. // "type": "string"
  15469. // }
  15470. // },
  15471. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads",
  15472. // "response": {
  15473. // "$ref": "Upload"
  15474. // },
  15475. // "scopes": [
  15476. // "https://www.googleapis.com/auth/analytics",
  15477. // "https://www.googleapis.com/auth/analytics.edit"
  15478. // ],
  15479. // "supportsMediaUpload": true
  15480. // }
  15481. }
  15482. // method id "analytics.management.webPropertyAdWordsLinks.delete":
  15483. type ManagementWebPropertyAdWordsLinksDeleteCall struct {
  15484. s *Service
  15485. accountId string
  15486. webPropertyId string
  15487. webPropertyAdWordsLinkId string
  15488. urlParams_ gensupport.URLParams
  15489. ctx_ context.Context
  15490. header_ http.Header
  15491. }
  15492. // Delete: Deletes a web property-Google Ads link.
  15493. func (r *ManagementWebPropertyAdWordsLinksService) Delete(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksDeleteCall {
  15494. c := &ManagementWebPropertyAdWordsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15495. c.accountId = accountId
  15496. c.webPropertyId = webPropertyId
  15497. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  15498. return c
  15499. }
  15500. // Fields allows partial responses to be retrieved. See
  15501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15502. // for more information.
  15503. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksDeleteCall {
  15504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15505. return c
  15506. }
  15507. // Context sets the context to be used in this call's Do method. Any
  15508. // pending HTTP request will be aborted if the provided context is
  15509. // canceled.
  15510. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksDeleteCall {
  15511. c.ctx_ = ctx
  15512. return c
  15513. }
  15514. // Header returns an http.Header that can be modified by the caller to
  15515. // add HTTP headers to the request.
  15516. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Header() http.Header {
  15517. if c.header_ == nil {
  15518. c.header_ = make(http.Header)
  15519. }
  15520. return c.header_
  15521. }
  15522. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  15523. reqHeaders := make(http.Header)
  15524. for k, v := range c.header_ {
  15525. reqHeaders[k] = v
  15526. }
  15527. reqHeaders.Set("User-Agent", c.s.userAgent())
  15528. var body io.Reader = nil
  15529. c.urlParams_.Set("alt", alt)
  15530. c.urlParams_.Set("prettyPrint", "false")
  15531. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  15532. urls += "?" + c.urlParams_.Encode()
  15533. req, err := http.NewRequest("DELETE", urls, body)
  15534. if err != nil {
  15535. return nil, err
  15536. }
  15537. req.Header = reqHeaders
  15538. googleapi.Expand(req.URL, map[string]string{
  15539. "accountId": c.accountId,
  15540. "webPropertyId": c.webPropertyId,
  15541. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  15542. })
  15543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15544. }
  15545. // Do executes the "analytics.management.webPropertyAdWordsLinks.delete" call.
  15546. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  15547. gensupport.SetOptions(c.urlParams_, opts...)
  15548. res, err := c.doRequest("json")
  15549. if err != nil {
  15550. return err
  15551. }
  15552. defer googleapi.CloseBody(res)
  15553. if err := googleapi.CheckResponse(res); err != nil {
  15554. return err
  15555. }
  15556. return nil
  15557. // {
  15558. // "description": "Deletes a web property-Google Ads link.",
  15559. // "httpMethod": "DELETE",
  15560. // "id": "analytics.management.webPropertyAdWordsLinks.delete",
  15561. // "parameterOrder": [
  15562. // "accountId",
  15563. // "webPropertyId",
  15564. // "webPropertyAdWordsLinkId"
  15565. // ],
  15566. // "parameters": {
  15567. // "accountId": {
  15568. // "description": "ID of the account which the given web property belongs to.",
  15569. // "location": "path",
  15570. // "required": true,
  15571. // "type": "string"
  15572. // },
  15573. // "webPropertyAdWordsLinkId": {
  15574. // "description": "Web property Google Ads link ID.",
  15575. // "location": "path",
  15576. // "required": true,
  15577. // "type": "string"
  15578. // },
  15579. // "webPropertyId": {
  15580. // "description": "Web property ID to delete the Google Ads link for.",
  15581. // "location": "path",
  15582. // "required": true,
  15583. // "type": "string"
  15584. // }
  15585. // },
  15586. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  15587. // "scopes": [
  15588. // "https://www.googleapis.com/auth/analytics.edit"
  15589. // ]
  15590. // }
  15591. }
  15592. // method id "analytics.management.webPropertyAdWordsLinks.get":
  15593. type ManagementWebPropertyAdWordsLinksGetCall struct {
  15594. s *Service
  15595. accountId string
  15596. webPropertyId string
  15597. webPropertyAdWordsLinkId string
  15598. urlParams_ gensupport.URLParams
  15599. ifNoneMatch_ string
  15600. ctx_ context.Context
  15601. header_ http.Header
  15602. }
  15603. // Get: Returns a web property-Google Ads link to which the user has
  15604. // access.
  15605. func (r *ManagementWebPropertyAdWordsLinksService) Get(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksGetCall {
  15606. c := &ManagementWebPropertyAdWordsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15607. c.accountId = accountId
  15608. c.webPropertyId = webPropertyId
  15609. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  15610. return c
  15611. }
  15612. // Fields allows partial responses to be retrieved. See
  15613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15614. // for more information.
  15615. func (c *ManagementWebPropertyAdWordsLinksGetCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksGetCall {
  15616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15617. return c
  15618. }
  15619. // IfNoneMatch sets the optional parameter which makes the operation
  15620. // fail if the object's ETag matches the given value. This is useful for
  15621. // getting updates only after the object has changed since the last
  15622. // request. Use googleapi.IsNotModified to check whether the response
  15623. // error from Do is the result of In-None-Match.
  15624. func (c *ManagementWebPropertyAdWordsLinksGetCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksGetCall {
  15625. c.ifNoneMatch_ = entityTag
  15626. return c
  15627. }
  15628. // Context sets the context to be used in this call's Do method. Any
  15629. // pending HTTP request will be aborted if the provided context is
  15630. // canceled.
  15631. func (c *ManagementWebPropertyAdWordsLinksGetCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksGetCall {
  15632. c.ctx_ = ctx
  15633. return c
  15634. }
  15635. // Header returns an http.Header that can be modified by the caller to
  15636. // add HTTP headers to the request.
  15637. func (c *ManagementWebPropertyAdWordsLinksGetCall) Header() http.Header {
  15638. if c.header_ == nil {
  15639. c.header_ = make(http.Header)
  15640. }
  15641. return c.header_
  15642. }
  15643. func (c *ManagementWebPropertyAdWordsLinksGetCall) doRequest(alt string) (*http.Response, error) {
  15644. reqHeaders := make(http.Header)
  15645. for k, v := range c.header_ {
  15646. reqHeaders[k] = v
  15647. }
  15648. reqHeaders.Set("User-Agent", c.s.userAgent())
  15649. if c.ifNoneMatch_ != "" {
  15650. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15651. }
  15652. var body io.Reader = nil
  15653. c.urlParams_.Set("alt", alt)
  15654. c.urlParams_.Set("prettyPrint", "false")
  15655. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  15656. urls += "?" + c.urlParams_.Encode()
  15657. req, err := http.NewRequest("GET", urls, body)
  15658. if err != nil {
  15659. return nil, err
  15660. }
  15661. req.Header = reqHeaders
  15662. googleapi.Expand(req.URL, map[string]string{
  15663. "accountId": c.accountId,
  15664. "webPropertyId": c.webPropertyId,
  15665. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  15666. })
  15667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15668. }
  15669. // Do executes the "analytics.management.webPropertyAdWordsLinks.get" call.
  15670. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  15671. // non-2xx status code is an error. Response headers are in either
  15672. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  15673. // returned at all) in error.(*googleapi.Error).Header. Use
  15674. // googleapi.IsNotModified to check whether the returned error was
  15675. // because http.StatusNotModified was returned.
  15676. func (c *ManagementWebPropertyAdWordsLinksGetCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  15677. gensupport.SetOptions(c.urlParams_, opts...)
  15678. res, err := c.doRequest("json")
  15679. if res != nil && res.StatusCode == http.StatusNotModified {
  15680. if res.Body != nil {
  15681. res.Body.Close()
  15682. }
  15683. return nil, &googleapi.Error{
  15684. Code: res.StatusCode,
  15685. Header: res.Header,
  15686. }
  15687. }
  15688. if err != nil {
  15689. return nil, err
  15690. }
  15691. defer googleapi.CloseBody(res)
  15692. if err := googleapi.CheckResponse(res); err != nil {
  15693. return nil, err
  15694. }
  15695. ret := &EntityAdWordsLink{
  15696. ServerResponse: googleapi.ServerResponse{
  15697. Header: res.Header,
  15698. HTTPStatusCode: res.StatusCode,
  15699. },
  15700. }
  15701. target := &ret
  15702. if err := gensupport.DecodeResponse(target, res); err != nil {
  15703. return nil, err
  15704. }
  15705. return ret, nil
  15706. // {
  15707. // "description": "Returns a web property-Google Ads link to which the user has access.",
  15708. // "httpMethod": "GET",
  15709. // "id": "analytics.management.webPropertyAdWordsLinks.get",
  15710. // "parameterOrder": [
  15711. // "accountId",
  15712. // "webPropertyId",
  15713. // "webPropertyAdWordsLinkId"
  15714. // ],
  15715. // "parameters": {
  15716. // "accountId": {
  15717. // "description": "ID of the account which the given web property belongs to.",
  15718. // "location": "path",
  15719. // "required": true,
  15720. // "type": "string"
  15721. // },
  15722. // "webPropertyAdWordsLinkId": {
  15723. // "description": "Web property-Google Ads link ID.",
  15724. // "location": "path",
  15725. // "required": true,
  15726. // "type": "string"
  15727. // },
  15728. // "webPropertyId": {
  15729. // "description": "Web property ID to retrieve the Google Ads link for.",
  15730. // "location": "path",
  15731. // "required": true,
  15732. // "type": "string"
  15733. // }
  15734. // },
  15735. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  15736. // "response": {
  15737. // "$ref": "EntityAdWordsLink"
  15738. // },
  15739. // "scopes": [
  15740. // "https://www.googleapis.com/auth/analytics.edit",
  15741. // "https://www.googleapis.com/auth/analytics.readonly"
  15742. // ]
  15743. // }
  15744. }
  15745. // method id "analytics.management.webPropertyAdWordsLinks.insert":
  15746. type ManagementWebPropertyAdWordsLinksInsertCall struct {
  15747. s *Service
  15748. accountId string
  15749. webPropertyId string
  15750. entityadwordslink *EntityAdWordsLink
  15751. urlParams_ gensupport.URLParams
  15752. ctx_ context.Context
  15753. header_ http.Header
  15754. }
  15755. // Insert: Creates a webProperty-Google Ads link.
  15756. func (r *ManagementWebPropertyAdWordsLinksService) Insert(accountId string, webPropertyId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksInsertCall {
  15757. c := &ManagementWebPropertyAdWordsLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15758. c.accountId = accountId
  15759. c.webPropertyId = webPropertyId
  15760. c.entityadwordslink = entityadwordslink
  15761. return c
  15762. }
  15763. // Fields allows partial responses to be retrieved. See
  15764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15765. // for more information.
  15766. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksInsertCall {
  15767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15768. return c
  15769. }
  15770. // Context sets the context to be used in this call's Do method. Any
  15771. // pending HTTP request will be aborted if the provided context is
  15772. // canceled.
  15773. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksInsertCall {
  15774. c.ctx_ = ctx
  15775. return c
  15776. }
  15777. // Header returns an http.Header that can be modified by the caller to
  15778. // add HTTP headers to the request.
  15779. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Header() http.Header {
  15780. if c.header_ == nil {
  15781. c.header_ = make(http.Header)
  15782. }
  15783. return c.header_
  15784. }
  15785. func (c *ManagementWebPropertyAdWordsLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  15786. reqHeaders := make(http.Header)
  15787. for k, v := range c.header_ {
  15788. reqHeaders[k] = v
  15789. }
  15790. reqHeaders.Set("User-Agent", c.s.userAgent())
  15791. var body io.Reader = nil
  15792. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  15793. if err != nil {
  15794. return nil, err
  15795. }
  15796. reqHeaders.Set("Content-Type", "application/json")
  15797. c.urlParams_.Set("alt", alt)
  15798. c.urlParams_.Set("prettyPrint", "false")
  15799. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks")
  15800. urls += "?" + c.urlParams_.Encode()
  15801. req, err := http.NewRequest("POST", urls, body)
  15802. if err != nil {
  15803. return nil, err
  15804. }
  15805. req.Header = reqHeaders
  15806. googleapi.Expand(req.URL, map[string]string{
  15807. "accountId": c.accountId,
  15808. "webPropertyId": c.webPropertyId,
  15809. })
  15810. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15811. }
  15812. // Do executes the "analytics.management.webPropertyAdWordsLinks.insert" call.
  15813. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  15814. // non-2xx status code is an error. Response headers are in either
  15815. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  15816. // returned at all) in error.(*googleapi.Error).Header. Use
  15817. // googleapi.IsNotModified to check whether the returned error was
  15818. // because http.StatusNotModified was returned.
  15819. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  15820. gensupport.SetOptions(c.urlParams_, opts...)
  15821. res, err := c.doRequest("json")
  15822. if res != nil && res.StatusCode == http.StatusNotModified {
  15823. if res.Body != nil {
  15824. res.Body.Close()
  15825. }
  15826. return nil, &googleapi.Error{
  15827. Code: res.StatusCode,
  15828. Header: res.Header,
  15829. }
  15830. }
  15831. if err != nil {
  15832. return nil, err
  15833. }
  15834. defer googleapi.CloseBody(res)
  15835. if err := googleapi.CheckResponse(res); err != nil {
  15836. return nil, err
  15837. }
  15838. ret := &EntityAdWordsLink{
  15839. ServerResponse: googleapi.ServerResponse{
  15840. Header: res.Header,
  15841. HTTPStatusCode: res.StatusCode,
  15842. },
  15843. }
  15844. target := &ret
  15845. if err := gensupport.DecodeResponse(target, res); err != nil {
  15846. return nil, err
  15847. }
  15848. return ret, nil
  15849. // {
  15850. // "description": "Creates a webProperty-Google Ads link.",
  15851. // "httpMethod": "POST",
  15852. // "id": "analytics.management.webPropertyAdWordsLinks.insert",
  15853. // "parameterOrder": [
  15854. // "accountId",
  15855. // "webPropertyId"
  15856. // ],
  15857. // "parameters": {
  15858. // "accountId": {
  15859. // "description": "ID of the Google Analytics account to create the link for.",
  15860. // "location": "path",
  15861. // "required": true,
  15862. // "type": "string"
  15863. // },
  15864. // "webPropertyId": {
  15865. // "description": "Web property ID to create the link for.",
  15866. // "location": "path",
  15867. // "required": true,
  15868. // "type": "string"
  15869. // }
  15870. // },
  15871. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks",
  15872. // "request": {
  15873. // "$ref": "EntityAdWordsLink"
  15874. // },
  15875. // "response": {
  15876. // "$ref": "EntityAdWordsLink"
  15877. // },
  15878. // "scopes": [
  15879. // "https://www.googleapis.com/auth/analytics.edit"
  15880. // ]
  15881. // }
  15882. }
  15883. // method id "analytics.management.webPropertyAdWordsLinks.list":
  15884. type ManagementWebPropertyAdWordsLinksListCall struct {
  15885. s *Service
  15886. accountId string
  15887. webPropertyId string
  15888. urlParams_ gensupport.URLParams
  15889. ifNoneMatch_ string
  15890. ctx_ context.Context
  15891. header_ http.Header
  15892. }
  15893. // List: Lists webProperty-Google Ads links for a given web property.
  15894. func (r *ManagementWebPropertyAdWordsLinksService) List(accountId string, webPropertyId string) *ManagementWebPropertyAdWordsLinksListCall {
  15895. c := &ManagementWebPropertyAdWordsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15896. c.accountId = accountId
  15897. c.webPropertyId = webPropertyId
  15898. return c
  15899. }
  15900. // MaxResults sets the optional parameter "max-results": The maximum
  15901. // number of webProperty-Google Ads links to include in this response.
  15902. func (c *ManagementWebPropertyAdWordsLinksListCall) MaxResults(maxResults int64) *ManagementWebPropertyAdWordsLinksListCall {
  15903. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  15904. return c
  15905. }
  15906. // StartIndex sets the optional parameter "start-index": An index of the
  15907. // first webProperty-Google Ads link to retrieve. Use this parameter as
  15908. // a pagination mechanism along with the max-results parameter.
  15909. func (c *ManagementWebPropertyAdWordsLinksListCall) StartIndex(startIndex int64) *ManagementWebPropertyAdWordsLinksListCall {
  15910. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  15911. return c
  15912. }
  15913. // Fields allows partial responses to be retrieved. See
  15914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15915. // for more information.
  15916. func (c *ManagementWebPropertyAdWordsLinksListCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksListCall {
  15917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15918. return c
  15919. }
  15920. // IfNoneMatch sets the optional parameter which makes the operation
  15921. // fail if the object's ETag matches the given value. This is useful for
  15922. // getting updates only after the object has changed since the last
  15923. // request. Use googleapi.IsNotModified to check whether the response
  15924. // error from Do is the result of In-None-Match.
  15925. func (c *ManagementWebPropertyAdWordsLinksListCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksListCall {
  15926. c.ifNoneMatch_ = entityTag
  15927. return c
  15928. }
  15929. // Context sets the context to be used in this call's Do method. Any
  15930. // pending HTTP request will be aborted if the provided context is
  15931. // canceled.
  15932. func (c *ManagementWebPropertyAdWordsLinksListCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksListCall {
  15933. c.ctx_ = ctx
  15934. return c
  15935. }
  15936. // Header returns an http.Header that can be modified by the caller to
  15937. // add HTTP headers to the request.
  15938. func (c *ManagementWebPropertyAdWordsLinksListCall) Header() http.Header {
  15939. if c.header_ == nil {
  15940. c.header_ = make(http.Header)
  15941. }
  15942. return c.header_
  15943. }
  15944. func (c *ManagementWebPropertyAdWordsLinksListCall) doRequest(alt string) (*http.Response, error) {
  15945. reqHeaders := make(http.Header)
  15946. for k, v := range c.header_ {
  15947. reqHeaders[k] = v
  15948. }
  15949. reqHeaders.Set("User-Agent", c.s.userAgent())
  15950. if c.ifNoneMatch_ != "" {
  15951. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15952. }
  15953. var body io.Reader = nil
  15954. c.urlParams_.Set("alt", alt)
  15955. c.urlParams_.Set("prettyPrint", "false")
  15956. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks")
  15957. urls += "?" + c.urlParams_.Encode()
  15958. req, err := http.NewRequest("GET", urls, body)
  15959. if err != nil {
  15960. return nil, err
  15961. }
  15962. req.Header = reqHeaders
  15963. googleapi.Expand(req.URL, map[string]string{
  15964. "accountId": c.accountId,
  15965. "webPropertyId": c.webPropertyId,
  15966. })
  15967. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15968. }
  15969. // Do executes the "analytics.management.webPropertyAdWordsLinks.list" call.
  15970. // Exactly one of *EntityAdWordsLinks or error will be non-nil. Any
  15971. // non-2xx status code is an error. Response headers are in either
  15972. // *EntityAdWordsLinks.ServerResponse.Header or (if a response was
  15973. // returned at all) in error.(*googleapi.Error).Header. Use
  15974. // googleapi.IsNotModified to check whether the returned error was
  15975. // because http.StatusNotModified was returned.
  15976. func (c *ManagementWebPropertyAdWordsLinksListCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLinks, error) {
  15977. gensupport.SetOptions(c.urlParams_, opts...)
  15978. res, err := c.doRequest("json")
  15979. if res != nil && res.StatusCode == http.StatusNotModified {
  15980. if res.Body != nil {
  15981. res.Body.Close()
  15982. }
  15983. return nil, &googleapi.Error{
  15984. Code: res.StatusCode,
  15985. Header: res.Header,
  15986. }
  15987. }
  15988. if err != nil {
  15989. return nil, err
  15990. }
  15991. defer googleapi.CloseBody(res)
  15992. if err := googleapi.CheckResponse(res); err != nil {
  15993. return nil, err
  15994. }
  15995. ret := &EntityAdWordsLinks{
  15996. ServerResponse: googleapi.ServerResponse{
  15997. Header: res.Header,
  15998. HTTPStatusCode: res.StatusCode,
  15999. },
  16000. }
  16001. target := &ret
  16002. if err := gensupport.DecodeResponse(target, res); err != nil {
  16003. return nil, err
  16004. }
  16005. return ret, nil
  16006. // {
  16007. // "description": "Lists webProperty-Google Ads links for a given web property.",
  16008. // "httpMethod": "GET",
  16009. // "id": "analytics.management.webPropertyAdWordsLinks.list",
  16010. // "parameterOrder": [
  16011. // "accountId",
  16012. // "webPropertyId"
  16013. // ],
  16014. // "parameters": {
  16015. // "accountId": {
  16016. // "description": "ID of the account which the given web property belongs to.",
  16017. // "location": "path",
  16018. // "pattern": "\\d+",
  16019. // "required": true,
  16020. // "type": "string"
  16021. // },
  16022. // "max-results": {
  16023. // "description": "The maximum number of webProperty-Google Ads links to include in this response.",
  16024. // "format": "int32",
  16025. // "location": "query",
  16026. // "type": "integer"
  16027. // },
  16028. // "start-index": {
  16029. // "description": "An index of the first webProperty-Google Ads link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  16030. // "format": "int32",
  16031. // "location": "query",
  16032. // "minimum": "1",
  16033. // "type": "integer"
  16034. // },
  16035. // "webPropertyId": {
  16036. // "description": "Web property ID to retrieve the Google Ads links for.",
  16037. // "location": "path",
  16038. // "required": true,
  16039. // "type": "string"
  16040. // }
  16041. // },
  16042. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks",
  16043. // "response": {
  16044. // "$ref": "EntityAdWordsLinks"
  16045. // },
  16046. // "scopes": [
  16047. // "https://www.googleapis.com/auth/analytics.edit",
  16048. // "https://www.googleapis.com/auth/analytics.readonly"
  16049. // ]
  16050. // }
  16051. }
  16052. // method id "analytics.management.webPropertyAdWordsLinks.patch":
  16053. type ManagementWebPropertyAdWordsLinksPatchCall struct {
  16054. s *Service
  16055. accountId string
  16056. webPropertyId string
  16057. webPropertyAdWordsLinkId string
  16058. entityadwordslink *EntityAdWordsLink
  16059. urlParams_ gensupport.URLParams
  16060. ctx_ context.Context
  16061. header_ http.Header
  16062. }
  16063. // Patch: Updates an existing webProperty-Google Ads link. This method
  16064. // supports patch semantics.
  16065. func (r *ManagementWebPropertyAdWordsLinksService) Patch(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksPatchCall {
  16066. c := &ManagementWebPropertyAdWordsLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16067. c.accountId = accountId
  16068. c.webPropertyId = webPropertyId
  16069. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  16070. c.entityadwordslink = entityadwordslink
  16071. return c
  16072. }
  16073. // Fields allows partial responses to be retrieved. See
  16074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16075. // for more information.
  16076. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksPatchCall {
  16077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16078. return c
  16079. }
  16080. // Context sets the context to be used in this call's Do method. Any
  16081. // pending HTTP request will be aborted if the provided context is
  16082. // canceled.
  16083. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksPatchCall {
  16084. c.ctx_ = ctx
  16085. return c
  16086. }
  16087. // Header returns an http.Header that can be modified by the caller to
  16088. // add HTTP headers to the request.
  16089. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Header() http.Header {
  16090. if c.header_ == nil {
  16091. c.header_ = make(http.Header)
  16092. }
  16093. return c.header_
  16094. }
  16095. func (c *ManagementWebPropertyAdWordsLinksPatchCall) doRequest(alt string) (*http.Response, error) {
  16096. reqHeaders := make(http.Header)
  16097. for k, v := range c.header_ {
  16098. reqHeaders[k] = v
  16099. }
  16100. reqHeaders.Set("User-Agent", c.s.userAgent())
  16101. var body io.Reader = nil
  16102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  16103. if err != nil {
  16104. return nil, err
  16105. }
  16106. reqHeaders.Set("Content-Type", "application/json")
  16107. c.urlParams_.Set("alt", alt)
  16108. c.urlParams_.Set("prettyPrint", "false")
  16109. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  16110. urls += "?" + c.urlParams_.Encode()
  16111. req, err := http.NewRequest("PATCH", urls, body)
  16112. if err != nil {
  16113. return nil, err
  16114. }
  16115. req.Header = reqHeaders
  16116. googleapi.Expand(req.URL, map[string]string{
  16117. "accountId": c.accountId,
  16118. "webPropertyId": c.webPropertyId,
  16119. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  16120. })
  16121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16122. }
  16123. // Do executes the "analytics.management.webPropertyAdWordsLinks.patch" call.
  16124. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  16125. // non-2xx status code is an error. Response headers are in either
  16126. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  16127. // returned at all) in error.(*googleapi.Error).Header. Use
  16128. // googleapi.IsNotModified to check whether the returned error was
  16129. // because http.StatusNotModified was returned.
  16130. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  16131. gensupport.SetOptions(c.urlParams_, opts...)
  16132. res, err := c.doRequest("json")
  16133. if res != nil && res.StatusCode == http.StatusNotModified {
  16134. if res.Body != nil {
  16135. res.Body.Close()
  16136. }
  16137. return nil, &googleapi.Error{
  16138. Code: res.StatusCode,
  16139. Header: res.Header,
  16140. }
  16141. }
  16142. if err != nil {
  16143. return nil, err
  16144. }
  16145. defer googleapi.CloseBody(res)
  16146. if err := googleapi.CheckResponse(res); err != nil {
  16147. return nil, err
  16148. }
  16149. ret := &EntityAdWordsLink{
  16150. ServerResponse: googleapi.ServerResponse{
  16151. Header: res.Header,
  16152. HTTPStatusCode: res.StatusCode,
  16153. },
  16154. }
  16155. target := &ret
  16156. if err := gensupport.DecodeResponse(target, res); err != nil {
  16157. return nil, err
  16158. }
  16159. return ret, nil
  16160. // {
  16161. // "description": "Updates an existing webProperty-Google Ads link. This method supports patch semantics.",
  16162. // "httpMethod": "PATCH",
  16163. // "id": "analytics.management.webPropertyAdWordsLinks.patch",
  16164. // "parameterOrder": [
  16165. // "accountId",
  16166. // "webPropertyId",
  16167. // "webPropertyAdWordsLinkId"
  16168. // ],
  16169. // "parameters": {
  16170. // "accountId": {
  16171. // "description": "ID of the account which the given web property belongs to.",
  16172. // "location": "path",
  16173. // "required": true,
  16174. // "type": "string"
  16175. // },
  16176. // "webPropertyAdWordsLinkId": {
  16177. // "description": "Web property-Google Ads link ID.",
  16178. // "location": "path",
  16179. // "required": true,
  16180. // "type": "string"
  16181. // },
  16182. // "webPropertyId": {
  16183. // "description": "Web property ID to retrieve the Google Ads link for.",
  16184. // "location": "path",
  16185. // "required": true,
  16186. // "type": "string"
  16187. // }
  16188. // },
  16189. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  16190. // "request": {
  16191. // "$ref": "EntityAdWordsLink"
  16192. // },
  16193. // "response": {
  16194. // "$ref": "EntityAdWordsLink"
  16195. // },
  16196. // "scopes": [
  16197. // "https://www.googleapis.com/auth/analytics.edit"
  16198. // ]
  16199. // }
  16200. }
  16201. // method id "analytics.management.webPropertyAdWordsLinks.update":
  16202. type ManagementWebPropertyAdWordsLinksUpdateCall struct {
  16203. s *Service
  16204. accountId string
  16205. webPropertyId string
  16206. webPropertyAdWordsLinkId string
  16207. entityadwordslink *EntityAdWordsLink
  16208. urlParams_ gensupport.URLParams
  16209. ctx_ context.Context
  16210. header_ http.Header
  16211. }
  16212. // Update: Updates an existing webProperty-Google Ads link.
  16213. func (r *ManagementWebPropertyAdWordsLinksService) Update(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksUpdateCall {
  16214. c := &ManagementWebPropertyAdWordsLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16215. c.accountId = accountId
  16216. c.webPropertyId = webPropertyId
  16217. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  16218. c.entityadwordslink = entityadwordslink
  16219. return c
  16220. }
  16221. // Fields allows partial responses to be retrieved. See
  16222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16223. // for more information.
  16224. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksUpdateCall {
  16225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16226. return c
  16227. }
  16228. // Context sets the context to be used in this call's Do method. Any
  16229. // pending HTTP request will be aborted if the provided context is
  16230. // canceled.
  16231. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksUpdateCall {
  16232. c.ctx_ = ctx
  16233. return c
  16234. }
  16235. // Header returns an http.Header that can be modified by the caller to
  16236. // add HTTP headers to the request.
  16237. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Header() http.Header {
  16238. if c.header_ == nil {
  16239. c.header_ = make(http.Header)
  16240. }
  16241. return c.header_
  16242. }
  16243. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  16244. reqHeaders := make(http.Header)
  16245. for k, v := range c.header_ {
  16246. reqHeaders[k] = v
  16247. }
  16248. reqHeaders.Set("User-Agent", c.s.userAgent())
  16249. var body io.Reader = nil
  16250. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  16251. if err != nil {
  16252. return nil, err
  16253. }
  16254. reqHeaders.Set("Content-Type", "application/json")
  16255. c.urlParams_.Set("alt", alt)
  16256. c.urlParams_.Set("prettyPrint", "false")
  16257. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  16258. urls += "?" + c.urlParams_.Encode()
  16259. req, err := http.NewRequest("PUT", urls, body)
  16260. if err != nil {
  16261. return nil, err
  16262. }
  16263. req.Header = reqHeaders
  16264. googleapi.Expand(req.URL, map[string]string{
  16265. "accountId": c.accountId,
  16266. "webPropertyId": c.webPropertyId,
  16267. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  16268. })
  16269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16270. }
  16271. // Do executes the "analytics.management.webPropertyAdWordsLinks.update" call.
  16272. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  16273. // non-2xx status code is an error. Response headers are in either
  16274. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  16275. // returned at all) in error.(*googleapi.Error).Header. Use
  16276. // googleapi.IsNotModified to check whether the returned error was
  16277. // because http.StatusNotModified was returned.
  16278. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  16279. gensupport.SetOptions(c.urlParams_, opts...)
  16280. res, err := c.doRequest("json")
  16281. if res != nil && res.StatusCode == http.StatusNotModified {
  16282. if res.Body != nil {
  16283. res.Body.Close()
  16284. }
  16285. return nil, &googleapi.Error{
  16286. Code: res.StatusCode,
  16287. Header: res.Header,
  16288. }
  16289. }
  16290. if err != nil {
  16291. return nil, err
  16292. }
  16293. defer googleapi.CloseBody(res)
  16294. if err := googleapi.CheckResponse(res); err != nil {
  16295. return nil, err
  16296. }
  16297. ret := &EntityAdWordsLink{
  16298. ServerResponse: googleapi.ServerResponse{
  16299. Header: res.Header,
  16300. HTTPStatusCode: res.StatusCode,
  16301. },
  16302. }
  16303. target := &ret
  16304. if err := gensupport.DecodeResponse(target, res); err != nil {
  16305. return nil, err
  16306. }
  16307. return ret, nil
  16308. // {
  16309. // "description": "Updates an existing webProperty-Google Ads link.",
  16310. // "httpMethod": "PUT",
  16311. // "id": "analytics.management.webPropertyAdWordsLinks.update",
  16312. // "parameterOrder": [
  16313. // "accountId",
  16314. // "webPropertyId",
  16315. // "webPropertyAdWordsLinkId"
  16316. // ],
  16317. // "parameters": {
  16318. // "accountId": {
  16319. // "description": "ID of the account which the given web property belongs to.",
  16320. // "location": "path",
  16321. // "required": true,
  16322. // "type": "string"
  16323. // },
  16324. // "webPropertyAdWordsLinkId": {
  16325. // "description": "Web property-Google Ads link ID.",
  16326. // "location": "path",
  16327. // "required": true,
  16328. // "type": "string"
  16329. // },
  16330. // "webPropertyId": {
  16331. // "description": "Web property ID to retrieve the Google Ads link for.",
  16332. // "location": "path",
  16333. // "required": true,
  16334. // "type": "string"
  16335. // }
  16336. // },
  16337. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  16338. // "request": {
  16339. // "$ref": "EntityAdWordsLink"
  16340. // },
  16341. // "response": {
  16342. // "$ref": "EntityAdWordsLink"
  16343. // },
  16344. // "scopes": [
  16345. // "https://www.googleapis.com/auth/analytics.edit"
  16346. // ]
  16347. // }
  16348. }
  16349. // method id "analytics.management.webproperties.get":
  16350. type ManagementWebpropertiesGetCall struct {
  16351. s *Service
  16352. accountId string
  16353. webPropertyId string
  16354. urlParams_ gensupport.URLParams
  16355. ifNoneMatch_ string
  16356. ctx_ context.Context
  16357. header_ http.Header
  16358. }
  16359. // Get: Gets a web property to which the user has access.
  16360. func (r *ManagementWebpropertiesService) Get(accountId string, webPropertyId string) *ManagementWebpropertiesGetCall {
  16361. c := &ManagementWebpropertiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16362. c.accountId = accountId
  16363. c.webPropertyId = webPropertyId
  16364. return c
  16365. }
  16366. // Fields allows partial responses to be retrieved. See
  16367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16368. // for more information.
  16369. func (c *ManagementWebpropertiesGetCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesGetCall {
  16370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16371. return c
  16372. }
  16373. // IfNoneMatch sets the optional parameter which makes the operation
  16374. // fail if the object's ETag matches the given value. This is useful for
  16375. // getting updates only after the object has changed since the last
  16376. // request. Use googleapi.IsNotModified to check whether the response
  16377. // error from Do is the result of In-None-Match.
  16378. func (c *ManagementWebpropertiesGetCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesGetCall {
  16379. c.ifNoneMatch_ = entityTag
  16380. return c
  16381. }
  16382. // Context sets the context to be used in this call's Do method. Any
  16383. // pending HTTP request will be aborted if the provided context is
  16384. // canceled.
  16385. func (c *ManagementWebpropertiesGetCall) Context(ctx context.Context) *ManagementWebpropertiesGetCall {
  16386. c.ctx_ = ctx
  16387. return c
  16388. }
  16389. // Header returns an http.Header that can be modified by the caller to
  16390. // add HTTP headers to the request.
  16391. func (c *ManagementWebpropertiesGetCall) Header() http.Header {
  16392. if c.header_ == nil {
  16393. c.header_ = make(http.Header)
  16394. }
  16395. return c.header_
  16396. }
  16397. func (c *ManagementWebpropertiesGetCall) doRequest(alt string) (*http.Response, error) {
  16398. reqHeaders := make(http.Header)
  16399. for k, v := range c.header_ {
  16400. reqHeaders[k] = v
  16401. }
  16402. reqHeaders.Set("User-Agent", c.s.userAgent())
  16403. if c.ifNoneMatch_ != "" {
  16404. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16405. }
  16406. var body io.Reader = nil
  16407. c.urlParams_.Set("alt", alt)
  16408. c.urlParams_.Set("prettyPrint", "false")
  16409. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  16410. urls += "?" + c.urlParams_.Encode()
  16411. req, err := http.NewRequest("GET", urls, body)
  16412. if err != nil {
  16413. return nil, err
  16414. }
  16415. req.Header = reqHeaders
  16416. googleapi.Expand(req.URL, map[string]string{
  16417. "accountId": c.accountId,
  16418. "webPropertyId": c.webPropertyId,
  16419. })
  16420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16421. }
  16422. // Do executes the "analytics.management.webproperties.get" call.
  16423. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16424. // status code is an error. Response headers are in either
  16425. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16426. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16427. // to check whether the returned error was because
  16428. // http.StatusNotModified was returned.
  16429. func (c *ManagementWebpropertiesGetCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16430. gensupport.SetOptions(c.urlParams_, opts...)
  16431. res, err := c.doRequest("json")
  16432. if res != nil && res.StatusCode == http.StatusNotModified {
  16433. if res.Body != nil {
  16434. res.Body.Close()
  16435. }
  16436. return nil, &googleapi.Error{
  16437. Code: res.StatusCode,
  16438. Header: res.Header,
  16439. }
  16440. }
  16441. if err != nil {
  16442. return nil, err
  16443. }
  16444. defer googleapi.CloseBody(res)
  16445. if err := googleapi.CheckResponse(res); err != nil {
  16446. return nil, err
  16447. }
  16448. ret := &Webproperty{
  16449. ServerResponse: googleapi.ServerResponse{
  16450. Header: res.Header,
  16451. HTTPStatusCode: res.StatusCode,
  16452. },
  16453. }
  16454. target := &ret
  16455. if err := gensupport.DecodeResponse(target, res); err != nil {
  16456. return nil, err
  16457. }
  16458. return ret, nil
  16459. // {
  16460. // "description": "Gets a web property to which the user has access.",
  16461. // "httpMethod": "GET",
  16462. // "id": "analytics.management.webproperties.get",
  16463. // "parameterOrder": [
  16464. // "accountId",
  16465. // "webPropertyId"
  16466. // ],
  16467. // "parameters": {
  16468. // "accountId": {
  16469. // "description": "Account ID to retrieve the web property for.",
  16470. // "location": "path",
  16471. // "pattern": "[0-9]+",
  16472. // "required": true,
  16473. // "type": "string"
  16474. // },
  16475. // "webPropertyId": {
  16476. // "description": "ID to retrieve the web property for.",
  16477. // "location": "path",
  16478. // "pattern": "UA-[0-9]+-[0-9]+",
  16479. // "required": true,
  16480. // "type": "string"
  16481. // }
  16482. // },
  16483. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  16484. // "response": {
  16485. // "$ref": "Webproperty"
  16486. // },
  16487. // "scopes": [
  16488. // "https://www.googleapis.com/auth/analytics.edit",
  16489. // "https://www.googleapis.com/auth/analytics.readonly"
  16490. // ]
  16491. // }
  16492. }
  16493. // method id "analytics.management.webproperties.insert":
  16494. type ManagementWebpropertiesInsertCall struct {
  16495. s *Service
  16496. accountId string
  16497. webproperty *Webproperty
  16498. urlParams_ gensupport.URLParams
  16499. ctx_ context.Context
  16500. header_ http.Header
  16501. }
  16502. // Insert: Create a new property if the account has fewer than 20
  16503. // properties. Web properties are visible in the Google Analytics
  16504. // interface only if they have at least one profile.
  16505. func (r *ManagementWebpropertiesService) Insert(accountId string, webproperty *Webproperty) *ManagementWebpropertiesInsertCall {
  16506. c := &ManagementWebpropertiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16507. c.accountId = accountId
  16508. c.webproperty = webproperty
  16509. return c
  16510. }
  16511. // Fields allows partial responses to be retrieved. See
  16512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16513. // for more information.
  16514. func (c *ManagementWebpropertiesInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesInsertCall {
  16515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16516. return c
  16517. }
  16518. // Context sets the context to be used in this call's Do method. Any
  16519. // pending HTTP request will be aborted if the provided context is
  16520. // canceled.
  16521. func (c *ManagementWebpropertiesInsertCall) Context(ctx context.Context) *ManagementWebpropertiesInsertCall {
  16522. c.ctx_ = ctx
  16523. return c
  16524. }
  16525. // Header returns an http.Header that can be modified by the caller to
  16526. // add HTTP headers to the request.
  16527. func (c *ManagementWebpropertiesInsertCall) Header() http.Header {
  16528. if c.header_ == nil {
  16529. c.header_ = make(http.Header)
  16530. }
  16531. return c.header_
  16532. }
  16533. func (c *ManagementWebpropertiesInsertCall) doRequest(alt string) (*http.Response, error) {
  16534. reqHeaders := make(http.Header)
  16535. for k, v := range c.header_ {
  16536. reqHeaders[k] = v
  16537. }
  16538. reqHeaders.Set("User-Agent", c.s.userAgent())
  16539. var body io.Reader = nil
  16540. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  16541. if err != nil {
  16542. return nil, err
  16543. }
  16544. reqHeaders.Set("Content-Type", "application/json")
  16545. c.urlParams_.Set("alt", alt)
  16546. c.urlParams_.Set("prettyPrint", "false")
  16547. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties")
  16548. urls += "?" + c.urlParams_.Encode()
  16549. req, err := http.NewRequest("POST", urls, body)
  16550. if err != nil {
  16551. return nil, err
  16552. }
  16553. req.Header = reqHeaders
  16554. googleapi.Expand(req.URL, map[string]string{
  16555. "accountId": c.accountId,
  16556. })
  16557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16558. }
  16559. // Do executes the "analytics.management.webproperties.insert" call.
  16560. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16561. // status code is an error. Response headers are in either
  16562. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16563. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16564. // to check whether the returned error was because
  16565. // http.StatusNotModified was returned.
  16566. func (c *ManagementWebpropertiesInsertCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16567. gensupport.SetOptions(c.urlParams_, opts...)
  16568. res, err := c.doRequest("json")
  16569. if res != nil && res.StatusCode == http.StatusNotModified {
  16570. if res.Body != nil {
  16571. res.Body.Close()
  16572. }
  16573. return nil, &googleapi.Error{
  16574. Code: res.StatusCode,
  16575. Header: res.Header,
  16576. }
  16577. }
  16578. if err != nil {
  16579. return nil, err
  16580. }
  16581. defer googleapi.CloseBody(res)
  16582. if err := googleapi.CheckResponse(res); err != nil {
  16583. return nil, err
  16584. }
  16585. ret := &Webproperty{
  16586. ServerResponse: googleapi.ServerResponse{
  16587. Header: res.Header,
  16588. HTTPStatusCode: res.StatusCode,
  16589. },
  16590. }
  16591. target := &ret
  16592. if err := gensupport.DecodeResponse(target, res); err != nil {
  16593. return nil, err
  16594. }
  16595. return ret, nil
  16596. // {
  16597. // "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.",
  16598. // "httpMethod": "POST",
  16599. // "id": "analytics.management.webproperties.insert",
  16600. // "parameterOrder": [
  16601. // "accountId"
  16602. // ],
  16603. // "parameters": {
  16604. // "accountId": {
  16605. // "description": "Account ID to create the web property for.",
  16606. // "location": "path",
  16607. // "required": true,
  16608. // "type": "string"
  16609. // }
  16610. // },
  16611. // "path": "management/accounts/{accountId}/webproperties",
  16612. // "request": {
  16613. // "$ref": "Webproperty"
  16614. // },
  16615. // "response": {
  16616. // "$ref": "Webproperty"
  16617. // },
  16618. // "scopes": [
  16619. // "https://www.googleapis.com/auth/analytics.edit"
  16620. // ]
  16621. // }
  16622. }
  16623. // method id "analytics.management.webproperties.list":
  16624. type ManagementWebpropertiesListCall struct {
  16625. s *Service
  16626. accountId string
  16627. urlParams_ gensupport.URLParams
  16628. ifNoneMatch_ string
  16629. ctx_ context.Context
  16630. header_ http.Header
  16631. }
  16632. // List: Lists web properties to which the user has access.
  16633. func (r *ManagementWebpropertiesService) List(accountId string) *ManagementWebpropertiesListCall {
  16634. c := &ManagementWebpropertiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16635. c.accountId = accountId
  16636. return c
  16637. }
  16638. // MaxResults sets the optional parameter "max-results": The maximum
  16639. // number of web properties to include in this response.
  16640. func (c *ManagementWebpropertiesListCall) MaxResults(maxResults int64) *ManagementWebpropertiesListCall {
  16641. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  16642. return c
  16643. }
  16644. // StartIndex sets the optional parameter "start-index": An index of the
  16645. // first entity to retrieve. Use this parameter as a pagination
  16646. // mechanism along with the max-results parameter.
  16647. func (c *ManagementWebpropertiesListCall) StartIndex(startIndex int64) *ManagementWebpropertiesListCall {
  16648. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  16649. return c
  16650. }
  16651. // Fields allows partial responses to be retrieved. See
  16652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16653. // for more information.
  16654. func (c *ManagementWebpropertiesListCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesListCall {
  16655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16656. return c
  16657. }
  16658. // IfNoneMatch sets the optional parameter which makes the operation
  16659. // fail if the object's ETag matches the given value. This is useful for
  16660. // getting updates only after the object has changed since the last
  16661. // request. Use googleapi.IsNotModified to check whether the response
  16662. // error from Do is the result of In-None-Match.
  16663. func (c *ManagementWebpropertiesListCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesListCall {
  16664. c.ifNoneMatch_ = entityTag
  16665. return c
  16666. }
  16667. // Context sets the context to be used in this call's Do method. Any
  16668. // pending HTTP request will be aborted if the provided context is
  16669. // canceled.
  16670. func (c *ManagementWebpropertiesListCall) Context(ctx context.Context) *ManagementWebpropertiesListCall {
  16671. c.ctx_ = ctx
  16672. return c
  16673. }
  16674. // Header returns an http.Header that can be modified by the caller to
  16675. // add HTTP headers to the request.
  16676. func (c *ManagementWebpropertiesListCall) Header() http.Header {
  16677. if c.header_ == nil {
  16678. c.header_ = make(http.Header)
  16679. }
  16680. return c.header_
  16681. }
  16682. func (c *ManagementWebpropertiesListCall) doRequest(alt string) (*http.Response, error) {
  16683. reqHeaders := make(http.Header)
  16684. for k, v := range c.header_ {
  16685. reqHeaders[k] = v
  16686. }
  16687. reqHeaders.Set("User-Agent", c.s.userAgent())
  16688. if c.ifNoneMatch_ != "" {
  16689. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16690. }
  16691. var body io.Reader = nil
  16692. c.urlParams_.Set("alt", alt)
  16693. c.urlParams_.Set("prettyPrint", "false")
  16694. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties")
  16695. urls += "?" + c.urlParams_.Encode()
  16696. req, err := http.NewRequest("GET", urls, body)
  16697. if err != nil {
  16698. return nil, err
  16699. }
  16700. req.Header = reqHeaders
  16701. googleapi.Expand(req.URL, map[string]string{
  16702. "accountId": c.accountId,
  16703. })
  16704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16705. }
  16706. // Do executes the "analytics.management.webproperties.list" call.
  16707. // Exactly one of *Webproperties or error will be non-nil. Any non-2xx
  16708. // status code is an error. Response headers are in either
  16709. // *Webproperties.ServerResponse.Header or (if a response was returned
  16710. // at all) in error.(*googleapi.Error).Header. Use
  16711. // googleapi.IsNotModified to check whether the returned error was
  16712. // because http.StatusNotModified was returned.
  16713. func (c *ManagementWebpropertiesListCall) Do(opts ...googleapi.CallOption) (*Webproperties, error) {
  16714. gensupport.SetOptions(c.urlParams_, opts...)
  16715. res, err := c.doRequest("json")
  16716. if res != nil && res.StatusCode == http.StatusNotModified {
  16717. if res.Body != nil {
  16718. res.Body.Close()
  16719. }
  16720. return nil, &googleapi.Error{
  16721. Code: res.StatusCode,
  16722. Header: res.Header,
  16723. }
  16724. }
  16725. if err != nil {
  16726. return nil, err
  16727. }
  16728. defer googleapi.CloseBody(res)
  16729. if err := googleapi.CheckResponse(res); err != nil {
  16730. return nil, err
  16731. }
  16732. ret := &Webproperties{
  16733. ServerResponse: googleapi.ServerResponse{
  16734. Header: res.Header,
  16735. HTTPStatusCode: res.StatusCode,
  16736. },
  16737. }
  16738. target := &ret
  16739. if err := gensupport.DecodeResponse(target, res); err != nil {
  16740. return nil, err
  16741. }
  16742. return ret, nil
  16743. // {
  16744. // "description": "Lists web properties to which the user has access.",
  16745. // "httpMethod": "GET",
  16746. // "id": "analytics.management.webproperties.list",
  16747. // "parameterOrder": [
  16748. // "accountId"
  16749. // ],
  16750. // "parameters": {
  16751. // "accountId": {
  16752. // "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.",
  16753. // "location": "path",
  16754. // "required": true,
  16755. // "type": "string"
  16756. // },
  16757. // "max-results": {
  16758. // "description": "The maximum number of web properties to include in this response.",
  16759. // "format": "int32",
  16760. // "location": "query",
  16761. // "type": "integer"
  16762. // },
  16763. // "start-index": {
  16764. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  16765. // "format": "int32",
  16766. // "location": "query",
  16767. // "minimum": "1",
  16768. // "type": "integer"
  16769. // }
  16770. // },
  16771. // "path": "management/accounts/{accountId}/webproperties",
  16772. // "response": {
  16773. // "$ref": "Webproperties"
  16774. // },
  16775. // "scopes": [
  16776. // "https://www.googleapis.com/auth/analytics",
  16777. // "https://www.googleapis.com/auth/analytics.edit",
  16778. // "https://www.googleapis.com/auth/analytics.readonly"
  16779. // ]
  16780. // }
  16781. }
  16782. // method id "analytics.management.webproperties.patch":
  16783. type ManagementWebpropertiesPatchCall struct {
  16784. s *Service
  16785. accountId string
  16786. webPropertyId string
  16787. webproperty *Webproperty
  16788. urlParams_ gensupport.URLParams
  16789. ctx_ context.Context
  16790. header_ http.Header
  16791. }
  16792. // Patch: Updates an existing web property. This method supports patch
  16793. // semantics.
  16794. func (r *ManagementWebpropertiesService) Patch(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesPatchCall {
  16795. c := &ManagementWebpropertiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16796. c.accountId = accountId
  16797. c.webPropertyId = webPropertyId
  16798. c.webproperty = webproperty
  16799. return c
  16800. }
  16801. // Fields allows partial responses to be retrieved. See
  16802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16803. // for more information.
  16804. func (c *ManagementWebpropertiesPatchCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesPatchCall {
  16805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16806. return c
  16807. }
  16808. // Context sets the context to be used in this call's Do method. Any
  16809. // pending HTTP request will be aborted if the provided context is
  16810. // canceled.
  16811. func (c *ManagementWebpropertiesPatchCall) Context(ctx context.Context) *ManagementWebpropertiesPatchCall {
  16812. c.ctx_ = ctx
  16813. return c
  16814. }
  16815. // Header returns an http.Header that can be modified by the caller to
  16816. // add HTTP headers to the request.
  16817. func (c *ManagementWebpropertiesPatchCall) Header() http.Header {
  16818. if c.header_ == nil {
  16819. c.header_ = make(http.Header)
  16820. }
  16821. return c.header_
  16822. }
  16823. func (c *ManagementWebpropertiesPatchCall) doRequest(alt string) (*http.Response, error) {
  16824. reqHeaders := make(http.Header)
  16825. for k, v := range c.header_ {
  16826. reqHeaders[k] = v
  16827. }
  16828. reqHeaders.Set("User-Agent", c.s.userAgent())
  16829. var body io.Reader = nil
  16830. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  16831. if err != nil {
  16832. return nil, err
  16833. }
  16834. reqHeaders.Set("Content-Type", "application/json")
  16835. c.urlParams_.Set("alt", alt)
  16836. c.urlParams_.Set("prettyPrint", "false")
  16837. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  16838. urls += "?" + c.urlParams_.Encode()
  16839. req, err := http.NewRequest("PATCH", urls, body)
  16840. if err != nil {
  16841. return nil, err
  16842. }
  16843. req.Header = reqHeaders
  16844. googleapi.Expand(req.URL, map[string]string{
  16845. "accountId": c.accountId,
  16846. "webPropertyId": c.webPropertyId,
  16847. })
  16848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16849. }
  16850. // Do executes the "analytics.management.webproperties.patch" call.
  16851. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16852. // status code is an error. Response headers are in either
  16853. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16854. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16855. // to check whether the returned error was because
  16856. // http.StatusNotModified was returned.
  16857. func (c *ManagementWebpropertiesPatchCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16858. gensupport.SetOptions(c.urlParams_, opts...)
  16859. res, err := c.doRequest("json")
  16860. if res != nil && res.StatusCode == http.StatusNotModified {
  16861. if res.Body != nil {
  16862. res.Body.Close()
  16863. }
  16864. return nil, &googleapi.Error{
  16865. Code: res.StatusCode,
  16866. Header: res.Header,
  16867. }
  16868. }
  16869. if err != nil {
  16870. return nil, err
  16871. }
  16872. defer googleapi.CloseBody(res)
  16873. if err := googleapi.CheckResponse(res); err != nil {
  16874. return nil, err
  16875. }
  16876. ret := &Webproperty{
  16877. ServerResponse: googleapi.ServerResponse{
  16878. Header: res.Header,
  16879. HTTPStatusCode: res.StatusCode,
  16880. },
  16881. }
  16882. target := &ret
  16883. if err := gensupport.DecodeResponse(target, res); err != nil {
  16884. return nil, err
  16885. }
  16886. return ret, nil
  16887. // {
  16888. // "description": "Updates an existing web property. This method supports patch semantics.",
  16889. // "httpMethod": "PATCH",
  16890. // "id": "analytics.management.webproperties.patch",
  16891. // "parameterOrder": [
  16892. // "accountId",
  16893. // "webPropertyId"
  16894. // ],
  16895. // "parameters": {
  16896. // "accountId": {
  16897. // "description": "Account ID to which the web property belongs",
  16898. // "location": "path",
  16899. // "required": true,
  16900. // "type": "string"
  16901. // },
  16902. // "webPropertyId": {
  16903. // "description": "Web property ID",
  16904. // "location": "path",
  16905. // "required": true,
  16906. // "type": "string"
  16907. // }
  16908. // },
  16909. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  16910. // "request": {
  16911. // "$ref": "Webproperty"
  16912. // },
  16913. // "response": {
  16914. // "$ref": "Webproperty"
  16915. // },
  16916. // "scopes": [
  16917. // "https://www.googleapis.com/auth/analytics.edit"
  16918. // ]
  16919. // }
  16920. }
  16921. // method id "analytics.management.webproperties.update":
  16922. type ManagementWebpropertiesUpdateCall struct {
  16923. s *Service
  16924. accountId string
  16925. webPropertyId string
  16926. webproperty *Webproperty
  16927. urlParams_ gensupport.URLParams
  16928. ctx_ context.Context
  16929. header_ http.Header
  16930. }
  16931. // Update: Updates an existing web property.
  16932. func (r *ManagementWebpropertiesService) Update(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesUpdateCall {
  16933. c := &ManagementWebpropertiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16934. c.accountId = accountId
  16935. c.webPropertyId = webPropertyId
  16936. c.webproperty = webproperty
  16937. return c
  16938. }
  16939. // Fields allows partial responses to be retrieved. See
  16940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16941. // for more information.
  16942. func (c *ManagementWebpropertiesUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesUpdateCall {
  16943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16944. return c
  16945. }
  16946. // Context sets the context to be used in this call's Do method. Any
  16947. // pending HTTP request will be aborted if the provided context is
  16948. // canceled.
  16949. func (c *ManagementWebpropertiesUpdateCall) Context(ctx context.Context) *ManagementWebpropertiesUpdateCall {
  16950. c.ctx_ = ctx
  16951. return c
  16952. }
  16953. // Header returns an http.Header that can be modified by the caller to
  16954. // add HTTP headers to the request.
  16955. func (c *ManagementWebpropertiesUpdateCall) Header() http.Header {
  16956. if c.header_ == nil {
  16957. c.header_ = make(http.Header)
  16958. }
  16959. return c.header_
  16960. }
  16961. func (c *ManagementWebpropertiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16962. reqHeaders := make(http.Header)
  16963. for k, v := range c.header_ {
  16964. reqHeaders[k] = v
  16965. }
  16966. reqHeaders.Set("User-Agent", c.s.userAgent())
  16967. var body io.Reader = nil
  16968. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  16969. if err != nil {
  16970. return nil, err
  16971. }
  16972. reqHeaders.Set("Content-Type", "application/json")
  16973. c.urlParams_.Set("alt", alt)
  16974. c.urlParams_.Set("prettyPrint", "false")
  16975. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  16976. urls += "?" + c.urlParams_.Encode()
  16977. req, err := http.NewRequest("PUT", urls, body)
  16978. if err != nil {
  16979. return nil, err
  16980. }
  16981. req.Header = reqHeaders
  16982. googleapi.Expand(req.URL, map[string]string{
  16983. "accountId": c.accountId,
  16984. "webPropertyId": c.webPropertyId,
  16985. })
  16986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16987. }
  16988. // Do executes the "analytics.management.webproperties.update" call.
  16989. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16990. // status code is an error. Response headers are in either
  16991. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16992. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16993. // to check whether the returned error was because
  16994. // http.StatusNotModified was returned.
  16995. func (c *ManagementWebpropertiesUpdateCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16996. gensupport.SetOptions(c.urlParams_, opts...)
  16997. res, err := c.doRequest("json")
  16998. if res != nil && res.StatusCode == http.StatusNotModified {
  16999. if res.Body != nil {
  17000. res.Body.Close()
  17001. }
  17002. return nil, &googleapi.Error{
  17003. Code: res.StatusCode,
  17004. Header: res.Header,
  17005. }
  17006. }
  17007. if err != nil {
  17008. return nil, err
  17009. }
  17010. defer googleapi.CloseBody(res)
  17011. if err := googleapi.CheckResponse(res); err != nil {
  17012. return nil, err
  17013. }
  17014. ret := &Webproperty{
  17015. ServerResponse: googleapi.ServerResponse{
  17016. Header: res.Header,
  17017. HTTPStatusCode: res.StatusCode,
  17018. },
  17019. }
  17020. target := &ret
  17021. if err := gensupport.DecodeResponse(target, res); err != nil {
  17022. return nil, err
  17023. }
  17024. return ret, nil
  17025. // {
  17026. // "description": "Updates an existing web property.",
  17027. // "httpMethod": "PUT",
  17028. // "id": "analytics.management.webproperties.update",
  17029. // "parameterOrder": [
  17030. // "accountId",
  17031. // "webPropertyId"
  17032. // ],
  17033. // "parameters": {
  17034. // "accountId": {
  17035. // "description": "Account ID to which the web property belongs",
  17036. // "location": "path",
  17037. // "required": true,
  17038. // "type": "string"
  17039. // },
  17040. // "webPropertyId": {
  17041. // "description": "Web property ID",
  17042. // "location": "path",
  17043. // "required": true,
  17044. // "type": "string"
  17045. // }
  17046. // },
  17047. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  17048. // "request": {
  17049. // "$ref": "Webproperty"
  17050. // },
  17051. // "response": {
  17052. // "$ref": "Webproperty"
  17053. // },
  17054. // "scopes": [
  17055. // "https://www.googleapis.com/auth/analytics.edit"
  17056. // ]
  17057. // }
  17058. }
  17059. // method id "analytics.management.webpropertyUserLinks.delete":
  17060. type ManagementWebpropertyUserLinksDeleteCall struct {
  17061. s *Service
  17062. accountId string
  17063. webPropertyId string
  17064. linkId string
  17065. urlParams_ gensupport.URLParams
  17066. ctx_ context.Context
  17067. header_ http.Header
  17068. }
  17069. // Delete: Removes a user from the given web property.
  17070. func (r *ManagementWebpropertyUserLinksService) Delete(accountId string, webPropertyId string, linkId string) *ManagementWebpropertyUserLinksDeleteCall {
  17071. c := &ManagementWebpropertyUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17072. c.accountId = accountId
  17073. c.webPropertyId = webPropertyId
  17074. c.linkId = linkId
  17075. return c
  17076. }
  17077. // Fields allows partial responses to be retrieved. See
  17078. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17079. // for more information.
  17080. func (c *ManagementWebpropertyUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksDeleteCall {
  17081. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17082. return c
  17083. }
  17084. // Context sets the context to be used in this call's Do method. Any
  17085. // pending HTTP request will be aborted if the provided context is
  17086. // canceled.
  17087. func (c *ManagementWebpropertyUserLinksDeleteCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksDeleteCall {
  17088. c.ctx_ = ctx
  17089. return c
  17090. }
  17091. // Header returns an http.Header that can be modified by the caller to
  17092. // add HTTP headers to the request.
  17093. func (c *ManagementWebpropertyUserLinksDeleteCall) Header() http.Header {
  17094. if c.header_ == nil {
  17095. c.header_ = make(http.Header)
  17096. }
  17097. return c.header_
  17098. }
  17099. func (c *ManagementWebpropertyUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  17100. reqHeaders := make(http.Header)
  17101. for k, v := range c.header_ {
  17102. reqHeaders[k] = v
  17103. }
  17104. reqHeaders.Set("User-Agent", c.s.userAgent())
  17105. var body io.Reader = nil
  17106. c.urlParams_.Set("alt", alt)
  17107. c.urlParams_.Set("prettyPrint", "false")
  17108. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}")
  17109. urls += "?" + c.urlParams_.Encode()
  17110. req, err := http.NewRequest("DELETE", urls, body)
  17111. if err != nil {
  17112. return nil, err
  17113. }
  17114. req.Header = reqHeaders
  17115. googleapi.Expand(req.URL, map[string]string{
  17116. "accountId": c.accountId,
  17117. "webPropertyId": c.webPropertyId,
  17118. "linkId": c.linkId,
  17119. })
  17120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17121. }
  17122. // Do executes the "analytics.management.webpropertyUserLinks.delete" call.
  17123. func (c *ManagementWebpropertyUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  17124. gensupport.SetOptions(c.urlParams_, opts...)
  17125. res, err := c.doRequest("json")
  17126. if err != nil {
  17127. return err
  17128. }
  17129. defer googleapi.CloseBody(res)
  17130. if err := googleapi.CheckResponse(res); err != nil {
  17131. return err
  17132. }
  17133. return nil
  17134. // {
  17135. // "description": "Removes a user from the given web property.",
  17136. // "httpMethod": "DELETE",
  17137. // "id": "analytics.management.webpropertyUserLinks.delete",
  17138. // "parameterOrder": [
  17139. // "accountId",
  17140. // "webPropertyId",
  17141. // "linkId"
  17142. // ],
  17143. // "parameters": {
  17144. // "accountId": {
  17145. // "description": "Account ID to delete the user link for.",
  17146. // "location": "path",
  17147. // "required": true,
  17148. // "type": "string"
  17149. // },
  17150. // "linkId": {
  17151. // "description": "Link ID to delete the user link for.",
  17152. // "location": "path",
  17153. // "required": true,
  17154. // "type": "string"
  17155. // },
  17156. // "webPropertyId": {
  17157. // "description": "Web Property ID to delete the user link for.",
  17158. // "location": "path",
  17159. // "required": true,
  17160. // "type": "string"
  17161. // }
  17162. // },
  17163. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}",
  17164. // "scopes": [
  17165. // "https://www.googleapis.com/auth/analytics.manage.users"
  17166. // ]
  17167. // }
  17168. }
  17169. // method id "analytics.management.webpropertyUserLinks.insert":
  17170. type ManagementWebpropertyUserLinksInsertCall struct {
  17171. s *Service
  17172. accountId string
  17173. webPropertyId string
  17174. entityuserlink *EntityUserLink
  17175. urlParams_ gensupport.URLParams
  17176. ctx_ context.Context
  17177. header_ http.Header
  17178. }
  17179. // Insert: Adds a new user to the given web property.
  17180. func (r *ManagementWebpropertyUserLinksService) Insert(accountId string, webPropertyId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksInsertCall {
  17181. c := &ManagementWebpropertyUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17182. c.accountId = accountId
  17183. c.webPropertyId = webPropertyId
  17184. c.entityuserlink = entityuserlink
  17185. return c
  17186. }
  17187. // Fields allows partial responses to be retrieved. See
  17188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17189. // for more information.
  17190. func (c *ManagementWebpropertyUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksInsertCall {
  17191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17192. return c
  17193. }
  17194. // Context sets the context to be used in this call's Do method. Any
  17195. // pending HTTP request will be aborted if the provided context is
  17196. // canceled.
  17197. func (c *ManagementWebpropertyUserLinksInsertCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksInsertCall {
  17198. c.ctx_ = ctx
  17199. return c
  17200. }
  17201. // Header returns an http.Header that can be modified by the caller to
  17202. // add HTTP headers to the request.
  17203. func (c *ManagementWebpropertyUserLinksInsertCall) Header() http.Header {
  17204. if c.header_ == nil {
  17205. c.header_ = make(http.Header)
  17206. }
  17207. return c.header_
  17208. }
  17209. func (c *ManagementWebpropertyUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  17210. reqHeaders := make(http.Header)
  17211. for k, v := range c.header_ {
  17212. reqHeaders[k] = v
  17213. }
  17214. reqHeaders.Set("User-Agent", c.s.userAgent())
  17215. var body io.Reader = nil
  17216. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  17217. if err != nil {
  17218. return nil, err
  17219. }
  17220. reqHeaders.Set("Content-Type", "application/json")
  17221. c.urlParams_.Set("alt", alt)
  17222. c.urlParams_.Set("prettyPrint", "false")
  17223. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks")
  17224. urls += "?" + c.urlParams_.Encode()
  17225. req, err := http.NewRequest("POST", urls, body)
  17226. if err != nil {
  17227. return nil, err
  17228. }
  17229. req.Header = reqHeaders
  17230. googleapi.Expand(req.URL, map[string]string{
  17231. "accountId": c.accountId,
  17232. "webPropertyId": c.webPropertyId,
  17233. })
  17234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17235. }
  17236. // Do executes the "analytics.management.webpropertyUserLinks.insert" call.
  17237. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  17238. // status code is an error. Response headers are in either
  17239. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  17240. // at all) in error.(*googleapi.Error).Header. Use
  17241. // googleapi.IsNotModified to check whether the returned error was
  17242. // because http.StatusNotModified was returned.
  17243. func (c *ManagementWebpropertyUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  17244. gensupport.SetOptions(c.urlParams_, opts...)
  17245. res, err := c.doRequest("json")
  17246. if res != nil && res.StatusCode == http.StatusNotModified {
  17247. if res.Body != nil {
  17248. res.Body.Close()
  17249. }
  17250. return nil, &googleapi.Error{
  17251. Code: res.StatusCode,
  17252. Header: res.Header,
  17253. }
  17254. }
  17255. if err != nil {
  17256. return nil, err
  17257. }
  17258. defer googleapi.CloseBody(res)
  17259. if err := googleapi.CheckResponse(res); err != nil {
  17260. return nil, err
  17261. }
  17262. ret := &EntityUserLink{
  17263. ServerResponse: googleapi.ServerResponse{
  17264. Header: res.Header,
  17265. HTTPStatusCode: res.StatusCode,
  17266. },
  17267. }
  17268. target := &ret
  17269. if err := gensupport.DecodeResponse(target, res); err != nil {
  17270. return nil, err
  17271. }
  17272. return ret, nil
  17273. // {
  17274. // "description": "Adds a new user to the given web property.",
  17275. // "httpMethod": "POST",
  17276. // "id": "analytics.management.webpropertyUserLinks.insert",
  17277. // "parameterOrder": [
  17278. // "accountId",
  17279. // "webPropertyId"
  17280. // ],
  17281. // "parameters": {
  17282. // "accountId": {
  17283. // "description": "Account ID to create the user link for.",
  17284. // "location": "path",
  17285. // "required": true,
  17286. // "type": "string"
  17287. // },
  17288. // "webPropertyId": {
  17289. // "description": "Web Property ID to create the user link for.",
  17290. // "location": "path",
  17291. // "required": true,
  17292. // "type": "string"
  17293. // }
  17294. // },
  17295. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks",
  17296. // "request": {
  17297. // "$ref": "EntityUserLink"
  17298. // },
  17299. // "response": {
  17300. // "$ref": "EntityUserLink"
  17301. // },
  17302. // "scopes": [
  17303. // "https://www.googleapis.com/auth/analytics.manage.users"
  17304. // ]
  17305. // }
  17306. }
  17307. // method id "analytics.management.webpropertyUserLinks.list":
  17308. type ManagementWebpropertyUserLinksListCall struct {
  17309. s *Service
  17310. accountId string
  17311. webPropertyId string
  17312. urlParams_ gensupport.URLParams
  17313. ifNoneMatch_ string
  17314. ctx_ context.Context
  17315. header_ http.Header
  17316. }
  17317. // List: Lists webProperty-user links for a given web property.
  17318. func (r *ManagementWebpropertyUserLinksService) List(accountId string, webPropertyId string) *ManagementWebpropertyUserLinksListCall {
  17319. c := &ManagementWebpropertyUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17320. c.accountId = accountId
  17321. c.webPropertyId = webPropertyId
  17322. return c
  17323. }
  17324. // MaxResults sets the optional parameter "max-results": The maximum
  17325. // number of webProperty-user Links to include in this response.
  17326. func (c *ManagementWebpropertyUserLinksListCall) MaxResults(maxResults int64) *ManagementWebpropertyUserLinksListCall {
  17327. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  17328. return c
  17329. }
  17330. // StartIndex sets the optional parameter "start-index": An index of the
  17331. // first webProperty-user link to retrieve. Use this parameter as a
  17332. // pagination mechanism along with the max-results parameter.
  17333. func (c *ManagementWebpropertyUserLinksListCall) StartIndex(startIndex int64) *ManagementWebpropertyUserLinksListCall {
  17334. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  17335. return c
  17336. }
  17337. // Fields allows partial responses to be retrieved. See
  17338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17339. // for more information.
  17340. func (c *ManagementWebpropertyUserLinksListCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksListCall {
  17341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17342. return c
  17343. }
  17344. // IfNoneMatch sets the optional parameter which makes the operation
  17345. // fail if the object's ETag matches the given value. This is useful for
  17346. // getting updates only after the object has changed since the last
  17347. // request. Use googleapi.IsNotModified to check whether the response
  17348. // error from Do is the result of In-None-Match.
  17349. func (c *ManagementWebpropertyUserLinksListCall) IfNoneMatch(entityTag string) *ManagementWebpropertyUserLinksListCall {
  17350. c.ifNoneMatch_ = entityTag
  17351. return c
  17352. }
  17353. // Context sets the context to be used in this call's Do method. Any
  17354. // pending HTTP request will be aborted if the provided context is
  17355. // canceled.
  17356. func (c *ManagementWebpropertyUserLinksListCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksListCall {
  17357. c.ctx_ = ctx
  17358. return c
  17359. }
  17360. // Header returns an http.Header that can be modified by the caller to
  17361. // add HTTP headers to the request.
  17362. func (c *ManagementWebpropertyUserLinksListCall) Header() http.Header {
  17363. if c.header_ == nil {
  17364. c.header_ = make(http.Header)
  17365. }
  17366. return c.header_
  17367. }
  17368. func (c *ManagementWebpropertyUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  17369. reqHeaders := make(http.Header)
  17370. for k, v := range c.header_ {
  17371. reqHeaders[k] = v
  17372. }
  17373. reqHeaders.Set("User-Agent", c.s.userAgent())
  17374. if c.ifNoneMatch_ != "" {
  17375. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17376. }
  17377. var body io.Reader = nil
  17378. c.urlParams_.Set("alt", alt)
  17379. c.urlParams_.Set("prettyPrint", "false")
  17380. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks")
  17381. urls += "?" + c.urlParams_.Encode()
  17382. req, err := http.NewRequest("GET", urls, body)
  17383. if err != nil {
  17384. return nil, err
  17385. }
  17386. req.Header = reqHeaders
  17387. googleapi.Expand(req.URL, map[string]string{
  17388. "accountId": c.accountId,
  17389. "webPropertyId": c.webPropertyId,
  17390. })
  17391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17392. }
  17393. // Do executes the "analytics.management.webpropertyUserLinks.list" call.
  17394. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  17395. // status code is an error. Response headers are in either
  17396. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  17397. // at all) in error.(*googleapi.Error).Header. Use
  17398. // googleapi.IsNotModified to check whether the returned error was
  17399. // because http.StatusNotModified was returned.
  17400. func (c *ManagementWebpropertyUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  17401. gensupport.SetOptions(c.urlParams_, opts...)
  17402. res, err := c.doRequest("json")
  17403. if res != nil && res.StatusCode == http.StatusNotModified {
  17404. if res.Body != nil {
  17405. res.Body.Close()
  17406. }
  17407. return nil, &googleapi.Error{
  17408. Code: res.StatusCode,
  17409. Header: res.Header,
  17410. }
  17411. }
  17412. if err != nil {
  17413. return nil, err
  17414. }
  17415. defer googleapi.CloseBody(res)
  17416. if err := googleapi.CheckResponse(res); err != nil {
  17417. return nil, err
  17418. }
  17419. ret := &EntityUserLinks{
  17420. ServerResponse: googleapi.ServerResponse{
  17421. Header: res.Header,
  17422. HTTPStatusCode: res.StatusCode,
  17423. },
  17424. }
  17425. target := &ret
  17426. if err := gensupport.DecodeResponse(target, res); err != nil {
  17427. return nil, err
  17428. }
  17429. return ret, nil
  17430. // {
  17431. // "description": "Lists webProperty-user links for a given web property.",
  17432. // "httpMethod": "GET",
  17433. // "id": "analytics.management.webpropertyUserLinks.list",
  17434. // "parameterOrder": [
  17435. // "accountId",
  17436. // "webPropertyId"
  17437. // ],
  17438. // "parameters": {
  17439. // "accountId": {
  17440. // "description": "Account ID which the given web property belongs to.",
  17441. // "location": "path",
  17442. // "required": true,
  17443. // "type": "string"
  17444. // },
  17445. // "max-results": {
  17446. // "description": "The maximum number of webProperty-user Links to include in this response.",
  17447. // "format": "int32",
  17448. // "location": "query",
  17449. // "type": "integer"
  17450. // },
  17451. // "start-index": {
  17452. // "description": "An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  17453. // "format": "int32",
  17454. // "location": "query",
  17455. // "minimum": "1",
  17456. // "type": "integer"
  17457. // },
  17458. // "webPropertyId": {
  17459. // "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.",
  17460. // "location": "path",
  17461. // "required": true,
  17462. // "type": "string"
  17463. // }
  17464. // },
  17465. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks",
  17466. // "response": {
  17467. // "$ref": "EntityUserLinks"
  17468. // },
  17469. // "scopes": [
  17470. // "https://www.googleapis.com/auth/analytics.manage.users",
  17471. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  17472. // ]
  17473. // }
  17474. }
  17475. // method id "analytics.management.webpropertyUserLinks.update":
  17476. type ManagementWebpropertyUserLinksUpdateCall struct {
  17477. s *Service
  17478. accountId string
  17479. webPropertyId string
  17480. linkId string
  17481. entityuserlink *EntityUserLink
  17482. urlParams_ gensupport.URLParams
  17483. ctx_ context.Context
  17484. header_ http.Header
  17485. }
  17486. // Update: Updates permissions for an existing user on the given web
  17487. // property.
  17488. func (r *ManagementWebpropertyUserLinksService) Update(accountId string, webPropertyId string, linkId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksUpdateCall {
  17489. c := &ManagementWebpropertyUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17490. c.accountId = accountId
  17491. c.webPropertyId = webPropertyId
  17492. c.linkId = linkId
  17493. c.entityuserlink = entityuserlink
  17494. return c
  17495. }
  17496. // Fields allows partial responses to be retrieved. See
  17497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17498. // for more information.
  17499. func (c *ManagementWebpropertyUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksUpdateCall {
  17500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17501. return c
  17502. }
  17503. // Context sets the context to be used in this call's Do method. Any
  17504. // pending HTTP request will be aborted if the provided context is
  17505. // canceled.
  17506. func (c *ManagementWebpropertyUserLinksUpdateCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksUpdateCall {
  17507. c.ctx_ = ctx
  17508. return c
  17509. }
  17510. // Header returns an http.Header that can be modified by the caller to
  17511. // add HTTP headers to the request.
  17512. func (c *ManagementWebpropertyUserLinksUpdateCall) Header() http.Header {
  17513. if c.header_ == nil {
  17514. c.header_ = make(http.Header)
  17515. }
  17516. return c.header_
  17517. }
  17518. func (c *ManagementWebpropertyUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  17519. reqHeaders := make(http.Header)
  17520. for k, v := range c.header_ {
  17521. reqHeaders[k] = v
  17522. }
  17523. reqHeaders.Set("User-Agent", c.s.userAgent())
  17524. var body io.Reader = nil
  17525. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  17526. if err != nil {
  17527. return nil, err
  17528. }
  17529. reqHeaders.Set("Content-Type", "application/json")
  17530. c.urlParams_.Set("alt", alt)
  17531. c.urlParams_.Set("prettyPrint", "false")
  17532. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}")
  17533. urls += "?" + c.urlParams_.Encode()
  17534. req, err := http.NewRequest("PUT", urls, body)
  17535. if err != nil {
  17536. return nil, err
  17537. }
  17538. req.Header = reqHeaders
  17539. googleapi.Expand(req.URL, map[string]string{
  17540. "accountId": c.accountId,
  17541. "webPropertyId": c.webPropertyId,
  17542. "linkId": c.linkId,
  17543. })
  17544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17545. }
  17546. // Do executes the "analytics.management.webpropertyUserLinks.update" call.
  17547. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  17548. // status code is an error. Response headers are in either
  17549. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  17550. // at all) in error.(*googleapi.Error).Header. Use
  17551. // googleapi.IsNotModified to check whether the returned error was
  17552. // because http.StatusNotModified was returned.
  17553. func (c *ManagementWebpropertyUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  17554. gensupport.SetOptions(c.urlParams_, opts...)
  17555. res, err := c.doRequest("json")
  17556. if res != nil && res.StatusCode == http.StatusNotModified {
  17557. if res.Body != nil {
  17558. res.Body.Close()
  17559. }
  17560. return nil, &googleapi.Error{
  17561. Code: res.StatusCode,
  17562. Header: res.Header,
  17563. }
  17564. }
  17565. if err != nil {
  17566. return nil, err
  17567. }
  17568. defer googleapi.CloseBody(res)
  17569. if err := googleapi.CheckResponse(res); err != nil {
  17570. return nil, err
  17571. }
  17572. ret := &EntityUserLink{
  17573. ServerResponse: googleapi.ServerResponse{
  17574. Header: res.Header,
  17575. HTTPStatusCode: res.StatusCode,
  17576. },
  17577. }
  17578. target := &ret
  17579. if err := gensupport.DecodeResponse(target, res); err != nil {
  17580. return nil, err
  17581. }
  17582. return ret, nil
  17583. // {
  17584. // "description": "Updates permissions for an existing user on the given web property.",
  17585. // "httpMethod": "PUT",
  17586. // "id": "analytics.management.webpropertyUserLinks.update",
  17587. // "parameterOrder": [
  17588. // "accountId",
  17589. // "webPropertyId",
  17590. // "linkId"
  17591. // ],
  17592. // "parameters": {
  17593. // "accountId": {
  17594. // "description": "Account ID to update the account-user link for.",
  17595. // "location": "path",
  17596. // "required": true,
  17597. // "type": "string"
  17598. // },
  17599. // "linkId": {
  17600. // "description": "Link ID to update the account-user link for.",
  17601. // "location": "path",
  17602. // "required": true,
  17603. // "type": "string"
  17604. // },
  17605. // "webPropertyId": {
  17606. // "description": "Web property ID to update the account-user link for.",
  17607. // "location": "path",
  17608. // "required": true,
  17609. // "type": "string"
  17610. // }
  17611. // },
  17612. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}",
  17613. // "request": {
  17614. // "$ref": "EntityUserLink"
  17615. // },
  17616. // "response": {
  17617. // "$ref": "EntityUserLink"
  17618. // },
  17619. // "scopes": [
  17620. // "https://www.googleapis.com/auth/analytics.manage.users"
  17621. // ]
  17622. // }
  17623. }
  17624. // method id "analytics.metadata.columns.list":
  17625. type MetadataColumnsListCall struct {
  17626. s *Service
  17627. reportType string
  17628. urlParams_ gensupport.URLParams
  17629. ifNoneMatch_ string
  17630. ctx_ context.Context
  17631. header_ http.Header
  17632. }
  17633. // List: Lists all columns for a report type
  17634. func (r *MetadataColumnsService) List(reportType string) *MetadataColumnsListCall {
  17635. c := &MetadataColumnsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17636. c.reportType = reportType
  17637. return c
  17638. }
  17639. // Fields allows partial responses to be retrieved. See
  17640. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17641. // for more information.
  17642. func (c *MetadataColumnsListCall) Fields(s ...googleapi.Field) *MetadataColumnsListCall {
  17643. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17644. return c
  17645. }
  17646. // IfNoneMatch sets the optional parameter which makes the operation
  17647. // fail if the object's ETag matches the given value. This is useful for
  17648. // getting updates only after the object has changed since the last
  17649. // request. Use googleapi.IsNotModified to check whether the response
  17650. // error from Do is the result of In-None-Match.
  17651. func (c *MetadataColumnsListCall) IfNoneMatch(entityTag string) *MetadataColumnsListCall {
  17652. c.ifNoneMatch_ = entityTag
  17653. return c
  17654. }
  17655. // Context sets the context to be used in this call's Do method. Any
  17656. // pending HTTP request will be aborted if the provided context is
  17657. // canceled.
  17658. func (c *MetadataColumnsListCall) Context(ctx context.Context) *MetadataColumnsListCall {
  17659. c.ctx_ = ctx
  17660. return c
  17661. }
  17662. // Header returns an http.Header that can be modified by the caller to
  17663. // add HTTP headers to the request.
  17664. func (c *MetadataColumnsListCall) Header() http.Header {
  17665. if c.header_ == nil {
  17666. c.header_ = make(http.Header)
  17667. }
  17668. return c.header_
  17669. }
  17670. func (c *MetadataColumnsListCall) doRequest(alt string) (*http.Response, error) {
  17671. reqHeaders := make(http.Header)
  17672. for k, v := range c.header_ {
  17673. reqHeaders[k] = v
  17674. }
  17675. reqHeaders.Set("User-Agent", c.s.userAgent())
  17676. if c.ifNoneMatch_ != "" {
  17677. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17678. }
  17679. var body io.Reader = nil
  17680. c.urlParams_.Set("alt", alt)
  17681. c.urlParams_.Set("prettyPrint", "false")
  17682. urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/{reportType}/columns")
  17683. urls += "?" + c.urlParams_.Encode()
  17684. req, err := http.NewRequest("GET", urls, body)
  17685. if err != nil {
  17686. return nil, err
  17687. }
  17688. req.Header = reqHeaders
  17689. googleapi.Expand(req.URL, map[string]string{
  17690. "reportType": c.reportType,
  17691. })
  17692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17693. }
  17694. // Do executes the "analytics.metadata.columns.list" call.
  17695. // Exactly one of *Columns or error will be non-nil. Any non-2xx status
  17696. // code is an error. Response headers are in either
  17697. // *Columns.ServerResponse.Header or (if a response was returned at all)
  17698. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  17699. // check whether the returned error was because http.StatusNotModified
  17700. // was returned.
  17701. func (c *MetadataColumnsListCall) Do(opts ...googleapi.CallOption) (*Columns, error) {
  17702. gensupport.SetOptions(c.urlParams_, opts...)
  17703. res, err := c.doRequest("json")
  17704. if res != nil && res.StatusCode == http.StatusNotModified {
  17705. if res.Body != nil {
  17706. res.Body.Close()
  17707. }
  17708. return nil, &googleapi.Error{
  17709. Code: res.StatusCode,
  17710. Header: res.Header,
  17711. }
  17712. }
  17713. if err != nil {
  17714. return nil, err
  17715. }
  17716. defer googleapi.CloseBody(res)
  17717. if err := googleapi.CheckResponse(res); err != nil {
  17718. return nil, err
  17719. }
  17720. ret := &Columns{
  17721. ServerResponse: googleapi.ServerResponse{
  17722. Header: res.Header,
  17723. HTTPStatusCode: res.StatusCode,
  17724. },
  17725. }
  17726. target := &ret
  17727. if err := gensupport.DecodeResponse(target, res); err != nil {
  17728. return nil, err
  17729. }
  17730. return ret, nil
  17731. // {
  17732. // "description": "Lists all columns for a report type",
  17733. // "httpMethod": "GET",
  17734. // "id": "analytics.metadata.columns.list",
  17735. // "parameterOrder": [
  17736. // "reportType"
  17737. // ],
  17738. // "parameters": {
  17739. // "reportType": {
  17740. // "description": "Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API",
  17741. // "location": "path",
  17742. // "pattern": "ga",
  17743. // "required": true,
  17744. // "type": "string"
  17745. // }
  17746. // },
  17747. // "path": "metadata/{reportType}/columns",
  17748. // "response": {
  17749. // "$ref": "Columns"
  17750. // },
  17751. // "scopes": [
  17752. // "https://www.googleapis.com/auth/analytics",
  17753. // "https://www.googleapis.com/auth/analytics.edit",
  17754. // "https://www.googleapis.com/auth/analytics.readonly"
  17755. // ]
  17756. // }
  17757. }
  17758. // method id "analytics.provisioning.createAccountTicket":
  17759. type ProvisioningCreateAccountTicketCall struct {
  17760. s *Service
  17761. accountticket *AccountTicket
  17762. urlParams_ gensupport.URLParams
  17763. ctx_ context.Context
  17764. header_ http.Header
  17765. }
  17766. // CreateAccountTicket: Creates an account ticket.
  17767. func (r *ProvisioningService) CreateAccountTicket(accountticket *AccountTicket) *ProvisioningCreateAccountTicketCall {
  17768. c := &ProvisioningCreateAccountTicketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17769. c.accountticket = accountticket
  17770. return c
  17771. }
  17772. // Fields allows partial responses to be retrieved. See
  17773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17774. // for more information.
  17775. func (c *ProvisioningCreateAccountTicketCall) Fields(s ...googleapi.Field) *ProvisioningCreateAccountTicketCall {
  17776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17777. return c
  17778. }
  17779. // Context sets the context to be used in this call's Do method. Any
  17780. // pending HTTP request will be aborted if the provided context is
  17781. // canceled.
  17782. func (c *ProvisioningCreateAccountTicketCall) Context(ctx context.Context) *ProvisioningCreateAccountTicketCall {
  17783. c.ctx_ = ctx
  17784. return c
  17785. }
  17786. // Header returns an http.Header that can be modified by the caller to
  17787. // add HTTP headers to the request.
  17788. func (c *ProvisioningCreateAccountTicketCall) Header() http.Header {
  17789. if c.header_ == nil {
  17790. c.header_ = make(http.Header)
  17791. }
  17792. return c.header_
  17793. }
  17794. func (c *ProvisioningCreateAccountTicketCall) doRequest(alt string) (*http.Response, error) {
  17795. reqHeaders := make(http.Header)
  17796. for k, v := range c.header_ {
  17797. reqHeaders[k] = v
  17798. }
  17799. reqHeaders.Set("User-Agent", c.s.userAgent())
  17800. var body io.Reader = nil
  17801. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountticket)
  17802. if err != nil {
  17803. return nil, err
  17804. }
  17805. reqHeaders.Set("Content-Type", "application/json")
  17806. c.urlParams_.Set("alt", alt)
  17807. c.urlParams_.Set("prettyPrint", "false")
  17808. urls := googleapi.ResolveRelative(c.s.BasePath, "provisioning/createAccountTicket")
  17809. urls += "?" + c.urlParams_.Encode()
  17810. req, err := http.NewRequest("POST", urls, body)
  17811. if err != nil {
  17812. return nil, err
  17813. }
  17814. req.Header = reqHeaders
  17815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17816. }
  17817. // Do executes the "analytics.provisioning.createAccountTicket" call.
  17818. // Exactly one of *AccountTicket or error will be non-nil. Any non-2xx
  17819. // status code is an error. Response headers are in either
  17820. // *AccountTicket.ServerResponse.Header or (if a response was returned
  17821. // at all) in error.(*googleapi.Error).Header. Use
  17822. // googleapi.IsNotModified to check whether the returned error was
  17823. // because http.StatusNotModified was returned.
  17824. func (c *ProvisioningCreateAccountTicketCall) Do(opts ...googleapi.CallOption) (*AccountTicket, error) {
  17825. gensupport.SetOptions(c.urlParams_, opts...)
  17826. res, err := c.doRequest("json")
  17827. if res != nil && res.StatusCode == http.StatusNotModified {
  17828. if res.Body != nil {
  17829. res.Body.Close()
  17830. }
  17831. return nil, &googleapi.Error{
  17832. Code: res.StatusCode,
  17833. Header: res.Header,
  17834. }
  17835. }
  17836. if err != nil {
  17837. return nil, err
  17838. }
  17839. defer googleapi.CloseBody(res)
  17840. if err := googleapi.CheckResponse(res); err != nil {
  17841. return nil, err
  17842. }
  17843. ret := &AccountTicket{
  17844. ServerResponse: googleapi.ServerResponse{
  17845. Header: res.Header,
  17846. HTTPStatusCode: res.StatusCode,
  17847. },
  17848. }
  17849. target := &ret
  17850. if err := gensupport.DecodeResponse(target, res); err != nil {
  17851. return nil, err
  17852. }
  17853. return ret, nil
  17854. // {
  17855. // "description": "Creates an account ticket.",
  17856. // "httpMethod": "POST",
  17857. // "id": "analytics.provisioning.createAccountTicket",
  17858. // "path": "provisioning/createAccountTicket",
  17859. // "request": {
  17860. // "$ref": "AccountTicket"
  17861. // },
  17862. // "response": {
  17863. // "$ref": "AccountTicket"
  17864. // },
  17865. // "scopes": [
  17866. // "https://www.googleapis.com/auth/analytics.provision"
  17867. // ]
  17868. // }
  17869. }
  17870. // method id "analytics.provisioning.createAccountTree":
  17871. type ProvisioningCreateAccountTreeCall struct {
  17872. s *Service
  17873. accounttreerequest *AccountTreeRequest
  17874. urlParams_ gensupport.URLParams
  17875. ctx_ context.Context
  17876. header_ http.Header
  17877. }
  17878. // CreateAccountTree: Provision account.
  17879. func (r *ProvisioningService) CreateAccountTree(accounttreerequest *AccountTreeRequest) *ProvisioningCreateAccountTreeCall {
  17880. c := &ProvisioningCreateAccountTreeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17881. c.accounttreerequest = accounttreerequest
  17882. return c
  17883. }
  17884. // Fields allows partial responses to be retrieved. See
  17885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17886. // for more information.
  17887. func (c *ProvisioningCreateAccountTreeCall) Fields(s ...googleapi.Field) *ProvisioningCreateAccountTreeCall {
  17888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17889. return c
  17890. }
  17891. // Context sets the context to be used in this call's Do method. Any
  17892. // pending HTTP request will be aborted if the provided context is
  17893. // canceled.
  17894. func (c *ProvisioningCreateAccountTreeCall) Context(ctx context.Context) *ProvisioningCreateAccountTreeCall {
  17895. c.ctx_ = ctx
  17896. return c
  17897. }
  17898. // Header returns an http.Header that can be modified by the caller to
  17899. // add HTTP headers to the request.
  17900. func (c *ProvisioningCreateAccountTreeCall) Header() http.Header {
  17901. if c.header_ == nil {
  17902. c.header_ = make(http.Header)
  17903. }
  17904. return c.header_
  17905. }
  17906. func (c *ProvisioningCreateAccountTreeCall) doRequest(alt string) (*http.Response, error) {
  17907. reqHeaders := make(http.Header)
  17908. for k, v := range c.header_ {
  17909. reqHeaders[k] = v
  17910. }
  17911. reqHeaders.Set("User-Agent", c.s.userAgent())
  17912. var body io.Reader = nil
  17913. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttreerequest)
  17914. if err != nil {
  17915. return nil, err
  17916. }
  17917. reqHeaders.Set("Content-Type", "application/json")
  17918. c.urlParams_.Set("alt", alt)
  17919. c.urlParams_.Set("prettyPrint", "false")
  17920. urls := googleapi.ResolveRelative(c.s.BasePath, "provisioning/createAccountTree")
  17921. urls += "?" + c.urlParams_.Encode()
  17922. req, err := http.NewRequest("POST", urls, body)
  17923. if err != nil {
  17924. return nil, err
  17925. }
  17926. req.Header = reqHeaders
  17927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17928. }
  17929. // Do executes the "analytics.provisioning.createAccountTree" call.
  17930. // Exactly one of *AccountTreeResponse or error will be non-nil. Any
  17931. // non-2xx status code is an error. Response headers are in either
  17932. // *AccountTreeResponse.ServerResponse.Header or (if a response was
  17933. // returned at all) in error.(*googleapi.Error).Header. Use
  17934. // googleapi.IsNotModified to check whether the returned error was
  17935. // because http.StatusNotModified was returned.
  17936. func (c *ProvisioningCreateAccountTreeCall) Do(opts ...googleapi.CallOption) (*AccountTreeResponse, error) {
  17937. gensupport.SetOptions(c.urlParams_, opts...)
  17938. res, err := c.doRequest("json")
  17939. if res != nil && res.StatusCode == http.StatusNotModified {
  17940. if res.Body != nil {
  17941. res.Body.Close()
  17942. }
  17943. return nil, &googleapi.Error{
  17944. Code: res.StatusCode,
  17945. Header: res.Header,
  17946. }
  17947. }
  17948. if err != nil {
  17949. return nil, err
  17950. }
  17951. defer googleapi.CloseBody(res)
  17952. if err := googleapi.CheckResponse(res); err != nil {
  17953. return nil, err
  17954. }
  17955. ret := &AccountTreeResponse{
  17956. ServerResponse: googleapi.ServerResponse{
  17957. Header: res.Header,
  17958. HTTPStatusCode: res.StatusCode,
  17959. },
  17960. }
  17961. target := &ret
  17962. if err := gensupport.DecodeResponse(target, res); err != nil {
  17963. return nil, err
  17964. }
  17965. return ret, nil
  17966. // {
  17967. // "description": "Provision account.",
  17968. // "httpMethod": "POST",
  17969. // "id": "analytics.provisioning.createAccountTree",
  17970. // "path": "provisioning/createAccountTree",
  17971. // "request": {
  17972. // "$ref": "AccountTreeRequest"
  17973. // },
  17974. // "response": {
  17975. // "$ref": "AccountTreeResponse"
  17976. // },
  17977. // "scopes": [
  17978. // "https://www.googleapis.com/auth/analytics.provision"
  17979. // ]
  17980. // }
  17981. }
  17982. // method id "analytics.userDeletion.userDeletionRequest.upsert":
  17983. type UserDeletionUserDeletionRequestUpsertCall struct {
  17984. s *Service
  17985. userdeletionrequest *UserDeletionRequest
  17986. urlParams_ gensupport.URLParams
  17987. ctx_ context.Context
  17988. header_ http.Header
  17989. }
  17990. // Upsert: Insert or update a user deletion requests.
  17991. func (r *UserDeletionUserDeletionRequestService) Upsert(userdeletionrequest *UserDeletionRequest) *UserDeletionUserDeletionRequestUpsertCall {
  17992. c := &UserDeletionUserDeletionRequestUpsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17993. c.userdeletionrequest = userdeletionrequest
  17994. return c
  17995. }
  17996. // Fields allows partial responses to be retrieved. See
  17997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17998. // for more information.
  17999. func (c *UserDeletionUserDeletionRequestUpsertCall) Fields(s ...googleapi.Field) *UserDeletionUserDeletionRequestUpsertCall {
  18000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18001. return c
  18002. }
  18003. // Context sets the context to be used in this call's Do method. Any
  18004. // pending HTTP request will be aborted if the provided context is
  18005. // canceled.
  18006. func (c *UserDeletionUserDeletionRequestUpsertCall) Context(ctx context.Context) *UserDeletionUserDeletionRequestUpsertCall {
  18007. c.ctx_ = ctx
  18008. return c
  18009. }
  18010. // Header returns an http.Header that can be modified by the caller to
  18011. // add HTTP headers to the request.
  18012. func (c *UserDeletionUserDeletionRequestUpsertCall) Header() http.Header {
  18013. if c.header_ == nil {
  18014. c.header_ = make(http.Header)
  18015. }
  18016. return c.header_
  18017. }
  18018. func (c *UserDeletionUserDeletionRequestUpsertCall) doRequest(alt string) (*http.Response, error) {
  18019. reqHeaders := make(http.Header)
  18020. for k, v := range c.header_ {
  18021. reqHeaders[k] = v
  18022. }
  18023. reqHeaders.Set("User-Agent", c.s.userAgent())
  18024. var body io.Reader = nil
  18025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userdeletionrequest)
  18026. if err != nil {
  18027. return nil, err
  18028. }
  18029. reqHeaders.Set("Content-Type", "application/json")
  18030. c.urlParams_.Set("alt", alt)
  18031. c.urlParams_.Set("prettyPrint", "false")
  18032. urls := googleapi.ResolveRelative(c.s.BasePath, "userDeletion/userDeletionRequests:upsert")
  18033. urls += "?" + c.urlParams_.Encode()
  18034. req, err := http.NewRequest("POST", urls, body)
  18035. if err != nil {
  18036. return nil, err
  18037. }
  18038. req.Header = reqHeaders
  18039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18040. }
  18041. // Do executes the "analytics.userDeletion.userDeletionRequest.upsert" call.
  18042. // Exactly one of *UserDeletionRequest or error will be non-nil. Any
  18043. // non-2xx status code is an error. Response headers are in either
  18044. // *UserDeletionRequest.ServerResponse.Header or (if a response was
  18045. // returned at all) in error.(*googleapi.Error).Header. Use
  18046. // googleapi.IsNotModified to check whether the returned error was
  18047. // because http.StatusNotModified was returned.
  18048. func (c *UserDeletionUserDeletionRequestUpsertCall) Do(opts ...googleapi.CallOption) (*UserDeletionRequest, error) {
  18049. gensupport.SetOptions(c.urlParams_, opts...)
  18050. res, err := c.doRequest("json")
  18051. if res != nil && res.StatusCode == http.StatusNotModified {
  18052. if res.Body != nil {
  18053. res.Body.Close()
  18054. }
  18055. return nil, &googleapi.Error{
  18056. Code: res.StatusCode,
  18057. Header: res.Header,
  18058. }
  18059. }
  18060. if err != nil {
  18061. return nil, err
  18062. }
  18063. defer googleapi.CloseBody(res)
  18064. if err := googleapi.CheckResponse(res); err != nil {
  18065. return nil, err
  18066. }
  18067. ret := &UserDeletionRequest{
  18068. ServerResponse: googleapi.ServerResponse{
  18069. Header: res.Header,
  18070. HTTPStatusCode: res.StatusCode,
  18071. },
  18072. }
  18073. target := &ret
  18074. if err := gensupport.DecodeResponse(target, res); err != nil {
  18075. return nil, err
  18076. }
  18077. return ret, nil
  18078. // {
  18079. // "description": "Insert or update a user deletion requests.",
  18080. // "httpMethod": "POST",
  18081. // "id": "analytics.userDeletion.userDeletionRequest.upsert",
  18082. // "path": "userDeletion/userDeletionRequests:upsert",
  18083. // "request": {
  18084. // "$ref": "UserDeletionRequest"
  18085. // },
  18086. // "response": {
  18087. // "$ref": "UserDeletionRequest"
  18088. // },
  18089. // "scopes": [
  18090. // "https://www.googleapis.com/auth/analytics.user.deletion"
  18091. // ]
  18092. // }
  18093. }