games-gen.go 409 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816
  1. // Package games provides access to the Google Play Game Services API.
  2. //
  3. // See https://developers.google.com/games/services/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/games/v1"
  8. // ...
  9. // gamesService, err := games.New(oauthHttpClient)
  10. package games // import "google.golang.org/api/games/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "games:v1"
  41. const apiName = "games"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/games/v1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage its own configuration data in your Google Drive
  47. DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata"
  48. // Share your Google+ profile information and view and manage your game
  49. // activity
  50. GamesScope = "https://www.googleapis.com/auth/games"
  51. // Know the list of people in your circles, your age range, and language
  52. PlusLoginScope = "https://www.googleapis.com/auth/plus.login"
  53. )
  54. func New(client *http.Client) (*Service, error) {
  55. if client == nil {
  56. return nil, errors.New("client is nil")
  57. }
  58. s := &Service{client: client, BasePath: basePath}
  59. s.AchievementDefinitions = NewAchievementDefinitionsService(s)
  60. s.Achievements = NewAchievementsService(s)
  61. s.Applications = NewApplicationsService(s)
  62. s.Events = NewEventsService(s)
  63. s.Leaderboards = NewLeaderboardsService(s)
  64. s.Metagame = NewMetagameService(s)
  65. s.Players = NewPlayersService(s)
  66. s.Pushtokens = NewPushtokensService(s)
  67. s.QuestMilestones = NewQuestMilestonesService(s)
  68. s.Quests = NewQuestsService(s)
  69. s.Revisions = NewRevisionsService(s)
  70. s.Rooms = NewRoomsService(s)
  71. s.Scores = NewScoresService(s)
  72. s.Snapshots = NewSnapshotsService(s)
  73. s.TurnBasedMatches = NewTurnBasedMatchesService(s)
  74. return s, nil
  75. }
  76. type Service struct {
  77. client *http.Client
  78. BasePath string // API endpoint base URL
  79. UserAgent string // optional additional User-Agent fragment
  80. AchievementDefinitions *AchievementDefinitionsService
  81. Achievements *AchievementsService
  82. Applications *ApplicationsService
  83. Events *EventsService
  84. Leaderboards *LeaderboardsService
  85. Metagame *MetagameService
  86. Players *PlayersService
  87. Pushtokens *PushtokensService
  88. QuestMilestones *QuestMilestonesService
  89. Quests *QuestsService
  90. Revisions *RevisionsService
  91. Rooms *RoomsService
  92. Scores *ScoresService
  93. Snapshots *SnapshotsService
  94. TurnBasedMatches *TurnBasedMatchesService
  95. }
  96. func (s *Service) userAgent() string {
  97. if s.UserAgent == "" {
  98. return googleapi.UserAgent
  99. }
  100. return googleapi.UserAgent + " " + s.UserAgent
  101. }
  102. func NewAchievementDefinitionsService(s *Service) *AchievementDefinitionsService {
  103. rs := &AchievementDefinitionsService{s: s}
  104. return rs
  105. }
  106. type AchievementDefinitionsService struct {
  107. s *Service
  108. }
  109. func NewAchievementsService(s *Service) *AchievementsService {
  110. rs := &AchievementsService{s: s}
  111. return rs
  112. }
  113. type AchievementsService struct {
  114. s *Service
  115. }
  116. func NewApplicationsService(s *Service) *ApplicationsService {
  117. rs := &ApplicationsService{s: s}
  118. return rs
  119. }
  120. type ApplicationsService struct {
  121. s *Service
  122. }
  123. func NewEventsService(s *Service) *EventsService {
  124. rs := &EventsService{s: s}
  125. return rs
  126. }
  127. type EventsService struct {
  128. s *Service
  129. }
  130. func NewLeaderboardsService(s *Service) *LeaderboardsService {
  131. rs := &LeaderboardsService{s: s}
  132. return rs
  133. }
  134. type LeaderboardsService struct {
  135. s *Service
  136. }
  137. func NewMetagameService(s *Service) *MetagameService {
  138. rs := &MetagameService{s: s}
  139. return rs
  140. }
  141. type MetagameService struct {
  142. s *Service
  143. }
  144. func NewPlayersService(s *Service) *PlayersService {
  145. rs := &PlayersService{s: s}
  146. return rs
  147. }
  148. type PlayersService struct {
  149. s *Service
  150. }
  151. func NewPushtokensService(s *Service) *PushtokensService {
  152. rs := &PushtokensService{s: s}
  153. return rs
  154. }
  155. type PushtokensService struct {
  156. s *Service
  157. }
  158. func NewQuestMilestonesService(s *Service) *QuestMilestonesService {
  159. rs := &QuestMilestonesService{s: s}
  160. return rs
  161. }
  162. type QuestMilestonesService struct {
  163. s *Service
  164. }
  165. func NewQuestsService(s *Service) *QuestsService {
  166. rs := &QuestsService{s: s}
  167. return rs
  168. }
  169. type QuestsService struct {
  170. s *Service
  171. }
  172. func NewRevisionsService(s *Service) *RevisionsService {
  173. rs := &RevisionsService{s: s}
  174. return rs
  175. }
  176. type RevisionsService struct {
  177. s *Service
  178. }
  179. func NewRoomsService(s *Service) *RoomsService {
  180. rs := &RoomsService{s: s}
  181. return rs
  182. }
  183. type RoomsService struct {
  184. s *Service
  185. }
  186. func NewScoresService(s *Service) *ScoresService {
  187. rs := &ScoresService{s: s}
  188. return rs
  189. }
  190. type ScoresService struct {
  191. s *Service
  192. }
  193. func NewSnapshotsService(s *Service) *SnapshotsService {
  194. rs := &SnapshotsService{s: s}
  195. return rs
  196. }
  197. type SnapshotsService struct {
  198. s *Service
  199. }
  200. func NewTurnBasedMatchesService(s *Service) *TurnBasedMatchesService {
  201. rs := &TurnBasedMatchesService{s: s}
  202. return rs
  203. }
  204. type TurnBasedMatchesService struct {
  205. s *Service
  206. }
  207. // AchievementDefinition: This is a JSON template for an achievement
  208. // definition object.
  209. type AchievementDefinition struct {
  210. // AchievementType: The type of the achievement.
  211. // Possible values are:
  212. // - "STANDARD" - Achievement is either locked or unlocked.
  213. // - "INCREMENTAL" - Achievement is incremental.
  214. AchievementType string `json:"achievementType,omitempty"`
  215. // Description: The description of the achievement.
  216. Description string `json:"description,omitempty"`
  217. // ExperiencePoints: Experience points which will be earned when
  218. // unlocking this achievement.
  219. ExperiencePoints int64 `json:"experiencePoints,omitempty,string"`
  220. // FormattedTotalSteps: The total steps for an incremental achievement
  221. // as a string.
  222. FormattedTotalSteps string `json:"formattedTotalSteps,omitempty"`
  223. // Id: The ID of the achievement.
  224. Id string `json:"id,omitempty"`
  225. // InitialState: The initial state of the achievement.
  226. // Possible values are:
  227. // - "HIDDEN" - Achievement is hidden.
  228. // - "REVEALED" - Achievement is revealed.
  229. // - "UNLOCKED" - Achievement is unlocked.
  230. InitialState string `json:"initialState,omitempty"`
  231. // IsRevealedIconUrlDefault: Indicates whether the revealed icon image
  232. // being returned is a default image, or is provided by the game.
  233. IsRevealedIconUrlDefault bool `json:"isRevealedIconUrlDefault,omitempty"`
  234. // IsUnlockedIconUrlDefault: Indicates whether the unlocked icon image
  235. // being returned is a default image, or is game-provided.
  236. IsUnlockedIconUrlDefault bool `json:"isUnlockedIconUrlDefault,omitempty"`
  237. // Kind: Uniquely identifies the type of this resource. Value is always
  238. // the fixed string games#achievementDefinition.
  239. Kind string `json:"kind,omitempty"`
  240. // Name: The name of the achievement.
  241. Name string `json:"name,omitempty"`
  242. // RevealedIconUrl: The image URL for the revealed achievement icon.
  243. RevealedIconUrl string `json:"revealedIconUrl,omitempty"`
  244. // TotalSteps: The total steps for an incremental achievement.
  245. TotalSteps int64 `json:"totalSteps,omitempty"`
  246. // UnlockedIconUrl: The image URL for the unlocked achievement icon.
  247. UnlockedIconUrl string `json:"unlockedIconUrl,omitempty"`
  248. // ForceSendFields is a list of field names (e.g. "AchievementType") to
  249. // unconditionally include in API requests. By default, fields with
  250. // empty values are omitted from API requests. However, any non-pointer,
  251. // non-interface field appearing in ForceSendFields will be sent to the
  252. // server regardless of whether the field is empty or not. This may be
  253. // used to include empty fields in Patch requests.
  254. ForceSendFields []string `json:"-"`
  255. }
  256. func (s *AchievementDefinition) MarshalJSON() ([]byte, error) {
  257. type noMethod AchievementDefinition
  258. raw := noMethod(*s)
  259. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  260. }
  261. // AchievementDefinitionsListResponse: This is a JSON template for a
  262. // list of achievement definition objects.
  263. type AchievementDefinitionsListResponse struct {
  264. // Items: The achievement definitions.
  265. Items []*AchievementDefinition `json:"items,omitempty"`
  266. // Kind: Uniquely identifies the type of this resource. Value is always
  267. // the fixed string games#achievementDefinitionsListResponse.
  268. Kind string `json:"kind,omitempty"`
  269. // NextPageToken: Token corresponding to the next page of results.
  270. NextPageToken string `json:"nextPageToken,omitempty"`
  271. // ServerResponse contains the HTTP response code and headers from the
  272. // server.
  273. googleapi.ServerResponse `json:"-"`
  274. // ForceSendFields is a list of field names (e.g. "Items") to
  275. // unconditionally include in API requests. By default, fields with
  276. // empty values are omitted from API requests. However, any non-pointer,
  277. // non-interface field appearing in ForceSendFields will be sent to the
  278. // server regardless of whether the field is empty or not. This may be
  279. // used to include empty fields in Patch requests.
  280. ForceSendFields []string `json:"-"`
  281. }
  282. func (s *AchievementDefinitionsListResponse) MarshalJSON() ([]byte, error) {
  283. type noMethod AchievementDefinitionsListResponse
  284. raw := noMethod(*s)
  285. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  286. }
  287. // AchievementIncrementResponse: This is a JSON template for an
  288. // achievement increment response
  289. type AchievementIncrementResponse struct {
  290. // CurrentSteps: The current steps recorded for this incremental
  291. // achievement.
  292. CurrentSteps int64 `json:"currentSteps,omitempty"`
  293. // Kind: Uniquely identifies the type of this resource. Value is always
  294. // the fixed string games#achievementIncrementResponse.
  295. Kind string `json:"kind,omitempty"`
  296. // NewlyUnlocked: Whether the the current steps for the achievement has
  297. // reached the number of steps required to unlock.
  298. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  299. // ServerResponse contains the HTTP response code and headers from the
  300. // server.
  301. googleapi.ServerResponse `json:"-"`
  302. // ForceSendFields is a list of field names (e.g. "CurrentSteps") to
  303. // unconditionally include in API requests. By default, fields with
  304. // empty values are omitted from API requests. However, any non-pointer,
  305. // non-interface field appearing in ForceSendFields will be sent to the
  306. // server regardless of whether the field is empty or not. This may be
  307. // used to include empty fields in Patch requests.
  308. ForceSendFields []string `json:"-"`
  309. }
  310. func (s *AchievementIncrementResponse) MarshalJSON() ([]byte, error) {
  311. type noMethod AchievementIncrementResponse
  312. raw := noMethod(*s)
  313. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  314. }
  315. // AchievementRevealResponse: This is a JSON template for an achievement
  316. // reveal response
  317. type AchievementRevealResponse struct {
  318. // CurrentState: The current state of the achievement for which a reveal
  319. // was attempted. This might be UNLOCKED if the achievement was already
  320. // unlocked.
  321. // Possible values are:
  322. // - "REVEALED" - Achievement is revealed.
  323. // - "UNLOCKED" - Achievement is unlocked.
  324. CurrentState string `json:"currentState,omitempty"`
  325. // Kind: Uniquely identifies the type of this resource. Value is always
  326. // the fixed string games#achievementRevealResponse.
  327. Kind string `json:"kind,omitempty"`
  328. // ServerResponse contains the HTTP response code and headers from the
  329. // server.
  330. googleapi.ServerResponse `json:"-"`
  331. // ForceSendFields is a list of field names (e.g. "CurrentState") to
  332. // unconditionally include in API requests. By default, fields with
  333. // empty values are omitted from API requests. However, any non-pointer,
  334. // non-interface field appearing in ForceSendFields will be sent to the
  335. // server regardless of whether the field is empty or not. This may be
  336. // used to include empty fields in Patch requests.
  337. ForceSendFields []string `json:"-"`
  338. }
  339. func (s *AchievementRevealResponse) MarshalJSON() ([]byte, error) {
  340. type noMethod AchievementRevealResponse
  341. raw := noMethod(*s)
  342. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  343. }
  344. // AchievementSetStepsAtLeastResponse: This is a JSON template for an
  345. // achievement set steps at least response.
  346. type AchievementSetStepsAtLeastResponse struct {
  347. // CurrentSteps: The current steps recorded for this incremental
  348. // achievement.
  349. CurrentSteps int64 `json:"currentSteps,omitempty"`
  350. // Kind: Uniquely identifies the type of this resource. Value is always
  351. // the fixed string games#achievementSetStepsAtLeastResponse.
  352. Kind string `json:"kind,omitempty"`
  353. // NewlyUnlocked: Whether the the current steps for the achievement has
  354. // reached the number of steps required to unlock.
  355. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  356. // ServerResponse contains the HTTP response code and headers from the
  357. // server.
  358. googleapi.ServerResponse `json:"-"`
  359. // ForceSendFields is a list of field names (e.g. "CurrentSteps") to
  360. // unconditionally include in API requests. By default, fields with
  361. // empty values are omitted from API requests. However, any non-pointer,
  362. // non-interface field appearing in ForceSendFields will be sent to the
  363. // server regardless of whether the field is empty or not. This may be
  364. // used to include empty fields in Patch requests.
  365. ForceSendFields []string `json:"-"`
  366. }
  367. func (s *AchievementSetStepsAtLeastResponse) MarshalJSON() ([]byte, error) {
  368. type noMethod AchievementSetStepsAtLeastResponse
  369. raw := noMethod(*s)
  370. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  371. }
  372. // AchievementUnlockResponse: This is a JSON template for an achievement
  373. // unlock response
  374. type AchievementUnlockResponse struct {
  375. // Kind: Uniquely identifies the type of this resource. Value is always
  376. // the fixed string games#achievementUnlockResponse.
  377. Kind string `json:"kind,omitempty"`
  378. // NewlyUnlocked: Whether this achievement was newly unlocked (that is,
  379. // whether the unlock request for the achievement was the first for the
  380. // player).
  381. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  382. // ServerResponse contains the HTTP response code and headers from the
  383. // server.
  384. googleapi.ServerResponse `json:"-"`
  385. // ForceSendFields is a list of field names (e.g. "Kind") to
  386. // unconditionally include in API requests. By default, fields with
  387. // empty values are omitted from API requests. However, any non-pointer,
  388. // non-interface field appearing in ForceSendFields will be sent to the
  389. // server regardless of whether the field is empty or not. This may be
  390. // used to include empty fields in Patch requests.
  391. ForceSendFields []string `json:"-"`
  392. }
  393. func (s *AchievementUnlockResponse) MarshalJSON() ([]byte, error) {
  394. type noMethod AchievementUnlockResponse
  395. raw := noMethod(*s)
  396. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  397. }
  398. // AchievementUpdateMultipleRequest: This is a JSON template for a list
  399. // of achievement update requests.
  400. type AchievementUpdateMultipleRequest struct {
  401. // Kind: Uniquely identifies the type of this resource. Value is always
  402. // the fixed string games#achievementUpdateMultipleRequest.
  403. Kind string `json:"kind,omitempty"`
  404. // Updates: The individual achievement update requests.
  405. Updates []*AchievementUpdateRequest `json:"updates,omitempty"`
  406. // ForceSendFields is a list of field names (e.g. "Kind") to
  407. // unconditionally include in API requests. By default, fields with
  408. // empty values are omitted from API requests. However, any non-pointer,
  409. // non-interface field appearing in ForceSendFields will be sent to the
  410. // server regardless of whether the field is empty or not. This may be
  411. // used to include empty fields in Patch requests.
  412. ForceSendFields []string `json:"-"`
  413. }
  414. func (s *AchievementUpdateMultipleRequest) MarshalJSON() ([]byte, error) {
  415. type noMethod AchievementUpdateMultipleRequest
  416. raw := noMethod(*s)
  417. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  418. }
  419. // AchievementUpdateMultipleResponse: This is a JSON template for an
  420. // achievement unlock response.
  421. type AchievementUpdateMultipleResponse struct {
  422. // Kind: Uniquely identifies the type of this resource. Value is always
  423. // the fixed string games#achievementUpdateListResponse.
  424. Kind string `json:"kind,omitempty"`
  425. // UpdatedAchievements: The updated state of the achievements.
  426. UpdatedAchievements []*AchievementUpdateResponse `json:"updatedAchievements,omitempty"`
  427. // ServerResponse contains the HTTP response code and headers from the
  428. // server.
  429. googleapi.ServerResponse `json:"-"`
  430. // ForceSendFields is a list of field names (e.g. "Kind") to
  431. // unconditionally include in API requests. By default, fields with
  432. // empty values are omitted from API requests. However, any non-pointer,
  433. // non-interface field appearing in ForceSendFields will be sent to the
  434. // server regardless of whether the field is empty or not. This may be
  435. // used to include empty fields in Patch requests.
  436. ForceSendFields []string `json:"-"`
  437. }
  438. func (s *AchievementUpdateMultipleResponse) MarshalJSON() ([]byte, error) {
  439. type noMethod AchievementUpdateMultipleResponse
  440. raw := noMethod(*s)
  441. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  442. }
  443. // AchievementUpdateRequest: This is a JSON template for a request to
  444. // update an achievement.
  445. type AchievementUpdateRequest struct {
  446. // AchievementId: The achievement this update is being applied to.
  447. AchievementId string `json:"achievementId,omitempty"`
  448. // IncrementPayload: The payload if an update of type INCREMENT was
  449. // requested for the achievement.
  450. IncrementPayload *GamesAchievementIncrement `json:"incrementPayload,omitempty"`
  451. // Kind: Uniquely identifies the type of this resource. Value is always
  452. // the fixed string games#achievementUpdateRequest.
  453. Kind string `json:"kind,omitempty"`
  454. // SetStepsAtLeastPayload: The payload if an update of type
  455. // SET_STEPS_AT_LEAST was requested for the achievement.
  456. SetStepsAtLeastPayload *GamesAchievementSetStepsAtLeast `json:"setStepsAtLeastPayload,omitempty"`
  457. // UpdateType: The type of update being applied.
  458. // Possible values are:
  459. // - "REVEAL" - Achievement is revealed.
  460. // - "UNLOCK" - Achievement is unlocked.
  461. // - "INCREMENT" - Achievement is incremented.
  462. // - "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the
  463. // passed value.
  464. UpdateType string `json:"updateType,omitempty"`
  465. // ForceSendFields is a list of field names (e.g. "AchievementId") to
  466. // unconditionally include in API requests. By default, fields with
  467. // empty values are omitted from API requests. However, any non-pointer,
  468. // non-interface field appearing in ForceSendFields will be sent to the
  469. // server regardless of whether the field is empty or not. This may be
  470. // used to include empty fields in Patch requests.
  471. ForceSendFields []string `json:"-"`
  472. }
  473. func (s *AchievementUpdateRequest) MarshalJSON() ([]byte, error) {
  474. type noMethod AchievementUpdateRequest
  475. raw := noMethod(*s)
  476. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  477. }
  478. // AchievementUpdateResponse: This is a JSON template for an achievement
  479. // update response.
  480. type AchievementUpdateResponse struct {
  481. // AchievementId: The achievement this update is was applied to.
  482. AchievementId string `json:"achievementId,omitempty"`
  483. // CurrentState: The current state of the achievement.
  484. // Possible values are:
  485. // - "HIDDEN" - Achievement is hidden.
  486. // - "REVEALED" - Achievement is revealed.
  487. // - "UNLOCKED" - Achievement is unlocked.
  488. CurrentState string `json:"currentState,omitempty"`
  489. // CurrentSteps: The current steps recorded for this achievement if it
  490. // is incremental.
  491. CurrentSteps int64 `json:"currentSteps,omitempty"`
  492. // Kind: Uniquely identifies the type of this resource. Value is always
  493. // the fixed string games#achievementUpdateResponse.
  494. Kind string `json:"kind,omitempty"`
  495. // NewlyUnlocked: Whether this achievement was newly unlocked (that is,
  496. // whether the unlock request for the achievement was the first for the
  497. // player).
  498. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  499. // UpdateOccurred: Whether the requested updates actually affected the
  500. // achievement.
  501. UpdateOccurred bool `json:"updateOccurred,omitempty"`
  502. // ForceSendFields is a list of field names (e.g. "AchievementId") to
  503. // unconditionally include in API requests. By default, fields with
  504. // empty values are omitted from API requests. However, any non-pointer,
  505. // non-interface field appearing in ForceSendFields will be sent to the
  506. // server regardless of whether the field is empty or not. This may be
  507. // used to include empty fields in Patch requests.
  508. ForceSendFields []string `json:"-"`
  509. }
  510. func (s *AchievementUpdateResponse) MarshalJSON() ([]byte, error) {
  511. type noMethod AchievementUpdateResponse
  512. raw := noMethod(*s)
  513. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  514. }
  515. // AggregateStats: This is a JSON template for aggregate stats.
  516. type AggregateStats struct {
  517. // Count: The number of messages sent between a pair of peers.
  518. Count int64 `json:"count,omitempty,string"`
  519. // Kind: Uniquely identifies the type of this resource. Value is always
  520. // the fixed string games#aggregateStats.
  521. Kind string `json:"kind,omitempty"`
  522. // Max: The maximum amount.
  523. Max int64 `json:"max,omitempty,string"`
  524. // Min: The minimum amount.
  525. Min int64 `json:"min,omitempty,string"`
  526. // Sum: The total number of bytes sent for messages between a pair of
  527. // peers.
  528. Sum int64 `json:"sum,omitempty,string"`
  529. // ForceSendFields is a list of field names (e.g. "Count") to
  530. // unconditionally include in API requests. By default, fields with
  531. // empty values are omitted from API requests. However, any non-pointer,
  532. // non-interface field appearing in ForceSendFields will be sent to the
  533. // server regardless of whether the field is empty or not. This may be
  534. // used to include empty fields in Patch requests.
  535. ForceSendFields []string `json:"-"`
  536. }
  537. func (s *AggregateStats) MarshalJSON() ([]byte, error) {
  538. type noMethod AggregateStats
  539. raw := noMethod(*s)
  540. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  541. }
  542. // AnonymousPlayer: This is a JSON template for an anonymous player
  543. type AnonymousPlayer struct {
  544. // AvatarImageUrl: The base URL for the image to display for the
  545. // anonymous player.
  546. AvatarImageUrl string `json:"avatarImageUrl,omitempty"`
  547. // DisplayName: The name to display for the anonymous player.
  548. DisplayName string `json:"displayName,omitempty"`
  549. // Kind: Uniquely identifies the type of this resource. Value is always
  550. // the fixed string games#anonymousPlayer.
  551. Kind string `json:"kind,omitempty"`
  552. // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to
  553. // unconditionally include in API requests. By default, fields with
  554. // empty values are omitted from API requests. However, any non-pointer,
  555. // non-interface field appearing in ForceSendFields will be sent to the
  556. // server regardless of whether the field is empty or not. This may be
  557. // used to include empty fields in Patch requests.
  558. ForceSendFields []string `json:"-"`
  559. }
  560. func (s *AnonymousPlayer) MarshalJSON() ([]byte, error) {
  561. type noMethod AnonymousPlayer
  562. raw := noMethod(*s)
  563. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  564. }
  565. // Application: This is a JSON template for the Application resource.
  566. type Application struct {
  567. // AchievementCount: The number of achievements visible to the currently
  568. // authenticated player.
  569. AchievementCount int64 `json:"achievement_count,omitempty"`
  570. // Assets: The assets of the application.
  571. Assets []*ImageAsset `json:"assets,omitempty"`
  572. // Author: The author of the application.
  573. Author string `json:"author,omitempty"`
  574. // Category: The category of the application.
  575. Category *ApplicationCategory `json:"category,omitempty"`
  576. // Description: The description of the application.
  577. Description string `json:"description,omitempty"`
  578. // EnabledFeatures: A list of features that have been enabled for the
  579. // application.
  580. // Possible values are:
  581. // - "SNAPSHOTS" - Snapshots has been enabled
  582. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  583. // Id: The ID of the application.
  584. Id string `json:"id,omitempty"`
  585. // Instances: The instances of the application.
  586. Instances []*Instance `json:"instances,omitempty"`
  587. // Kind: Uniquely identifies the type of this resource. Value is always
  588. // the fixed string games#application.
  589. Kind string `json:"kind,omitempty"`
  590. // LastUpdatedTimestamp: The last updated timestamp of the application.
  591. LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"`
  592. // LeaderboardCount: The number of leaderboards visible to the currently
  593. // authenticated player.
  594. LeaderboardCount int64 `json:"leaderboard_count,omitempty"`
  595. // Name: The name of the application.
  596. Name string `json:"name,omitempty"`
  597. // ThemeColor: A hint to the client UI for what color to use as an
  598. // app-themed color. The color is given as an RGB triplet (e.g.
  599. // "E0E0E0").
  600. ThemeColor string `json:"themeColor,omitempty"`
  601. // ServerResponse contains the HTTP response code and headers from the
  602. // server.
  603. googleapi.ServerResponse `json:"-"`
  604. // ForceSendFields is a list of field names (e.g. "AchievementCount") to
  605. // unconditionally include in API requests. By default, fields with
  606. // empty values are omitted from API requests. However, any non-pointer,
  607. // non-interface field appearing in ForceSendFields will be sent to the
  608. // server regardless of whether the field is empty or not. This may be
  609. // used to include empty fields in Patch requests.
  610. ForceSendFields []string `json:"-"`
  611. }
  612. func (s *Application) MarshalJSON() ([]byte, error) {
  613. type noMethod Application
  614. raw := noMethod(*s)
  615. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  616. }
  617. // ApplicationCategory: This is a JSON template for an application
  618. // category object.
  619. type ApplicationCategory struct {
  620. // Kind: Uniquely identifies the type of this resource. Value is always
  621. // the fixed string games#applicationCategory.
  622. Kind string `json:"kind,omitempty"`
  623. // Primary: The primary category.
  624. Primary string `json:"primary,omitempty"`
  625. // Secondary: The secondary category.
  626. Secondary string `json:"secondary,omitempty"`
  627. // ForceSendFields is a list of field names (e.g. "Kind") to
  628. // unconditionally include in API requests. By default, fields with
  629. // empty values are omitted from API requests. However, any non-pointer,
  630. // non-interface field appearing in ForceSendFields will be sent to the
  631. // server regardless of whether the field is empty or not. This may be
  632. // used to include empty fields in Patch requests.
  633. ForceSendFields []string `json:"-"`
  634. }
  635. func (s *ApplicationCategory) MarshalJSON() ([]byte, error) {
  636. type noMethod ApplicationCategory
  637. raw := noMethod(*s)
  638. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  639. }
  640. // ApplicationVerifyResponse: This is a JSON template for a third party
  641. // application verification response resource.
  642. type ApplicationVerifyResponse struct {
  643. // Kind: Uniquely identifies the type of this resource. Value is always
  644. // the fixed string games#applicationVerifyResponse.
  645. Kind string `json:"kind,omitempty"`
  646. // PlayerId: The ID of the player that was issued the auth token used in
  647. // this request.
  648. PlayerId string `json:"player_id,omitempty"`
  649. // ServerResponse contains the HTTP response code and headers from the
  650. // server.
  651. googleapi.ServerResponse `json:"-"`
  652. // ForceSendFields is a list of field names (e.g. "Kind") to
  653. // unconditionally include in API requests. By default, fields with
  654. // empty values are omitted from API requests. However, any non-pointer,
  655. // non-interface field appearing in ForceSendFields will be sent to the
  656. // server regardless of whether the field is empty or not. This may be
  657. // used to include empty fields in Patch requests.
  658. ForceSendFields []string `json:"-"`
  659. }
  660. func (s *ApplicationVerifyResponse) MarshalJSON() ([]byte, error) {
  661. type noMethod ApplicationVerifyResponse
  662. raw := noMethod(*s)
  663. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  664. }
  665. // Category: This is a JSON template for data related to individual game
  666. // categories.
  667. type Category struct {
  668. // Category: The category name.
  669. Category string `json:"category,omitempty"`
  670. // ExperiencePoints: Experience points earned in this category.
  671. ExperiencePoints int64 `json:"experiencePoints,omitempty,string"`
  672. // Kind: Uniquely identifies the type of this resource. Value is always
  673. // the fixed string games#category.
  674. Kind string `json:"kind,omitempty"`
  675. // ForceSendFields is a list of field names (e.g. "Category") to
  676. // unconditionally include in API requests. By default, fields with
  677. // empty values are omitted from API requests. However, any non-pointer,
  678. // non-interface field appearing in ForceSendFields will be sent to the
  679. // server regardless of whether the field is empty or not. This may be
  680. // used to include empty fields in Patch requests.
  681. ForceSendFields []string `json:"-"`
  682. }
  683. func (s *Category) MarshalJSON() ([]byte, error) {
  684. type noMethod Category
  685. raw := noMethod(*s)
  686. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  687. }
  688. // CategoryListResponse: This is a JSON template for a list of category
  689. // data objects.
  690. type CategoryListResponse struct {
  691. // Items: The list of categories with usage data.
  692. Items []*Category `json:"items,omitempty"`
  693. // Kind: Uniquely identifies the type of this resource. Value is always
  694. // the fixed string games#categoryListResponse.
  695. Kind string `json:"kind,omitempty"`
  696. // NextPageToken: Token corresponding to the next page of results.
  697. NextPageToken string `json:"nextPageToken,omitempty"`
  698. // ServerResponse contains the HTTP response code and headers from the
  699. // server.
  700. googleapi.ServerResponse `json:"-"`
  701. // ForceSendFields is a list of field names (e.g. "Items") to
  702. // unconditionally include in API requests. By default, fields with
  703. // empty values are omitted from API requests. However, any non-pointer,
  704. // non-interface field appearing in ForceSendFields will be sent to the
  705. // server regardless of whether the field is empty or not. This may be
  706. // used to include empty fields in Patch requests.
  707. ForceSendFields []string `json:"-"`
  708. }
  709. func (s *CategoryListResponse) MarshalJSON() ([]byte, error) {
  710. type noMethod CategoryListResponse
  711. raw := noMethod(*s)
  712. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  713. }
  714. // EventBatchRecordFailure: This is a JSON template for a batch update
  715. // failure resource.
  716. type EventBatchRecordFailure struct {
  717. // FailureCause: The cause for the update failure.
  718. // Possible values are:
  719. // - "TOO_LARGE": A batch request was issued with more events than are
  720. // allowed in a single batch.
  721. // - "TIME_PERIOD_EXPIRED": A batch was sent with data too far in the
  722. // past to record.
  723. // - "TIME_PERIOD_SHORT": A batch was sent with a time range that was
  724. // too short.
  725. // - "TIME_PERIOD_LONG": A batch was sent with a time range that was too
  726. // long.
  727. // - "ALREADY_UPDATED": An attempt was made to record a batch of data
  728. // which was already seen.
  729. // - "RECORD_RATE_HIGH": An attempt was made to record data faster than
  730. // the server will apply updates.
  731. FailureCause string `json:"failureCause,omitempty"`
  732. // Kind: Uniquely identifies the type of this resource. Value is always
  733. // the fixed string games#eventBatchRecordFailure.
  734. Kind string `json:"kind,omitempty"`
  735. // Range: The time range which was rejected; empty for a request-wide
  736. // failure.
  737. Range *EventPeriodRange `json:"range,omitempty"`
  738. // ForceSendFields is a list of field names (e.g. "FailureCause") to
  739. // unconditionally include in API requests. By default, fields with
  740. // empty values are omitted from API requests. However, any non-pointer,
  741. // non-interface field appearing in ForceSendFields will be sent to the
  742. // server regardless of whether the field is empty or not. This may be
  743. // used to include empty fields in Patch requests.
  744. ForceSendFields []string `json:"-"`
  745. }
  746. func (s *EventBatchRecordFailure) MarshalJSON() ([]byte, error) {
  747. type noMethod EventBatchRecordFailure
  748. raw := noMethod(*s)
  749. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  750. }
  751. // EventChild: This is a JSON template for an event child relationship
  752. // resource.
  753. type EventChild struct {
  754. // ChildId: The ID of the child event.
  755. ChildId string `json:"childId,omitempty"`
  756. // Kind: Uniquely identifies the type of this resource. Value is always
  757. // the fixed string games#eventChild.
  758. Kind string `json:"kind,omitempty"`
  759. // ForceSendFields is a list of field names (e.g. "ChildId") to
  760. // unconditionally include in API requests. By default, fields with
  761. // empty values are omitted from API requests. However, any non-pointer,
  762. // non-interface field appearing in ForceSendFields will be sent to the
  763. // server regardless of whether the field is empty or not. This may be
  764. // used to include empty fields in Patch requests.
  765. ForceSendFields []string `json:"-"`
  766. }
  767. func (s *EventChild) MarshalJSON() ([]byte, error) {
  768. type noMethod EventChild
  769. raw := noMethod(*s)
  770. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  771. }
  772. // EventDefinition: This is a JSON template for an event definition
  773. // resource.
  774. type EventDefinition struct {
  775. // ChildEvents: A list of events that are a child of this event.
  776. ChildEvents []*EventChild `json:"childEvents,omitempty"`
  777. // Description: Description of what this event represents.
  778. Description string `json:"description,omitempty"`
  779. // DisplayName: The name to display for the event.
  780. DisplayName string `json:"displayName,omitempty"`
  781. // Id: The ID of the event.
  782. Id string `json:"id,omitempty"`
  783. // ImageUrl: The base URL for the image that represents the event.
  784. ImageUrl string `json:"imageUrl,omitempty"`
  785. // IsDefaultImageUrl: Indicates whether the icon image being returned is
  786. // a default image, or is game-provided.
  787. IsDefaultImageUrl bool `json:"isDefaultImageUrl,omitempty"`
  788. // Kind: Uniquely identifies the type of this resource. Value is always
  789. // the fixed string games#eventDefinition.
  790. Kind string `json:"kind,omitempty"`
  791. // Visibility: The visibility of event being tracked in this
  792. // definition.
  793. // Possible values are:
  794. // - "REVEALED": This event should be visible to all users.
  795. // - "HIDDEN": This event should only be shown to users that have
  796. // recorded this event at least once.
  797. Visibility string `json:"visibility,omitempty"`
  798. // ForceSendFields is a list of field names (e.g. "ChildEvents") to
  799. // unconditionally include in API requests. By default, fields with
  800. // empty values are omitted from API requests. However, any non-pointer,
  801. // non-interface field appearing in ForceSendFields will be sent to the
  802. // server regardless of whether the field is empty or not. This may be
  803. // used to include empty fields in Patch requests.
  804. ForceSendFields []string `json:"-"`
  805. }
  806. func (s *EventDefinition) MarshalJSON() ([]byte, error) {
  807. type noMethod EventDefinition
  808. raw := noMethod(*s)
  809. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  810. }
  811. // EventDefinitionListResponse: This is a JSON template for a
  812. // ListDefinitions response.
  813. type EventDefinitionListResponse struct {
  814. // Items: The event definitions.
  815. Items []*EventDefinition `json:"items,omitempty"`
  816. // Kind: Uniquely identifies the type of this resource. Value is always
  817. // the fixed string games#eventDefinitionListResponse.
  818. Kind string `json:"kind,omitempty"`
  819. // NextPageToken: The pagination token for the next page of results.
  820. NextPageToken string `json:"nextPageToken,omitempty"`
  821. // ServerResponse contains the HTTP response code and headers from the
  822. // server.
  823. googleapi.ServerResponse `json:"-"`
  824. // ForceSendFields is a list of field names (e.g. "Items") to
  825. // unconditionally include in API requests. By default, fields with
  826. // empty values are omitted from API requests. However, any non-pointer,
  827. // non-interface field appearing in ForceSendFields will be sent to the
  828. // server regardless of whether the field is empty or not. This may be
  829. // used to include empty fields in Patch requests.
  830. ForceSendFields []string `json:"-"`
  831. }
  832. func (s *EventDefinitionListResponse) MarshalJSON() ([]byte, error) {
  833. type noMethod EventDefinitionListResponse
  834. raw := noMethod(*s)
  835. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  836. }
  837. // EventPeriodRange: This is a JSON template for an event period time
  838. // range.
  839. type EventPeriodRange struct {
  840. // Kind: Uniquely identifies the type of this resource. Value is always
  841. // the fixed string games#eventPeriodRange.
  842. Kind string `json:"kind,omitempty"`
  843. // PeriodEndMillis: The time when this update period ends, in millis,
  844. // since 1970 UTC (Unix Epoch).
  845. PeriodEndMillis int64 `json:"periodEndMillis,omitempty,string"`
  846. // PeriodStartMillis: The time when this update period begins, in
  847. // millis, since 1970 UTC (Unix Epoch).
  848. PeriodStartMillis int64 `json:"periodStartMillis,omitempty,string"`
  849. // ForceSendFields is a list of field names (e.g. "Kind") to
  850. // unconditionally include in API requests. By default, fields with
  851. // empty values are omitted from API requests. However, any non-pointer,
  852. // non-interface field appearing in ForceSendFields will be sent to the
  853. // server regardless of whether the field is empty or not. This may be
  854. // used to include empty fields in Patch requests.
  855. ForceSendFields []string `json:"-"`
  856. }
  857. func (s *EventPeriodRange) MarshalJSON() ([]byte, error) {
  858. type noMethod EventPeriodRange
  859. raw := noMethod(*s)
  860. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  861. }
  862. // EventPeriodUpdate: This is a JSON template for an event period update
  863. // resource.
  864. type EventPeriodUpdate struct {
  865. // Kind: Uniquely identifies the type of this resource. Value is always
  866. // the fixed string games#eventPeriodUpdate.
  867. Kind string `json:"kind,omitempty"`
  868. // TimePeriod: The time period being covered by this update.
  869. TimePeriod *EventPeriodRange `json:"timePeriod,omitempty"`
  870. // Updates: The updates being made for this time period.
  871. Updates []*EventUpdateRequest `json:"updates,omitempty"`
  872. // ForceSendFields is a list of field names (e.g. "Kind") to
  873. // unconditionally include in API requests. By default, fields with
  874. // empty values are omitted from API requests. However, any non-pointer,
  875. // non-interface field appearing in ForceSendFields will be sent to the
  876. // server regardless of whether the field is empty or not. This may be
  877. // used to include empty fields in Patch requests.
  878. ForceSendFields []string `json:"-"`
  879. }
  880. func (s *EventPeriodUpdate) MarshalJSON() ([]byte, error) {
  881. type noMethod EventPeriodUpdate
  882. raw := noMethod(*s)
  883. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  884. }
  885. // EventRecordFailure: This is a JSON template for an event update
  886. // failure resource.
  887. type EventRecordFailure struct {
  888. // EventId: The ID of the event that was not updated.
  889. EventId string `json:"eventId,omitempty"`
  890. // FailureCause: The cause for the update failure.
  891. // Possible values are:
  892. // - "NOT_FOUND" - An attempt was made to set an event that was not
  893. // defined.
  894. // - "INVALID_UPDATE_VALUE" - An attempt was made to increment an event
  895. // by a non-positive value.
  896. FailureCause string `json:"failureCause,omitempty"`
  897. // Kind: Uniquely identifies the type of this resource. Value is always
  898. // the fixed string games#eventRecordFailure.
  899. Kind string `json:"kind,omitempty"`
  900. // ForceSendFields is a list of field names (e.g. "EventId") to
  901. // unconditionally include in API requests. By default, fields with
  902. // empty values are omitted from API requests. However, any non-pointer,
  903. // non-interface field appearing in ForceSendFields will be sent to the
  904. // server regardless of whether the field is empty or not. This may be
  905. // used to include empty fields in Patch requests.
  906. ForceSendFields []string `json:"-"`
  907. }
  908. func (s *EventRecordFailure) MarshalJSON() ([]byte, error) {
  909. type noMethod EventRecordFailure
  910. raw := noMethod(*s)
  911. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  912. }
  913. // EventRecordRequest: This is a JSON template for an event period
  914. // update resource.
  915. type EventRecordRequest struct {
  916. // CurrentTimeMillis: The current time when this update was sent, in
  917. // milliseconds, since 1970 UTC (Unix Epoch).
  918. CurrentTimeMillis int64 `json:"currentTimeMillis,omitempty,string"`
  919. // Kind: Uniquely identifies the type of this resource. Value is always
  920. // the fixed string games#eventRecordRequest.
  921. Kind string `json:"kind,omitempty"`
  922. // RequestId: The request ID used to identify this attempt to record
  923. // events.
  924. RequestId int64 `json:"requestId,omitempty,string"`
  925. // TimePeriods: A list of the time period updates being made in this
  926. // request.
  927. TimePeriods []*EventPeriodUpdate `json:"timePeriods,omitempty"`
  928. // ForceSendFields is a list of field names (e.g. "CurrentTimeMillis")
  929. // to unconditionally include in API requests. By default, fields with
  930. // empty values are omitted from API requests. However, any non-pointer,
  931. // non-interface field appearing in ForceSendFields will be sent to the
  932. // server regardless of whether the field is empty or not. This may be
  933. // used to include empty fields in Patch requests.
  934. ForceSendFields []string `json:"-"`
  935. }
  936. func (s *EventRecordRequest) MarshalJSON() ([]byte, error) {
  937. type noMethod EventRecordRequest
  938. raw := noMethod(*s)
  939. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  940. }
  941. // EventUpdateRequest: This is a JSON template for an event period
  942. // update resource.
  943. type EventUpdateRequest struct {
  944. // DefinitionId: The ID of the event being modified in this update.
  945. DefinitionId string `json:"definitionId,omitempty"`
  946. // Kind: Uniquely identifies the type of this resource. Value is always
  947. // the fixed string games#eventUpdateRequest.
  948. Kind string `json:"kind,omitempty"`
  949. // UpdateCount: The number of times this event occurred in this time
  950. // period.
  951. UpdateCount int64 `json:"updateCount,omitempty,string"`
  952. // ForceSendFields is a list of field names (e.g. "DefinitionId") to
  953. // unconditionally include in API requests. By default, fields with
  954. // empty values are omitted from API requests. However, any non-pointer,
  955. // non-interface field appearing in ForceSendFields will be sent to the
  956. // server regardless of whether the field is empty or not. This may be
  957. // used to include empty fields in Patch requests.
  958. ForceSendFields []string `json:"-"`
  959. }
  960. func (s *EventUpdateRequest) MarshalJSON() ([]byte, error) {
  961. type noMethod EventUpdateRequest
  962. raw := noMethod(*s)
  963. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  964. }
  965. // EventUpdateResponse: This is a JSON template for an event period
  966. // update resource.
  967. type EventUpdateResponse struct {
  968. // BatchFailures: Any batch-wide failures which occurred applying
  969. // updates.
  970. BatchFailures []*EventBatchRecordFailure `json:"batchFailures,omitempty"`
  971. // EventFailures: Any failures updating a particular event.
  972. EventFailures []*EventRecordFailure `json:"eventFailures,omitempty"`
  973. // Kind: Uniquely identifies the type of this resource. Value is always
  974. // the fixed string games#eventUpdateResponse.
  975. Kind string `json:"kind,omitempty"`
  976. // PlayerEvents: The current status of any updated events
  977. PlayerEvents []*PlayerEvent `json:"playerEvents,omitempty"`
  978. // ServerResponse contains the HTTP response code and headers from the
  979. // server.
  980. googleapi.ServerResponse `json:"-"`
  981. // ForceSendFields is a list of field names (e.g. "BatchFailures") to
  982. // unconditionally include in API requests. By default, fields with
  983. // empty values are omitted from API requests. However, any non-pointer,
  984. // non-interface field appearing in ForceSendFields will be sent to the
  985. // server regardless of whether the field is empty or not. This may be
  986. // used to include empty fields in Patch requests.
  987. ForceSendFields []string `json:"-"`
  988. }
  989. func (s *EventUpdateResponse) MarshalJSON() ([]byte, error) {
  990. type noMethod EventUpdateResponse
  991. raw := noMethod(*s)
  992. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  993. }
  994. // GamesAchievementIncrement: This is a JSON template for the payload to
  995. // request to increment an achievement.
  996. type GamesAchievementIncrement struct {
  997. // Kind: Uniquely identifies the type of this resource. Value is always
  998. // the fixed string games#GamesAchievementIncrement.
  999. Kind string `json:"kind,omitempty"`
  1000. // RequestId: The requestId associated with an increment to an
  1001. // achievement.
  1002. RequestId int64 `json:"requestId,omitempty,string"`
  1003. // Steps: The number of steps to be incremented.
  1004. Steps int64 `json:"steps,omitempty"`
  1005. // ForceSendFields is a list of field names (e.g. "Kind") to
  1006. // unconditionally include in API requests. By default, fields with
  1007. // empty values are omitted from API requests. However, any non-pointer,
  1008. // non-interface field appearing in ForceSendFields will be sent to the
  1009. // server regardless of whether the field is empty or not. This may be
  1010. // used to include empty fields in Patch requests.
  1011. ForceSendFields []string `json:"-"`
  1012. }
  1013. func (s *GamesAchievementIncrement) MarshalJSON() ([]byte, error) {
  1014. type noMethod GamesAchievementIncrement
  1015. raw := noMethod(*s)
  1016. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1017. }
  1018. // GamesAchievementSetStepsAtLeast: This is a JSON template for the
  1019. // payload to request to increment an achievement.
  1020. type GamesAchievementSetStepsAtLeast struct {
  1021. // Kind: Uniquely identifies the type of this resource. Value is always
  1022. // the fixed string games#GamesAchievementSetStepsAtLeast.
  1023. Kind string `json:"kind,omitempty"`
  1024. // Steps: The minimum number of steps for the achievement to be set to.
  1025. Steps int64 `json:"steps,omitempty"`
  1026. // ForceSendFields is a list of field names (e.g. "Kind") to
  1027. // unconditionally include in API requests. By default, fields with
  1028. // empty values are omitted from API requests. However, any non-pointer,
  1029. // non-interface field appearing in ForceSendFields will be sent to the
  1030. // server regardless of whether the field is empty or not. This may be
  1031. // used to include empty fields in Patch requests.
  1032. ForceSendFields []string `json:"-"`
  1033. }
  1034. func (s *GamesAchievementSetStepsAtLeast) MarshalJSON() ([]byte, error) {
  1035. type noMethod GamesAchievementSetStepsAtLeast
  1036. raw := noMethod(*s)
  1037. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1038. }
  1039. // ImageAsset: This is a JSON template for an image asset object.
  1040. type ImageAsset struct {
  1041. // Height: The height of the asset.
  1042. Height int64 `json:"height,omitempty"`
  1043. // Kind: Uniquely identifies the type of this resource. Value is always
  1044. // the fixed string games#imageAsset.
  1045. Kind string `json:"kind,omitempty"`
  1046. // Name: The name of the asset.
  1047. Name string `json:"name,omitempty"`
  1048. // Url: The URL of the asset.
  1049. Url string `json:"url,omitempty"`
  1050. // Width: The width of the asset.
  1051. Width int64 `json:"width,omitempty"`
  1052. // ForceSendFields is a list of field names (e.g. "Height") to
  1053. // unconditionally include in API requests. By default, fields with
  1054. // empty values are omitted from API requests. However, any non-pointer,
  1055. // non-interface field appearing in ForceSendFields will be sent to the
  1056. // server regardless of whether the field is empty or not. This may be
  1057. // used to include empty fields in Patch requests.
  1058. ForceSendFields []string `json:"-"`
  1059. }
  1060. func (s *ImageAsset) MarshalJSON() ([]byte, error) {
  1061. type noMethod ImageAsset
  1062. raw := noMethod(*s)
  1063. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1064. }
  1065. // Instance: This is a JSON template for the Instance resource.
  1066. type Instance struct {
  1067. // AcquisitionUri: URI which shows where a user can acquire this
  1068. // instance.
  1069. AcquisitionUri string `json:"acquisitionUri,omitempty"`
  1070. // AndroidInstance: Platform dependent details for Android.
  1071. AndroidInstance *InstanceAndroidDetails `json:"androidInstance,omitempty"`
  1072. // IosInstance: Platform dependent details for iOS.
  1073. IosInstance *InstanceIosDetails `json:"iosInstance,omitempty"`
  1074. // Kind: Uniquely identifies the type of this resource. Value is always
  1075. // the fixed string games#instance.
  1076. Kind string `json:"kind,omitempty"`
  1077. // Name: Localized display name.
  1078. Name string `json:"name,omitempty"`
  1079. // PlatformType: The platform type.
  1080. // Possible values are:
  1081. // - "ANDROID" - Instance is for Android.
  1082. // - "IOS" - Instance is for iOS
  1083. // - "WEB_APP" - Instance is for Web App.
  1084. PlatformType string `json:"platformType,omitempty"`
  1085. // RealtimePlay: Flag to show if this game instance supports realtime
  1086. // play.
  1087. RealtimePlay bool `json:"realtimePlay,omitempty"`
  1088. // TurnBasedPlay: Flag to show if this game instance supports turn based
  1089. // play.
  1090. TurnBasedPlay bool `json:"turnBasedPlay,omitempty"`
  1091. // WebInstance: Platform dependent details for Web.
  1092. WebInstance *InstanceWebDetails `json:"webInstance,omitempty"`
  1093. // ForceSendFields is a list of field names (e.g. "AcquisitionUri") to
  1094. // unconditionally include in API requests. By default, fields with
  1095. // empty values are omitted from API requests. However, any non-pointer,
  1096. // non-interface field appearing in ForceSendFields will be sent to the
  1097. // server regardless of whether the field is empty or not. This may be
  1098. // used to include empty fields in Patch requests.
  1099. ForceSendFields []string `json:"-"`
  1100. }
  1101. func (s *Instance) MarshalJSON() ([]byte, error) {
  1102. type noMethod Instance
  1103. raw := noMethod(*s)
  1104. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1105. }
  1106. // InstanceAndroidDetails: This is a JSON template for the Android
  1107. // instance details resource.
  1108. type InstanceAndroidDetails struct {
  1109. // EnablePiracyCheck: Flag indicating whether the anti-piracy check is
  1110. // enabled.
  1111. EnablePiracyCheck bool `json:"enablePiracyCheck,omitempty"`
  1112. // Kind: Uniquely identifies the type of this resource. Value is always
  1113. // the fixed string games#instanceAndroidDetails.
  1114. Kind string `json:"kind,omitempty"`
  1115. // PackageName: Android package name which maps to Google Play URL.
  1116. PackageName string `json:"packageName,omitempty"`
  1117. // Preferred: Indicates that this instance is the default for new
  1118. // installations.
  1119. Preferred bool `json:"preferred,omitempty"`
  1120. // ForceSendFields is a list of field names (e.g. "EnablePiracyCheck")
  1121. // to unconditionally include in API requests. By default, fields with
  1122. // empty values are omitted from API requests. However, any non-pointer,
  1123. // non-interface field appearing in ForceSendFields will be sent to the
  1124. // server regardless of whether the field is empty or not. This may be
  1125. // used to include empty fields in Patch requests.
  1126. ForceSendFields []string `json:"-"`
  1127. }
  1128. func (s *InstanceAndroidDetails) MarshalJSON() ([]byte, error) {
  1129. type noMethod InstanceAndroidDetails
  1130. raw := noMethod(*s)
  1131. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1132. }
  1133. // InstanceIosDetails: This is a JSON template for the iOS details
  1134. // resource.
  1135. type InstanceIosDetails struct {
  1136. // BundleIdentifier: Bundle identifier.
  1137. BundleIdentifier string `json:"bundleIdentifier,omitempty"`
  1138. // ItunesAppId: iTunes App ID.
  1139. ItunesAppId string `json:"itunesAppId,omitempty"`
  1140. // Kind: Uniquely identifies the type of this resource. Value is always
  1141. // the fixed string games#instanceIosDetails.
  1142. Kind string `json:"kind,omitempty"`
  1143. // PreferredForIpad: Indicates that this instance is the default for new
  1144. // installations on iPad devices.
  1145. PreferredForIpad bool `json:"preferredForIpad,omitempty"`
  1146. // PreferredForIphone: Indicates that this instance is the default for
  1147. // new installations on iPhone devices.
  1148. PreferredForIphone bool `json:"preferredForIphone,omitempty"`
  1149. // SupportIpad: Flag to indicate if this instance supports iPad.
  1150. SupportIpad bool `json:"supportIpad,omitempty"`
  1151. // SupportIphone: Flag to indicate if this instance supports iPhone.
  1152. SupportIphone bool `json:"supportIphone,omitempty"`
  1153. // ForceSendFields is a list of field names (e.g. "BundleIdentifier") to
  1154. // unconditionally include in API requests. By default, fields with
  1155. // empty values are omitted from API requests. However, any non-pointer,
  1156. // non-interface field appearing in ForceSendFields will be sent to the
  1157. // server regardless of whether the field is empty or not. This may be
  1158. // used to include empty fields in Patch requests.
  1159. ForceSendFields []string `json:"-"`
  1160. }
  1161. func (s *InstanceIosDetails) MarshalJSON() ([]byte, error) {
  1162. type noMethod InstanceIosDetails
  1163. raw := noMethod(*s)
  1164. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1165. }
  1166. // InstanceWebDetails: This is a JSON template for the Web details
  1167. // resource.
  1168. type InstanceWebDetails struct {
  1169. // Kind: Uniquely identifies the type of this resource. Value is always
  1170. // the fixed string games#instanceWebDetails.
  1171. Kind string `json:"kind,omitempty"`
  1172. // LaunchUrl: Launch URL for the game.
  1173. LaunchUrl string `json:"launchUrl,omitempty"`
  1174. // Preferred: Indicates that this instance is the default for new
  1175. // installations.
  1176. Preferred bool `json:"preferred,omitempty"`
  1177. // ForceSendFields is a list of field names (e.g. "Kind") to
  1178. // unconditionally include in API requests. By default, fields with
  1179. // empty values are omitted from API requests. However, any non-pointer,
  1180. // non-interface field appearing in ForceSendFields will be sent to the
  1181. // server regardless of whether the field is empty or not. This may be
  1182. // used to include empty fields in Patch requests.
  1183. ForceSendFields []string `json:"-"`
  1184. }
  1185. func (s *InstanceWebDetails) MarshalJSON() ([]byte, error) {
  1186. type noMethod InstanceWebDetails
  1187. raw := noMethod(*s)
  1188. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1189. }
  1190. // Leaderboard: This is a JSON template for the Leaderboard resource.
  1191. type Leaderboard struct {
  1192. // IconUrl: The icon for the leaderboard.
  1193. IconUrl string `json:"iconUrl,omitempty"`
  1194. // Id: The leaderboard ID.
  1195. Id string `json:"id,omitempty"`
  1196. // IsIconUrlDefault: Indicates whether the icon image being returned is
  1197. // a default image, or is game-provided.
  1198. IsIconUrlDefault bool `json:"isIconUrlDefault,omitempty"`
  1199. // Kind: Uniquely identifies the type of this resource. Value is always
  1200. // the fixed string games#leaderboard.
  1201. Kind string `json:"kind,omitempty"`
  1202. // Name: The name of the leaderboard.
  1203. Name string `json:"name,omitempty"`
  1204. // Order: How scores are ordered.
  1205. // Possible values are:
  1206. // - "LARGER_IS_BETTER" - Larger values are better; scores are sorted in
  1207. // descending order.
  1208. // - "SMALLER_IS_BETTER" - Smaller values are better; scores are sorted
  1209. // in ascending order.
  1210. Order string `json:"order,omitempty"`
  1211. // ServerResponse contains the HTTP response code and headers from the
  1212. // server.
  1213. googleapi.ServerResponse `json:"-"`
  1214. // ForceSendFields is a list of field names (e.g. "IconUrl") to
  1215. // unconditionally include in API requests. By default, fields with
  1216. // empty values are omitted from API requests. However, any non-pointer,
  1217. // non-interface field appearing in ForceSendFields will be sent to the
  1218. // server regardless of whether the field is empty or not. This may be
  1219. // used to include empty fields in Patch requests.
  1220. ForceSendFields []string `json:"-"`
  1221. }
  1222. func (s *Leaderboard) MarshalJSON() ([]byte, error) {
  1223. type noMethod Leaderboard
  1224. raw := noMethod(*s)
  1225. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1226. }
  1227. // LeaderboardEntry: This is a JSON template for the Leaderboard Entry
  1228. // resource.
  1229. type LeaderboardEntry struct {
  1230. // FormattedScore: The localized string for the numerical value of this
  1231. // score.
  1232. FormattedScore string `json:"formattedScore,omitempty"`
  1233. // FormattedScoreRank: The localized string for the rank of this score
  1234. // for this leaderboard.
  1235. FormattedScoreRank string `json:"formattedScoreRank,omitempty"`
  1236. // Kind: Uniquely identifies the type of this resource. Value is always
  1237. // the fixed string games#leaderboardEntry.
  1238. Kind string `json:"kind,omitempty"`
  1239. // Player: The player who holds this score.
  1240. Player *Player `json:"player,omitempty"`
  1241. // ScoreRank: The rank of this score for this leaderboard.
  1242. ScoreRank int64 `json:"scoreRank,omitempty,string"`
  1243. // ScoreTag: Additional information about the score. Values must contain
  1244. // no more than 64 URI-safe characters as defined by section 2.3 of RFC
  1245. // 3986.
  1246. ScoreTag string `json:"scoreTag,omitempty"`
  1247. // ScoreValue: The numerical value of this score.
  1248. ScoreValue int64 `json:"scoreValue,omitempty,string"`
  1249. // TimeSpan: The time span of this high score.
  1250. // Possible values are:
  1251. // - "ALL_TIME" - The score is an all-time high score.
  1252. // - "WEEKLY" - The score is a weekly high score.
  1253. // - "DAILY" - The score is a daily high score.
  1254. TimeSpan string `json:"timeSpan,omitempty"`
  1255. // WriteTimestampMillis: The timestamp at which this score was recorded,
  1256. // in milliseconds since the epoch in UTC.
  1257. WriteTimestampMillis int64 `json:"writeTimestampMillis,omitempty,string"`
  1258. // ForceSendFields is a list of field names (e.g. "FormattedScore") to
  1259. // unconditionally include in API requests. By default, fields with
  1260. // empty values are omitted from API requests. However, any non-pointer,
  1261. // non-interface field appearing in ForceSendFields will be sent to the
  1262. // server regardless of whether the field is empty or not. This may be
  1263. // used to include empty fields in Patch requests.
  1264. ForceSendFields []string `json:"-"`
  1265. }
  1266. func (s *LeaderboardEntry) MarshalJSON() ([]byte, error) {
  1267. type noMethod LeaderboardEntry
  1268. raw := noMethod(*s)
  1269. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1270. }
  1271. // LeaderboardListResponse: This is a JSON template for a list of
  1272. // leaderboard objects.
  1273. type LeaderboardListResponse struct {
  1274. // Items: The leaderboards.
  1275. Items []*Leaderboard `json:"items,omitempty"`
  1276. // Kind: Uniquely identifies the type of this resource. Value is always
  1277. // the fixed string games#leaderboardListResponse.
  1278. Kind string `json:"kind,omitempty"`
  1279. // NextPageToken: Token corresponding to the next page of results.
  1280. NextPageToken string `json:"nextPageToken,omitempty"`
  1281. // ServerResponse contains the HTTP response code and headers from the
  1282. // server.
  1283. googleapi.ServerResponse `json:"-"`
  1284. // ForceSendFields is a list of field names (e.g. "Items") to
  1285. // unconditionally include in API requests. By default, fields with
  1286. // empty values are omitted from API requests. However, any non-pointer,
  1287. // non-interface field appearing in ForceSendFields will be sent to the
  1288. // server regardless of whether the field is empty or not. This may be
  1289. // used to include empty fields in Patch requests.
  1290. ForceSendFields []string `json:"-"`
  1291. }
  1292. func (s *LeaderboardListResponse) MarshalJSON() ([]byte, error) {
  1293. type noMethod LeaderboardListResponse
  1294. raw := noMethod(*s)
  1295. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1296. }
  1297. // LeaderboardScoreRank: This is a JSON template for a score rank in a
  1298. // leaderboard.
  1299. type LeaderboardScoreRank struct {
  1300. // FormattedNumScores: The number of scores in the leaderboard as a
  1301. // string.
  1302. FormattedNumScores string `json:"formattedNumScores,omitempty"`
  1303. // FormattedRank: The rank in the leaderboard as a string.
  1304. FormattedRank string `json:"formattedRank,omitempty"`
  1305. // Kind: Uniquely identifies the type of this resource. Value is always
  1306. // the fixed string games#leaderboardScoreRank.
  1307. Kind string `json:"kind,omitempty"`
  1308. // NumScores: The number of scores in the leaderboard.
  1309. NumScores int64 `json:"numScores,omitempty,string"`
  1310. // Rank: The rank in the leaderboard.
  1311. Rank int64 `json:"rank,omitempty,string"`
  1312. // ForceSendFields is a list of field names (e.g. "FormattedNumScores")
  1313. // to unconditionally include in API requests. By default, fields with
  1314. // empty values are omitted from API requests. However, any non-pointer,
  1315. // non-interface field appearing in ForceSendFields will be sent to the
  1316. // server regardless of whether the field is empty or not. This may be
  1317. // used to include empty fields in Patch requests.
  1318. ForceSendFields []string `json:"-"`
  1319. }
  1320. func (s *LeaderboardScoreRank) MarshalJSON() ([]byte, error) {
  1321. type noMethod LeaderboardScoreRank
  1322. raw := noMethod(*s)
  1323. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1324. }
  1325. // LeaderboardScores: This is a JSON template for a ListScores response.
  1326. type LeaderboardScores struct {
  1327. // Items: The scores in the leaderboard.
  1328. Items []*LeaderboardEntry `json:"items,omitempty"`
  1329. // Kind: Uniquely identifies the type of this resource. Value is always
  1330. // the fixed string games#leaderboardScores.
  1331. Kind string `json:"kind,omitempty"`
  1332. // NextPageToken: The pagination token for the next page of results.
  1333. NextPageToken string `json:"nextPageToken,omitempty"`
  1334. // NumScores: The total number of scores in the leaderboard.
  1335. NumScores int64 `json:"numScores,omitempty,string"`
  1336. // PlayerScore: The score of the requesting player on the leaderboard.
  1337. // The player's score may appear both here and in the list of scores
  1338. // above. If you are viewing a public leaderboard and the player is not
  1339. // sharing their gameplay information publicly, the scoreRank and
  1340. // formattedScoreRank values will not be present.
  1341. PlayerScore *LeaderboardEntry `json:"playerScore,omitempty"`
  1342. // PrevPageToken: The pagination token for the previous page of results.
  1343. PrevPageToken string `json:"prevPageToken,omitempty"`
  1344. // ServerResponse contains the HTTP response code and headers from the
  1345. // server.
  1346. googleapi.ServerResponse `json:"-"`
  1347. // ForceSendFields is a list of field names (e.g. "Items") to
  1348. // unconditionally include in API requests. By default, fields with
  1349. // empty values are omitted from API requests. However, any non-pointer,
  1350. // non-interface field appearing in ForceSendFields will be sent to the
  1351. // server regardless of whether the field is empty or not. This may be
  1352. // used to include empty fields in Patch requests.
  1353. ForceSendFields []string `json:"-"`
  1354. }
  1355. func (s *LeaderboardScores) MarshalJSON() ([]byte, error) {
  1356. type noMethod LeaderboardScores
  1357. raw := noMethod(*s)
  1358. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1359. }
  1360. // MetagameConfig: This is a JSON template for the metagame config
  1361. // resource
  1362. type MetagameConfig struct {
  1363. // CurrentVersion: Current version of the metagame configuration data.
  1364. // When this data is updated, the version number will be increased by
  1365. // one.
  1366. CurrentVersion int64 `json:"currentVersion,omitempty"`
  1367. // Kind: Uniquely identifies the type of this resource. Value is always
  1368. // the fixed string games#metagameConfig.
  1369. Kind string `json:"kind,omitempty"`
  1370. // PlayerLevels: The list of player levels.
  1371. PlayerLevels []*PlayerLevel `json:"playerLevels,omitempty"`
  1372. // ServerResponse contains the HTTP response code and headers from the
  1373. // server.
  1374. googleapi.ServerResponse `json:"-"`
  1375. // ForceSendFields is a list of field names (e.g. "CurrentVersion") to
  1376. // unconditionally include in API requests. By default, fields with
  1377. // empty values are omitted from API requests. However, any non-pointer,
  1378. // non-interface field appearing in ForceSendFields will be sent to the
  1379. // server regardless of whether the field is empty or not. This may be
  1380. // used to include empty fields in Patch requests.
  1381. ForceSendFields []string `json:"-"`
  1382. }
  1383. func (s *MetagameConfig) MarshalJSON() ([]byte, error) {
  1384. type noMethod MetagameConfig
  1385. raw := noMethod(*s)
  1386. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1387. }
  1388. // NetworkDiagnostics: This is a JSON template for network diagnostics
  1389. // reported for a client.
  1390. type NetworkDiagnostics struct {
  1391. // AndroidNetworkSubtype: The Android network subtype.
  1392. AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"`
  1393. // AndroidNetworkType: The Android network type.
  1394. AndroidNetworkType int64 `json:"androidNetworkType,omitempty"`
  1395. // IosNetworkType: iOS network type as defined in Reachability.h.
  1396. IosNetworkType int64 `json:"iosNetworkType,omitempty"`
  1397. // Kind: Uniquely identifies the type of this resource. Value is always
  1398. // the fixed string games#networkDiagnostics.
  1399. Kind string `json:"kind,omitempty"`
  1400. // NetworkOperatorCode: The MCC+MNC code for the client's network
  1401. // connection. On Android:
  1402. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see:
  1403. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html
  1404. NetworkOperatorCode string `json:"networkOperatorCode,omitempty"`
  1405. // NetworkOperatorName: The name of the carrier of the client's network
  1406. // connection. On Android:
  1407. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS:
  1408. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName
  1409. NetworkOperatorName string `json:"networkOperatorName,omitempty"`
  1410. // RegistrationLatencyMillis: The amount of time in milliseconds it took
  1411. // for the client to establish a connection with the XMPP server.
  1412. RegistrationLatencyMillis int64 `json:"registrationLatencyMillis,omitempty"`
  1413. // ForceSendFields is a list of field names (e.g.
  1414. // "AndroidNetworkSubtype") to unconditionally include in API requests.
  1415. // By default, fields with empty values are omitted from API requests.
  1416. // However, any non-pointer, non-interface field appearing in
  1417. // ForceSendFields will be sent to the server regardless of whether the
  1418. // field is empty or not. This may be used to include empty fields in
  1419. // Patch requests.
  1420. ForceSendFields []string `json:"-"`
  1421. }
  1422. func (s *NetworkDiagnostics) MarshalJSON() ([]byte, error) {
  1423. type noMethod NetworkDiagnostics
  1424. raw := noMethod(*s)
  1425. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1426. }
  1427. // ParticipantResult: This is a JSON template for a result for a match
  1428. // participant.
  1429. type ParticipantResult struct {
  1430. // Kind: Uniquely identifies the type of this resource. Value is always
  1431. // the fixed string games#participantResult.
  1432. Kind string `json:"kind,omitempty"`
  1433. // ParticipantId: The ID of the participant.
  1434. ParticipantId string `json:"participantId,omitempty"`
  1435. // Placing: The placement or ranking of the participant in the match
  1436. // results; a number from one to the number of participants in the
  1437. // match. Multiple participants may have the same placing value in case
  1438. // of a type.
  1439. Placing int64 `json:"placing,omitempty"`
  1440. // Result: The result of the participant for this match.
  1441. // Possible values are:
  1442. // - "MATCH_RESULT_WIN" - The participant won the match.
  1443. // - "MATCH_RESULT_LOSS" - The participant lost the match.
  1444. // - "MATCH_RESULT_TIE" - The participant tied the match.
  1445. // - "MATCH_RESULT_NONE" - There was no winner for the match (nobody
  1446. // wins or loses this kind of game.)
  1447. // - "MATCH_RESULT_DISCONNECT" - The participant disconnected / left
  1448. // during the match.
  1449. // - "MATCH_RESULT_DISAGREED" - Different clients reported different
  1450. // results for this participant.
  1451. Result string `json:"result,omitempty"`
  1452. // ForceSendFields is a list of field names (e.g. "Kind") 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. }
  1460. func (s *ParticipantResult) MarshalJSON() ([]byte, error) {
  1461. type noMethod ParticipantResult
  1462. raw := noMethod(*s)
  1463. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1464. }
  1465. // PeerChannelDiagnostics: This is a JSON template for peer channel
  1466. // diagnostics.
  1467. type PeerChannelDiagnostics struct {
  1468. // BytesReceived: Number of bytes received.
  1469. BytesReceived *AggregateStats `json:"bytesReceived,omitempty"`
  1470. // BytesSent: Number of bytes sent.
  1471. BytesSent *AggregateStats `json:"bytesSent,omitempty"`
  1472. // Kind: Uniquely identifies the type of this resource. Value is always
  1473. // the fixed string games#peerChannelDiagnostics.
  1474. Kind string `json:"kind,omitempty"`
  1475. // NumMessagesLost: Number of messages lost.
  1476. NumMessagesLost int64 `json:"numMessagesLost,omitempty"`
  1477. // NumMessagesReceived: Number of messages received.
  1478. NumMessagesReceived int64 `json:"numMessagesReceived,omitempty"`
  1479. // NumMessagesSent: Number of messages sent.
  1480. NumMessagesSent int64 `json:"numMessagesSent,omitempty"`
  1481. // NumSendFailures: Number of send failures.
  1482. NumSendFailures int64 `json:"numSendFailures,omitempty"`
  1483. // RoundtripLatencyMillis: Roundtrip latency stats in milliseconds.
  1484. RoundtripLatencyMillis *AggregateStats `json:"roundtripLatencyMillis,omitempty"`
  1485. // ForceSendFields is a list of field names (e.g. "BytesReceived") to
  1486. // unconditionally include in API requests. By default, fields with
  1487. // empty values are omitted from API requests. However, any non-pointer,
  1488. // non-interface field appearing in ForceSendFields will be sent to the
  1489. // server regardless of whether the field is empty or not. This may be
  1490. // used to include empty fields in Patch requests.
  1491. ForceSendFields []string `json:"-"`
  1492. }
  1493. func (s *PeerChannelDiagnostics) MarshalJSON() ([]byte, error) {
  1494. type noMethod PeerChannelDiagnostics
  1495. raw := noMethod(*s)
  1496. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1497. }
  1498. // PeerSessionDiagnostics: This is a JSON template for peer session
  1499. // diagnostics.
  1500. type PeerSessionDiagnostics struct {
  1501. // ConnectedTimestampMillis: Connected time in milliseconds.
  1502. ConnectedTimestampMillis int64 `json:"connectedTimestampMillis,omitempty,string"`
  1503. // Kind: Uniquely identifies the type of this resource. Value is always
  1504. // the fixed string games#peerSessionDiagnostics.
  1505. Kind string `json:"kind,omitempty"`
  1506. // ParticipantId: The participant ID of the peer.
  1507. ParticipantId string `json:"participantId,omitempty"`
  1508. // ReliableChannel: Reliable channel diagnostics.
  1509. ReliableChannel *PeerChannelDiagnostics `json:"reliableChannel,omitempty"`
  1510. // UnreliableChannel: Unreliable channel diagnostics.
  1511. UnreliableChannel *PeerChannelDiagnostics `json:"unreliableChannel,omitempty"`
  1512. // ForceSendFields is a list of field names (e.g.
  1513. // "ConnectedTimestampMillis") to unconditionally include in API
  1514. // requests. By default, fields with empty values are omitted from API
  1515. // requests. However, any non-pointer, non-interface field appearing in
  1516. // ForceSendFields will be sent to the server regardless of whether the
  1517. // field is empty or not. This may be used to include empty fields in
  1518. // Patch requests.
  1519. ForceSendFields []string `json:"-"`
  1520. }
  1521. func (s *PeerSessionDiagnostics) MarshalJSON() ([]byte, error) {
  1522. type noMethod PeerSessionDiagnostics
  1523. raw := noMethod(*s)
  1524. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1525. }
  1526. // Played: This is a JSON template for metadata about a player playing a
  1527. // game with the currently authenticated user.
  1528. type Played struct {
  1529. // AutoMatched: True if the player was auto-matched with the currently
  1530. // authenticated user.
  1531. AutoMatched bool `json:"autoMatched,omitempty"`
  1532. // Kind: Uniquely identifies the type of this resource. Value is always
  1533. // the fixed string games#played.
  1534. Kind string `json:"kind,omitempty"`
  1535. // TimeMillis: The last time the player played the game in milliseconds
  1536. // since the epoch in UTC.
  1537. TimeMillis int64 `json:"timeMillis,omitempty,string"`
  1538. // ForceSendFields is a list of field names (e.g. "AutoMatched") to
  1539. // unconditionally include in API requests. By default, fields with
  1540. // empty values are omitted from API requests. However, any non-pointer,
  1541. // non-interface field appearing in ForceSendFields will be sent to the
  1542. // server regardless of whether the field is empty or not. This may be
  1543. // used to include empty fields in Patch requests.
  1544. ForceSendFields []string `json:"-"`
  1545. }
  1546. func (s *Played) MarshalJSON() ([]byte, error) {
  1547. type noMethod Played
  1548. raw := noMethod(*s)
  1549. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1550. }
  1551. // Player: This is a JSON template for a Player resource.
  1552. type Player struct {
  1553. // AvatarImageUrl: The base URL for the image that represents the
  1554. // player.
  1555. AvatarImageUrl string `json:"avatarImageUrl,omitempty"`
  1556. // BannerUrlLandscape: The url to the landscape mode player banner
  1557. // image.
  1558. BannerUrlLandscape string `json:"bannerUrlLandscape,omitempty"`
  1559. // BannerUrlPortrait: The url to the portrait mode player banner image.
  1560. BannerUrlPortrait string `json:"bannerUrlPortrait,omitempty"`
  1561. // DisplayName: The name to display for the player.
  1562. DisplayName string `json:"displayName,omitempty"`
  1563. // ExperienceInfo: An object to represent Play Game experience
  1564. // information for the player.
  1565. ExperienceInfo *PlayerExperienceInfo `json:"experienceInfo,omitempty"`
  1566. // Kind: Uniquely identifies the type of this resource. Value is always
  1567. // the fixed string games#player.
  1568. Kind string `json:"kind,omitempty"`
  1569. // LastPlayedWith: Details about the last time this player played a
  1570. // multiplayer game with the currently authenticated player. Populated
  1571. // for PLAYED_WITH player collection members.
  1572. LastPlayedWith *Played `json:"lastPlayedWith,omitempty"`
  1573. // Name: An object representation of the individual components of the
  1574. // player's name. For some players, these fields may not be present.
  1575. Name *PlayerName `json:"name,omitempty"`
  1576. // OriginalPlayerId: The player ID that was used for this player the
  1577. // first time they signed into the game in question. This is only
  1578. // populated for calls to player.get for the requesting player, only if
  1579. // the player ID has subsequently changed, and only to clients that
  1580. // support remapping player IDs.
  1581. OriginalPlayerId string `json:"originalPlayerId,omitempty"`
  1582. // PlayerId: The ID of the player.
  1583. PlayerId string `json:"playerId,omitempty"`
  1584. // Title: The player's title rewarded for their game activities.
  1585. Title string `json:"title,omitempty"`
  1586. // ServerResponse contains the HTTP response code and headers from the
  1587. // server.
  1588. googleapi.ServerResponse `json:"-"`
  1589. // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to
  1590. // unconditionally include in API requests. By default, fields with
  1591. // empty values are omitted from API requests. However, any non-pointer,
  1592. // non-interface field appearing in ForceSendFields will be sent to the
  1593. // server regardless of whether the field is empty or not. This may be
  1594. // used to include empty fields in Patch requests.
  1595. ForceSendFields []string `json:"-"`
  1596. }
  1597. func (s *Player) MarshalJSON() ([]byte, error) {
  1598. type noMethod Player
  1599. raw := noMethod(*s)
  1600. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1601. }
  1602. // PlayerName: An object representation of the individual components of
  1603. // the player's name. For some players, these fields may not be present.
  1604. type PlayerName struct {
  1605. // FamilyName: The family name of this player. In some places, this is
  1606. // known as the last name.
  1607. FamilyName string `json:"familyName,omitempty"`
  1608. // GivenName: The given name of this player. In some places, this is
  1609. // known as the first name.
  1610. GivenName string `json:"givenName,omitempty"`
  1611. // ForceSendFields is a list of field names (e.g. "FamilyName") to
  1612. // unconditionally include in API requests. By default, fields with
  1613. // empty values are omitted from API requests. However, any non-pointer,
  1614. // non-interface field appearing in ForceSendFields will be sent to the
  1615. // server regardless of whether the field is empty or not. This may be
  1616. // used to include empty fields in Patch requests.
  1617. ForceSendFields []string `json:"-"`
  1618. }
  1619. func (s *PlayerName) MarshalJSON() ([]byte, error) {
  1620. type noMethod PlayerName
  1621. raw := noMethod(*s)
  1622. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1623. }
  1624. // PlayerAchievement: This is a JSON template for an achievement object.
  1625. type PlayerAchievement struct {
  1626. // AchievementState: The state of the achievement.
  1627. // Possible values are:
  1628. // - "HIDDEN" - Achievement is hidden.
  1629. // - "REVEALED" - Achievement is revealed.
  1630. // - "UNLOCKED" - Achievement is unlocked.
  1631. AchievementState string `json:"achievementState,omitempty"`
  1632. // CurrentSteps: The current steps for an incremental achievement.
  1633. CurrentSteps int64 `json:"currentSteps,omitempty"`
  1634. // ExperiencePoints: Experience points earned for the achievement. This
  1635. // field is absent for achievements that have not yet been unlocked and
  1636. // 0 for achievements that have been unlocked by testers but that are
  1637. // unpublished.
  1638. ExperiencePoints int64 `json:"experiencePoints,omitempty,string"`
  1639. // FormattedCurrentStepsString: The current steps for an incremental
  1640. // achievement as a string.
  1641. FormattedCurrentStepsString string `json:"formattedCurrentStepsString,omitempty"`
  1642. // Id: The ID of the achievement.
  1643. Id string `json:"id,omitempty"`
  1644. // Kind: Uniquely identifies the type of this resource. Value is always
  1645. // the fixed string games#playerAchievement.
  1646. Kind string `json:"kind,omitempty"`
  1647. // LastUpdatedTimestamp: The timestamp of the last modification to this
  1648. // achievement's state.
  1649. LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"`
  1650. // ForceSendFields is a list of field names (e.g. "AchievementState") to
  1651. // unconditionally include in API requests. By default, fields with
  1652. // empty values are omitted from API requests. However, any non-pointer,
  1653. // non-interface field appearing in ForceSendFields will be sent to the
  1654. // server regardless of whether the field is empty or not. This may be
  1655. // used to include empty fields in Patch requests.
  1656. ForceSendFields []string `json:"-"`
  1657. }
  1658. func (s *PlayerAchievement) MarshalJSON() ([]byte, error) {
  1659. type noMethod PlayerAchievement
  1660. raw := noMethod(*s)
  1661. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1662. }
  1663. // PlayerAchievementListResponse: This is a JSON template for a list of
  1664. // achievement objects.
  1665. type PlayerAchievementListResponse struct {
  1666. // Items: The achievements.
  1667. Items []*PlayerAchievement `json:"items,omitempty"`
  1668. // Kind: Uniquely identifies the type of this resource. Value is always
  1669. // the fixed string games#playerAchievementListResponse.
  1670. Kind string `json:"kind,omitempty"`
  1671. // NextPageToken: Token corresponding to the next page of results.
  1672. NextPageToken string `json:"nextPageToken,omitempty"`
  1673. // ServerResponse contains the HTTP response code and headers from the
  1674. // server.
  1675. googleapi.ServerResponse `json:"-"`
  1676. // ForceSendFields is a list of field names (e.g. "Items") to
  1677. // unconditionally include in API requests. By default, fields with
  1678. // empty values are omitted from API requests. However, any non-pointer,
  1679. // non-interface field appearing in ForceSendFields will be sent to the
  1680. // server regardless of whether the field is empty or not. This may be
  1681. // used to include empty fields in Patch requests.
  1682. ForceSendFields []string `json:"-"`
  1683. }
  1684. func (s *PlayerAchievementListResponse) MarshalJSON() ([]byte, error) {
  1685. type noMethod PlayerAchievementListResponse
  1686. raw := noMethod(*s)
  1687. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1688. }
  1689. // PlayerEvent: This is a JSON template for an event status resource.
  1690. type PlayerEvent struct {
  1691. // DefinitionId: The ID of the event definition.
  1692. DefinitionId string `json:"definitionId,omitempty"`
  1693. // FormattedNumEvents: The current number of times this event has
  1694. // occurred, as a string. The formatting of this string depends on the
  1695. // configuration of your event in the Play Games Developer Console.
  1696. FormattedNumEvents string `json:"formattedNumEvents,omitempty"`
  1697. // Kind: Uniquely identifies the type of this resource. Value is always
  1698. // the fixed string games#playerEvent.
  1699. Kind string `json:"kind,omitempty"`
  1700. // NumEvents: The current number of times this event has occurred.
  1701. NumEvents int64 `json:"numEvents,omitempty,string"`
  1702. // PlayerId: The ID of the player.
  1703. PlayerId string `json:"playerId,omitempty"`
  1704. // ForceSendFields is a list of field names (e.g. "DefinitionId") to
  1705. // unconditionally include in API requests. By default, fields with
  1706. // empty values are omitted from API requests. However, any non-pointer,
  1707. // non-interface field appearing in ForceSendFields will be sent to the
  1708. // server regardless of whether the field is empty or not. This may be
  1709. // used to include empty fields in Patch requests.
  1710. ForceSendFields []string `json:"-"`
  1711. }
  1712. func (s *PlayerEvent) MarshalJSON() ([]byte, error) {
  1713. type noMethod PlayerEvent
  1714. raw := noMethod(*s)
  1715. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1716. }
  1717. // PlayerEventListResponse: This is a JSON template for a ListByPlayer
  1718. // response.
  1719. type PlayerEventListResponse struct {
  1720. // Items: The player events.
  1721. Items []*PlayerEvent `json:"items,omitempty"`
  1722. // Kind: Uniquely identifies the type of this resource. Value is always
  1723. // the fixed string games#playerEventListResponse.
  1724. Kind string `json:"kind,omitempty"`
  1725. // NextPageToken: The pagination token for the next page of results.
  1726. NextPageToken string `json:"nextPageToken,omitempty"`
  1727. // ServerResponse contains the HTTP response code and headers from the
  1728. // server.
  1729. googleapi.ServerResponse `json:"-"`
  1730. // ForceSendFields is a list of field names (e.g. "Items") to
  1731. // unconditionally include in API requests. By default, fields with
  1732. // empty values are omitted from API requests. However, any non-pointer,
  1733. // non-interface field appearing in ForceSendFields will be sent to the
  1734. // server regardless of whether the field is empty or not. This may be
  1735. // used to include empty fields in Patch requests.
  1736. ForceSendFields []string `json:"-"`
  1737. }
  1738. func (s *PlayerEventListResponse) MarshalJSON() ([]byte, error) {
  1739. type noMethod PlayerEventListResponse
  1740. raw := noMethod(*s)
  1741. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1742. }
  1743. // PlayerExperienceInfo: This is a JSON template for 1P/3P metadata
  1744. // about the player's experience.
  1745. type PlayerExperienceInfo struct {
  1746. // CurrentExperiencePoints: The current number of experience points for
  1747. // the player.
  1748. CurrentExperiencePoints int64 `json:"currentExperiencePoints,omitempty,string"`
  1749. // CurrentLevel: The current level of the player.
  1750. CurrentLevel *PlayerLevel `json:"currentLevel,omitempty"`
  1751. // Kind: Uniquely identifies the type of this resource. Value is always
  1752. // the fixed string games#playerExperienceInfo.
  1753. Kind string `json:"kind,omitempty"`
  1754. // LastLevelUpTimestampMillis: The timestamp when the player was leveled
  1755. // up, in millis since Unix epoch UTC.
  1756. LastLevelUpTimestampMillis int64 `json:"lastLevelUpTimestampMillis,omitempty,string"`
  1757. // NextLevel: The next level of the player. If the current level is the
  1758. // maximum level, this should be same as the current level.
  1759. NextLevel *PlayerLevel `json:"nextLevel,omitempty"`
  1760. // ForceSendFields is a list of field names (e.g.
  1761. // "CurrentExperiencePoints") to unconditionally include in API
  1762. // requests. By default, fields with empty values are omitted from API
  1763. // requests. However, any non-pointer, non-interface field appearing in
  1764. // ForceSendFields will be sent to the server regardless of whether the
  1765. // field is empty or not. This may be used to include empty fields in
  1766. // Patch requests.
  1767. ForceSendFields []string `json:"-"`
  1768. }
  1769. func (s *PlayerExperienceInfo) MarshalJSON() ([]byte, error) {
  1770. type noMethod PlayerExperienceInfo
  1771. raw := noMethod(*s)
  1772. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1773. }
  1774. // PlayerLeaderboardScore: This is a JSON template for a player
  1775. // leaderboard score object.
  1776. type PlayerLeaderboardScore struct {
  1777. // Kind: Uniquely identifies the type of this resource. Value is always
  1778. // the fixed string games#playerLeaderboardScore.
  1779. Kind string `json:"kind,omitempty"`
  1780. // LeaderboardId: The ID of the leaderboard this score is in.
  1781. LeaderboardId string `json:"leaderboard_id,omitempty"`
  1782. // PublicRank: The public rank of the score in this leaderboard. This
  1783. // object will not be present if the user is not sharing their scores
  1784. // publicly.
  1785. PublicRank *LeaderboardScoreRank `json:"publicRank,omitempty"`
  1786. // ScoreString: The formatted value of this score.
  1787. ScoreString string `json:"scoreString,omitempty"`
  1788. // ScoreTag: Additional information about the score. Values must contain
  1789. // no more than 64 URI-safe characters as defined by section 2.3 of RFC
  1790. // 3986.
  1791. ScoreTag string `json:"scoreTag,omitempty"`
  1792. // ScoreValue: The numerical value of this score.
  1793. ScoreValue int64 `json:"scoreValue,omitempty,string"`
  1794. // SocialRank: The social rank of the score in this leaderboard.
  1795. SocialRank *LeaderboardScoreRank `json:"socialRank,omitempty"`
  1796. // TimeSpan: The time span of this score.
  1797. // Possible values are:
  1798. // - "ALL_TIME" - The score is an all-time score.
  1799. // - "WEEKLY" - The score is a weekly score.
  1800. // - "DAILY" - The score is a daily score.
  1801. TimeSpan string `json:"timeSpan,omitempty"`
  1802. // WriteTimestamp: The timestamp at which this score was recorded, in
  1803. // milliseconds since the epoch in UTC.
  1804. WriteTimestamp int64 `json:"writeTimestamp,omitempty,string"`
  1805. // ForceSendFields is a list of field names (e.g. "Kind") to
  1806. // unconditionally include in API requests. By default, fields with
  1807. // empty values are omitted from API requests. However, any non-pointer,
  1808. // non-interface field appearing in ForceSendFields will be sent to the
  1809. // server regardless of whether the field is empty or not. This may be
  1810. // used to include empty fields in Patch requests.
  1811. ForceSendFields []string `json:"-"`
  1812. }
  1813. func (s *PlayerLeaderboardScore) MarshalJSON() ([]byte, error) {
  1814. type noMethod PlayerLeaderboardScore
  1815. raw := noMethod(*s)
  1816. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1817. }
  1818. // PlayerLeaderboardScoreListResponse: This is a JSON template for a
  1819. // list of player leaderboard scores.
  1820. type PlayerLeaderboardScoreListResponse struct {
  1821. // Items: The leaderboard scores.
  1822. Items []*PlayerLeaderboardScore `json:"items,omitempty"`
  1823. // Kind: Uniquely identifies the type of this resource. Value is always
  1824. // the fixed string games#playerLeaderboardScoreListResponse.
  1825. Kind string `json:"kind,omitempty"`
  1826. // NextPageToken: The pagination token for the next page of results.
  1827. NextPageToken string `json:"nextPageToken,omitempty"`
  1828. // Player: The Player resources for the owner of this score.
  1829. Player *Player `json:"player,omitempty"`
  1830. // ServerResponse contains the HTTP response code and headers from the
  1831. // server.
  1832. googleapi.ServerResponse `json:"-"`
  1833. // ForceSendFields is a list of field names (e.g. "Items") to
  1834. // unconditionally include in API requests. By default, fields with
  1835. // empty values are omitted from API requests. However, any non-pointer,
  1836. // non-interface field appearing in ForceSendFields will be sent to the
  1837. // server regardless of whether the field is empty or not. This may be
  1838. // used to include empty fields in Patch requests.
  1839. ForceSendFields []string `json:"-"`
  1840. }
  1841. func (s *PlayerLeaderboardScoreListResponse) MarshalJSON() ([]byte, error) {
  1842. type noMethod PlayerLeaderboardScoreListResponse
  1843. raw := noMethod(*s)
  1844. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1845. }
  1846. // PlayerLevel: This is a JSON template for 1P/3P metadata about a
  1847. // user's level.
  1848. type PlayerLevel struct {
  1849. // Kind: Uniquely identifies the type of this resource. Value is always
  1850. // the fixed string games#playerLevel.
  1851. Kind string `json:"kind,omitempty"`
  1852. // Level: The level for the user.
  1853. Level int64 `json:"level,omitempty"`
  1854. // MaxExperiencePoints: The maximum experience points for this level.
  1855. MaxExperiencePoints int64 `json:"maxExperiencePoints,omitempty,string"`
  1856. // MinExperiencePoints: The minimum experience points for this level.
  1857. MinExperiencePoints int64 `json:"minExperiencePoints,omitempty,string"`
  1858. // ForceSendFields is a list of field names (e.g. "Kind") to
  1859. // unconditionally include in API requests. By default, fields with
  1860. // empty values are omitted from API requests. However, any non-pointer,
  1861. // non-interface field appearing in ForceSendFields will be sent to the
  1862. // server regardless of whether the field is empty or not. This may be
  1863. // used to include empty fields in Patch requests.
  1864. ForceSendFields []string `json:"-"`
  1865. }
  1866. func (s *PlayerLevel) MarshalJSON() ([]byte, error) {
  1867. type noMethod PlayerLevel
  1868. raw := noMethod(*s)
  1869. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1870. }
  1871. // PlayerListResponse: This is a JSON template for a third party player
  1872. // list response.
  1873. type PlayerListResponse struct {
  1874. // Items: The players.
  1875. Items []*Player `json:"items,omitempty"`
  1876. // Kind: Uniquely identifies the type of this resource. Value is always
  1877. // the fixed string games#playerListResponse.
  1878. Kind string `json:"kind,omitempty"`
  1879. // NextPageToken: Token corresponding to the next page of results.
  1880. NextPageToken string `json:"nextPageToken,omitempty"`
  1881. // ServerResponse contains the HTTP response code and headers from the
  1882. // server.
  1883. googleapi.ServerResponse `json:"-"`
  1884. // ForceSendFields is a list of field names (e.g. "Items") to
  1885. // unconditionally include in API requests. By default, fields with
  1886. // empty values are omitted from API requests. However, any non-pointer,
  1887. // non-interface field appearing in ForceSendFields will be sent to the
  1888. // server regardless of whether the field is empty or not. This may be
  1889. // used to include empty fields in Patch requests.
  1890. ForceSendFields []string `json:"-"`
  1891. }
  1892. func (s *PlayerListResponse) MarshalJSON() ([]byte, error) {
  1893. type noMethod PlayerListResponse
  1894. raw := noMethod(*s)
  1895. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1896. }
  1897. // PlayerScore: This is a JSON template for a player score.
  1898. type PlayerScore struct {
  1899. // FormattedScore: The formatted score for this player score.
  1900. FormattedScore string `json:"formattedScore,omitempty"`
  1901. // Kind: Uniquely identifies the type of this resource. Value is always
  1902. // the fixed string games#playerScore.
  1903. Kind string `json:"kind,omitempty"`
  1904. // Score: The numerical value for this player score.
  1905. Score int64 `json:"score,omitempty,string"`
  1906. // ScoreTag: Additional information about this score. Values will
  1907. // contain no more than 64 URI-safe characters as defined by section 2.3
  1908. // of RFC 3986.
  1909. ScoreTag string `json:"scoreTag,omitempty"`
  1910. // TimeSpan: The time span for this player score.
  1911. // Possible values are:
  1912. // - "ALL_TIME" - The score is an all-time score.
  1913. // - "WEEKLY" - The score is a weekly score.
  1914. // - "DAILY" - The score is a daily score.
  1915. TimeSpan string `json:"timeSpan,omitempty"`
  1916. // ForceSendFields is a list of field names (e.g. "FormattedScore") to
  1917. // unconditionally include in API requests. By default, fields with
  1918. // empty values are omitted from API requests. However, any non-pointer,
  1919. // non-interface field appearing in ForceSendFields will be sent to the
  1920. // server regardless of whether the field is empty or not. This may be
  1921. // used to include empty fields in Patch requests.
  1922. ForceSendFields []string `json:"-"`
  1923. }
  1924. func (s *PlayerScore) MarshalJSON() ([]byte, error) {
  1925. type noMethod PlayerScore
  1926. raw := noMethod(*s)
  1927. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1928. }
  1929. // PlayerScoreListResponse: This is a JSON template for a list of score
  1930. // submission statuses.
  1931. type PlayerScoreListResponse struct {
  1932. // Kind: Uniquely identifies the type of this resource. Value is always
  1933. // the fixed string games#playerScoreListResponse.
  1934. Kind string `json:"kind,omitempty"`
  1935. // SubmittedScores: The score submissions statuses.
  1936. SubmittedScores []*PlayerScoreResponse `json:"submittedScores,omitempty"`
  1937. // ServerResponse contains the HTTP response code and headers from the
  1938. // server.
  1939. googleapi.ServerResponse `json:"-"`
  1940. // ForceSendFields is a list of field names (e.g. "Kind") to
  1941. // unconditionally include in API requests. By default, fields with
  1942. // empty values are omitted from API requests. However, any non-pointer,
  1943. // non-interface field appearing in ForceSendFields will be sent to the
  1944. // server regardless of whether the field is empty or not. This may be
  1945. // used to include empty fields in Patch requests.
  1946. ForceSendFields []string `json:"-"`
  1947. }
  1948. func (s *PlayerScoreListResponse) MarshalJSON() ([]byte, error) {
  1949. type noMethod PlayerScoreListResponse
  1950. raw := noMethod(*s)
  1951. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1952. }
  1953. // PlayerScoreResponse: This is a JSON template for a list of
  1954. // leaderboard entry resources.
  1955. type PlayerScoreResponse struct {
  1956. // BeatenScoreTimeSpans: The time spans where the submitted score is
  1957. // better than the existing score for that time span.
  1958. // Possible values are:
  1959. // - "ALL_TIME" - The score is an all-time score.
  1960. // - "WEEKLY" - The score is a weekly score.
  1961. // - "DAILY" - The score is a daily score.
  1962. BeatenScoreTimeSpans []string `json:"beatenScoreTimeSpans,omitempty"`
  1963. // FormattedScore: The formatted value of the submitted score.
  1964. FormattedScore string `json:"formattedScore,omitempty"`
  1965. // Kind: Uniquely identifies the type of this resource. Value is always
  1966. // the fixed string games#playerScoreResponse.
  1967. Kind string `json:"kind,omitempty"`
  1968. // LeaderboardId: The leaderboard ID that this score was submitted to.
  1969. LeaderboardId string `json:"leaderboardId,omitempty"`
  1970. // ScoreTag: Additional information about this score. Values will
  1971. // contain no more than 64 URI-safe characters as defined by section 2.3
  1972. // of RFC 3986.
  1973. ScoreTag string `json:"scoreTag,omitempty"`
  1974. // UnbeatenScores: The scores in time spans that have not been beaten.
  1975. // As an example, the submitted score may be better than the player's
  1976. // DAILY score, but not better than the player's scores for the WEEKLY
  1977. // or ALL_TIME time spans.
  1978. UnbeatenScores []*PlayerScore `json:"unbeatenScores,omitempty"`
  1979. // ServerResponse contains the HTTP response code and headers from the
  1980. // server.
  1981. googleapi.ServerResponse `json:"-"`
  1982. // ForceSendFields is a list of field names (e.g.
  1983. // "BeatenScoreTimeSpans") to unconditionally include in API requests.
  1984. // By default, fields with empty values are omitted from API requests.
  1985. // However, any non-pointer, non-interface field appearing in
  1986. // ForceSendFields will be sent to the server regardless of whether the
  1987. // field is empty or not. This may be used to include empty fields in
  1988. // Patch requests.
  1989. ForceSendFields []string `json:"-"`
  1990. }
  1991. func (s *PlayerScoreResponse) MarshalJSON() ([]byte, error) {
  1992. type noMethod PlayerScoreResponse
  1993. raw := noMethod(*s)
  1994. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1995. }
  1996. // PlayerScoreSubmissionList: This is a JSON template for a list of
  1997. // score submission requests
  1998. type PlayerScoreSubmissionList struct {
  1999. // Kind: Uniquely identifies the type of this resource. Value is always
  2000. // the fixed string games#playerScoreSubmissionList.
  2001. Kind string `json:"kind,omitempty"`
  2002. // Scores: The score submissions.
  2003. Scores []*ScoreSubmission `json:"scores,omitempty"`
  2004. // ForceSendFields is a list of field names (e.g. "Kind") to
  2005. // unconditionally include in API requests. By default, fields with
  2006. // empty values are omitted from API requests. However, any non-pointer,
  2007. // non-interface field appearing in ForceSendFields will be sent to the
  2008. // server regardless of whether the field is empty or not. This may be
  2009. // used to include empty fields in Patch requests.
  2010. ForceSendFields []string `json:"-"`
  2011. }
  2012. func (s *PlayerScoreSubmissionList) MarshalJSON() ([]byte, error) {
  2013. type noMethod PlayerScoreSubmissionList
  2014. raw := noMethod(*s)
  2015. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2016. }
  2017. // PushToken: This is a JSON template for a push token resource.
  2018. type PushToken struct {
  2019. // ClientRevision: The revision of the client SDK used by your
  2020. // application, in the same format that's used by revisions.check. Used
  2021. // to send backward compatible messages. Format:
  2022. // [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE
  2023. // are:
  2024. // - IOS - Push token is for iOS
  2025. ClientRevision string `json:"clientRevision,omitempty"`
  2026. // Id: Unique identifier for this push token.
  2027. Id *PushTokenId `json:"id,omitempty"`
  2028. // Kind: Uniquely identifies the type of this resource. Value is always
  2029. // the fixed string games#pushToken.
  2030. Kind string `json:"kind,omitempty"`
  2031. // Language: The preferred language for notifications that are sent
  2032. // using this token.
  2033. Language string `json:"language,omitempty"`
  2034. // ForceSendFields is a list of field names (e.g. "ClientRevision") to
  2035. // unconditionally include in API requests. By default, fields with
  2036. // empty values are omitted from API requests. However, any non-pointer,
  2037. // non-interface field appearing in ForceSendFields will be sent to the
  2038. // server regardless of whether the field is empty or not. This may be
  2039. // used to include empty fields in Patch requests.
  2040. ForceSendFields []string `json:"-"`
  2041. }
  2042. func (s *PushToken) MarshalJSON() ([]byte, error) {
  2043. type noMethod PushToken
  2044. raw := noMethod(*s)
  2045. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2046. }
  2047. // PushTokenId: This is a JSON template for a push token ID resource.
  2048. type PushTokenId struct {
  2049. // Ios: A push token ID for iOS devices.
  2050. Ios *PushTokenIdIos `json:"ios,omitempty"`
  2051. // Kind: Uniquely identifies the type of this resource. Value is always
  2052. // the fixed string games#pushTokenId.
  2053. Kind string `json:"kind,omitempty"`
  2054. // ForceSendFields is a list of field names (e.g. "Ios") to
  2055. // unconditionally include in API requests. By default, fields with
  2056. // empty values are omitted from API requests. However, any non-pointer,
  2057. // non-interface field appearing in ForceSendFields will be sent to the
  2058. // server regardless of whether the field is empty or not. This may be
  2059. // used to include empty fields in Patch requests.
  2060. ForceSendFields []string `json:"-"`
  2061. }
  2062. func (s *PushTokenId) MarshalJSON() ([]byte, error) {
  2063. type noMethod PushTokenId
  2064. raw := noMethod(*s)
  2065. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2066. }
  2067. // PushTokenIdIos: A push token ID for iOS devices.
  2068. type PushTokenIdIos struct {
  2069. // ApnsDeviceToken: Device token supplied by an iOS system call to
  2070. // register for remote notifications. Encode this field as web-safe
  2071. // base64.
  2072. ApnsDeviceToken string `json:"apns_device_token,omitempty"`
  2073. // ApnsEnvironment: Indicates whether this token should be used for the
  2074. // production or sandbox APNS server.
  2075. ApnsEnvironment string `json:"apns_environment,omitempty"`
  2076. // ForceSendFields is a list of field names (e.g. "ApnsDeviceToken") to
  2077. // unconditionally include in API requests. By default, fields with
  2078. // empty values are omitted from API requests. However, any non-pointer,
  2079. // non-interface field appearing in ForceSendFields will be sent to the
  2080. // server regardless of whether the field is empty or not. This may be
  2081. // used to include empty fields in Patch requests.
  2082. ForceSendFields []string `json:"-"`
  2083. }
  2084. func (s *PushTokenIdIos) MarshalJSON() ([]byte, error) {
  2085. type noMethod PushTokenIdIos
  2086. raw := noMethod(*s)
  2087. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2088. }
  2089. // Quest: This is a JSON template for a Quest resource.
  2090. type Quest struct {
  2091. // AcceptedTimestampMillis: The timestamp at which the user accepted the
  2092. // quest in milliseconds since the epoch in UTC. Only present if the
  2093. // player has accepted the quest.
  2094. AcceptedTimestampMillis int64 `json:"acceptedTimestampMillis,omitempty,string"`
  2095. // ApplicationId: The ID of the application this quest is part of.
  2096. ApplicationId string `json:"applicationId,omitempty"`
  2097. // BannerUrl: The banner image URL for the quest.
  2098. BannerUrl string `json:"bannerUrl,omitempty"`
  2099. // Description: The description of the quest.
  2100. Description string `json:"description,omitempty"`
  2101. // EndTimestampMillis: The timestamp at which the quest ceases to be
  2102. // active in milliseconds since the epoch in UTC.
  2103. EndTimestampMillis int64 `json:"endTimestampMillis,omitempty,string"`
  2104. // IconUrl: The icon image URL for the quest.
  2105. IconUrl string `json:"iconUrl,omitempty"`
  2106. // Id: The ID of the quest.
  2107. Id string `json:"id,omitempty"`
  2108. // IsDefaultBannerUrl: Indicates whether the banner image being returned
  2109. // is a default image, or is game-provided.
  2110. IsDefaultBannerUrl bool `json:"isDefaultBannerUrl,omitempty"`
  2111. // IsDefaultIconUrl: Indicates whether the icon image being returned is
  2112. // a default image, or is game-provided.
  2113. IsDefaultIconUrl bool `json:"isDefaultIconUrl,omitempty"`
  2114. // Kind: Uniquely identifies the type of this resource. Value is always
  2115. // the fixed string games#quest.
  2116. Kind string `json:"kind,omitempty"`
  2117. // LastUpdatedTimestampMillis: The timestamp at which the quest was last
  2118. // updated by the user in milliseconds since the epoch in UTC. Only
  2119. // present if the player has accepted the quest.
  2120. LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"`
  2121. // Milestones: The quest milestones.
  2122. Milestones []*QuestMilestone `json:"milestones,omitempty"`
  2123. // Name: The name of the quest.
  2124. Name string `json:"name,omitempty"`
  2125. // NotifyTimestampMillis: The timestamp at which the user should be
  2126. // notified that the quest will end soon in milliseconds since the epoch
  2127. // in UTC.
  2128. NotifyTimestampMillis int64 `json:"notifyTimestampMillis,omitempty,string"`
  2129. // StartTimestampMillis: The timestamp at which the quest becomes active
  2130. // in milliseconds since the epoch in UTC.
  2131. StartTimestampMillis int64 `json:"startTimestampMillis,omitempty,string"`
  2132. // State: The state of the quest.
  2133. // Possible values are:
  2134. // - "UPCOMING": The quest is upcoming. The user can see the quest, but
  2135. // cannot accept it until it is open.
  2136. // - "OPEN": The quest is currently open and may be accepted at this
  2137. // time.
  2138. // - "ACCEPTED": The user is currently participating in this quest.
  2139. // - "COMPLETED": The user has completed the quest.
  2140. // - "FAILED": The quest was attempted but was not completed before the
  2141. // deadline expired.
  2142. // - "EXPIRED": The quest has expired and was not accepted.
  2143. // - "DELETED": The quest should be deleted from the local database.
  2144. State string `json:"state,omitempty"`
  2145. // ServerResponse contains the HTTP response code and headers from the
  2146. // server.
  2147. googleapi.ServerResponse `json:"-"`
  2148. // ForceSendFields is a list of field names (e.g.
  2149. // "AcceptedTimestampMillis") to unconditionally include in API
  2150. // requests. By default, fields with empty values are omitted from API
  2151. // requests. However, any non-pointer, non-interface field appearing in
  2152. // ForceSendFields will be sent to the server regardless of whether the
  2153. // field is empty or not. This may be used to include empty fields in
  2154. // Patch requests.
  2155. ForceSendFields []string `json:"-"`
  2156. }
  2157. func (s *Quest) MarshalJSON() ([]byte, error) {
  2158. type noMethod Quest
  2159. raw := noMethod(*s)
  2160. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2161. }
  2162. // QuestContribution: This is a JSON template for a Quest Criterion
  2163. // Contribution resource.
  2164. type QuestContribution struct {
  2165. // FormattedValue: The formatted value of the contribution as a string.
  2166. // Format depends on the configuration for the associated event
  2167. // definition in the Play Games Developer Console.
  2168. FormattedValue string `json:"formattedValue,omitempty"`
  2169. // Kind: Uniquely identifies the type of this resource. Value is always
  2170. // the fixed string games#questContribution.
  2171. Kind string `json:"kind,omitempty"`
  2172. // Value: The value of the contribution.
  2173. Value int64 `json:"value,omitempty,string"`
  2174. // ForceSendFields is a list of field names (e.g. "FormattedValue") to
  2175. // unconditionally include in API requests. By default, fields with
  2176. // empty values are omitted from API requests. However, any non-pointer,
  2177. // non-interface field appearing in ForceSendFields will be sent to the
  2178. // server regardless of whether the field is empty or not. This may be
  2179. // used to include empty fields in Patch requests.
  2180. ForceSendFields []string `json:"-"`
  2181. }
  2182. func (s *QuestContribution) MarshalJSON() ([]byte, error) {
  2183. type noMethod QuestContribution
  2184. raw := noMethod(*s)
  2185. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2186. }
  2187. // QuestCriterion: This is a JSON template for a Quest Criterion
  2188. // resource.
  2189. type QuestCriterion struct {
  2190. // CompletionContribution: The total number of times the associated
  2191. // event must be incremented for the player to complete this quest.
  2192. CompletionContribution *QuestContribution `json:"completionContribution,omitempty"`
  2193. // CurrentContribution: The number of increments the player has made
  2194. // toward the completion count event increments required to complete the
  2195. // quest. This value will not exceed the completion contribution.
  2196. // There will be no currentContribution until the player has accepted
  2197. // the quest.
  2198. CurrentContribution *QuestContribution `json:"currentContribution,omitempty"`
  2199. // EventId: The ID of the event the criterion corresponds to.
  2200. EventId string `json:"eventId,omitempty"`
  2201. // InitialPlayerProgress: The value of the event associated with this
  2202. // quest at the time that the quest was accepted. This value may change
  2203. // if event increments that took place before the start of quest are
  2204. // uploaded after the quest starts.
  2205. // There will be no initialPlayerProgress until the player has accepted
  2206. // the quest.
  2207. InitialPlayerProgress *QuestContribution `json:"initialPlayerProgress,omitempty"`
  2208. // Kind: Uniquely identifies the type of this resource. Value is always
  2209. // the fixed string games#questCriterion.
  2210. Kind string `json:"kind,omitempty"`
  2211. // ForceSendFields is a list of field names (e.g.
  2212. // "CompletionContribution") to unconditionally include in API requests.
  2213. // By default, fields with empty values are omitted from API requests.
  2214. // However, any non-pointer, non-interface field appearing in
  2215. // ForceSendFields will be sent to the server regardless of whether the
  2216. // field is empty or not. This may be used to include empty fields in
  2217. // Patch requests.
  2218. ForceSendFields []string `json:"-"`
  2219. }
  2220. func (s *QuestCriterion) MarshalJSON() ([]byte, error) {
  2221. type noMethod QuestCriterion
  2222. raw := noMethod(*s)
  2223. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2224. }
  2225. // QuestListResponse: This is a JSON template for a list of quest
  2226. // objects.
  2227. type QuestListResponse struct {
  2228. // Items: The quests.
  2229. Items []*Quest `json:"items,omitempty"`
  2230. // Kind: Uniquely identifies the type of this resource. Value is always
  2231. // the fixed string games#questListResponse.
  2232. Kind string `json:"kind,omitempty"`
  2233. // NextPageToken: Token corresponding to the next page of results.
  2234. NextPageToken string `json:"nextPageToken,omitempty"`
  2235. // ServerResponse contains the HTTP response code and headers from the
  2236. // server.
  2237. googleapi.ServerResponse `json:"-"`
  2238. // ForceSendFields is a list of field names (e.g. "Items") to
  2239. // unconditionally include in API requests. By default, fields with
  2240. // empty values are omitted from API requests. However, any non-pointer,
  2241. // non-interface field appearing in ForceSendFields will be sent to the
  2242. // server regardless of whether the field is empty or not. This may be
  2243. // used to include empty fields in Patch requests.
  2244. ForceSendFields []string `json:"-"`
  2245. }
  2246. func (s *QuestListResponse) MarshalJSON() ([]byte, error) {
  2247. type noMethod QuestListResponse
  2248. raw := noMethod(*s)
  2249. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2250. }
  2251. // QuestMilestone: This is a JSON template for a Quest Milestone
  2252. // resource.
  2253. type QuestMilestone struct {
  2254. // CompletionRewardData: The completion reward data of the milestone,
  2255. // represented as a Base64-encoded string. This is a developer-specified
  2256. // binary blob with size between 0 and 2 KB before encoding.
  2257. CompletionRewardData string `json:"completionRewardData,omitempty"`
  2258. // Criteria: The criteria of the milestone.
  2259. Criteria []*QuestCriterion `json:"criteria,omitempty"`
  2260. // Id: The milestone ID.
  2261. Id string `json:"id,omitempty"`
  2262. // Kind: Uniquely identifies the type of this resource. Value is always
  2263. // the fixed string games#questMilestone.
  2264. Kind string `json:"kind,omitempty"`
  2265. // State: The current state of the milestone.
  2266. // Possible values are:
  2267. // - "COMPLETED_NOT_CLAIMED" - The milestone is complete, but has not
  2268. // yet been claimed.
  2269. // - "CLAIMED" - The milestone is complete and has been claimed.
  2270. // - "NOT_COMPLETED" - The milestone has not yet been completed.
  2271. // - "NOT_STARTED" - The milestone is for a quest that has not yet been
  2272. // accepted.
  2273. State string `json:"state,omitempty"`
  2274. // ForceSendFields is a list of field names (e.g.
  2275. // "CompletionRewardData") to unconditionally include in API requests.
  2276. // By default, fields with empty values are omitted from API requests.
  2277. // However, any non-pointer, non-interface field appearing in
  2278. // ForceSendFields will be sent to the server regardless of whether the
  2279. // field is empty or not. This may be used to include empty fields in
  2280. // Patch requests.
  2281. ForceSendFields []string `json:"-"`
  2282. }
  2283. func (s *QuestMilestone) MarshalJSON() ([]byte, error) {
  2284. type noMethod QuestMilestone
  2285. raw := noMethod(*s)
  2286. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2287. }
  2288. // RevisionCheckResponse: This is a JSON template for the result of
  2289. // checking a revision.
  2290. type RevisionCheckResponse struct {
  2291. // ApiVersion: The version of the API this client revision should use
  2292. // when calling API methods.
  2293. ApiVersion string `json:"apiVersion,omitempty"`
  2294. // Kind: Uniquely identifies the type of this resource. Value is always
  2295. // the fixed string games#revisionCheckResponse.
  2296. Kind string `json:"kind,omitempty"`
  2297. // RevisionStatus: The result of the revision check.
  2298. // Possible values are:
  2299. // - "OK" - The revision being used is current.
  2300. // - "DEPRECATED" - There is currently a newer version available, but
  2301. // the revision being used still works.
  2302. // - "INVALID" - The revision being used is not supported in any
  2303. // released version.
  2304. RevisionStatus string `json:"revisionStatus,omitempty"`
  2305. // ServerResponse contains the HTTP response code and headers from the
  2306. // server.
  2307. googleapi.ServerResponse `json:"-"`
  2308. // ForceSendFields is a list of field names (e.g. "ApiVersion") to
  2309. // unconditionally include in API requests. By default, fields with
  2310. // empty values are omitted from API requests. However, any non-pointer,
  2311. // non-interface field appearing in ForceSendFields will be sent to the
  2312. // server regardless of whether the field is empty or not. This may be
  2313. // used to include empty fields in Patch requests.
  2314. ForceSendFields []string `json:"-"`
  2315. }
  2316. func (s *RevisionCheckResponse) MarshalJSON() ([]byte, error) {
  2317. type noMethod RevisionCheckResponse
  2318. raw := noMethod(*s)
  2319. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2320. }
  2321. // Room: This is a JSON template for a room resource object.
  2322. type Room struct {
  2323. // ApplicationId: The ID of the application being played.
  2324. ApplicationId string `json:"applicationId,omitempty"`
  2325. // AutoMatchingCriteria: Criteria for auto-matching players into this
  2326. // room.
  2327. AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  2328. // AutoMatchingStatus: Auto-matching status for this room. Not set if
  2329. // the room is not currently in the auto-matching queue.
  2330. AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"`
  2331. // CreationDetails: Details about the room creation.
  2332. CreationDetails *RoomModification `json:"creationDetails,omitempty"`
  2333. // Description: This short description is generated by our servers and
  2334. // worded relative to the player requesting the room. It is intended to
  2335. // be displayed when the room is shown in a list (that is, an invitation
  2336. // to a room.)
  2337. Description string `json:"description,omitempty"`
  2338. // InviterId: The ID of the participant that invited the user to the
  2339. // room. Not set if the user was not invited to the room.
  2340. InviterId string `json:"inviterId,omitempty"`
  2341. // Kind: Uniquely identifies the type of this resource. Value is always
  2342. // the fixed string games#room.
  2343. Kind string `json:"kind,omitempty"`
  2344. // LastUpdateDetails: Details about the last update to the room.
  2345. LastUpdateDetails *RoomModification `json:"lastUpdateDetails,omitempty"`
  2346. // Participants: The participants involved in the room, along with their
  2347. // statuses. Includes participants who have left or declined
  2348. // invitations.
  2349. Participants []*RoomParticipant `json:"participants,omitempty"`
  2350. // RoomId: Globally unique ID for a room.
  2351. RoomId string `json:"roomId,omitempty"`
  2352. // RoomStatusVersion: The version of the room status: an increasing
  2353. // counter, used by the client to ignore out-of-order updates to room
  2354. // status.
  2355. RoomStatusVersion int64 `json:"roomStatusVersion,omitempty"`
  2356. // Status: The status of the room.
  2357. // Possible values are:
  2358. // - "ROOM_INVITING" - One or more players have been invited and not
  2359. // responded.
  2360. // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by
  2361. // auto-matching.
  2362. // - "ROOM_CONNECTING" - Players have joined and are connecting to each
  2363. // other (either before or after auto-matching).
  2364. // - "ROOM_ACTIVE" - All players have joined and connected to each
  2365. // other.
  2366. // - "ROOM_DELETED" - The room should no longer be shown on the client.
  2367. // Returned in sync calls when a player joins a room (as a tombstone),
  2368. // or for rooms where all joined participants have left.
  2369. Status string `json:"status,omitempty"`
  2370. // Variant: The variant / mode of the application being played; can be
  2371. // any integer value, or left blank.
  2372. Variant int64 `json:"variant,omitempty"`
  2373. // ServerResponse contains the HTTP response code and headers from the
  2374. // server.
  2375. googleapi.ServerResponse `json:"-"`
  2376. // ForceSendFields is a list of field names (e.g. "ApplicationId") to
  2377. // unconditionally include in API requests. By default, fields with
  2378. // empty values are omitted from API requests. However, any non-pointer,
  2379. // non-interface field appearing in ForceSendFields will be sent to the
  2380. // server regardless of whether the field is empty or not. This may be
  2381. // used to include empty fields in Patch requests.
  2382. ForceSendFields []string `json:"-"`
  2383. }
  2384. func (s *Room) MarshalJSON() ([]byte, error) {
  2385. type noMethod Room
  2386. raw := noMethod(*s)
  2387. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2388. }
  2389. // RoomAutoMatchStatus: This is a JSON template for status of room
  2390. // automatching that is in progress.
  2391. type RoomAutoMatchStatus struct {
  2392. // Kind: Uniquely identifies the type of this resource. Value is always
  2393. // the fixed string games#roomAutoMatchStatus.
  2394. Kind string `json:"kind,omitempty"`
  2395. // WaitEstimateSeconds: An estimate for the amount of time (in seconds)
  2396. // that auto-matching is expected to take to complete.
  2397. WaitEstimateSeconds int64 `json:"waitEstimateSeconds,omitempty"`
  2398. // ForceSendFields is a list of field names (e.g. "Kind") to
  2399. // unconditionally include in API requests. By default, fields with
  2400. // empty values are omitted from API requests. However, any non-pointer,
  2401. // non-interface field appearing in ForceSendFields will be sent to the
  2402. // server regardless of whether the field is empty or not. This may be
  2403. // used to include empty fields in Patch requests.
  2404. ForceSendFields []string `json:"-"`
  2405. }
  2406. func (s *RoomAutoMatchStatus) MarshalJSON() ([]byte, error) {
  2407. type noMethod RoomAutoMatchStatus
  2408. raw := noMethod(*s)
  2409. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2410. }
  2411. // RoomAutoMatchingCriteria: This is a JSON template for a room
  2412. // auto-match criteria object.
  2413. type RoomAutoMatchingCriteria struct {
  2414. // ExclusiveBitmask: A bitmask indicating when auto-matches are valid.
  2415. // When ANDed with other exclusive bitmasks, the result must be zero.
  2416. // Can be used to support exclusive roles within a game.
  2417. ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"`
  2418. // Kind: Uniquely identifies the type of this resource. Value is always
  2419. // the fixed string games#roomAutoMatchingCriteria.
  2420. Kind string `json:"kind,omitempty"`
  2421. // MaxAutoMatchingPlayers: The maximum number of players that should be
  2422. // added to the room by auto-matching.
  2423. MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"`
  2424. // MinAutoMatchingPlayers: The minimum number of players that should be
  2425. // added to the room by auto-matching.
  2426. MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"`
  2427. // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to
  2428. // unconditionally include in API requests. By default, fields with
  2429. // empty values are omitted from API requests. However, any non-pointer,
  2430. // non-interface field appearing in ForceSendFields will be sent to the
  2431. // server regardless of whether the field is empty or not. This may be
  2432. // used to include empty fields in Patch requests.
  2433. ForceSendFields []string `json:"-"`
  2434. }
  2435. func (s *RoomAutoMatchingCriteria) MarshalJSON() ([]byte, error) {
  2436. type noMethod RoomAutoMatchingCriteria
  2437. raw := noMethod(*s)
  2438. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2439. }
  2440. // RoomClientAddress: This is a JSON template for the client address
  2441. // when setting up a room.
  2442. type RoomClientAddress struct {
  2443. // Kind: Uniquely identifies the type of this resource. Value is always
  2444. // the fixed string games#roomClientAddress.
  2445. Kind string `json:"kind,omitempty"`
  2446. // XmppAddress: The XMPP address of the client on the Google Games XMPP
  2447. // network.
  2448. XmppAddress string `json:"xmppAddress,omitempty"`
  2449. // ForceSendFields is a list of field names (e.g. "Kind") to
  2450. // unconditionally include in API requests. By default, fields with
  2451. // empty values are omitted from API requests. However, any non-pointer,
  2452. // non-interface field appearing in ForceSendFields will be sent to the
  2453. // server regardless of whether the field is empty or not. This may be
  2454. // used to include empty fields in Patch requests.
  2455. ForceSendFields []string `json:"-"`
  2456. }
  2457. func (s *RoomClientAddress) MarshalJSON() ([]byte, error) {
  2458. type noMethod RoomClientAddress
  2459. raw := noMethod(*s)
  2460. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2461. }
  2462. // RoomCreateRequest: This is a JSON template for a room creation
  2463. // request.
  2464. type RoomCreateRequest struct {
  2465. // AutoMatchingCriteria: Criteria for auto-matching players into this
  2466. // room.
  2467. AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  2468. // Capabilities: The capabilities that this client supports for realtime
  2469. // communication.
  2470. Capabilities []string `json:"capabilities,omitempty"`
  2471. // ClientAddress: Client address for the player creating the room.
  2472. ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"`
  2473. // InvitedPlayerIds: The player IDs to invite to the room.
  2474. InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"`
  2475. // Kind: Uniquely identifies the type of this resource. Value is always
  2476. // the fixed string games#roomCreateRequest.
  2477. Kind string `json:"kind,omitempty"`
  2478. // NetworkDiagnostics: Network diagnostics for the client creating the
  2479. // room.
  2480. NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"`
  2481. // RequestId: A randomly generated numeric ID. This number is used at
  2482. // the server to ensure that the request is handled correctly across
  2483. // retries.
  2484. RequestId int64 `json:"requestId,omitempty,string"`
  2485. // Variant: The variant / mode of the application to be played. This can
  2486. // be any integer value, or left blank. You should use a small number of
  2487. // variants to keep the auto-matching pool as large as possible.
  2488. Variant int64 `json:"variant,omitempty"`
  2489. // ForceSendFields is a list of field names (e.g.
  2490. // "AutoMatchingCriteria") to unconditionally include in API requests.
  2491. // By default, fields with empty values are omitted from API requests.
  2492. // However, any non-pointer, non-interface field appearing in
  2493. // ForceSendFields will be sent to the server regardless of whether the
  2494. // field is empty or not. This may be used to include empty fields in
  2495. // Patch requests.
  2496. ForceSendFields []string `json:"-"`
  2497. }
  2498. func (s *RoomCreateRequest) MarshalJSON() ([]byte, error) {
  2499. type noMethod RoomCreateRequest
  2500. raw := noMethod(*s)
  2501. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2502. }
  2503. // RoomJoinRequest: This is a JSON template for a join room request.
  2504. type RoomJoinRequest struct {
  2505. // Capabilities: The capabilities that this client supports for realtime
  2506. // communication.
  2507. Capabilities []string `json:"capabilities,omitempty"`
  2508. // ClientAddress: Client address for the player joining the room.
  2509. ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"`
  2510. // Kind: Uniquely identifies the type of this resource. Value is always
  2511. // the fixed string games#roomJoinRequest.
  2512. Kind string `json:"kind,omitempty"`
  2513. // NetworkDiagnostics: Network diagnostics for the client joining the
  2514. // room.
  2515. NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"`
  2516. // ForceSendFields is a list of field names (e.g. "Capabilities") to
  2517. // unconditionally include in API requests. By default, fields with
  2518. // empty values are omitted from API requests. However, any non-pointer,
  2519. // non-interface field appearing in ForceSendFields will be sent to the
  2520. // server regardless of whether the field is empty or not. This may be
  2521. // used to include empty fields in Patch requests.
  2522. ForceSendFields []string `json:"-"`
  2523. }
  2524. func (s *RoomJoinRequest) MarshalJSON() ([]byte, error) {
  2525. type noMethod RoomJoinRequest
  2526. raw := noMethod(*s)
  2527. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2528. }
  2529. // RoomLeaveDiagnostics: This is a JSON template for room leave
  2530. // diagnostics.
  2531. type RoomLeaveDiagnostics struct {
  2532. // AndroidNetworkSubtype: Android network subtype.
  2533. // http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype()
  2534. AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"`
  2535. // AndroidNetworkType: Android network type.
  2536. // http://developer.android.com/reference/android/net/NetworkInfo.html#getType()
  2537. AndroidNetworkType int64 `json:"androidNetworkType,omitempty"`
  2538. // IosNetworkType: iOS network type as defined in Reachability.h.
  2539. IosNetworkType int64 `json:"iosNetworkType,omitempty"`
  2540. // Kind: Uniquely identifies the type of this resource. Value is always
  2541. // the fixed string games#roomLeaveDiagnostics.
  2542. Kind string `json:"kind,omitempty"`
  2543. // NetworkOperatorCode: The MCC+MNC code for the client's network
  2544. // connection. On Android:
  2545. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see:
  2546. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html
  2547. NetworkOperatorCode string `json:"networkOperatorCode,omitempty"`
  2548. // NetworkOperatorName: The name of the carrier of the client's network
  2549. // connection. On Android:
  2550. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS:
  2551. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName
  2552. NetworkOperatorName string `json:"networkOperatorName,omitempty"`
  2553. // PeerSession: Diagnostics about all peer sessions.
  2554. PeerSession []*PeerSessionDiagnostics `json:"peerSession,omitempty"`
  2555. // SocketsUsed: Whether or not sockets were used.
  2556. SocketsUsed bool `json:"socketsUsed,omitempty"`
  2557. // ForceSendFields is a list of field names (e.g.
  2558. // "AndroidNetworkSubtype") to unconditionally include in API requests.
  2559. // By default, fields with empty values are omitted from API requests.
  2560. // However, any non-pointer, non-interface field appearing in
  2561. // ForceSendFields will be sent to the server regardless of whether the
  2562. // field is empty or not. This may be used to include empty fields in
  2563. // Patch requests.
  2564. ForceSendFields []string `json:"-"`
  2565. }
  2566. func (s *RoomLeaveDiagnostics) MarshalJSON() ([]byte, error) {
  2567. type noMethod RoomLeaveDiagnostics
  2568. raw := noMethod(*s)
  2569. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2570. }
  2571. // RoomLeaveRequest: This is a JSON template for a leave room request.
  2572. type RoomLeaveRequest struct {
  2573. // Kind: Uniquely identifies the type of this resource. Value is always
  2574. // the fixed string games#roomLeaveRequest.
  2575. Kind string `json:"kind,omitempty"`
  2576. // LeaveDiagnostics: Diagnostics for a player leaving the room.
  2577. LeaveDiagnostics *RoomLeaveDiagnostics `json:"leaveDiagnostics,omitempty"`
  2578. // Reason: Reason for leaving the match.
  2579. // Possible values are:
  2580. // - "PLAYER_LEFT" - The player chose to leave the room..
  2581. // - "GAME_LEFT" - The game chose to remove the player from the room.
  2582. // - "REALTIME_ABANDONED" - The player switched to another application
  2583. // and abandoned the room.
  2584. // - "REALTIME_PEER_CONNECTION_FAILURE" - The client was unable to
  2585. // establish a connection to other peer(s).
  2586. // - "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to
  2587. // communicate with the server.
  2588. // - "REALTIME_SERVER_ERROR" - The client received an error response
  2589. // when it tried to communicate with the server.
  2590. // - "REALTIME_TIMEOUT" - The client timed out while waiting for a room.
  2591. //
  2592. // - "REALTIME_CLIENT_DISCONNECTING" - The client disconnects without
  2593. // first calling Leave.
  2594. // - "REALTIME_SIGN_OUT" - The user signed out of G+ while in the room.
  2595. //
  2596. // - "REALTIME_GAME_CRASHED" - The game crashed.
  2597. // - "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed.
  2598. // - "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client is
  2599. // trying to enter a room.
  2600. // - "REALTIME_SAME_CLIENT_ROOM_OPERATION" - The same client is trying
  2601. // to enter a new room.
  2602. Reason string `json:"reason,omitempty"`
  2603. // ForceSendFields is a list of field names (e.g. "Kind") to
  2604. // unconditionally include in API requests. By default, fields with
  2605. // empty values are omitted from API requests. However, any non-pointer,
  2606. // non-interface field appearing in ForceSendFields will be sent to the
  2607. // server regardless of whether the field is empty or not. This may be
  2608. // used to include empty fields in Patch requests.
  2609. ForceSendFields []string `json:"-"`
  2610. }
  2611. func (s *RoomLeaveRequest) MarshalJSON() ([]byte, error) {
  2612. type noMethod RoomLeaveRequest
  2613. raw := noMethod(*s)
  2614. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2615. }
  2616. // RoomList: This is a JSON template for a list of rooms.
  2617. type RoomList struct {
  2618. // Items: The rooms.
  2619. Items []*Room `json:"items,omitempty"`
  2620. // Kind: Uniquely identifies the type of this resource. Value is always
  2621. // the fixed string games#roomList.
  2622. Kind string `json:"kind,omitempty"`
  2623. // NextPageToken: The pagination token for the next page of results.
  2624. NextPageToken string `json:"nextPageToken,omitempty"`
  2625. // ServerResponse contains the HTTP response code and headers from the
  2626. // server.
  2627. googleapi.ServerResponse `json:"-"`
  2628. // ForceSendFields is a list of field names (e.g. "Items") to
  2629. // unconditionally include in API requests. By default, fields with
  2630. // empty values are omitted from API requests. However, any non-pointer,
  2631. // non-interface field appearing in ForceSendFields will be sent to the
  2632. // server regardless of whether the field is empty or not. This may be
  2633. // used to include empty fields in Patch requests.
  2634. ForceSendFields []string `json:"-"`
  2635. }
  2636. func (s *RoomList) MarshalJSON() ([]byte, error) {
  2637. type noMethod RoomList
  2638. raw := noMethod(*s)
  2639. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2640. }
  2641. // RoomModification: This is a JSON template for room modification
  2642. // metadata.
  2643. type RoomModification struct {
  2644. // Kind: Uniquely identifies the type of this resource. Value is always
  2645. // the fixed string games#roomModification.
  2646. Kind string `json:"kind,omitempty"`
  2647. // ModifiedTimestampMillis: The timestamp at which they modified the
  2648. // room, in milliseconds since the epoch in UTC.
  2649. ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"`
  2650. // ParticipantId: The ID of the participant that modified the room.
  2651. ParticipantId string `json:"participantId,omitempty"`
  2652. // ForceSendFields is a list of field names (e.g. "Kind") to
  2653. // unconditionally include in API requests. By default, fields with
  2654. // empty values are omitted from API requests. However, any non-pointer,
  2655. // non-interface field appearing in ForceSendFields will be sent to the
  2656. // server regardless of whether the field is empty or not. This may be
  2657. // used to include empty fields in Patch requests.
  2658. ForceSendFields []string `json:"-"`
  2659. }
  2660. func (s *RoomModification) MarshalJSON() ([]byte, error) {
  2661. type noMethod RoomModification
  2662. raw := noMethod(*s)
  2663. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2664. }
  2665. // RoomP2PStatus: This is a JSON template for an update on the status of
  2666. // a peer in a room.
  2667. type RoomP2PStatus struct {
  2668. // ConnectionSetupLatencyMillis: The amount of time in milliseconds it
  2669. // took to establish connections with this peer.
  2670. ConnectionSetupLatencyMillis int64 `json:"connectionSetupLatencyMillis,omitempty"`
  2671. // Error: The error code in event of a failure.
  2672. // Possible values are:
  2673. // - "P2P_FAILED" - The client failed to establish a P2P connection with
  2674. // the peer.
  2675. // - "PRESENCE_FAILED" - The client failed to register to receive P2P
  2676. // connections.
  2677. // - "RELAY_SERVER_FAILED" - The client received an error when trying to
  2678. // use the relay server to establish a P2P connection with the peer.
  2679. Error string `json:"error,omitempty"`
  2680. // ErrorReason: More detailed diagnostic message returned in event of a
  2681. // failure.
  2682. ErrorReason string `json:"error_reason,omitempty"`
  2683. // Kind: Uniquely identifies the type of this resource. Value is always
  2684. // the fixed string games#roomP2PStatus.
  2685. Kind string `json:"kind,omitempty"`
  2686. // ParticipantId: The ID of the participant.
  2687. ParticipantId string `json:"participantId,omitempty"`
  2688. // Status: The status of the peer in the room.
  2689. // Possible values are:
  2690. // - "CONNECTION_ESTABLISHED" - The client established a P2P connection
  2691. // with the peer.
  2692. // - "CONNECTION_FAILED" - The client failed to establish directed
  2693. // presence with the peer.
  2694. Status string `json:"status,omitempty"`
  2695. // UnreliableRoundtripLatencyMillis: The amount of time in milliseconds
  2696. // it took to send packets back and forth on the unreliable channel with
  2697. // this peer.
  2698. UnreliableRoundtripLatencyMillis int64 `json:"unreliableRoundtripLatencyMillis,omitempty"`
  2699. // ForceSendFields is a list of field names (e.g.
  2700. // "ConnectionSetupLatencyMillis") to unconditionally include in API
  2701. // requests. By default, fields with empty values are omitted from API
  2702. // requests. However, any non-pointer, non-interface field appearing in
  2703. // ForceSendFields will be sent to the server regardless of whether the
  2704. // field is empty or not. This may be used to include empty fields in
  2705. // Patch requests.
  2706. ForceSendFields []string `json:"-"`
  2707. }
  2708. func (s *RoomP2PStatus) MarshalJSON() ([]byte, error) {
  2709. type noMethod RoomP2PStatus
  2710. raw := noMethod(*s)
  2711. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2712. }
  2713. // RoomP2PStatuses: This is a JSON template for an update on the status
  2714. // of peers in a room.
  2715. type RoomP2PStatuses struct {
  2716. // Kind: Uniquely identifies the type of this resource. Value is always
  2717. // the fixed string games#roomP2PStatuses.
  2718. Kind string `json:"kind,omitempty"`
  2719. // Updates: The updates for the peers.
  2720. Updates []*RoomP2PStatus `json:"updates,omitempty"`
  2721. // ForceSendFields is a list of field names (e.g. "Kind") to
  2722. // unconditionally include in API requests. By default, fields with
  2723. // empty values are omitted from API requests. However, any non-pointer,
  2724. // non-interface field appearing in ForceSendFields will be sent to the
  2725. // server regardless of whether the field is empty or not. This may be
  2726. // used to include empty fields in Patch requests.
  2727. ForceSendFields []string `json:"-"`
  2728. }
  2729. func (s *RoomP2PStatuses) MarshalJSON() ([]byte, error) {
  2730. type noMethod RoomP2PStatuses
  2731. raw := noMethod(*s)
  2732. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2733. }
  2734. // RoomParticipant: This is a JSON template for a participant in a room.
  2735. type RoomParticipant struct {
  2736. // AutoMatched: True if this participant was auto-matched with the
  2737. // requesting player.
  2738. AutoMatched bool `json:"autoMatched,omitempty"`
  2739. // AutoMatchedPlayer: Information about a player that has been
  2740. // anonymously auto-matched against the requesting player. (Either
  2741. // player or autoMatchedPlayer will be set.)
  2742. AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"`
  2743. // Capabilities: The capabilities which can be used when communicating
  2744. // with this participant.
  2745. Capabilities []string `json:"capabilities,omitempty"`
  2746. // ClientAddress: Client address for the participant.
  2747. ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"`
  2748. // Connected: True if this participant is in the fully connected set of
  2749. // peers in the room.
  2750. Connected bool `json:"connected,omitempty"`
  2751. // Id: An identifier for the participant in the scope of the room.
  2752. // Cannot be used to identify a player across rooms or in other
  2753. // contexts.
  2754. Id string `json:"id,omitempty"`
  2755. // Kind: Uniquely identifies the type of this resource. Value is always
  2756. // the fixed string games#roomParticipant.
  2757. Kind string `json:"kind,omitempty"`
  2758. // LeaveReason: The reason the participant left the room; populated if
  2759. // the participant status is PARTICIPANT_LEFT.
  2760. // Possible values are:
  2761. // - "PLAYER_LEFT" - The player explicitly chose to leave the room.
  2762. // - "GAME_LEFT" - The game chose to remove the player from the room.
  2763. // - "ABANDONED" - The player switched to another application and
  2764. // abandoned the room.
  2765. // - "PEER_CONNECTION_FAILURE" - The client was unable to establish or
  2766. // maintain a connection to other peer(s) in the room.
  2767. // - "SERVER_ERROR" - The client received an error response when it
  2768. // tried to communicate with the server.
  2769. // - "TIMEOUT" - The client timed out while waiting for players to join
  2770. // and connect.
  2771. // - "PRESENCE_FAILURE" - The client's XMPP connection ended abruptly.
  2772. LeaveReason string `json:"leaveReason,omitempty"`
  2773. // Player: Information about the player. Not populated if this player
  2774. // was anonymously auto-matched against the requesting player. (Either
  2775. // player or autoMatchedPlayer will be set.)
  2776. Player *Player `json:"player,omitempty"`
  2777. // Status: The status of the participant with respect to the
  2778. // room.
  2779. // Possible values are:
  2780. // - "PARTICIPANT_INVITED" - The participant has been invited to join
  2781. // the room, but has not yet responded.
  2782. // - "PARTICIPANT_JOINED" - The participant has joined the room (either
  2783. // after creating it or accepting an invitation.)
  2784. // - "PARTICIPANT_DECLINED" - The participant declined an invitation to
  2785. // join the room.
  2786. // - "PARTICIPANT_LEFT" - The participant joined the room and then left
  2787. // it.
  2788. Status string `json:"status,omitempty"`
  2789. // ForceSendFields is a list of field names (e.g. "AutoMatched") to
  2790. // unconditionally include in API requests. By default, fields with
  2791. // empty values are omitted from API requests. However, any non-pointer,
  2792. // non-interface field appearing in ForceSendFields will be sent to the
  2793. // server regardless of whether the field is empty or not. This may be
  2794. // used to include empty fields in Patch requests.
  2795. ForceSendFields []string `json:"-"`
  2796. }
  2797. func (s *RoomParticipant) MarshalJSON() ([]byte, error) {
  2798. type noMethod RoomParticipant
  2799. raw := noMethod(*s)
  2800. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2801. }
  2802. // RoomStatus: This is a JSON template for the status of a room that the
  2803. // player has joined.
  2804. type RoomStatus struct {
  2805. // AutoMatchingStatus: Auto-matching status for this room. Not set if
  2806. // the room is not currently in the automatching queue.
  2807. AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"`
  2808. // Kind: Uniquely identifies the type of this resource. Value is always
  2809. // the fixed string games#roomStatus.
  2810. Kind string `json:"kind,omitempty"`
  2811. // Participants: The participants involved in the room, along with their
  2812. // statuses. Includes participants who have left or declined
  2813. // invitations.
  2814. Participants []*RoomParticipant `json:"participants,omitempty"`
  2815. // RoomId: Globally unique ID for a room.
  2816. RoomId string `json:"roomId,omitempty"`
  2817. // Status: The status of the room.
  2818. // Possible values are:
  2819. // - "ROOM_INVITING" - One or more players have been invited and not
  2820. // responded.
  2821. // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by
  2822. // auto-matching.
  2823. // - "ROOM_CONNECTING" - Players have joined are connecting to each
  2824. // other (either before or after auto-matching).
  2825. // - "ROOM_ACTIVE" - All players have joined and connected to each
  2826. // other.
  2827. // - "ROOM_DELETED" - All joined players have left.
  2828. Status string `json:"status,omitempty"`
  2829. // StatusVersion: The version of the status for the room: an increasing
  2830. // counter, used by the client to ignore out-of-order updates to room
  2831. // status.
  2832. StatusVersion int64 `json:"statusVersion,omitempty"`
  2833. // ServerResponse contains the HTTP response code and headers from the
  2834. // server.
  2835. googleapi.ServerResponse `json:"-"`
  2836. // ForceSendFields is a list of field names (e.g. "AutoMatchingStatus")
  2837. // to unconditionally include in API requests. By default, fields with
  2838. // empty values are omitted from API requests. However, any non-pointer,
  2839. // non-interface field appearing in ForceSendFields will be sent to the
  2840. // server regardless of whether the field is empty or not. This may be
  2841. // used to include empty fields in Patch requests.
  2842. ForceSendFields []string `json:"-"`
  2843. }
  2844. func (s *RoomStatus) MarshalJSON() ([]byte, error) {
  2845. type noMethod RoomStatus
  2846. raw := noMethod(*s)
  2847. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2848. }
  2849. // ScoreSubmission: This is a JSON template for a request to submit a
  2850. // score to leaderboards.
  2851. type ScoreSubmission struct {
  2852. // Kind: Uniquely identifies the type of this resource. Value is always
  2853. // the fixed string games#scoreSubmission.
  2854. Kind string `json:"kind,omitempty"`
  2855. // LeaderboardId: The leaderboard this score is being submitted to.
  2856. LeaderboardId string `json:"leaderboardId,omitempty"`
  2857. // Score: The new score being submitted.
  2858. Score int64 `json:"score,omitempty,string"`
  2859. // ScoreTag: Additional information about this score. Values will
  2860. // contain no more than 64 URI-safe characters as defined by section 2.3
  2861. // of RFC 3986.
  2862. ScoreTag string `json:"scoreTag,omitempty"`
  2863. // Signature: Signature Values will contain URI-safe characters as
  2864. // defined by section 2.3 of RFC 3986.
  2865. Signature string `json:"signature,omitempty"`
  2866. // ForceSendFields is a list of field names (e.g. "Kind") to
  2867. // unconditionally include in API requests. By default, fields with
  2868. // empty values are omitted from API requests. However, any non-pointer,
  2869. // non-interface field appearing in ForceSendFields will be sent to the
  2870. // server regardless of whether the field is empty or not. This may be
  2871. // used to include empty fields in Patch requests.
  2872. ForceSendFields []string `json:"-"`
  2873. }
  2874. func (s *ScoreSubmission) MarshalJSON() ([]byte, error) {
  2875. type noMethod ScoreSubmission
  2876. raw := noMethod(*s)
  2877. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2878. }
  2879. // Snapshot: This is a JSON template for an snapshot object.
  2880. type Snapshot struct {
  2881. // CoverImage: The cover image of this snapshot. May be absent if there
  2882. // is no image.
  2883. CoverImage *SnapshotImage `json:"coverImage,omitempty"`
  2884. // Description: The description of this snapshot.
  2885. Description string `json:"description,omitempty"`
  2886. // DriveId: The ID of the file underlying this snapshot in the Drive
  2887. // API. Only present if the snapshot is a view on a Drive file and the
  2888. // file is owned by the caller.
  2889. DriveId string `json:"driveId,omitempty"`
  2890. // DurationMillis: The duration associated with this snapshot, in
  2891. // millis.
  2892. DurationMillis int64 `json:"durationMillis,omitempty,string"`
  2893. // Id: The ID of the snapshot.
  2894. Id string `json:"id,omitempty"`
  2895. // Kind: Uniquely identifies the type of this resource. Value is always
  2896. // the fixed string games#snapshot.
  2897. Kind string `json:"kind,omitempty"`
  2898. // LastModifiedMillis: The timestamp (in millis since Unix epoch) of the
  2899. // last modification to this snapshot.
  2900. LastModifiedMillis int64 `json:"lastModifiedMillis,omitempty,string"`
  2901. // ProgressValue: The progress value (64-bit integer set by developer)
  2902. // associated with this snapshot.
  2903. ProgressValue int64 `json:"progressValue,omitempty,string"`
  2904. // Title: The title of this snapshot.
  2905. Title string `json:"title,omitempty"`
  2906. // Type: The type of this snapshot.
  2907. // Possible values are:
  2908. // - "SAVE_GAME" - A snapshot representing a save game.
  2909. Type string `json:"type,omitempty"`
  2910. // UniqueName: The unique name provided when the snapshot was created.
  2911. UniqueName string `json:"uniqueName,omitempty"`
  2912. // ServerResponse contains the HTTP response code and headers from the
  2913. // server.
  2914. googleapi.ServerResponse `json:"-"`
  2915. // ForceSendFields is a list of field names (e.g. "CoverImage") 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. }
  2923. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  2924. type noMethod Snapshot
  2925. raw := noMethod(*s)
  2926. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2927. }
  2928. // SnapshotImage: This is a JSON template for an image of a snapshot.
  2929. type SnapshotImage struct {
  2930. // Height: The height of the image.
  2931. Height int64 `json:"height,omitempty"`
  2932. // Kind: Uniquely identifies the type of this resource. Value is always
  2933. // the fixed string games#snapshotImage.
  2934. Kind string `json:"kind,omitempty"`
  2935. // MimeType: The MIME type of the image.
  2936. MimeType string `json:"mime_type,omitempty"`
  2937. // Url: The URL of the image. This URL may be invalidated at any time
  2938. // and should not be cached.
  2939. Url string `json:"url,omitempty"`
  2940. // Width: The width of the image.
  2941. Width int64 `json:"width,omitempty"`
  2942. // ForceSendFields is a list of field names (e.g. "Height") to
  2943. // unconditionally include in API requests. By default, fields with
  2944. // empty values are omitted from API requests. However, any non-pointer,
  2945. // non-interface field appearing in ForceSendFields will be sent to the
  2946. // server regardless of whether the field is empty or not. This may be
  2947. // used to include empty fields in Patch requests.
  2948. ForceSendFields []string `json:"-"`
  2949. }
  2950. func (s *SnapshotImage) MarshalJSON() ([]byte, error) {
  2951. type noMethod SnapshotImage
  2952. raw := noMethod(*s)
  2953. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2954. }
  2955. // SnapshotListResponse: This is a JSON template for a list of snapshot
  2956. // objects.
  2957. type SnapshotListResponse struct {
  2958. // Items: The snapshots.
  2959. Items []*Snapshot `json:"items,omitempty"`
  2960. // Kind: Uniquely identifies the type of this resource. Value is always
  2961. // the fixed string games#snapshotListResponse.
  2962. Kind string `json:"kind,omitempty"`
  2963. // NextPageToken: Token corresponding to the next page of results. If
  2964. // there are no more results, the token is omitted.
  2965. NextPageToken string `json:"nextPageToken,omitempty"`
  2966. // ServerResponse contains the HTTP response code and headers from the
  2967. // server.
  2968. googleapi.ServerResponse `json:"-"`
  2969. // ForceSendFields is a list of field names (e.g. "Items") to
  2970. // unconditionally include in API requests. By default, fields with
  2971. // empty values are omitted from API requests. However, any non-pointer,
  2972. // non-interface field appearing in ForceSendFields will be sent to the
  2973. // server regardless of whether the field is empty or not. This may be
  2974. // used to include empty fields in Patch requests.
  2975. ForceSendFields []string `json:"-"`
  2976. }
  2977. func (s *SnapshotListResponse) MarshalJSON() ([]byte, error) {
  2978. type noMethod SnapshotListResponse
  2979. raw := noMethod(*s)
  2980. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2981. }
  2982. // TurnBasedAutoMatchingCriteria: This is a JSON template for an
  2983. // turn-based auto-match criteria object.
  2984. type TurnBasedAutoMatchingCriteria struct {
  2985. // ExclusiveBitmask: A bitmask indicating when auto-matches are valid.
  2986. // When ANDed with other exclusive bitmasks, the result must be zero.
  2987. // Can be used to support exclusive roles within a game.
  2988. ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"`
  2989. // Kind: Uniquely identifies the type of this resource. Value is always
  2990. // the fixed string games#turnBasedAutoMatchingCriteria.
  2991. Kind string `json:"kind,omitempty"`
  2992. // MaxAutoMatchingPlayers: The maximum number of players that should be
  2993. // added to the match by auto-matching.
  2994. MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"`
  2995. // MinAutoMatchingPlayers: The minimum number of players that should be
  2996. // added to the match by auto-matching.
  2997. MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"`
  2998. // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to
  2999. // unconditionally include in API requests. By default, fields with
  3000. // empty values are omitted from API requests. However, any non-pointer,
  3001. // non-interface field appearing in ForceSendFields will be sent to the
  3002. // server regardless of whether the field is empty or not. This may be
  3003. // used to include empty fields in Patch requests.
  3004. ForceSendFields []string `json:"-"`
  3005. }
  3006. func (s *TurnBasedAutoMatchingCriteria) MarshalJSON() ([]byte, error) {
  3007. type noMethod TurnBasedAutoMatchingCriteria
  3008. raw := noMethod(*s)
  3009. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3010. }
  3011. // TurnBasedMatch: This is a JSON template for a turn-based match
  3012. // resource object.
  3013. type TurnBasedMatch struct {
  3014. // ApplicationId: The ID of the application being played.
  3015. ApplicationId string `json:"applicationId,omitempty"`
  3016. // AutoMatchingCriteria: Criteria for auto-matching players into this
  3017. // match.
  3018. AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  3019. // CreationDetails: Details about the match creation.
  3020. CreationDetails *TurnBasedMatchModification `json:"creationDetails,omitempty"`
  3021. // Data: The data / game state for this match.
  3022. Data *TurnBasedMatchData `json:"data,omitempty"`
  3023. // Description: This short description is generated by our servers based
  3024. // on turn state and is localized and worded relative to the player
  3025. // requesting the match. It is intended to be displayed when the match
  3026. // is shown in a list.
  3027. Description string `json:"description,omitempty"`
  3028. // InviterId: The ID of the participant that invited the user to the
  3029. // match. Not set if the user was not invited to the match.
  3030. InviterId string `json:"inviterId,omitempty"`
  3031. // Kind: Uniquely identifies the type of this resource. Value is always
  3032. // the fixed string games#turnBasedMatch.
  3033. Kind string `json:"kind,omitempty"`
  3034. // LastUpdateDetails: Details about the last update to the match.
  3035. LastUpdateDetails *TurnBasedMatchModification `json:"lastUpdateDetails,omitempty"`
  3036. // MatchId: Globally unique ID for a turn-based match.
  3037. MatchId string `json:"matchId,omitempty"`
  3038. // MatchNumber: The number of the match in a chain of rematches. Will be
  3039. // set to 1 for the first match and incremented by 1 for each rematch.
  3040. MatchNumber int64 `json:"matchNumber,omitempty"`
  3041. // MatchVersion: The version of this match: an increasing counter, used
  3042. // to avoid out-of-date updates to the match.
  3043. MatchVersion int64 `json:"matchVersion,omitempty"`
  3044. // Participants: The participants involved in the match, along with
  3045. // their statuses. Includes participants who have left or declined
  3046. // invitations.
  3047. Participants []*TurnBasedMatchParticipant `json:"participants,omitempty"`
  3048. // PendingParticipantId: The ID of the participant that is taking a
  3049. // turn.
  3050. PendingParticipantId string `json:"pendingParticipantId,omitempty"`
  3051. // PreviousMatchData: The data / game state for the previous match; set
  3052. // for the first turn of rematches only.
  3053. PreviousMatchData *TurnBasedMatchData `json:"previousMatchData,omitempty"`
  3054. // RematchId: The ID of a rematch of this match. Only set for completed
  3055. // matches that have been rematched.
  3056. RematchId string `json:"rematchId,omitempty"`
  3057. // Results: The results reported for this match.
  3058. Results []*ParticipantResult `json:"results,omitempty"`
  3059. // Status: The status of the match.
  3060. // Possible values are:
  3061. // - "MATCH_AUTO_MATCHING" - One or more slots need to be filled by
  3062. // auto-matching; the match cannot be established until they are filled.
  3063. //
  3064. // - "MATCH_ACTIVE" - The match has started.
  3065. // - "MATCH_COMPLETE" - The match has finished.
  3066. // - "MATCH_CANCELED" - The match was canceled.
  3067. // - "MATCH_EXPIRED" - The match expired due to inactivity.
  3068. // - "MATCH_DELETED" - The match should no longer be shown on the
  3069. // client. Returned only for tombstones for matches when sync is called.
  3070. Status string `json:"status,omitempty"`
  3071. // UserMatchStatus: The status of the current user in the match. Derived
  3072. // from the match type, match status, the user's participant status, and
  3073. // the pending participant for the match.
  3074. // Possible values are:
  3075. // - "USER_INVITED" - The user has been invited to join the match and
  3076. // has not responded yet.
  3077. // - "USER_AWAITING_TURN" - The user is waiting for their turn.
  3078. // - "USER_TURN" - The user has an action to take in the match.
  3079. // - "USER_MATCH_COMPLETED" - The match has ended (it is completed,
  3080. // canceled, or expired.)
  3081. UserMatchStatus string `json:"userMatchStatus,omitempty"`
  3082. // Variant: The variant / mode of the application being played; can be
  3083. // any integer value, or left blank.
  3084. Variant int64 `json:"variant,omitempty"`
  3085. // WithParticipantId: The ID of another participant in the match that
  3086. // can be used when describing the participants the user is playing
  3087. // with.
  3088. WithParticipantId string `json:"withParticipantId,omitempty"`
  3089. // ServerResponse contains the HTTP response code and headers from the
  3090. // server.
  3091. googleapi.ServerResponse `json:"-"`
  3092. // ForceSendFields is a list of field names (e.g. "ApplicationId") to
  3093. // unconditionally include in API requests. By default, fields with
  3094. // empty values are omitted from API requests. However, any non-pointer,
  3095. // non-interface field appearing in ForceSendFields will be sent to the
  3096. // server regardless of whether the field is empty or not. This may be
  3097. // used to include empty fields in Patch requests.
  3098. ForceSendFields []string `json:"-"`
  3099. }
  3100. func (s *TurnBasedMatch) MarshalJSON() ([]byte, error) {
  3101. type noMethod TurnBasedMatch
  3102. raw := noMethod(*s)
  3103. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3104. }
  3105. // TurnBasedMatchCreateRequest: This is a JSON template for a turn-based
  3106. // match creation request.
  3107. type TurnBasedMatchCreateRequest struct {
  3108. // AutoMatchingCriteria: Criteria for auto-matching players into this
  3109. // match.
  3110. AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  3111. // InvitedPlayerIds: The player ids to invite to the match.
  3112. InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"`
  3113. // Kind: Uniquely identifies the type of this resource. Value is always
  3114. // the fixed string games#turnBasedMatchCreateRequest.
  3115. Kind string `json:"kind,omitempty"`
  3116. // RequestId: A randomly generated numeric ID. This number is used at
  3117. // the server to ensure that the request is handled correctly across
  3118. // retries.
  3119. RequestId int64 `json:"requestId,omitempty,string"`
  3120. // Variant: The variant / mode of the application to be played. This can
  3121. // be any integer value, or left blank. You should use a small number of
  3122. // variants to keep the auto-matching pool as large as possible.
  3123. Variant int64 `json:"variant,omitempty"`
  3124. // ForceSendFields is a list of field names (e.g.
  3125. // "AutoMatchingCriteria") to unconditionally include in API requests.
  3126. // By default, fields with empty values are omitted from API requests.
  3127. // However, any non-pointer, non-interface field appearing in
  3128. // ForceSendFields will be sent to the server regardless of whether the
  3129. // field is empty or not. This may be used to include empty fields in
  3130. // Patch requests.
  3131. ForceSendFields []string `json:"-"`
  3132. }
  3133. func (s *TurnBasedMatchCreateRequest) MarshalJSON() ([]byte, error) {
  3134. type noMethod TurnBasedMatchCreateRequest
  3135. raw := noMethod(*s)
  3136. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3137. }
  3138. // TurnBasedMatchData: This is a JSON template for a turn-based match
  3139. // data object.
  3140. type TurnBasedMatchData struct {
  3141. // Data: The byte representation of the data (limited to 128 kB), as a
  3142. // Base64-encoded string with the URL_SAFE encoding option.
  3143. Data string `json:"data,omitempty"`
  3144. // DataAvailable: True if this match has data available but it wasn't
  3145. // returned in a list response; fetching the match individually will
  3146. // retrieve this data.
  3147. DataAvailable bool `json:"dataAvailable,omitempty"`
  3148. // Kind: Uniquely identifies the type of this resource. Value is always
  3149. // the fixed string games#turnBasedMatchData.
  3150. Kind string `json:"kind,omitempty"`
  3151. // ForceSendFields is a list of field names (e.g. "Data") to
  3152. // unconditionally include in API requests. By default, fields with
  3153. // empty values are omitted from API requests. However, any non-pointer,
  3154. // non-interface field appearing in ForceSendFields will be sent to the
  3155. // server regardless of whether the field is empty or not. This may be
  3156. // used to include empty fields in Patch requests.
  3157. ForceSendFields []string `json:"-"`
  3158. }
  3159. func (s *TurnBasedMatchData) MarshalJSON() ([]byte, error) {
  3160. type noMethod TurnBasedMatchData
  3161. raw := noMethod(*s)
  3162. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3163. }
  3164. // TurnBasedMatchDataRequest: This is a JSON template for sending a
  3165. // turn-based match data object.
  3166. type TurnBasedMatchDataRequest struct {
  3167. // Data: The byte representation of the data (limited to 128 kB), as a
  3168. // Base64-encoded string with the URL_SAFE encoding option.
  3169. Data string `json:"data,omitempty"`
  3170. // Kind: Uniquely identifies the type of this resource. Value is always
  3171. // the fixed string games#turnBasedMatchDataRequest.
  3172. Kind string `json:"kind,omitempty"`
  3173. // ForceSendFields is a list of field names (e.g. "Data") to
  3174. // unconditionally include in API requests. By default, fields with
  3175. // empty values are omitted from API requests. However, any non-pointer,
  3176. // non-interface field appearing in ForceSendFields will be sent to the
  3177. // server regardless of whether the field is empty or not. This may be
  3178. // used to include empty fields in Patch requests.
  3179. ForceSendFields []string `json:"-"`
  3180. }
  3181. func (s *TurnBasedMatchDataRequest) MarshalJSON() ([]byte, error) {
  3182. type noMethod TurnBasedMatchDataRequest
  3183. raw := noMethod(*s)
  3184. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3185. }
  3186. // TurnBasedMatchList: This is a JSON template for a list of turn-based
  3187. // matches.
  3188. type TurnBasedMatchList struct {
  3189. // Items: The matches.
  3190. Items []*TurnBasedMatch `json:"items,omitempty"`
  3191. // Kind: Uniquely identifies the type of this resource. Value is always
  3192. // the fixed string games#turnBasedMatchList.
  3193. Kind string `json:"kind,omitempty"`
  3194. // NextPageToken: The pagination token for the next page of results.
  3195. NextPageToken string `json:"nextPageToken,omitempty"`
  3196. // ServerResponse contains the HTTP response code and headers from the
  3197. // server.
  3198. googleapi.ServerResponse `json:"-"`
  3199. // ForceSendFields is a list of field names (e.g. "Items") to
  3200. // unconditionally include in API requests. By default, fields with
  3201. // empty values are omitted from API requests. However, any non-pointer,
  3202. // non-interface field appearing in ForceSendFields will be sent to the
  3203. // server regardless of whether the field is empty or not. This may be
  3204. // used to include empty fields in Patch requests.
  3205. ForceSendFields []string `json:"-"`
  3206. }
  3207. func (s *TurnBasedMatchList) MarshalJSON() ([]byte, error) {
  3208. type noMethod TurnBasedMatchList
  3209. raw := noMethod(*s)
  3210. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3211. }
  3212. // TurnBasedMatchModification: This is a JSON template for turn-based
  3213. // match modification metadata.
  3214. type TurnBasedMatchModification struct {
  3215. // Kind: Uniquely identifies the type of this resource. Value is always
  3216. // the fixed string games#turnBasedMatchModification.
  3217. Kind string `json:"kind,omitempty"`
  3218. // ModifiedTimestampMillis: The timestamp at which they modified the
  3219. // match, in milliseconds since the epoch in UTC.
  3220. ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"`
  3221. // ParticipantId: The ID of the participant that modified the match.
  3222. ParticipantId string `json:"participantId,omitempty"`
  3223. // ForceSendFields is a list of field names (e.g. "Kind") to
  3224. // unconditionally include in API requests. By default, fields with
  3225. // empty values are omitted from API requests. However, any non-pointer,
  3226. // non-interface field appearing in ForceSendFields will be sent to the
  3227. // server regardless of whether the field is empty or not. This may be
  3228. // used to include empty fields in Patch requests.
  3229. ForceSendFields []string `json:"-"`
  3230. }
  3231. func (s *TurnBasedMatchModification) MarshalJSON() ([]byte, error) {
  3232. type noMethod TurnBasedMatchModification
  3233. raw := noMethod(*s)
  3234. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3235. }
  3236. // TurnBasedMatchParticipant: This is a JSON template for a participant
  3237. // in a turn-based match.
  3238. type TurnBasedMatchParticipant struct {
  3239. // AutoMatched: True if this participant was auto-matched with the
  3240. // requesting player.
  3241. AutoMatched bool `json:"autoMatched,omitempty"`
  3242. // AutoMatchedPlayer: Information about a player that has been
  3243. // anonymously auto-matched against the requesting player. (Either
  3244. // player or autoMatchedPlayer will be set.)
  3245. AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"`
  3246. // Id: An identifier for the participant in the scope of the match.
  3247. // Cannot be used to identify a player across matches or in other
  3248. // contexts.
  3249. Id string `json:"id,omitempty"`
  3250. // Kind: Uniquely identifies the type of this resource. Value is always
  3251. // the fixed string games#turnBasedMatchParticipant.
  3252. Kind string `json:"kind,omitempty"`
  3253. // Player: Information about the player. Not populated if this player
  3254. // was anonymously auto-matched against the requesting player. (Either
  3255. // player or autoMatchedPlayer will be set.)
  3256. Player *Player `json:"player,omitempty"`
  3257. // Status: The status of the participant with respect to the
  3258. // match.
  3259. // Possible values are:
  3260. // - "PARTICIPANT_NOT_INVITED_YET" - The participant is slated to be
  3261. // invited to the match, but the invitation has not been sent; the
  3262. // invite will be sent when it becomes their turn.
  3263. // - "PARTICIPANT_INVITED" - The participant has been invited to join
  3264. // the match, but has not yet responded.
  3265. // - "PARTICIPANT_JOINED" - The participant has joined the match (either
  3266. // after creating it or accepting an invitation.)
  3267. // - "PARTICIPANT_DECLINED" - The participant declined an invitation to
  3268. // join the match.
  3269. // - "PARTICIPANT_LEFT" - The participant joined the match and then left
  3270. // it.
  3271. // - "PARTICIPANT_FINISHED" - The participant finished playing in the
  3272. // match.
  3273. // - "PARTICIPANT_UNRESPONSIVE" - The participant did not take their
  3274. // turn in the allotted time.
  3275. Status string `json:"status,omitempty"`
  3276. // ForceSendFields is a list of field names (e.g. "AutoMatched") to
  3277. // unconditionally include in API requests. By default, fields with
  3278. // empty values are omitted from API requests. However, any non-pointer,
  3279. // non-interface field appearing in ForceSendFields will be sent to the
  3280. // server regardless of whether the field is empty or not. This may be
  3281. // used to include empty fields in Patch requests.
  3282. ForceSendFields []string `json:"-"`
  3283. }
  3284. func (s *TurnBasedMatchParticipant) MarshalJSON() ([]byte, error) {
  3285. type noMethod TurnBasedMatchParticipant
  3286. raw := noMethod(*s)
  3287. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3288. }
  3289. // TurnBasedMatchRematch: This is a JSON template for a rematch
  3290. // response.
  3291. type TurnBasedMatchRematch struct {
  3292. // Kind: Uniquely identifies the type of this resource. Value is always
  3293. // the fixed string games#turnBasedMatchRematch.
  3294. Kind string `json:"kind,omitempty"`
  3295. // PreviousMatch: The old match that the rematch was created from; will
  3296. // be updated such that the rematchId field will point at the new match.
  3297. PreviousMatch *TurnBasedMatch `json:"previousMatch,omitempty"`
  3298. // Rematch: The newly created match; a rematch of the old match with the
  3299. // same participants.
  3300. Rematch *TurnBasedMatch `json:"rematch,omitempty"`
  3301. // ServerResponse contains the HTTP response code and headers from the
  3302. // server.
  3303. googleapi.ServerResponse `json:"-"`
  3304. // ForceSendFields is a list of field names (e.g. "Kind") to
  3305. // unconditionally include in API requests. By default, fields with
  3306. // empty values are omitted from API requests. However, any non-pointer,
  3307. // non-interface field appearing in ForceSendFields will be sent to the
  3308. // server regardless of whether the field is empty or not. This may be
  3309. // used to include empty fields in Patch requests.
  3310. ForceSendFields []string `json:"-"`
  3311. }
  3312. func (s *TurnBasedMatchRematch) MarshalJSON() ([]byte, error) {
  3313. type noMethod TurnBasedMatchRematch
  3314. raw := noMethod(*s)
  3315. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3316. }
  3317. // TurnBasedMatchResults: This is a JSON template for a turn-based match
  3318. // results object.
  3319. type TurnBasedMatchResults struct {
  3320. // Data: The final match data.
  3321. Data *TurnBasedMatchDataRequest `json:"data,omitempty"`
  3322. // Kind: Uniquely identifies the type of this resource. Value is always
  3323. // the fixed string games#turnBasedMatchResults.
  3324. Kind string `json:"kind,omitempty"`
  3325. // MatchVersion: The version of the match being updated.
  3326. MatchVersion int64 `json:"matchVersion,omitempty"`
  3327. // Results: The match results for the participants in the match.
  3328. Results []*ParticipantResult `json:"results,omitempty"`
  3329. // ForceSendFields is a list of field names (e.g. "Data") to
  3330. // unconditionally include in API requests. By default, fields with
  3331. // empty values are omitted from API requests. However, any non-pointer,
  3332. // non-interface field appearing in ForceSendFields will be sent to the
  3333. // server regardless of whether the field is empty or not. This may be
  3334. // used to include empty fields in Patch requests.
  3335. ForceSendFields []string `json:"-"`
  3336. }
  3337. func (s *TurnBasedMatchResults) MarshalJSON() ([]byte, error) {
  3338. type noMethod TurnBasedMatchResults
  3339. raw := noMethod(*s)
  3340. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3341. }
  3342. // TurnBasedMatchSync: This is a JSON template for a list of turn-based
  3343. // matches returned from a sync.
  3344. type TurnBasedMatchSync struct {
  3345. // Items: The matches.
  3346. Items []*TurnBasedMatch `json:"items,omitempty"`
  3347. // Kind: Uniquely identifies the type of this resource. Value is always
  3348. // the fixed string games#turnBasedMatchSync.
  3349. Kind string `json:"kind,omitempty"`
  3350. // MoreAvailable: True if there were more matches available to fetch at
  3351. // the time the response was generated (which were not returned due to
  3352. // page size limits.)
  3353. MoreAvailable bool `json:"moreAvailable,omitempty"`
  3354. // NextPageToken: The pagination token for the next page of results.
  3355. NextPageToken string `json:"nextPageToken,omitempty"`
  3356. // ServerResponse contains the HTTP response code and headers from the
  3357. // server.
  3358. googleapi.ServerResponse `json:"-"`
  3359. // ForceSendFields is a list of field names (e.g. "Items") to
  3360. // unconditionally include in API requests. By default, fields with
  3361. // empty values are omitted from API requests. However, any non-pointer,
  3362. // non-interface field appearing in ForceSendFields will be sent to the
  3363. // server regardless of whether the field is empty or not. This may be
  3364. // used to include empty fields in Patch requests.
  3365. ForceSendFields []string `json:"-"`
  3366. }
  3367. func (s *TurnBasedMatchSync) MarshalJSON() ([]byte, error) {
  3368. type noMethod TurnBasedMatchSync
  3369. raw := noMethod(*s)
  3370. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3371. }
  3372. // TurnBasedMatchTurn: This is a JSON template for the object
  3373. // representing a turn.
  3374. type TurnBasedMatchTurn struct {
  3375. // Data: The shared game state data after the turn is over.
  3376. Data *TurnBasedMatchDataRequest `json:"data,omitempty"`
  3377. // Kind: Uniquely identifies the type of this resource. Value is always
  3378. // the fixed string games#turnBasedMatchTurn.
  3379. Kind string `json:"kind,omitempty"`
  3380. // MatchVersion: The version of this match: an increasing counter, used
  3381. // to avoid out-of-date updates to the match.
  3382. MatchVersion int64 `json:"matchVersion,omitempty"`
  3383. // PendingParticipantId: The ID of the participant who should take their
  3384. // turn next. May be set to the current player's participant ID to
  3385. // update match state without changing the turn. If not set, the match
  3386. // will wait for other player(s) to join via automatching; this is only
  3387. // valid if automatch criteria is set on the match with remaining slots
  3388. // for automatched players.
  3389. PendingParticipantId string `json:"pendingParticipantId,omitempty"`
  3390. // Results: The match results for the participants in the match.
  3391. Results []*ParticipantResult `json:"results,omitempty"`
  3392. // ForceSendFields is a list of field names (e.g. "Data") to
  3393. // unconditionally include in API requests. By default, fields with
  3394. // empty values are omitted from API requests. However, any non-pointer,
  3395. // non-interface field appearing in ForceSendFields will be sent to the
  3396. // server regardless of whether the field is empty or not. This may be
  3397. // used to include empty fields in Patch requests.
  3398. ForceSendFields []string `json:"-"`
  3399. }
  3400. func (s *TurnBasedMatchTurn) MarshalJSON() ([]byte, error) {
  3401. type noMethod TurnBasedMatchTurn
  3402. raw := noMethod(*s)
  3403. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3404. }
  3405. // method id "games.achievementDefinitions.list":
  3406. type AchievementDefinitionsListCall struct {
  3407. s *Service
  3408. urlParams_ gensupport.URLParams
  3409. ifNoneMatch_ string
  3410. ctx_ context.Context
  3411. }
  3412. // List: Lists all the achievement definitions for your application.
  3413. func (r *AchievementDefinitionsService) List() *AchievementDefinitionsListCall {
  3414. c := &AchievementDefinitionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3415. return c
  3416. }
  3417. // Language sets the optional parameter "language": The preferred
  3418. // language to use for strings returned by this method.
  3419. func (c *AchievementDefinitionsListCall) Language(language string) *AchievementDefinitionsListCall {
  3420. c.urlParams_.Set("language", language)
  3421. return c
  3422. }
  3423. // MaxResults sets the optional parameter "maxResults": The maximum
  3424. // number of achievement resources to return in the response, used for
  3425. // paging. For any response, the actual number of achievement resources
  3426. // returned may be less than the specified maxResults.
  3427. func (c *AchievementDefinitionsListCall) MaxResults(maxResults int64) *AchievementDefinitionsListCall {
  3428. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3429. return c
  3430. }
  3431. // PageToken sets the optional parameter "pageToken": The token returned
  3432. // by the previous request.
  3433. func (c *AchievementDefinitionsListCall) PageToken(pageToken string) *AchievementDefinitionsListCall {
  3434. c.urlParams_.Set("pageToken", pageToken)
  3435. return c
  3436. }
  3437. // Fields allows partial responses to be retrieved. See
  3438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3439. // for more information.
  3440. func (c *AchievementDefinitionsListCall) Fields(s ...googleapi.Field) *AchievementDefinitionsListCall {
  3441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3442. return c
  3443. }
  3444. // IfNoneMatch sets the optional parameter which makes the operation
  3445. // fail if the object's ETag matches the given value. This is useful for
  3446. // getting updates only after the object has changed since the last
  3447. // request. Use googleapi.IsNotModified to check whether the response
  3448. // error from Do is the result of In-None-Match.
  3449. func (c *AchievementDefinitionsListCall) IfNoneMatch(entityTag string) *AchievementDefinitionsListCall {
  3450. c.ifNoneMatch_ = entityTag
  3451. return c
  3452. }
  3453. // Context sets the context to be used in this call's Do method. Any
  3454. // pending HTTP request will be aborted if the provided context is
  3455. // canceled.
  3456. func (c *AchievementDefinitionsListCall) Context(ctx context.Context) *AchievementDefinitionsListCall {
  3457. c.ctx_ = ctx
  3458. return c
  3459. }
  3460. func (c *AchievementDefinitionsListCall) doRequest(alt string) (*http.Response, error) {
  3461. var body io.Reader = nil
  3462. c.urlParams_.Set("alt", alt)
  3463. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements")
  3464. urls += "?" + c.urlParams_.Encode()
  3465. req, _ := http.NewRequest("GET", urls, body)
  3466. googleapi.SetOpaque(req.URL)
  3467. req.Header.Set("User-Agent", c.s.userAgent())
  3468. if c.ifNoneMatch_ != "" {
  3469. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3470. }
  3471. if c.ctx_ != nil {
  3472. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3473. }
  3474. return c.s.client.Do(req)
  3475. }
  3476. // Do executes the "games.achievementDefinitions.list" call.
  3477. // Exactly one of *AchievementDefinitionsListResponse or error will be
  3478. // non-nil. Any non-2xx status code is an error. Response headers are in
  3479. // either *AchievementDefinitionsListResponse.ServerResponse.Header or
  3480. // (if a response was returned at all) in
  3481. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3482. // whether the returned error was because http.StatusNotModified was
  3483. // returned.
  3484. func (c *AchievementDefinitionsListCall) Do(opts ...googleapi.CallOption) (*AchievementDefinitionsListResponse, error) {
  3485. gensupport.SetOptions(c.urlParams_, opts...)
  3486. res, err := c.doRequest("json")
  3487. if res != nil && res.StatusCode == http.StatusNotModified {
  3488. if res.Body != nil {
  3489. res.Body.Close()
  3490. }
  3491. return nil, &googleapi.Error{
  3492. Code: res.StatusCode,
  3493. Header: res.Header,
  3494. }
  3495. }
  3496. if err != nil {
  3497. return nil, err
  3498. }
  3499. defer googleapi.CloseBody(res)
  3500. if err := googleapi.CheckResponse(res); err != nil {
  3501. return nil, err
  3502. }
  3503. ret := &AchievementDefinitionsListResponse{
  3504. ServerResponse: googleapi.ServerResponse{
  3505. Header: res.Header,
  3506. HTTPStatusCode: res.StatusCode,
  3507. },
  3508. }
  3509. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3510. return nil, err
  3511. }
  3512. return ret, nil
  3513. // {
  3514. // "description": "Lists all the achievement definitions for your application.",
  3515. // "httpMethod": "GET",
  3516. // "id": "games.achievementDefinitions.list",
  3517. // "parameters": {
  3518. // "language": {
  3519. // "description": "The preferred language to use for strings returned by this method.",
  3520. // "location": "query",
  3521. // "type": "string"
  3522. // },
  3523. // "maxResults": {
  3524. // "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.",
  3525. // "format": "int32",
  3526. // "location": "query",
  3527. // "maximum": "200",
  3528. // "minimum": "1",
  3529. // "type": "integer"
  3530. // },
  3531. // "pageToken": {
  3532. // "description": "The token returned by the previous request.",
  3533. // "location": "query",
  3534. // "type": "string"
  3535. // }
  3536. // },
  3537. // "path": "achievements",
  3538. // "response": {
  3539. // "$ref": "AchievementDefinitionsListResponse"
  3540. // },
  3541. // "scopes": [
  3542. // "https://www.googleapis.com/auth/games",
  3543. // "https://www.googleapis.com/auth/plus.login"
  3544. // ]
  3545. // }
  3546. }
  3547. // Pages invokes f for each page of results.
  3548. // A non-nil error returned from f will halt the iteration.
  3549. // The provided context supersedes any context provided to the Context method.
  3550. func (c *AchievementDefinitionsListCall) Pages(ctx context.Context, f func(*AchievementDefinitionsListResponse) error) error {
  3551. c.ctx_ = ctx
  3552. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3553. for {
  3554. x, err := c.Do()
  3555. if err != nil {
  3556. return err
  3557. }
  3558. if err := f(x); err != nil {
  3559. return err
  3560. }
  3561. if x.NextPageToken == "" {
  3562. return nil
  3563. }
  3564. c.PageToken(x.NextPageToken)
  3565. }
  3566. }
  3567. // method id "games.achievements.increment":
  3568. type AchievementsIncrementCall struct {
  3569. s *Service
  3570. achievementId string
  3571. urlParams_ gensupport.URLParams
  3572. ctx_ context.Context
  3573. }
  3574. // Increment: Increments the steps of the achievement with the given ID
  3575. // for the currently authenticated player.
  3576. func (r *AchievementsService) Increment(achievementId string, stepsToIncrement int64) *AchievementsIncrementCall {
  3577. c := &AchievementsIncrementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3578. c.achievementId = achievementId
  3579. c.urlParams_.Set("stepsToIncrement", fmt.Sprint(stepsToIncrement))
  3580. return c
  3581. }
  3582. // RequestId sets the optional parameter "requestId": A randomly
  3583. // generated numeric ID for each request specified by the caller. This
  3584. // number is used at the server to ensure that the request is handled
  3585. // correctly across retries.
  3586. func (c *AchievementsIncrementCall) RequestId(requestId int64) *AchievementsIncrementCall {
  3587. c.urlParams_.Set("requestId", fmt.Sprint(requestId))
  3588. return c
  3589. }
  3590. // Fields allows partial responses to be retrieved. See
  3591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3592. // for more information.
  3593. func (c *AchievementsIncrementCall) Fields(s ...googleapi.Field) *AchievementsIncrementCall {
  3594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3595. return c
  3596. }
  3597. // Context sets the context to be used in this call's Do method. Any
  3598. // pending HTTP request will be aborted if the provided context is
  3599. // canceled.
  3600. func (c *AchievementsIncrementCall) Context(ctx context.Context) *AchievementsIncrementCall {
  3601. c.ctx_ = ctx
  3602. return c
  3603. }
  3604. func (c *AchievementsIncrementCall) doRequest(alt string) (*http.Response, error) {
  3605. var body io.Reader = nil
  3606. c.urlParams_.Set("alt", alt)
  3607. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/increment")
  3608. urls += "?" + c.urlParams_.Encode()
  3609. req, _ := http.NewRequest("POST", urls, body)
  3610. googleapi.Expand(req.URL, map[string]string{
  3611. "achievementId": c.achievementId,
  3612. })
  3613. req.Header.Set("User-Agent", c.s.userAgent())
  3614. if c.ctx_ != nil {
  3615. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3616. }
  3617. return c.s.client.Do(req)
  3618. }
  3619. // Do executes the "games.achievements.increment" call.
  3620. // Exactly one of *AchievementIncrementResponse or error will be
  3621. // non-nil. Any non-2xx status code is an error. Response headers are in
  3622. // either *AchievementIncrementResponse.ServerResponse.Header or (if a
  3623. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3624. // googleapi.IsNotModified to check whether the returned error was
  3625. // because http.StatusNotModified was returned.
  3626. func (c *AchievementsIncrementCall) Do(opts ...googleapi.CallOption) (*AchievementIncrementResponse, error) {
  3627. gensupport.SetOptions(c.urlParams_, opts...)
  3628. res, err := c.doRequest("json")
  3629. if res != nil && res.StatusCode == http.StatusNotModified {
  3630. if res.Body != nil {
  3631. res.Body.Close()
  3632. }
  3633. return nil, &googleapi.Error{
  3634. Code: res.StatusCode,
  3635. Header: res.Header,
  3636. }
  3637. }
  3638. if err != nil {
  3639. return nil, err
  3640. }
  3641. defer googleapi.CloseBody(res)
  3642. if err := googleapi.CheckResponse(res); err != nil {
  3643. return nil, err
  3644. }
  3645. ret := &AchievementIncrementResponse{
  3646. ServerResponse: googleapi.ServerResponse{
  3647. Header: res.Header,
  3648. HTTPStatusCode: res.StatusCode,
  3649. },
  3650. }
  3651. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3652. return nil, err
  3653. }
  3654. return ret, nil
  3655. // {
  3656. // "description": "Increments the steps of the achievement with the given ID for the currently authenticated player.",
  3657. // "httpMethod": "POST",
  3658. // "id": "games.achievements.increment",
  3659. // "parameterOrder": [
  3660. // "achievementId",
  3661. // "stepsToIncrement"
  3662. // ],
  3663. // "parameters": {
  3664. // "achievementId": {
  3665. // "description": "The ID of the achievement used by this method.",
  3666. // "location": "path",
  3667. // "required": true,
  3668. // "type": "string"
  3669. // },
  3670. // "requestId": {
  3671. // "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.",
  3672. // "format": "int64",
  3673. // "location": "query",
  3674. // "type": "string"
  3675. // },
  3676. // "stepsToIncrement": {
  3677. // "description": "The number of steps to increment.",
  3678. // "format": "int32",
  3679. // "location": "query",
  3680. // "minimum": "1",
  3681. // "required": true,
  3682. // "type": "integer"
  3683. // }
  3684. // },
  3685. // "path": "achievements/{achievementId}/increment",
  3686. // "response": {
  3687. // "$ref": "AchievementIncrementResponse"
  3688. // },
  3689. // "scopes": [
  3690. // "https://www.googleapis.com/auth/games",
  3691. // "https://www.googleapis.com/auth/plus.login"
  3692. // ]
  3693. // }
  3694. }
  3695. // method id "games.achievements.list":
  3696. type AchievementsListCall struct {
  3697. s *Service
  3698. playerId string
  3699. urlParams_ gensupport.URLParams
  3700. ifNoneMatch_ string
  3701. ctx_ context.Context
  3702. }
  3703. // List: Lists the progress for all your application's achievements for
  3704. // the currently authenticated player.
  3705. func (r *AchievementsService) List(playerId string) *AchievementsListCall {
  3706. c := &AchievementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3707. c.playerId = playerId
  3708. return c
  3709. }
  3710. // Language sets the optional parameter "language": The preferred
  3711. // language to use for strings returned by this method.
  3712. func (c *AchievementsListCall) Language(language string) *AchievementsListCall {
  3713. c.urlParams_.Set("language", language)
  3714. return c
  3715. }
  3716. // MaxResults sets the optional parameter "maxResults": The maximum
  3717. // number of achievement resources to return in the response, used for
  3718. // paging. For any response, the actual number of achievement resources
  3719. // returned may be less than the specified maxResults.
  3720. func (c *AchievementsListCall) MaxResults(maxResults int64) *AchievementsListCall {
  3721. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3722. return c
  3723. }
  3724. // PageToken sets the optional parameter "pageToken": The token returned
  3725. // by the previous request.
  3726. func (c *AchievementsListCall) PageToken(pageToken string) *AchievementsListCall {
  3727. c.urlParams_.Set("pageToken", pageToken)
  3728. return c
  3729. }
  3730. // State sets the optional parameter "state": Tells the server to return
  3731. // only achievements with the specified state. If this parameter isn't
  3732. // specified, all achievements are returned.
  3733. //
  3734. // Possible values:
  3735. // "ALL" - List all achievements. This is the default.
  3736. // "HIDDEN" - List only hidden achievements.
  3737. // "REVEALED" - List only revealed achievements.
  3738. // "UNLOCKED" - List only unlocked achievements.
  3739. func (c *AchievementsListCall) State(state string) *AchievementsListCall {
  3740. c.urlParams_.Set("state", state)
  3741. return c
  3742. }
  3743. // Fields allows partial responses to be retrieved. See
  3744. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3745. // for more information.
  3746. func (c *AchievementsListCall) Fields(s ...googleapi.Field) *AchievementsListCall {
  3747. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3748. return c
  3749. }
  3750. // IfNoneMatch sets the optional parameter which makes the operation
  3751. // fail if the object's ETag matches the given value. This is useful for
  3752. // getting updates only after the object has changed since the last
  3753. // request. Use googleapi.IsNotModified to check whether the response
  3754. // error from Do is the result of In-None-Match.
  3755. func (c *AchievementsListCall) IfNoneMatch(entityTag string) *AchievementsListCall {
  3756. c.ifNoneMatch_ = entityTag
  3757. return c
  3758. }
  3759. // Context sets the context to be used in this call's Do method. Any
  3760. // pending HTTP request will be aborted if the provided context is
  3761. // canceled.
  3762. func (c *AchievementsListCall) Context(ctx context.Context) *AchievementsListCall {
  3763. c.ctx_ = ctx
  3764. return c
  3765. }
  3766. func (c *AchievementsListCall) doRequest(alt string) (*http.Response, error) {
  3767. var body io.Reader = nil
  3768. c.urlParams_.Set("alt", alt)
  3769. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/achievements")
  3770. urls += "?" + c.urlParams_.Encode()
  3771. req, _ := http.NewRequest("GET", urls, body)
  3772. googleapi.Expand(req.URL, map[string]string{
  3773. "playerId": c.playerId,
  3774. })
  3775. req.Header.Set("User-Agent", c.s.userAgent())
  3776. if c.ifNoneMatch_ != "" {
  3777. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3778. }
  3779. if c.ctx_ != nil {
  3780. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3781. }
  3782. return c.s.client.Do(req)
  3783. }
  3784. // Do executes the "games.achievements.list" call.
  3785. // Exactly one of *PlayerAchievementListResponse or error will be
  3786. // non-nil. Any non-2xx status code is an error. Response headers are in
  3787. // either *PlayerAchievementListResponse.ServerResponse.Header or (if a
  3788. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3789. // googleapi.IsNotModified to check whether the returned error was
  3790. // because http.StatusNotModified was returned.
  3791. func (c *AchievementsListCall) Do(opts ...googleapi.CallOption) (*PlayerAchievementListResponse, error) {
  3792. gensupport.SetOptions(c.urlParams_, opts...)
  3793. res, err := c.doRequest("json")
  3794. if res != nil && res.StatusCode == http.StatusNotModified {
  3795. if res.Body != nil {
  3796. res.Body.Close()
  3797. }
  3798. return nil, &googleapi.Error{
  3799. Code: res.StatusCode,
  3800. Header: res.Header,
  3801. }
  3802. }
  3803. if err != nil {
  3804. return nil, err
  3805. }
  3806. defer googleapi.CloseBody(res)
  3807. if err := googleapi.CheckResponse(res); err != nil {
  3808. return nil, err
  3809. }
  3810. ret := &PlayerAchievementListResponse{
  3811. ServerResponse: googleapi.ServerResponse{
  3812. Header: res.Header,
  3813. HTTPStatusCode: res.StatusCode,
  3814. },
  3815. }
  3816. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3817. return nil, err
  3818. }
  3819. return ret, nil
  3820. // {
  3821. // "description": "Lists the progress for all your application's achievements for the currently authenticated player.",
  3822. // "httpMethod": "GET",
  3823. // "id": "games.achievements.list",
  3824. // "parameterOrder": [
  3825. // "playerId"
  3826. // ],
  3827. // "parameters": {
  3828. // "language": {
  3829. // "description": "The preferred language to use for strings returned by this method.",
  3830. // "location": "query",
  3831. // "type": "string"
  3832. // },
  3833. // "maxResults": {
  3834. // "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.",
  3835. // "format": "int32",
  3836. // "location": "query",
  3837. // "maximum": "200",
  3838. // "minimum": "1",
  3839. // "type": "integer"
  3840. // },
  3841. // "pageToken": {
  3842. // "description": "The token returned by the previous request.",
  3843. // "location": "query",
  3844. // "type": "string"
  3845. // },
  3846. // "playerId": {
  3847. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  3848. // "location": "path",
  3849. // "required": true,
  3850. // "type": "string"
  3851. // },
  3852. // "state": {
  3853. // "description": "Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned.",
  3854. // "enum": [
  3855. // "ALL",
  3856. // "HIDDEN",
  3857. // "REVEALED",
  3858. // "UNLOCKED"
  3859. // ],
  3860. // "enumDescriptions": [
  3861. // "List all achievements. This is the default.",
  3862. // "List only hidden achievements.",
  3863. // "List only revealed achievements.",
  3864. // "List only unlocked achievements."
  3865. // ],
  3866. // "location": "query",
  3867. // "type": "string"
  3868. // }
  3869. // },
  3870. // "path": "players/{playerId}/achievements",
  3871. // "response": {
  3872. // "$ref": "PlayerAchievementListResponse"
  3873. // },
  3874. // "scopes": [
  3875. // "https://www.googleapis.com/auth/games",
  3876. // "https://www.googleapis.com/auth/plus.login"
  3877. // ]
  3878. // }
  3879. }
  3880. // Pages invokes f for each page of results.
  3881. // A non-nil error returned from f will halt the iteration.
  3882. // The provided context supersedes any context provided to the Context method.
  3883. func (c *AchievementsListCall) Pages(ctx context.Context, f func(*PlayerAchievementListResponse) error) error {
  3884. c.ctx_ = ctx
  3885. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3886. for {
  3887. x, err := c.Do()
  3888. if err != nil {
  3889. return err
  3890. }
  3891. if err := f(x); err != nil {
  3892. return err
  3893. }
  3894. if x.NextPageToken == "" {
  3895. return nil
  3896. }
  3897. c.PageToken(x.NextPageToken)
  3898. }
  3899. }
  3900. // method id "games.achievements.reveal":
  3901. type AchievementsRevealCall struct {
  3902. s *Service
  3903. achievementId string
  3904. urlParams_ gensupport.URLParams
  3905. ctx_ context.Context
  3906. }
  3907. // Reveal: Sets the state of the achievement with the given ID to
  3908. // REVEALED for the currently authenticated player.
  3909. func (r *AchievementsService) Reveal(achievementId string) *AchievementsRevealCall {
  3910. c := &AchievementsRevealCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3911. c.achievementId = achievementId
  3912. return c
  3913. }
  3914. // Fields allows partial responses to be retrieved. See
  3915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3916. // for more information.
  3917. func (c *AchievementsRevealCall) Fields(s ...googleapi.Field) *AchievementsRevealCall {
  3918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3919. return c
  3920. }
  3921. // Context sets the context to be used in this call's Do method. Any
  3922. // pending HTTP request will be aborted if the provided context is
  3923. // canceled.
  3924. func (c *AchievementsRevealCall) Context(ctx context.Context) *AchievementsRevealCall {
  3925. c.ctx_ = ctx
  3926. return c
  3927. }
  3928. func (c *AchievementsRevealCall) doRequest(alt string) (*http.Response, error) {
  3929. var body io.Reader = nil
  3930. c.urlParams_.Set("alt", alt)
  3931. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/reveal")
  3932. urls += "?" + c.urlParams_.Encode()
  3933. req, _ := http.NewRequest("POST", urls, body)
  3934. googleapi.Expand(req.URL, map[string]string{
  3935. "achievementId": c.achievementId,
  3936. })
  3937. req.Header.Set("User-Agent", c.s.userAgent())
  3938. if c.ctx_ != nil {
  3939. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3940. }
  3941. return c.s.client.Do(req)
  3942. }
  3943. // Do executes the "games.achievements.reveal" call.
  3944. // Exactly one of *AchievementRevealResponse or error will be non-nil.
  3945. // Any non-2xx status code is an error. Response headers are in either
  3946. // *AchievementRevealResponse.ServerResponse.Header or (if a response
  3947. // was returned at all) in error.(*googleapi.Error).Header. Use
  3948. // googleapi.IsNotModified to check whether the returned error was
  3949. // because http.StatusNotModified was returned.
  3950. func (c *AchievementsRevealCall) Do(opts ...googleapi.CallOption) (*AchievementRevealResponse, error) {
  3951. gensupport.SetOptions(c.urlParams_, opts...)
  3952. res, err := c.doRequest("json")
  3953. if res != nil && res.StatusCode == http.StatusNotModified {
  3954. if res.Body != nil {
  3955. res.Body.Close()
  3956. }
  3957. return nil, &googleapi.Error{
  3958. Code: res.StatusCode,
  3959. Header: res.Header,
  3960. }
  3961. }
  3962. if err != nil {
  3963. return nil, err
  3964. }
  3965. defer googleapi.CloseBody(res)
  3966. if err := googleapi.CheckResponse(res); err != nil {
  3967. return nil, err
  3968. }
  3969. ret := &AchievementRevealResponse{
  3970. ServerResponse: googleapi.ServerResponse{
  3971. Header: res.Header,
  3972. HTTPStatusCode: res.StatusCode,
  3973. },
  3974. }
  3975. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3976. return nil, err
  3977. }
  3978. return ret, nil
  3979. // {
  3980. // "description": "Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.",
  3981. // "httpMethod": "POST",
  3982. // "id": "games.achievements.reveal",
  3983. // "parameterOrder": [
  3984. // "achievementId"
  3985. // ],
  3986. // "parameters": {
  3987. // "achievementId": {
  3988. // "description": "The ID of the achievement used by this method.",
  3989. // "location": "path",
  3990. // "required": true,
  3991. // "type": "string"
  3992. // }
  3993. // },
  3994. // "path": "achievements/{achievementId}/reveal",
  3995. // "response": {
  3996. // "$ref": "AchievementRevealResponse"
  3997. // },
  3998. // "scopes": [
  3999. // "https://www.googleapis.com/auth/games",
  4000. // "https://www.googleapis.com/auth/plus.login"
  4001. // ]
  4002. // }
  4003. }
  4004. // method id "games.achievements.setStepsAtLeast":
  4005. type AchievementsSetStepsAtLeastCall struct {
  4006. s *Service
  4007. achievementId string
  4008. urlParams_ gensupport.URLParams
  4009. ctx_ context.Context
  4010. }
  4011. // SetStepsAtLeast: Sets the steps for the currently authenticated
  4012. // player towards unlocking an achievement. If the steps parameter is
  4013. // less than the current number of steps that the player already gained
  4014. // for the achievement, the achievement is not modified.
  4015. func (r *AchievementsService) SetStepsAtLeast(achievementId string, steps int64) *AchievementsSetStepsAtLeastCall {
  4016. c := &AchievementsSetStepsAtLeastCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4017. c.achievementId = achievementId
  4018. c.urlParams_.Set("steps", fmt.Sprint(steps))
  4019. return c
  4020. }
  4021. // Fields allows partial responses to be retrieved. See
  4022. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4023. // for more information.
  4024. func (c *AchievementsSetStepsAtLeastCall) Fields(s ...googleapi.Field) *AchievementsSetStepsAtLeastCall {
  4025. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4026. return c
  4027. }
  4028. // Context sets the context to be used in this call's Do method. Any
  4029. // pending HTTP request will be aborted if the provided context is
  4030. // canceled.
  4031. func (c *AchievementsSetStepsAtLeastCall) Context(ctx context.Context) *AchievementsSetStepsAtLeastCall {
  4032. c.ctx_ = ctx
  4033. return c
  4034. }
  4035. func (c *AchievementsSetStepsAtLeastCall) doRequest(alt string) (*http.Response, error) {
  4036. var body io.Reader = nil
  4037. c.urlParams_.Set("alt", alt)
  4038. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/setStepsAtLeast")
  4039. urls += "?" + c.urlParams_.Encode()
  4040. req, _ := http.NewRequest("POST", urls, body)
  4041. googleapi.Expand(req.URL, map[string]string{
  4042. "achievementId": c.achievementId,
  4043. })
  4044. req.Header.Set("User-Agent", c.s.userAgent())
  4045. if c.ctx_ != nil {
  4046. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4047. }
  4048. return c.s.client.Do(req)
  4049. }
  4050. // Do executes the "games.achievements.setStepsAtLeast" call.
  4051. // Exactly one of *AchievementSetStepsAtLeastResponse or error will be
  4052. // non-nil. Any non-2xx status code is an error. Response headers are in
  4053. // either *AchievementSetStepsAtLeastResponse.ServerResponse.Header or
  4054. // (if a response was returned at all) in
  4055. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4056. // whether the returned error was because http.StatusNotModified was
  4057. // returned.
  4058. func (c *AchievementsSetStepsAtLeastCall) Do(opts ...googleapi.CallOption) (*AchievementSetStepsAtLeastResponse, error) {
  4059. gensupport.SetOptions(c.urlParams_, opts...)
  4060. res, err := c.doRequest("json")
  4061. if res != nil && res.StatusCode == http.StatusNotModified {
  4062. if res.Body != nil {
  4063. res.Body.Close()
  4064. }
  4065. return nil, &googleapi.Error{
  4066. Code: res.StatusCode,
  4067. Header: res.Header,
  4068. }
  4069. }
  4070. if err != nil {
  4071. return nil, err
  4072. }
  4073. defer googleapi.CloseBody(res)
  4074. if err := googleapi.CheckResponse(res); err != nil {
  4075. return nil, err
  4076. }
  4077. ret := &AchievementSetStepsAtLeastResponse{
  4078. ServerResponse: googleapi.ServerResponse{
  4079. Header: res.Header,
  4080. HTTPStatusCode: res.StatusCode,
  4081. },
  4082. }
  4083. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4084. return nil, err
  4085. }
  4086. return ret, nil
  4087. // {
  4088. // "description": "Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified.",
  4089. // "httpMethod": "POST",
  4090. // "id": "games.achievements.setStepsAtLeast",
  4091. // "parameterOrder": [
  4092. // "achievementId",
  4093. // "steps"
  4094. // ],
  4095. // "parameters": {
  4096. // "achievementId": {
  4097. // "description": "The ID of the achievement used by this method.",
  4098. // "location": "path",
  4099. // "required": true,
  4100. // "type": "string"
  4101. // },
  4102. // "steps": {
  4103. // "description": "The minimum value to set the steps to.",
  4104. // "format": "int32",
  4105. // "location": "query",
  4106. // "minimum": "1",
  4107. // "required": true,
  4108. // "type": "integer"
  4109. // }
  4110. // },
  4111. // "path": "achievements/{achievementId}/setStepsAtLeast",
  4112. // "response": {
  4113. // "$ref": "AchievementSetStepsAtLeastResponse"
  4114. // },
  4115. // "scopes": [
  4116. // "https://www.googleapis.com/auth/games",
  4117. // "https://www.googleapis.com/auth/plus.login"
  4118. // ]
  4119. // }
  4120. }
  4121. // method id "games.achievements.unlock":
  4122. type AchievementsUnlockCall struct {
  4123. s *Service
  4124. achievementId string
  4125. urlParams_ gensupport.URLParams
  4126. ctx_ context.Context
  4127. }
  4128. // Unlock: Unlocks this achievement for the currently authenticated
  4129. // player.
  4130. func (r *AchievementsService) Unlock(achievementId string) *AchievementsUnlockCall {
  4131. c := &AchievementsUnlockCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4132. c.achievementId = achievementId
  4133. return c
  4134. }
  4135. // Fields allows partial responses to be retrieved. See
  4136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4137. // for more information.
  4138. func (c *AchievementsUnlockCall) Fields(s ...googleapi.Field) *AchievementsUnlockCall {
  4139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4140. return c
  4141. }
  4142. // Context sets the context to be used in this call's Do method. Any
  4143. // pending HTTP request will be aborted if the provided context is
  4144. // canceled.
  4145. func (c *AchievementsUnlockCall) Context(ctx context.Context) *AchievementsUnlockCall {
  4146. c.ctx_ = ctx
  4147. return c
  4148. }
  4149. func (c *AchievementsUnlockCall) doRequest(alt string) (*http.Response, error) {
  4150. var body io.Reader = nil
  4151. c.urlParams_.Set("alt", alt)
  4152. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/unlock")
  4153. urls += "?" + c.urlParams_.Encode()
  4154. req, _ := http.NewRequest("POST", urls, body)
  4155. googleapi.Expand(req.URL, map[string]string{
  4156. "achievementId": c.achievementId,
  4157. })
  4158. req.Header.Set("User-Agent", c.s.userAgent())
  4159. if c.ctx_ != nil {
  4160. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4161. }
  4162. return c.s.client.Do(req)
  4163. }
  4164. // Do executes the "games.achievements.unlock" call.
  4165. // Exactly one of *AchievementUnlockResponse or error will be non-nil.
  4166. // Any non-2xx status code is an error. Response headers are in either
  4167. // *AchievementUnlockResponse.ServerResponse.Header or (if a response
  4168. // was returned at all) in error.(*googleapi.Error).Header. Use
  4169. // googleapi.IsNotModified to check whether the returned error was
  4170. // because http.StatusNotModified was returned.
  4171. func (c *AchievementsUnlockCall) Do(opts ...googleapi.CallOption) (*AchievementUnlockResponse, error) {
  4172. gensupport.SetOptions(c.urlParams_, opts...)
  4173. res, err := c.doRequest("json")
  4174. if res != nil && res.StatusCode == http.StatusNotModified {
  4175. if res.Body != nil {
  4176. res.Body.Close()
  4177. }
  4178. return nil, &googleapi.Error{
  4179. Code: res.StatusCode,
  4180. Header: res.Header,
  4181. }
  4182. }
  4183. if err != nil {
  4184. return nil, err
  4185. }
  4186. defer googleapi.CloseBody(res)
  4187. if err := googleapi.CheckResponse(res); err != nil {
  4188. return nil, err
  4189. }
  4190. ret := &AchievementUnlockResponse{
  4191. ServerResponse: googleapi.ServerResponse{
  4192. Header: res.Header,
  4193. HTTPStatusCode: res.StatusCode,
  4194. },
  4195. }
  4196. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4197. return nil, err
  4198. }
  4199. return ret, nil
  4200. // {
  4201. // "description": "Unlocks this achievement for the currently authenticated player.",
  4202. // "httpMethod": "POST",
  4203. // "id": "games.achievements.unlock",
  4204. // "parameterOrder": [
  4205. // "achievementId"
  4206. // ],
  4207. // "parameters": {
  4208. // "achievementId": {
  4209. // "description": "The ID of the achievement used by this method.",
  4210. // "location": "path",
  4211. // "required": true,
  4212. // "type": "string"
  4213. // }
  4214. // },
  4215. // "path": "achievements/{achievementId}/unlock",
  4216. // "response": {
  4217. // "$ref": "AchievementUnlockResponse"
  4218. // },
  4219. // "scopes": [
  4220. // "https://www.googleapis.com/auth/games",
  4221. // "https://www.googleapis.com/auth/plus.login"
  4222. // ]
  4223. // }
  4224. }
  4225. // method id "games.achievements.updateMultiple":
  4226. type AchievementsUpdateMultipleCall struct {
  4227. s *Service
  4228. achievementupdatemultiplerequest *AchievementUpdateMultipleRequest
  4229. urlParams_ gensupport.URLParams
  4230. ctx_ context.Context
  4231. }
  4232. // UpdateMultiple: Updates multiple achievements for the currently
  4233. // authenticated player.
  4234. func (r *AchievementsService) UpdateMultiple(achievementupdatemultiplerequest *AchievementUpdateMultipleRequest) *AchievementsUpdateMultipleCall {
  4235. c := &AchievementsUpdateMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4236. c.achievementupdatemultiplerequest = achievementupdatemultiplerequest
  4237. return c
  4238. }
  4239. // Fields allows partial responses to be retrieved. See
  4240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4241. // for more information.
  4242. func (c *AchievementsUpdateMultipleCall) Fields(s ...googleapi.Field) *AchievementsUpdateMultipleCall {
  4243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4244. return c
  4245. }
  4246. // Context sets the context to be used in this call's Do method. Any
  4247. // pending HTTP request will be aborted if the provided context is
  4248. // canceled.
  4249. func (c *AchievementsUpdateMultipleCall) Context(ctx context.Context) *AchievementsUpdateMultipleCall {
  4250. c.ctx_ = ctx
  4251. return c
  4252. }
  4253. func (c *AchievementsUpdateMultipleCall) doRequest(alt string) (*http.Response, error) {
  4254. var body io.Reader = nil
  4255. body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementupdatemultiplerequest)
  4256. if err != nil {
  4257. return nil, err
  4258. }
  4259. ctype := "application/json"
  4260. c.urlParams_.Set("alt", alt)
  4261. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/updateMultiple")
  4262. urls += "?" + c.urlParams_.Encode()
  4263. req, _ := http.NewRequest("POST", urls, body)
  4264. googleapi.SetOpaque(req.URL)
  4265. req.Header.Set("Content-Type", ctype)
  4266. req.Header.Set("User-Agent", c.s.userAgent())
  4267. if c.ctx_ != nil {
  4268. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4269. }
  4270. return c.s.client.Do(req)
  4271. }
  4272. // Do executes the "games.achievements.updateMultiple" call.
  4273. // Exactly one of *AchievementUpdateMultipleResponse or error will be
  4274. // non-nil. Any non-2xx status code is an error. Response headers are in
  4275. // either *AchievementUpdateMultipleResponse.ServerResponse.Header or
  4276. // (if a response was returned at all) in
  4277. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4278. // whether the returned error was because http.StatusNotModified was
  4279. // returned.
  4280. func (c *AchievementsUpdateMultipleCall) Do(opts ...googleapi.CallOption) (*AchievementUpdateMultipleResponse, error) {
  4281. gensupport.SetOptions(c.urlParams_, opts...)
  4282. res, err := c.doRequest("json")
  4283. if res != nil && res.StatusCode == http.StatusNotModified {
  4284. if res.Body != nil {
  4285. res.Body.Close()
  4286. }
  4287. return nil, &googleapi.Error{
  4288. Code: res.StatusCode,
  4289. Header: res.Header,
  4290. }
  4291. }
  4292. if err != nil {
  4293. return nil, err
  4294. }
  4295. defer googleapi.CloseBody(res)
  4296. if err := googleapi.CheckResponse(res); err != nil {
  4297. return nil, err
  4298. }
  4299. ret := &AchievementUpdateMultipleResponse{
  4300. ServerResponse: googleapi.ServerResponse{
  4301. Header: res.Header,
  4302. HTTPStatusCode: res.StatusCode,
  4303. },
  4304. }
  4305. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4306. return nil, err
  4307. }
  4308. return ret, nil
  4309. // {
  4310. // "description": "Updates multiple achievements for the currently authenticated player.",
  4311. // "httpMethod": "POST",
  4312. // "id": "games.achievements.updateMultiple",
  4313. // "path": "achievements/updateMultiple",
  4314. // "request": {
  4315. // "$ref": "AchievementUpdateMultipleRequest"
  4316. // },
  4317. // "response": {
  4318. // "$ref": "AchievementUpdateMultipleResponse"
  4319. // },
  4320. // "scopes": [
  4321. // "https://www.googleapis.com/auth/games",
  4322. // "https://www.googleapis.com/auth/plus.login"
  4323. // ]
  4324. // }
  4325. }
  4326. // method id "games.applications.get":
  4327. type ApplicationsGetCall struct {
  4328. s *Service
  4329. applicationId string
  4330. urlParams_ gensupport.URLParams
  4331. ifNoneMatch_ string
  4332. ctx_ context.Context
  4333. }
  4334. // Get: Retrieves the metadata of the application with the given ID. If
  4335. // the requested application is not available for the specified
  4336. // platformType, the returned response will not include any instance
  4337. // data.
  4338. func (r *ApplicationsService) Get(applicationId string) *ApplicationsGetCall {
  4339. c := &ApplicationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4340. c.applicationId = applicationId
  4341. return c
  4342. }
  4343. // Language sets the optional parameter "language": The preferred
  4344. // language to use for strings returned by this method.
  4345. func (c *ApplicationsGetCall) Language(language string) *ApplicationsGetCall {
  4346. c.urlParams_.Set("language", language)
  4347. return c
  4348. }
  4349. // PlatformType sets the optional parameter "platformType": Restrict
  4350. // application details returned to the specific platform.
  4351. //
  4352. // Possible values:
  4353. // "ANDROID" - Retrieve applications that can be played on Android.
  4354. // "IOS" - Retrieve applications that can be played on iOS.
  4355. // "WEB_APP" - Retrieve applications that can be played on desktop
  4356. // web.
  4357. func (c *ApplicationsGetCall) PlatformType(platformType string) *ApplicationsGetCall {
  4358. c.urlParams_.Set("platformType", platformType)
  4359. return c
  4360. }
  4361. // Fields allows partial responses to be retrieved. See
  4362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4363. // for more information.
  4364. func (c *ApplicationsGetCall) Fields(s ...googleapi.Field) *ApplicationsGetCall {
  4365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4366. return c
  4367. }
  4368. // IfNoneMatch sets the optional parameter which makes the operation
  4369. // fail if the object's ETag matches the given value. This is useful for
  4370. // getting updates only after the object has changed since the last
  4371. // request. Use googleapi.IsNotModified to check whether the response
  4372. // error from Do is the result of In-None-Match.
  4373. func (c *ApplicationsGetCall) IfNoneMatch(entityTag string) *ApplicationsGetCall {
  4374. c.ifNoneMatch_ = entityTag
  4375. return c
  4376. }
  4377. // Context sets the context to be used in this call's Do method. Any
  4378. // pending HTTP request will be aborted if the provided context is
  4379. // canceled.
  4380. func (c *ApplicationsGetCall) Context(ctx context.Context) *ApplicationsGetCall {
  4381. c.ctx_ = ctx
  4382. return c
  4383. }
  4384. func (c *ApplicationsGetCall) doRequest(alt string) (*http.Response, error) {
  4385. var body io.Reader = nil
  4386. c.urlParams_.Set("alt", alt)
  4387. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}")
  4388. urls += "?" + c.urlParams_.Encode()
  4389. req, _ := http.NewRequest("GET", urls, body)
  4390. googleapi.Expand(req.URL, map[string]string{
  4391. "applicationId": c.applicationId,
  4392. })
  4393. req.Header.Set("User-Agent", c.s.userAgent())
  4394. if c.ifNoneMatch_ != "" {
  4395. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4396. }
  4397. if c.ctx_ != nil {
  4398. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4399. }
  4400. return c.s.client.Do(req)
  4401. }
  4402. // Do executes the "games.applications.get" call.
  4403. // Exactly one of *Application or error will be non-nil. Any non-2xx
  4404. // status code is an error. Response headers are in either
  4405. // *Application.ServerResponse.Header or (if a response was returned at
  4406. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4407. // to check whether the returned error was because
  4408. // http.StatusNotModified was returned.
  4409. func (c *ApplicationsGetCall) Do(opts ...googleapi.CallOption) (*Application, error) {
  4410. gensupport.SetOptions(c.urlParams_, opts...)
  4411. res, err := c.doRequest("json")
  4412. if res != nil && res.StatusCode == http.StatusNotModified {
  4413. if res.Body != nil {
  4414. res.Body.Close()
  4415. }
  4416. return nil, &googleapi.Error{
  4417. Code: res.StatusCode,
  4418. Header: res.Header,
  4419. }
  4420. }
  4421. if err != nil {
  4422. return nil, err
  4423. }
  4424. defer googleapi.CloseBody(res)
  4425. if err := googleapi.CheckResponse(res); err != nil {
  4426. return nil, err
  4427. }
  4428. ret := &Application{
  4429. ServerResponse: googleapi.ServerResponse{
  4430. Header: res.Header,
  4431. HTTPStatusCode: res.StatusCode,
  4432. },
  4433. }
  4434. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4435. return nil, err
  4436. }
  4437. return ret, nil
  4438. // {
  4439. // "description": "Retrieves the metadata of the application with the given ID. If the requested application is not available for the specified platformType, the returned response will not include any instance data.",
  4440. // "httpMethod": "GET",
  4441. // "id": "games.applications.get",
  4442. // "parameterOrder": [
  4443. // "applicationId"
  4444. // ],
  4445. // "parameters": {
  4446. // "applicationId": {
  4447. // "description": "The application ID from the Google Play developer console.",
  4448. // "location": "path",
  4449. // "required": true,
  4450. // "type": "string"
  4451. // },
  4452. // "language": {
  4453. // "description": "The preferred language to use for strings returned by this method.",
  4454. // "location": "query",
  4455. // "type": "string"
  4456. // },
  4457. // "platformType": {
  4458. // "description": "Restrict application details returned to the specific platform.",
  4459. // "enum": [
  4460. // "ANDROID",
  4461. // "IOS",
  4462. // "WEB_APP"
  4463. // ],
  4464. // "enumDescriptions": [
  4465. // "Retrieve applications that can be played on Android.",
  4466. // "Retrieve applications that can be played on iOS.",
  4467. // "Retrieve applications that can be played on desktop web."
  4468. // ],
  4469. // "location": "query",
  4470. // "type": "string"
  4471. // }
  4472. // },
  4473. // "path": "applications/{applicationId}",
  4474. // "response": {
  4475. // "$ref": "Application"
  4476. // },
  4477. // "scopes": [
  4478. // "https://www.googleapis.com/auth/games",
  4479. // "https://www.googleapis.com/auth/plus.login"
  4480. // ]
  4481. // }
  4482. }
  4483. // method id "games.applications.played":
  4484. type ApplicationsPlayedCall struct {
  4485. s *Service
  4486. urlParams_ gensupport.URLParams
  4487. ctx_ context.Context
  4488. }
  4489. // Played: Indicate that the the currently authenticated user is playing
  4490. // your application.
  4491. func (r *ApplicationsService) Played() *ApplicationsPlayedCall {
  4492. c := &ApplicationsPlayedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4493. return c
  4494. }
  4495. // Fields allows partial responses to be retrieved. See
  4496. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4497. // for more information.
  4498. func (c *ApplicationsPlayedCall) Fields(s ...googleapi.Field) *ApplicationsPlayedCall {
  4499. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4500. return c
  4501. }
  4502. // Context sets the context to be used in this call's Do method. Any
  4503. // pending HTTP request will be aborted if the provided context is
  4504. // canceled.
  4505. func (c *ApplicationsPlayedCall) Context(ctx context.Context) *ApplicationsPlayedCall {
  4506. c.ctx_ = ctx
  4507. return c
  4508. }
  4509. func (c *ApplicationsPlayedCall) doRequest(alt string) (*http.Response, error) {
  4510. var body io.Reader = nil
  4511. c.urlParams_.Set("alt", alt)
  4512. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/played")
  4513. urls += "?" + c.urlParams_.Encode()
  4514. req, _ := http.NewRequest("POST", urls, body)
  4515. googleapi.SetOpaque(req.URL)
  4516. req.Header.Set("User-Agent", c.s.userAgent())
  4517. if c.ctx_ != nil {
  4518. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4519. }
  4520. return c.s.client.Do(req)
  4521. }
  4522. // Do executes the "games.applications.played" call.
  4523. func (c *ApplicationsPlayedCall) Do(opts ...googleapi.CallOption) error {
  4524. gensupport.SetOptions(c.urlParams_, opts...)
  4525. res, err := c.doRequest("json")
  4526. if err != nil {
  4527. return err
  4528. }
  4529. defer googleapi.CloseBody(res)
  4530. if err := googleapi.CheckResponse(res); err != nil {
  4531. return err
  4532. }
  4533. return nil
  4534. // {
  4535. // "description": "Indicate that the the currently authenticated user is playing your application.",
  4536. // "httpMethod": "POST",
  4537. // "id": "games.applications.played",
  4538. // "path": "applications/played",
  4539. // "scopes": [
  4540. // "https://www.googleapis.com/auth/games",
  4541. // "https://www.googleapis.com/auth/plus.login"
  4542. // ]
  4543. // }
  4544. }
  4545. // method id "games.applications.verify":
  4546. type ApplicationsVerifyCall struct {
  4547. s *Service
  4548. applicationId string
  4549. urlParams_ gensupport.URLParams
  4550. ifNoneMatch_ string
  4551. ctx_ context.Context
  4552. }
  4553. // Verify: Verifies the auth token provided with this request is for the
  4554. // application with the specified ID, and returns the ID of the player
  4555. // it was granted for.
  4556. func (r *ApplicationsService) Verify(applicationId string) *ApplicationsVerifyCall {
  4557. c := &ApplicationsVerifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4558. c.applicationId = applicationId
  4559. return c
  4560. }
  4561. // Fields allows partial responses to be retrieved. See
  4562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4563. // for more information.
  4564. func (c *ApplicationsVerifyCall) Fields(s ...googleapi.Field) *ApplicationsVerifyCall {
  4565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4566. return c
  4567. }
  4568. // IfNoneMatch sets the optional parameter which makes the operation
  4569. // fail if the object's ETag matches the given value. This is useful for
  4570. // getting updates only after the object has changed since the last
  4571. // request. Use googleapi.IsNotModified to check whether the response
  4572. // error from Do is the result of In-None-Match.
  4573. func (c *ApplicationsVerifyCall) IfNoneMatch(entityTag string) *ApplicationsVerifyCall {
  4574. c.ifNoneMatch_ = entityTag
  4575. return c
  4576. }
  4577. // Context sets the context to be used in this call's Do method. Any
  4578. // pending HTTP request will be aborted if the provided context is
  4579. // canceled.
  4580. func (c *ApplicationsVerifyCall) Context(ctx context.Context) *ApplicationsVerifyCall {
  4581. c.ctx_ = ctx
  4582. return c
  4583. }
  4584. func (c *ApplicationsVerifyCall) doRequest(alt string) (*http.Response, error) {
  4585. var body io.Reader = nil
  4586. c.urlParams_.Set("alt", alt)
  4587. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/verify")
  4588. urls += "?" + c.urlParams_.Encode()
  4589. req, _ := http.NewRequest("GET", urls, body)
  4590. googleapi.Expand(req.URL, map[string]string{
  4591. "applicationId": c.applicationId,
  4592. })
  4593. req.Header.Set("User-Agent", c.s.userAgent())
  4594. if c.ifNoneMatch_ != "" {
  4595. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4596. }
  4597. if c.ctx_ != nil {
  4598. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4599. }
  4600. return c.s.client.Do(req)
  4601. }
  4602. // Do executes the "games.applications.verify" call.
  4603. // Exactly one of *ApplicationVerifyResponse or error will be non-nil.
  4604. // Any non-2xx status code is an error. Response headers are in either
  4605. // *ApplicationVerifyResponse.ServerResponse.Header or (if a response
  4606. // was returned at all) in error.(*googleapi.Error).Header. Use
  4607. // googleapi.IsNotModified to check whether the returned error was
  4608. // because http.StatusNotModified was returned.
  4609. func (c *ApplicationsVerifyCall) Do(opts ...googleapi.CallOption) (*ApplicationVerifyResponse, error) {
  4610. gensupport.SetOptions(c.urlParams_, opts...)
  4611. res, err := c.doRequest("json")
  4612. if res != nil && res.StatusCode == http.StatusNotModified {
  4613. if res.Body != nil {
  4614. res.Body.Close()
  4615. }
  4616. return nil, &googleapi.Error{
  4617. Code: res.StatusCode,
  4618. Header: res.Header,
  4619. }
  4620. }
  4621. if err != nil {
  4622. return nil, err
  4623. }
  4624. defer googleapi.CloseBody(res)
  4625. if err := googleapi.CheckResponse(res); err != nil {
  4626. return nil, err
  4627. }
  4628. ret := &ApplicationVerifyResponse{
  4629. ServerResponse: googleapi.ServerResponse{
  4630. Header: res.Header,
  4631. HTTPStatusCode: res.StatusCode,
  4632. },
  4633. }
  4634. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4635. return nil, err
  4636. }
  4637. return ret, nil
  4638. // {
  4639. // "description": "Verifies the auth token provided with this request is for the application with the specified ID, and returns the ID of the player it was granted for.",
  4640. // "httpMethod": "GET",
  4641. // "id": "games.applications.verify",
  4642. // "parameterOrder": [
  4643. // "applicationId"
  4644. // ],
  4645. // "parameters": {
  4646. // "applicationId": {
  4647. // "description": "The application ID from the Google Play developer console.",
  4648. // "location": "path",
  4649. // "required": true,
  4650. // "type": "string"
  4651. // }
  4652. // },
  4653. // "path": "applications/{applicationId}/verify",
  4654. // "response": {
  4655. // "$ref": "ApplicationVerifyResponse"
  4656. // },
  4657. // "scopes": [
  4658. // "https://www.googleapis.com/auth/games",
  4659. // "https://www.googleapis.com/auth/plus.login"
  4660. // ]
  4661. // }
  4662. }
  4663. // method id "games.events.listByPlayer":
  4664. type EventsListByPlayerCall struct {
  4665. s *Service
  4666. urlParams_ gensupport.URLParams
  4667. ifNoneMatch_ string
  4668. ctx_ context.Context
  4669. }
  4670. // ListByPlayer: Returns a list showing the current progress on events
  4671. // in this application for the currently authenticated user.
  4672. func (r *EventsService) ListByPlayer() *EventsListByPlayerCall {
  4673. c := &EventsListByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4674. return c
  4675. }
  4676. // Language sets the optional parameter "language": The preferred
  4677. // language to use for strings returned by this method.
  4678. func (c *EventsListByPlayerCall) Language(language string) *EventsListByPlayerCall {
  4679. c.urlParams_.Set("language", language)
  4680. return c
  4681. }
  4682. // MaxResults sets the optional parameter "maxResults": The maximum
  4683. // number of events to return in the response, used for paging. For any
  4684. // response, the actual number of events to return may be less than the
  4685. // specified maxResults.
  4686. func (c *EventsListByPlayerCall) MaxResults(maxResults int64) *EventsListByPlayerCall {
  4687. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4688. return c
  4689. }
  4690. // PageToken sets the optional parameter "pageToken": The token returned
  4691. // by the previous request.
  4692. func (c *EventsListByPlayerCall) PageToken(pageToken string) *EventsListByPlayerCall {
  4693. c.urlParams_.Set("pageToken", pageToken)
  4694. return c
  4695. }
  4696. // Fields allows partial responses to be retrieved. See
  4697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4698. // for more information.
  4699. func (c *EventsListByPlayerCall) Fields(s ...googleapi.Field) *EventsListByPlayerCall {
  4700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4701. return c
  4702. }
  4703. // IfNoneMatch sets the optional parameter which makes the operation
  4704. // fail if the object's ETag matches the given value. This is useful for
  4705. // getting updates only after the object has changed since the last
  4706. // request. Use googleapi.IsNotModified to check whether the response
  4707. // error from Do is the result of In-None-Match.
  4708. func (c *EventsListByPlayerCall) IfNoneMatch(entityTag string) *EventsListByPlayerCall {
  4709. c.ifNoneMatch_ = entityTag
  4710. return c
  4711. }
  4712. // Context sets the context to be used in this call's Do method. Any
  4713. // pending HTTP request will be aborted if the provided context is
  4714. // canceled.
  4715. func (c *EventsListByPlayerCall) Context(ctx context.Context) *EventsListByPlayerCall {
  4716. c.ctx_ = ctx
  4717. return c
  4718. }
  4719. func (c *EventsListByPlayerCall) doRequest(alt string) (*http.Response, error) {
  4720. var body io.Reader = nil
  4721. c.urlParams_.Set("alt", alt)
  4722. urls := googleapi.ResolveRelative(c.s.BasePath, "events")
  4723. urls += "?" + c.urlParams_.Encode()
  4724. req, _ := http.NewRequest("GET", urls, body)
  4725. googleapi.SetOpaque(req.URL)
  4726. req.Header.Set("User-Agent", c.s.userAgent())
  4727. if c.ifNoneMatch_ != "" {
  4728. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4729. }
  4730. if c.ctx_ != nil {
  4731. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4732. }
  4733. return c.s.client.Do(req)
  4734. }
  4735. // Do executes the "games.events.listByPlayer" call.
  4736. // Exactly one of *PlayerEventListResponse or error will be non-nil. Any
  4737. // non-2xx status code is an error. Response headers are in either
  4738. // *PlayerEventListResponse.ServerResponse.Header or (if a response was
  4739. // returned at all) in error.(*googleapi.Error).Header. Use
  4740. // googleapi.IsNotModified to check whether the returned error was
  4741. // because http.StatusNotModified was returned.
  4742. func (c *EventsListByPlayerCall) Do(opts ...googleapi.CallOption) (*PlayerEventListResponse, error) {
  4743. gensupport.SetOptions(c.urlParams_, opts...)
  4744. res, err := c.doRequest("json")
  4745. if res != nil && res.StatusCode == http.StatusNotModified {
  4746. if res.Body != nil {
  4747. res.Body.Close()
  4748. }
  4749. return nil, &googleapi.Error{
  4750. Code: res.StatusCode,
  4751. Header: res.Header,
  4752. }
  4753. }
  4754. if err != nil {
  4755. return nil, err
  4756. }
  4757. defer googleapi.CloseBody(res)
  4758. if err := googleapi.CheckResponse(res); err != nil {
  4759. return nil, err
  4760. }
  4761. ret := &PlayerEventListResponse{
  4762. ServerResponse: googleapi.ServerResponse{
  4763. Header: res.Header,
  4764. HTTPStatusCode: res.StatusCode,
  4765. },
  4766. }
  4767. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4768. return nil, err
  4769. }
  4770. return ret, nil
  4771. // {
  4772. // "description": "Returns a list showing the current progress on events in this application for the currently authenticated user.",
  4773. // "httpMethod": "GET",
  4774. // "id": "games.events.listByPlayer",
  4775. // "parameters": {
  4776. // "language": {
  4777. // "description": "The preferred language to use for strings returned by this method.",
  4778. // "location": "query",
  4779. // "type": "string"
  4780. // },
  4781. // "maxResults": {
  4782. // "description": "The maximum number of events to return in the response, used for paging. For any response, the actual number of events to return may be less than the specified maxResults.",
  4783. // "format": "int32",
  4784. // "location": "query",
  4785. // "maximum": "100",
  4786. // "minimum": "1",
  4787. // "type": "integer"
  4788. // },
  4789. // "pageToken": {
  4790. // "description": "The token returned by the previous request.",
  4791. // "location": "query",
  4792. // "type": "string"
  4793. // }
  4794. // },
  4795. // "path": "events",
  4796. // "response": {
  4797. // "$ref": "PlayerEventListResponse"
  4798. // },
  4799. // "scopes": [
  4800. // "https://www.googleapis.com/auth/games",
  4801. // "https://www.googleapis.com/auth/plus.login"
  4802. // ]
  4803. // }
  4804. }
  4805. // Pages invokes f for each page of results.
  4806. // A non-nil error returned from f will halt the iteration.
  4807. // The provided context supersedes any context provided to the Context method.
  4808. func (c *EventsListByPlayerCall) Pages(ctx context.Context, f func(*PlayerEventListResponse) error) error {
  4809. c.ctx_ = ctx
  4810. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4811. for {
  4812. x, err := c.Do()
  4813. if err != nil {
  4814. return err
  4815. }
  4816. if err := f(x); err != nil {
  4817. return err
  4818. }
  4819. if x.NextPageToken == "" {
  4820. return nil
  4821. }
  4822. c.PageToken(x.NextPageToken)
  4823. }
  4824. }
  4825. // method id "games.events.listDefinitions":
  4826. type EventsListDefinitionsCall struct {
  4827. s *Service
  4828. urlParams_ gensupport.URLParams
  4829. ifNoneMatch_ string
  4830. ctx_ context.Context
  4831. }
  4832. // ListDefinitions: Returns a list of the event definitions in this
  4833. // application.
  4834. func (r *EventsService) ListDefinitions() *EventsListDefinitionsCall {
  4835. c := &EventsListDefinitionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4836. return c
  4837. }
  4838. // Language sets the optional parameter "language": The preferred
  4839. // language to use for strings returned by this method.
  4840. func (c *EventsListDefinitionsCall) Language(language string) *EventsListDefinitionsCall {
  4841. c.urlParams_.Set("language", language)
  4842. return c
  4843. }
  4844. // MaxResults sets the optional parameter "maxResults": The maximum
  4845. // number of event definitions to return in the response, used for
  4846. // paging. For any response, the actual number of event definitions to
  4847. // return may be less than the specified maxResults.
  4848. func (c *EventsListDefinitionsCall) MaxResults(maxResults int64) *EventsListDefinitionsCall {
  4849. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4850. return c
  4851. }
  4852. // PageToken sets the optional parameter "pageToken": The token returned
  4853. // by the previous request.
  4854. func (c *EventsListDefinitionsCall) PageToken(pageToken string) *EventsListDefinitionsCall {
  4855. c.urlParams_.Set("pageToken", pageToken)
  4856. return c
  4857. }
  4858. // Fields allows partial responses to be retrieved. See
  4859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4860. // for more information.
  4861. func (c *EventsListDefinitionsCall) Fields(s ...googleapi.Field) *EventsListDefinitionsCall {
  4862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4863. return c
  4864. }
  4865. // IfNoneMatch sets the optional parameter which makes the operation
  4866. // fail if the object's ETag matches the given value. This is useful for
  4867. // getting updates only after the object has changed since the last
  4868. // request. Use googleapi.IsNotModified to check whether the response
  4869. // error from Do is the result of In-None-Match.
  4870. func (c *EventsListDefinitionsCall) IfNoneMatch(entityTag string) *EventsListDefinitionsCall {
  4871. c.ifNoneMatch_ = entityTag
  4872. return c
  4873. }
  4874. // Context sets the context to be used in this call's Do method. Any
  4875. // pending HTTP request will be aborted if the provided context is
  4876. // canceled.
  4877. func (c *EventsListDefinitionsCall) Context(ctx context.Context) *EventsListDefinitionsCall {
  4878. c.ctx_ = ctx
  4879. return c
  4880. }
  4881. func (c *EventsListDefinitionsCall) doRequest(alt string) (*http.Response, error) {
  4882. var body io.Reader = nil
  4883. c.urlParams_.Set("alt", alt)
  4884. urls := googleapi.ResolveRelative(c.s.BasePath, "eventDefinitions")
  4885. urls += "?" + c.urlParams_.Encode()
  4886. req, _ := http.NewRequest("GET", urls, body)
  4887. googleapi.SetOpaque(req.URL)
  4888. req.Header.Set("User-Agent", c.s.userAgent())
  4889. if c.ifNoneMatch_ != "" {
  4890. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4891. }
  4892. if c.ctx_ != nil {
  4893. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4894. }
  4895. return c.s.client.Do(req)
  4896. }
  4897. // Do executes the "games.events.listDefinitions" call.
  4898. // Exactly one of *EventDefinitionListResponse or error will be non-nil.
  4899. // Any non-2xx status code is an error. Response headers are in either
  4900. // *EventDefinitionListResponse.ServerResponse.Header or (if a response
  4901. // was returned at all) in error.(*googleapi.Error).Header. Use
  4902. // googleapi.IsNotModified to check whether the returned error was
  4903. // because http.StatusNotModified was returned.
  4904. func (c *EventsListDefinitionsCall) Do(opts ...googleapi.CallOption) (*EventDefinitionListResponse, error) {
  4905. gensupport.SetOptions(c.urlParams_, opts...)
  4906. res, err := c.doRequest("json")
  4907. if res != nil && res.StatusCode == http.StatusNotModified {
  4908. if res.Body != nil {
  4909. res.Body.Close()
  4910. }
  4911. return nil, &googleapi.Error{
  4912. Code: res.StatusCode,
  4913. Header: res.Header,
  4914. }
  4915. }
  4916. if err != nil {
  4917. return nil, err
  4918. }
  4919. defer googleapi.CloseBody(res)
  4920. if err := googleapi.CheckResponse(res); err != nil {
  4921. return nil, err
  4922. }
  4923. ret := &EventDefinitionListResponse{
  4924. ServerResponse: googleapi.ServerResponse{
  4925. Header: res.Header,
  4926. HTTPStatusCode: res.StatusCode,
  4927. },
  4928. }
  4929. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4930. return nil, err
  4931. }
  4932. return ret, nil
  4933. // {
  4934. // "description": "Returns a list of the event definitions in this application.",
  4935. // "httpMethod": "GET",
  4936. // "id": "games.events.listDefinitions",
  4937. // "parameters": {
  4938. // "language": {
  4939. // "description": "The preferred language to use for strings returned by this method.",
  4940. // "location": "query",
  4941. // "type": "string"
  4942. // },
  4943. // "maxResults": {
  4944. // "description": "The maximum number of event definitions to return in the response, used for paging. For any response, the actual number of event definitions to return may be less than the specified maxResults.",
  4945. // "format": "int32",
  4946. // "location": "query",
  4947. // "maximum": "100",
  4948. // "minimum": "1",
  4949. // "type": "integer"
  4950. // },
  4951. // "pageToken": {
  4952. // "description": "The token returned by the previous request.",
  4953. // "location": "query",
  4954. // "type": "string"
  4955. // }
  4956. // },
  4957. // "path": "eventDefinitions",
  4958. // "response": {
  4959. // "$ref": "EventDefinitionListResponse"
  4960. // },
  4961. // "scopes": [
  4962. // "https://www.googleapis.com/auth/games",
  4963. // "https://www.googleapis.com/auth/plus.login"
  4964. // ]
  4965. // }
  4966. }
  4967. // Pages invokes f for each page of results.
  4968. // A non-nil error returned from f will halt the iteration.
  4969. // The provided context supersedes any context provided to the Context method.
  4970. func (c *EventsListDefinitionsCall) Pages(ctx context.Context, f func(*EventDefinitionListResponse) error) error {
  4971. c.ctx_ = ctx
  4972. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4973. for {
  4974. x, err := c.Do()
  4975. if err != nil {
  4976. return err
  4977. }
  4978. if err := f(x); err != nil {
  4979. return err
  4980. }
  4981. if x.NextPageToken == "" {
  4982. return nil
  4983. }
  4984. c.PageToken(x.NextPageToken)
  4985. }
  4986. }
  4987. // method id "games.events.record":
  4988. type EventsRecordCall struct {
  4989. s *Service
  4990. eventrecordrequest *EventRecordRequest
  4991. urlParams_ gensupport.URLParams
  4992. ctx_ context.Context
  4993. }
  4994. // Record: Records a batch of changes to the number of times events have
  4995. // occurred for the currently authenticated user of this application.
  4996. func (r *EventsService) Record(eventrecordrequest *EventRecordRequest) *EventsRecordCall {
  4997. c := &EventsRecordCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4998. c.eventrecordrequest = eventrecordrequest
  4999. return c
  5000. }
  5001. // Language sets the optional parameter "language": The preferred
  5002. // language to use for strings returned by this method.
  5003. func (c *EventsRecordCall) Language(language string) *EventsRecordCall {
  5004. c.urlParams_.Set("language", language)
  5005. return c
  5006. }
  5007. // Fields allows partial responses to be retrieved. See
  5008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5009. // for more information.
  5010. func (c *EventsRecordCall) Fields(s ...googleapi.Field) *EventsRecordCall {
  5011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5012. return c
  5013. }
  5014. // Context sets the context to be used in this call's Do method. Any
  5015. // pending HTTP request will be aborted if the provided context is
  5016. // canceled.
  5017. func (c *EventsRecordCall) Context(ctx context.Context) *EventsRecordCall {
  5018. c.ctx_ = ctx
  5019. return c
  5020. }
  5021. func (c *EventsRecordCall) doRequest(alt string) (*http.Response, error) {
  5022. var body io.Reader = nil
  5023. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventrecordrequest)
  5024. if err != nil {
  5025. return nil, err
  5026. }
  5027. ctype := "application/json"
  5028. c.urlParams_.Set("alt", alt)
  5029. urls := googleapi.ResolveRelative(c.s.BasePath, "events")
  5030. urls += "?" + c.urlParams_.Encode()
  5031. req, _ := http.NewRequest("POST", urls, body)
  5032. googleapi.SetOpaque(req.URL)
  5033. req.Header.Set("Content-Type", ctype)
  5034. req.Header.Set("User-Agent", c.s.userAgent())
  5035. if c.ctx_ != nil {
  5036. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5037. }
  5038. return c.s.client.Do(req)
  5039. }
  5040. // Do executes the "games.events.record" call.
  5041. // Exactly one of *EventUpdateResponse or error will be non-nil. Any
  5042. // non-2xx status code is an error. Response headers are in either
  5043. // *EventUpdateResponse.ServerResponse.Header or (if a response was
  5044. // returned at all) in error.(*googleapi.Error).Header. Use
  5045. // googleapi.IsNotModified to check whether the returned error was
  5046. // because http.StatusNotModified was returned.
  5047. func (c *EventsRecordCall) Do(opts ...googleapi.CallOption) (*EventUpdateResponse, error) {
  5048. gensupport.SetOptions(c.urlParams_, opts...)
  5049. res, err := c.doRequest("json")
  5050. if res != nil && res.StatusCode == http.StatusNotModified {
  5051. if res.Body != nil {
  5052. res.Body.Close()
  5053. }
  5054. return nil, &googleapi.Error{
  5055. Code: res.StatusCode,
  5056. Header: res.Header,
  5057. }
  5058. }
  5059. if err != nil {
  5060. return nil, err
  5061. }
  5062. defer googleapi.CloseBody(res)
  5063. if err := googleapi.CheckResponse(res); err != nil {
  5064. return nil, err
  5065. }
  5066. ret := &EventUpdateResponse{
  5067. ServerResponse: googleapi.ServerResponse{
  5068. Header: res.Header,
  5069. HTTPStatusCode: res.StatusCode,
  5070. },
  5071. }
  5072. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5073. return nil, err
  5074. }
  5075. return ret, nil
  5076. // {
  5077. // "description": "Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application.",
  5078. // "httpMethod": "POST",
  5079. // "id": "games.events.record",
  5080. // "parameters": {
  5081. // "language": {
  5082. // "description": "The preferred language to use for strings returned by this method.",
  5083. // "location": "query",
  5084. // "type": "string"
  5085. // }
  5086. // },
  5087. // "path": "events",
  5088. // "request": {
  5089. // "$ref": "EventRecordRequest"
  5090. // },
  5091. // "response": {
  5092. // "$ref": "EventUpdateResponse"
  5093. // },
  5094. // "scopes": [
  5095. // "https://www.googleapis.com/auth/games",
  5096. // "https://www.googleapis.com/auth/plus.login"
  5097. // ]
  5098. // }
  5099. }
  5100. // method id "games.leaderboards.get":
  5101. type LeaderboardsGetCall struct {
  5102. s *Service
  5103. leaderboardId string
  5104. urlParams_ gensupport.URLParams
  5105. ifNoneMatch_ string
  5106. ctx_ context.Context
  5107. }
  5108. // Get: Retrieves the metadata of the leaderboard with the given ID.
  5109. func (r *LeaderboardsService) Get(leaderboardId string) *LeaderboardsGetCall {
  5110. c := &LeaderboardsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5111. c.leaderboardId = leaderboardId
  5112. return c
  5113. }
  5114. // Language sets the optional parameter "language": The preferred
  5115. // language to use for strings returned by this method.
  5116. func (c *LeaderboardsGetCall) Language(language string) *LeaderboardsGetCall {
  5117. c.urlParams_.Set("language", language)
  5118. return c
  5119. }
  5120. // Fields allows partial responses to be retrieved. See
  5121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5122. // for more information.
  5123. func (c *LeaderboardsGetCall) Fields(s ...googleapi.Field) *LeaderboardsGetCall {
  5124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5125. return c
  5126. }
  5127. // IfNoneMatch sets the optional parameter which makes the operation
  5128. // fail if the object's ETag matches the given value. This is useful for
  5129. // getting updates only after the object has changed since the last
  5130. // request. Use googleapi.IsNotModified to check whether the response
  5131. // error from Do is the result of In-None-Match.
  5132. func (c *LeaderboardsGetCall) IfNoneMatch(entityTag string) *LeaderboardsGetCall {
  5133. c.ifNoneMatch_ = entityTag
  5134. return c
  5135. }
  5136. // Context sets the context to be used in this call's Do method. Any
  5137. // pending HTTP request will be aborted if the provided context is
  5138. // canceled.
  5139. func (c *LeaderboardsGetCall) Context(ctx context.Context) *LeaderboardsGetCall {
  5140. c.ctx_ = ctx
  5141. return c
  5142. }
  5143. func (c *LeaderboardsGetCall) doRequest(alt string) (*http.Response, error) {
  5144. var body io.Reader = nil
  5145. c.urlParams_.Set("alt", alt)
  5146. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}")
  5147. urls += "?" + c.urlParams_.Encode()
  5148. req, _ := http.NewRequest("GET", urls, body)
  5149. googleapi.Expand(req.URL, map[string]string{
  5150. "leaderboardId": c.leaderboardId,
  5151. })
  5152. req.Header.Set("User-Agent", c.s.userAgent())
  5153. if c.ifNoneMatch_ != "" {
  5154. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5155. }
  5156. if c.ctx_ != nil {
  5157. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5158. }
  5159. return c.s.client.Do(req)
  5160. }
  5161. // Do executes the "games.leaderboards.get" call.
  5162. // Exactly one of *Leaderboard or error will be non-nil. Any non-2xx
  5163. // status code is an error. Response headers are in either
  5164. // *Leaderboard.ServerResponse.Header or (if a response was returned at
  5165. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5166. // to check whether the returned error was because
  5167. // http.StatusNotModified was returned.
  5168. func (c *LeaderboardsGetCall) Do(opts ...googleapi.CallOption) (*Leaderboard, error) {
  5169. gensupport.SetOptions(c.urlParams_, opts...)
  5170. res, err := c.doRequest("json")
  5171. if res != nil && res.StatusCode == http.StatusNotModified {
  5172. if res.Body != nil {
  5173. res.Body.Close()
  5174. }
  5175. return nil, &googleapi.Error{
  5176. Code: res.StatusCode,
  5177. Header: res.Header,
  5178. }
  5179. }
  5180. if err != nil {
  5181. return nil, err
  5182. }
  5183. defer googleapi.CloseBody(res)
  5184. if err := googleapi.CheckResponse(res); err != nil {
  5185. return nil, err
  5186. }
  5187. ret := &Leaderboard{
  5188. ServerResponse: googleapi.ServerResponse{
  5189. Header: res.Header,
  5190. HTTPStatusCode: res.StatusCode,
  5191. },
  5192. }
  5193. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5194. return nil, err
  5195. }
  5196. return ret, nil
  5197. // {
  5198. // "description": "Retrieves the metadata of the leaderboard with the given ID.",
  5199. // "httpMethod": "GET",
  5200. // "id": "games.leaderboards.get",
  5201. // "parameterOrder": [
  5202. // "leaderboardId"
  5203. // ],
  5204. // "parameters": {
  5205. // "language": {
  5206. // "description": "The preferred language to use for strings returned by this method.",
  5207. // "location": "query",
  5208. // "type": "string"
  5209. // },
  5210. // "leaderboardId": {
  5211. // "description": "The ID of the leaderboard.",
  5212. // "location": "path",
  5213. // "required": true,
  5214. // "type": "string"
  5215. // }
  5216. // },
  5217. // "path": "leaderboards/{leaderboardId}",
  5218. // "response": {
  5219. // "$ref": "Leaderboard"
  5220. // },
  5221. // "scopes": [
  5222. // "https://www.googleapis.com/auth/games",
  5223. // "https://www.googleapis.com/auth/plus.login"
  5224. // ]
  5225. // }
  5226. }
  5227. // method id "games.leaderboards.list":
  5228. type LeaderboardsListCall struct {
  5229. s *Service
  5230. urlParams_ gensupport.URLParams
  5231. ifNoneMatch_ string
  5232. ctx_ context.Context
  5233. }
  5234. // List: Lists all the leaderboard metadata for your application.
  5235. func (r *LeaderboardsService) List() *LeaderboardsListCall {
  5236. c := &LeaderboardsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5237. return c
  5238. }
  5239. // Language sets the optional parameter "language": The preferred
  5240. // language to use for strings returned by this method.
  5241. func (c *LeaderboardsListCall) Language(language string) *LeaderboardsListCall {
  5242. c.urlParams_.Set("language", language)
  5243. return c
  5244. }
  5245. // MaxResults sets the optional parameter "maxResults": The maximum
  5246. // number of leaderboards to return in the response. For any response,
  5247. // the actual number of leaderboards returned may be less than the
  5248. // specified maxResults.
  5249. func (c *LeaderboardsListCall) MaxResults(maxResults int64) *LeaderboardsListCall {
  5250. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5251. return c
  5252. }
  5253. // PageToken sets the optional parameter "pageToken": The token returned
  5254. // by the previous request.
  5255. func (c *LeaderboardsListCall) PageToken(pageToken string) *LeaderboardsListCall {
  5256. c.urlParams_.Set("pageToken", pageToken)
  5257. return c
  5258. }
  5259. // Fields allows partial responses to be retrieved. See
  5260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5261. // for more information.
  5262. func (c *LeaderboardsListCall) Fields(s ...googleapi.Field) *LeaderboardsListCall {
  5263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5264. return c
  5265. }
  5266. // IfNoneMatch sets the optional parameter which makes the operation
  5267. // fail if the object's ETag matches the given value. This is useful for
  5268. // getting updates only after the object has changed since the last
  5269. // request. Use googleapi.IsNotModified to check whether the response
  5270. // error from Do is the result of In-None-Match.
  5271. func (c *LeaderboardsListCall) IfNoneMatch(entityTag string) *LeaderboardsListCall {
  5272. c.ifNoneMatch_ = entityTag
  5273. return c
  5274. }
  5275. // Context sets the context to be used in this call's Do method. Any
  5276. // pending HTTP request will be aborted if the provided context is
  5277. // canceled.
  5278. func (c *LeaderboardsListCall) Context(ctx context.Context) *LeaderboardsListCall {
  5279. c.ctx_ = ctx
  5280. return c
  5281. }
  5282. func (c *LeaderboardsListCall) doRequest(alt string) (*http.Response, error) {
  5283. var body io.Reader = nil
  5284. c.urlParams_.Set("alt", alt)
  5285. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards")
  5286. urls += "?" + c.urlParams_.Encode()
  5287. req, _ := http.NewRequest("GET", urls, body)
  5288. googleapi.SetOpaque(req.URL)
  5289. req.Header.Set("User-Agent", c.s.userAgent())
  5290. if c.ifNoneMatch_ != "" {
  5291. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5292. }
  5293. if c.ctx_ != nil {
  5294. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5295. }
  5296. return c.s.client.Do(req)
  5297. }
  5298. // Do executes the "games.leaderboards.list" call.
  5299. // Exactly one of *LeaderboardListResponse or error will be non-nil. Any
  5300. // non-2xx status code is an error. Response headers are in either
  5301. // *LeaderboardListResponse.ServerResponse.Header or (if a response was
  5302. // returned at all) in error.(*googleapi.Error).Header. Use
  5303. // googleapi.IsNotModified to check whether the returned error was
  5304. // because http.StatusNotModified was returned.
  5305. func (c *LeaderboardsListCall) Do(opts ...googleapi.CallOption) (*LeaderboardListResponse, error) {
  5306. gensupport.SetOptions(c.urlParams_, opts...)
  5307. res, err := c.doRequest("json")
  5308. if res != nil && res.StatusCode == http.StatusNotModified {
  5309. if res.Body != nil {
  5310. res.Body.Close()
  5311. }
  5312. return nil, &googleapi.Error{
  5313. Code: res.StatusCode,
  5314. Header: res.Header,
  5315. }
  5316. }
  5317. if err != nil {
  5318. return nil, err
  5319. }
  5320. defer googleapi.CloseBody(res)
  5321. if err := googleapi.CheckResponse(res); err != nil {
  5322. return nil, err
  5323. }
  5324. ret := &LeaderboardListResponse{
  5325. ServerResponse: googleapi.ServerResponse{
  5326. Header: res.Header,
  5327. HTTPStatusCode: res.StatusCode,
  5328. },
  5329. }
  5330. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5331. return nil, err
  5332. }
  5333. return ret, nil
  5334. // {
  5335. // "description": "Lists all the leaderboard metadata for your application.",
  5336. // "httpMethod": "GET",
  5337. // "id": "games.leaderboards.list",
  5338. // "parameters": {
  5339. // "language": {
  5340. // "description": "The preferred language to use for strings returned by this method.",
  5341. // "location": "query",
  5342. // "type": "string"
  5343. // },
  5344. // "maxResults": {
  5345. // "description": "The maximum number of leaderboards to return in the response. For any response, the actual number of leaderboards returned may be less than the specified maxResults.",
  5346. // "format": "int32",
  5347. // "location": "query",
  5348. // "maximum": "200",
  5349. // "minimum": "1",
  5350. // "type": "integer"
  5351. // },
  5352. // "pageToken": {
  5353. // "description": "The token returned by the previous request.",
  5354. // "location": "query",
  5355. // "type": "string"
  5356. // }
  5357. // },
  5358. // "path": "leaderboards",
  5359. // "response": {
  5360. // "$ref": "LeaderboardListResponse"
  5361. // },
  5362. // "scopes": [
  5363. // "https://www.googleapis.com/auth/games",
  5364. // "https://www.googleapis.com/auth/plus.login"
  5365. // ]
  5366. // }
  5367. }
  5368. // Pages invokes f for each page of results.
  5369. // A non-nil error returned from f will halt the iteration.
  5370. // The provided context supersedes any context provided to the Context method.
  5371. func (c *LeaderboardsListCall) Pages(ctx context.Context, f func(*LeaderboardListResponse) error) error {
  5372. c.ctx_ = ctx
  5373. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5374. for {
  5375. x, err := c.Do()
  5376. if err != nil {
  5377. return err
  5378. }
  5379. if err := f(x); err != nil {
  5380. return err
  5381. }
  5382. if x.NextPageToken == "" {
  5383. return nil
  5384. }
  5385. c.PageToken(x.NextPageToken)
  5386. }
  5387. }
  5388. // method id "games.metagame.getMetagameConfig":
  5389. type MetagameGetMetagameConfigCall struct {
  5390. s *Service
  5391. urlParams_ gensupport.URLParams
  5392. ifNoneMatch_ string
  5393. ctx_ context.Context
  5394. }
  5395. // GetMetagameConfig: Return the metagame configuration data for the
  5396. // calling application.
  5397. func (r *MetagameService) GetMetagameConfig() *MetagameGetMetagameConfigCall {
  5398. c := &MetagameGetMetagameConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5399. return c
  5400. }
  5401. // Fields allows partial responses to be retrieved. See
  5402. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5403. // for more information.
  5404. func (c *MetagameGetMetagameConfigCall) Fields(s ...googleapi.Field) *MetagameGetMetagameConfigCall {
  5405. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5406. return c
  5407. }
  5408. // IfNoneMatch sets the optional parameter which makes the operation
  5409. // fail if the object's ETag matches the given value. This is useful for
  5410. // getting updates only after the object has changed since the last
  5411. // request. Use googleapi.IsNotModified to check whether the response
  5412. // error from Do is the result of In-None-Match.
  5413. func (c *MetagameGetMetagameConfigCall) IfNoneMatch(entityTag string) *MetagameGetMetagameConfigCall {
  5414. c.ifNoneMatch_ = entityTag
  5415. return c
  5416. }
  5417. // Context sets the context to be used in this call's Do method. Any
  5418. // pending HTTP request will be aborted if the provided context is
  5419. // canceled.
  5420. func (c *MetagameGetMetagameConfigCall) Context(ctx context.Context) *MetagameGetMetagameConfigCall {
  5421. c.ctx_ = ctx
  5422. return c
  5423. }
  5424. func (c *MetagameGetMetagameConfigCall) doRequest(alt string) (*http.Response, error) {
  5425. var body io.Reader = nil
  5426. c.urlParams_.Set("alt", alt)
  5427. urls := googleapi.ResolveRelative(c.s.BasePath, "metagameConfig")
  5428. urls += "?" + c.urlParams_.Encode()
  5429. req, _ := http.NewRequest("GET", urls, body)
  5430. googleapi.SetOpaque(req.URL)
  5431. req.Header.Set("User-Agent", c.s.userAgent())
  5432. if c.ifNoneMatch_ != "" {
  5433. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5434. }
  5435. if c.ctx_ != nil {
  5436. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5437. }
  5438. return c.s.client.Do(req)
  5439. }
  5440. // Do executes the "games.metagame.getMetagameConfig" call.
  5441. // Exactly one of *MetagameConfig or error will be non-nil. Any non-2xx
  5442. // status code is an error. Response headers are in either
  5443. // *MetagameConfig.ServerResponse.Header or (if a response was returned
  5444. // at all) in error.(*googleapi.Error).Header. Use
  5445. // googleapi.IsNotModified to check whether the returned error was
  5446. // because http.StatusNotModified was returned.
  5447. func (c *MetagameGetMetagameConfigCall) Do(opts ...googleapi.CallOption) (*MetagameConfig, error) {
  5448. gensupport.SetOptions(c.urlParams_, opts...)
  5449. res, err := c.doRequest("json")
  5450. if res != nil && res.StatusCode == http.StatusNotModified {
  5451. if res.Body != nil {
  5452. res.Body.Close()
  5453. }
  5454. return nil, &googleapi.Error{
  5455. Code: res.StatusCode,
  5456. Header: res.Header,
  5457. }
  5458. }
  5459. if err != nil {
  5460. return nil, err
  5461. }
  5462. defer googleapi.CloseBody(res)
  5463. if err := googleapi.CheckResponse(res); err != nil {
  5464. return nil, err
  5465. }
  5466. ret := &MetagameConfig{
  5467. ServerResponse: googleapi.ServerResponse{
  5468. Header: res.Header,
  5469. HTTPStatusCode: res.StatusCode,
  5470. },
  5471. }
  5472. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5473. return nil, err
  5474. }
  5475. return ret, nil
  5476. // {
  5477. // "description": "Return the metagame configuration data for the calling application.",
  5478. // "httpMethod": "GET",
  5479. // "id": "games.metagame.getMetagameConfig",
  5480. // "path": "metagameConfig",
  5481. // "response": {
  5482. // "$ref": "MetagameConfig"
  5483. // },
  5484. // "scopes": [
  5485. // "https://www.googleapis.com/auth/games",
  5486. // "https://www.googleapis.com/auth/plus.login"
  5487. // ]
  5488. // }
  5489. }
  5490. // method id "games.metagame.listCategoriesByPlayer":
  5491. type MetagameListCategoriesByPlayerCall struct {
  5492. s *Service
  5493. playerId string
  5494. collection string
  5495. urlParams_ gensupport.URLParams
  5496. ifNoneMatch_ string
  5497. ctx_ context.Context
  5498. }
  5499. // ListCategoriesByPlayer: List play data aggregated per category for
  5500. // the player corresponding to playerId.
  5501. func (r *MetagameService) ListCategoriesByPlayer(playerId string, collection string) *MetagameListCategoriesByPlayerCall {
  5502. c := &MetagameListCategoriesByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5503. c.playerId = playerId
  5504. c.collection = collection
  5505. return c
  5506. }
  5507. // Language sets the optional parameter "language": The preferred
  5508. // language to use for strings returned by this method.
  5509. func (c *MetagameListCategoriesByPlayerCall) Language(language string) *MetagameListCategoriesByPlayerCall {
  5510. c.urlParams_.Set("language", language)
  5511. return c
  5512. }
  5513. // MaxResults sets the optional parameter "maxResults": The maximum
  5514. // number of category resources to return in the response, used for
  5515. // paging. For any response, the actual number of category resources
  5516. // returned may be less than the specified maxResults.
  5517. func (c *MetagameListCategoriesByPlayerCall) MaxResults(maxResults int64) *MetagameListCategoriesByPlayerCall {
  5518. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5519. return c
  5520. }
  5521. // PageToken sets the optional parameter "pageToken": The token returned
  5522. // by the previous request.
  5523. func (c *MetagameListCategoriesByPlayerCall) PageToken(pageToken string) *MetagameListCategoriesByPlayerCall {
  5524. c.urlParams_.Set("pageToken", pageToken)
  5525. return c
  5526. }
  5527. // Fields allows partial responses to be retrieved. See
  5528. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5529. // for more information.
  5530. func (c *MetagameListCategoriesByPlayerCall) Fields(s ...googleapi.Field) *MetagameListCategoriesByPlayerCall {
  5531. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5532. return c
  5533. }
  5534. // IfNoneMatch sets the optional parameter which makes the operation
  5535. // fail if the object's ETag matches the given value. This is useful for
  5536. // getting updates only after the object has changed since the last
  5537. // request. Use googleapi.IsNotModified to check whether the response
  5538. // error from Do is the result of In-None-Match.
  5539. func (c *MetagameListCategoriesByPlayerCall) IfNoneMatch(entityTag string) *MetagameListCategoriesByPlayerCall {
  5540. c.ifNoneMatch_ = entityTag
  5541. return c
  5542. }
  5543. // Context sets the context to be used in this call's Do method. Any
  5544. // pending HTTP request will be aborted if the provided context is
  5545. // canceled.
  5546. func (c *MetagameListCategoriesByPlayerCall) Context(ctx context.Context) *MetagameListCategoriesByPlayerCall {
  5547. c.ctx_ = ctx
  5548. return c
  5549. }
  5550. func (c *MetagameListCategoriesByPlayerCall) doRequest(alt string) (*http.Response, error) {
  5551. var body io.Reader = nil
  5552. c.urlParams_.Set("alt", alt)
  5553. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/categories/{collection}")
  5554. urls += "?" + c.urlParams_.Encode()
  5555. req, _ := http.NewRequest("GET", urls, body)
  5556. googleapi.Expand(req.URL, map[string]string{
  5557. "playerId": c.playerId,
  5558. "collection": c.collection,
  5559. })
  5560. req.Header.Set("User-Agent", c.s.userAgent())
  5561. if c.ifNoneMatch_ != "" {
  5562. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5563. }
  5564. if c.ctx_ != nil {
  5565. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5566. }
  5567. return c.s.client.Do(req)
  5568. }
  5569. // Do executes the "games.metagame.listCategoriesByPlayer" call.
  5570. // Exactly one of *CategoryListResponse or error will be non-nil. Any
  5571. // non-2xx status code is an error. Response headers are in either
  5572. // *CategoryListResponse.ServerResponse.Header or (if a response was
  5573. // returned at all) in error.(*googleapi.Error).Header. Use
  5574. // googleapi.IsNotModified to check whether the returned error was
  5575. // because http.StatusNotModified was returned.
  5576. func (c *MetagameListCategoriesByPlayerCall) Do(opts ...googleapi.CallOption) (*CategoryListResponse, error) {
  5577. gensupport.SetOptions(c.urlParams_, opts...)
  5578. res, err := c.doRequest("json")
  5579. if res != nil && res.StatusCode == http.StatusNotModified {
  5580. if res.Body != nil {
  5581. res.Body.Close()
  5582. }
  5583. return nil, &googleapi.Error{
  5584. Code: res.StatusCode,
  5585. Header: res.Header,
  5586. }
  5587. }
  5588. if err != nil {
  5589. return nil, err
  5590. }
  5591. defer googleapi.CloseBody(res)
  5592. if err := googleapi.CheckResponse(res); err != nil {
  5593. return nil, err
  5594. }
  5595. ret := &CategoryListResponse{
  5596. ServerResponse: googleapi.ServerResponse{
  5597. Header: res.Header,
  5598. HTTPStatusCode: res.StatusCode,
  5599. },
  5600. }
  5601. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5602. return nil, err
  5603. }
  5604. return ret, nil
  5605. // {
  5606. // "description": "List play data aggregated per category for the player corresponding to playerId.",
  5607. // "httpMethod": "GET",
  5608. // "id": "games.metagame.listCategoriesByPlayer",
  5609. // "parameterOrder": [
  5610. // "playerId",
  5611. // "collection"
  5612. // ],
  5613. // "parameters": {
  5614. // "collection": {
  5615. // "description": "The collection of categories for which data will be returned.",
  5616. // "enum": [
  5617. // "all"
  5618. // ],
  5619. // "enumDescriptions": [
  5620. // "Retrieve data for all categories. This is the default."
  5621. // ],
  5622. // "location": "path",
  5623. // "required": true,
  5624. // "type": "string"
  5625. // },
  5626. // "language": {
  5627. // "description": "The preferred language to use for strings returned by this method.",
  5628. // "location": "query",
  5629. // "type": "string"
  5630. // },
  5631. // "maxResults": {
  5632. // "description": "The maximum number of category resources to return in the response, used for paging. For any response, the actual number of category resources returned may be less than the specified maxResults.",
  5633. // "format": "int32",
  5634. // "location": "query",
  5635. // "maximum": "100",
  5636. // "minimum": "1",
  5637. // "type": "integer"
  5638. // },
  5639. // "pageToken": {
  5640. // "description": "The token returned by the previous request.",
  5641. // "location": "query",
  5642. // "type": "string"
  5643. // },
  5644. // "playerId": {
  5645. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  5646. // "location": "path",
  5647. // "required": true,
  5648. // "type": "string"
  5649. // }
  5650. // },
  5651. // "path": "players/{playerId}/categories/{collection}",
  5652. // "response": {
  5653. // "$ref": "CategoryListResponse"
  5654. // },
  5655. // "scopes": [
  5656. // "https://www.googleapis.com/auth/games",
  5657. // "https://www.googleapis.com/auth/plus.login"
  5658. // ]
  5659. // }
  5660. }
  5661. // Pages invokes f for each page of results.
  5662. // A non-nil error returned from f will halt the iteration.
  5663. // The provided context supersedes any context provided to the Context method.
  5664. func (c *MetagameListCategoriesByPlayerCall) Pages(ctx context.Context, f func(*CategoryListResponse) error) error {
  5665. c.ctx_ = ctx
  5666. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5667. for {
  5668. x, err := c.Do()
  5669. if err != nil {
  5670. return err
  5671. }
  5672. if err := f(x); err != nil {
  5673. return err
  5674. }
  5675. if x.NextPageToken == "" {
  5676. return nil
  5677. }
  5678. c.PageToken(x.NextPageToken)
  5679. }
  5680. }
  5681. // method id "games.players.get":
  5682. type PlayersGetCall struct {
  5683. s *Service
  5684. playerId string
  5685. urlParams_ gensupport.URLParams
  5686. ifNoneMatch_ string
  5687. ctx_ context.Context
  5688. }
  5689. // Get: Retrieves the Player resource with the given ID. To retrieve the
  5690. // player for the currently authenticated user, set playerId to me.
  5691. func (r *PlayersService) Get(playerId string) *PlayersGetCall {
  5692. c := &PlayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5693. c.playerId = playerId
  5694. return c
  5695. }
  5696. // Language sets the optional parameter "language": The preferred
  5697. // language to use for strings returned by this method.
  5698. func (c *PlayersGetCall) Language(language string) *PlayersGetCall {
  5699. c.urlParams_.Set("language", language)
  5700. return c
  5701. }
  5702. // Fields allows partial responses to be retrieved. See
  5703. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5704. // for more information.
  5705. func (c *PlayersGetCall) Fields(s ...googleapi.Field) *PlayersGetCall {
  5706. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5707. return c
  5708. }
  5709. // IfNoneMatch sets the optional parameter which makes the operation
  5710. // fail if the object's ETag matches the given value. This is useful for
  5711. // getting updates only after the object has changed since the last
  5712. // request. Use googleapi.IsNotModified to check whether the response
  5713. // error from Do is the result of In-None-Match.
  5714. func (c *PlayersGetCall) IfNoneMatch(entityTag string) *PlayersGetCall {
  5715. c.ifNoneMatch_ = entityTag
  5716. return c
  5717. }
  5718. // Context sets the context to be used in this call's Do method. Any
  5719. // pending HTTP request will be aborted if the provided context is
  5720. // canceled.
  5721. func (c *PlayersGetCall) Context(ctx context.Context) *PlayersGetCall {
  5722. c.ctx_ = ctx
  5723. return c
  5724. }
  5725. func (c *PlayersGetCall) doRequest(alt string) (*http.Response, error) {
  5726. var body io.Reader = nil
  5727. c.urlParams_.Set("alt", alt)
  5728. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}")
  5729. urls += "?" + c.urlParams_.Encode()
  5730. req, _ := http.NewRequest("GET", urls, body)
  5731. googleapi.Expand(req.URL, map[string]string{
  5732. "playerId": c.playerId,
  5733. })
  5734. req.Header.Set("User-Agent", c.s.userAgent())
  5735. if c.ifNoneMatch_ != "" {
  5736. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5737. }
  5738. if c.ctx_ != nil {
  5739. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5740. }
  5741. return c.s.client.Do(req)
  5742. }
  5743. // Do executes the "games.players.get" call.
  5744. // Exactly one of *Player or error will be non-nil. Any non-2xx status
  5745. // code is an error. Response headers are in either
  5746. // *Player.ServerResponse.Header or (if a response was returned at all)
  5747. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5748. // check whether the returned error was because http.StatusNotModified
  5749. // was returned.
  5750. func (c *PlayersGetCall) Do(opts ...googleapi.CallOption) (*Player, error) {
  5751. gensupport.SetOptions(c.urlParams_, opts...)
  5752. res, err := c.doRequest("json")
  5753. if res != nil && res.StatusCode == http.StatusNotModified {
  5754. if res.Body != nil {
  5755. res.Body.Close()
  5756. }
  5757. return nil, &googleapi.Error{
  5758. Code: res.StatusCode,
  5759. Header: res.Header,
  5760. }
  5761. }
  5762. if err != nil {
  5763. return nil, err
  5764. }
  5765. defer googleapi.CloseBody(res)
  5766. if err := googleapi.CheckResponse(res); err != nil {
  5767. return nil, err
  5768. }
  5769. ret := &Player{
  5770. ServerResponse: googleapi.ServerResponse{
  5771. Header: res.Header,
  5772. HTTPStatusCode: res.StatusCode,
  5773. },
  5774. }
  5775. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5776. return nil, err
  5777. }
  5778. return ret, nil
  5779. // {
  5780. // "description": "Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.",
  5781. // "httpMethod": "GET",
  5782. // "id": "games.players.get",
  5783. // "parameterOrder": [
  5784. // "playerId"
  5785. // ],
  5786. // "parameters": {
  5787. // "language": {
  5788. // "description": "The preferred language to use for strings returned by this method.",
  5789. // "location": "query",
  5790. // "type": "string"
  5791. // },
  5792. // "playerId": {
  5793. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  5794. // "location": "path",
  5795. // "required": true,
  5796. // "type": "string"
  5797. // }
  5798. // },
  5799. // "path": "players/{playerId}",
  5800. // "response": {
  5801. // "$ref": "Player"
  5802. // },
  5803. // "scopes": [
  5804. // "https://www.googleapis.com/auth/games",
  5805. // "https://www.googleapis.com/auth/plus.login"
  5806. // ]
  5807. // }
  5808. }
  5809. // method id "games.players.list":
  5810. type PlayersListCall struct {
  5811. s *Service
  5812. collection string
  5813. urlParams_ gensupport.URLParams
  5814. ifNoneMatch_ string
  5815. ctx_ context.Context
  5816. }
  5817. // List: Get the collection of players for the currently authenticated
  5818. // user.
  5819. func (r *PlayersService) List(collection string) *PlayersListCall {
  5820. c := &PlayersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5821. c.collection = collection
  5822. return c
  5823. }
  5824. // Language sets the optional parameter "language": The preferred
  5825. // language to use for strings returned by this method.
  5826. func (c *PlayersListCall) Language(language string) *PlayersListCall {
  5827. c.urlParams_.Set("language", language)
  5828. return c
  5829. }
  5830. // MaxResults sets the optional parameter "maxResults": The maximum
  5831. // number of player resources to return in the response, used for
  5832. // paging. For any response, the actual number of player resources
  5833. // returned may be less than the specified maxResults.
  5834. func (c *PlayersListCall) MaxResults(maxResults int64) *PlayersListCall {
  5835. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5836. return c
  5837. }
  5838. // PageToken sets the optional parameter "pageToken": The token returned
  5839. // by the previous request.
  5840. func (c *PlayersListCall) PageToken(pageToken string) *PlayersListCall {
  5841. c.urlParams_.Set("pageToken", pageToken)
  5842. return c
  5843. }
  5844. // Fields allows partial responses to be retrieved. See
  5845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5846. // for more information.
  5847. func (c *PlayersListCall) Fields(s ...googleapi.Field) *PlayersListCall {
  5848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5849. return c
  5850. }
  5851. // IfNoneMatch sets the optional parameter which makes the operation
  5852. // fail if the object's ETag matches the given value. This is useful for
  5853. // getting updates only after the object has changed since the last
  5854. // request. Use googleapi.IsNotModified to check whether the response
  5855. // error from Do is the result of In-None-Match.
  5856. func (c *PlayersListCall) IfNoneMatch(entityTag string) *PlayersListCall {
  5857. c.ifNoneMatch_ = entityTag
  5858. return c
  5859. }
  5860. // Context sets the context to be used in this call's Do method. Any
  5861. // pending HTTP request will be aborted if the provided context is
  5862. // canceled.
  5863. func (c *PlayersListCall) Context(ctx context.Context) *PlayersListCall {
  5864. c.ctx_ = ctx
  5865. return c
  5866. }
  5867. func (c *PlayersListCall) doRequest(alt string) (*http.Response, error) {
  5868. var body io.Reader = nil
  5869. c.urlParams_.Set("alt", alt)
  5870. urls := googleapi.ResolveRelative(c.s.BasePath, "players/me/players/{collection}")
  5871. urls += "?" + c.urlParams_.Encode()
  5872. req, _ := http.NewRequest("GET", urls, body)
  5873. googleapi.Expand(req.URL, map[string]string{
  5874. "collection": c.collection,
  5875. })
  5876. req.Header.Set("User-Agent", c.s.userAgent())
  5877. if c.ifNoneMatch_ != "" {
  5878. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5879. }
  5880. if c.ctx_ != nil {
  5881. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5882. }
  5883. return c.s.client.Do(req)
  5884. }
  5885. // Do executes the "games.players.list" call.
  5886. // Exactly one of *PlayerListResponse or error will be non-nil. Any
  5887. // non-2xx status code is an error. Response headers are in either
  5888. // *PlayerListResponse.ServerResponse.Header or (if a response was
  5889. // returned at all) in error.(*googleapi.Error).Header. Use
  5890. // googleapi.IsNotModified to check whether the returned error was
  5891. // because http.StatusNotModified was returned.
  5892. func (c *PlayersListCall) Do(opts ...googleapi.CallOption) (*PlayerListResponse, error) {
  5893. gensupport.SetOptions(c.urlParams_, opts...)
  5894. res, err := c.doRequest("json")
  5895. if res != nil && res.StatusCode == http.StatusNotModified {
  5896. if res.Body != nil {
  5897. res.Body.Close()
  5898. }
  5899. return nil, &googleapi.Error{
  5900. Code: res.StatusCode,
  5901. Header: res.Header,
  5902. }
  5903. }
  5904. if err != nil {
  5905. return nil, err
  5906. }
  5907. defer googleapi.CloseBody(res)
  5908. if err := googleapi.CheckResponse(res); err != nil {
  5909. return nil, err
  5910. }
  5911. ret := &PlayerListResponse{
  5912. ServerResponse: googleapi.ServerResponse{
  5913. Header: res.Header,
  5914. HTTPStatusCode: res.StatusCode,
  5915. },
  5916. }
  5917. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5918. return nil, err
  5919. }
  5920. return ret, nil
  5921. // {
  5922. // "description": "Get the collection of players for the currently authenticated user.",
  5923. // "httpMethod": "GET",
  5924. // "id": "games.players.list",
  5925. // "parameterOrder": [
  5926. // "collection"
  5927. // ],
  5928. // "parameters": {
  5929. // "collection": {
  5930. // "description": "Collection of players being retrieved",
  5931. // "enum": [
  5932. // "connected",
  5933. // "playedWith",
  5934. // "played_with",
  5935. // "visible"
  5936. // ],
  5937. // "enumDescriptions": [
  5938. // "Retrieve a list of players that are also playing this game in reverse chronological order.",
  5939. // "(DEPRECATED: please use played_with!) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.",
  5940. // "Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.",
  5941. // "Retrieve a list of players in the user's social graph that are visible to this game."
  5942. // ],
  5943. // "location": "path",
  5944. // "required": true,
  5945. // "type": "string"
  5946. // },
  5947. // "language": {
  5948. // "description": "The preferred language to use for strings returned by this method.",
  5949. // "location": "query",
  5950. // "type": "string"
  5951. // },
  5952. // "maxResults": {
  5953. // "description": "The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults.",
  5954. // "format": "int32",
  5955. // "location": "query",
  5956. // "maximum": "50",
  5957. // "minimum": "1",
  5958. // "type": "integer"
  5959. // },
  5960. // "pageToken": {
  5961. // "description": "The token returned by the previous request.",
  5962. // "location": "query",
  5963. // "type": "string"
  5964. // }
  5965. // },
  5966. // "path": "players/me/players/{collection}",
  5967. // "response": {
  5968. // "$ref": "PlayerListResponse"
  5969. // },
  5970. // "scopes": [
  5971. // "https://www.googleapis.com/auth/games",
  5972. // "https://www.googleapis.com/auth/plus.login"
  5973. // ]
  5974. // }
  5975. }
  5976. // Pages invokes f for each page of results.
  5977. // A non-nil error returned from f will halt the iteration.
  5978. // The provided context supersedes any context provided to the Context method.
  5979. func (c *PlayersListCall) Pages(ctx context.Context, f func(*PlayerListResponse) error) error {
  5980. c.ctx_ = ctx
  5981. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5982. for {
  5983. x, err := c.Do()
  5984. if err != nil {
  5985. return err
  5986. }
  5987. if err := f(x); err != nil {
  5988. return err
  5989. }
  5990. if x.NextPageToken == "" {
  5991. return nil
  5992. }
  5993. c.PageToken(x.NextPageToken)
  5994. }
  5995. }
  5996. // method id "games.pushtokens.remove":
  5997. type PushtokensRemoveCall struct {
  5998. s *Service
  5999. pushtokenid *PushTokenId
  6000. urlParams_ gensupport.URLParams
  6001. ctx_ context.Context
  6002. }
  6003. // Remove: Removes a push token for the current user and application.
  6004. // Removing a non-existent push token will report success.
  6005. func (r *PushtokensService) Remove(pushtokenid *PushTokenId) *PushtokensRemoveCall {
  6006. c := &PushtokensRemoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6007. c.pushtokenid = pushtokenid
  6008. return c
  6009. }
  6010. // Fields allows partial responses to be retrieved. See
  6011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6012. // for more information.
  6013. func (c *PushtokensRemoveCall) Fields(s ...googleapi.Field) *PushtokensRemoveCall {
  6014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6015. return c
  6016. }
  6017. // Context sets the context to be used in this call's Do method. Any
  6018. // pending HTTP request will be aborted if the provided context is
  6019. // canceled.
  6020. func (c *PushtokensRemoveCall) Context(ctx context.Context) *PushtokensRemoveCall {
  6021. c.ctx_ = ctx
  6022. return c
  6023. }
  6024. func (c *PushtokensRemoveCall) doRequest(alt string) (*http.Response, error) {
  6025. var body io.Reader = nil
  6026. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtokenid)
  6027. if err != nil {
  6028. return nil, err
  6029. }
  6030. ctype := "application/json"
  6031. c.urlParams_.Set("alt", alt)
  6032. urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens/remove")
  6033. urls += "?" + c.urlParams_.Encode()
  6034. req, _ := http.NewRequest("POST", urls, body)
  6035. googleapi.SetOpaque(req.URL)
  6036. req.Header.Set("Content-Type", ctype)
  6037. req.Header.Set("User-Agent", c.s.userAgent())
  6038. if c.ctx_ != nil {
  6039. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6040. }
  6041. return c.s.client.Do(req)
  6042. }
  6043. // Do executes the "games.pushtokens.remove" call.
  6044. func (c *PushtokensRemoveCall) Do(opts ...googleapi.CallOption) error {
  6045. gensupport.SetOptions(c.urlParams_, opts...)
  6046. res, err := c.doRequest("json")
  6047. if err != nil {
  6048. return err
  6049. }
  6050. defer googleapi.CloseBody(res)
  6051. if err := googleapi.CheckResponse(res); err != nil {
  6052. return err
  6053. }
  6054. return nil
  6055. // {
  6056. // "description": "Removes a push token for the current user and application. Removing a non-existent push token will report success.",
  6057. // "httpMethod": "POST",
  6058. // "id": "games.pushtokens.remove",
  6059. // "path": "pushtokens/remove",
  6060. // "request": {
  6061. // "$ref": "PushTokenId"
  6062. // },
  6063. // "scopes": [
  6064. // "https://www.googleapis.com/auth/games",
  6065. // "https://www.googleapis.com/auth/plus.login"
  6066. // ]
  6067. // }
  6068. }
  6069. // method id "games.pushtokens.update":
  6070. type PushtokensUpdateCall struct {
  6071. s *Service
  6072. pushtoken *PushToken
  6073. urlParams_ gensupport.URLParams
  6074. ctx_ context.Context
  6075. }
  6076. // Update: Registers a push token for the current user and application.
  6077. func (r *PushtokensService) Update(pushtoken *PushToken) *PushtokensUpdateCall {
  6078. c := &PushtokensUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6079. c.pushtoken = pushtoken
  6080. return c
  6081. }
  6082. // Fields allows partial responses to be retrieved. See
  6083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6084. // for more information.
  6085. func (c *PushtokensUpdateCall) Fields(s ...googleapi.Field) *PushtokensUpdateCall {
  6086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6087. return c
  6088. }
  6089. // Context sets the context to be used in this call's Do method. Any
  6090. // pending HTTP request will be aborted if the provided context is
  6091. // canceled.
  6092. func (c *PushtokensUpdateCall) Context(ctx context.Context) *PushtokensUpdateCall {
  6093. c.ctx_ = ctx
  6094. return c
  6095. }
  6096. func (c *PushtokensUpdateCall) doRequest(alt string) (*http.Response, error) {
  6097. var body io.Reader = nil
  6098. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtoken)
  6099. if err != nil {
  6100. return nil, err
  6101. }
  6102. ctype := "application/json"
  6103. c.urlParams_.Set("alt", alt)
  6104. urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens")
  6105. urls += "?" + c.urlParams_.Encode()
  6106. req, _ := http.NewRequest("PUT", urls, body)
  6107. googleapi.SetOpaque(req.URL)
  6108. req.Header.Set("Content-Type", ctype)
  6109. req.Header.Set("User-Agent", c.s.userAgent())
  6110. if c.ctx_ != nil {
  6111. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6112. }
  6113. return c.s.client.Do(req)
  6114. }
  6115. // Do executes the "games.pushtokens.update" call.
  6116. func (c *PushtokensUpdateCall) Do(opts ...googleapi.CallOption) error {
  6117. gensupport.SetOptions(c.urlParams_, opts...)
  6118. res, err := c.doRequest("json")
  6119. if err != nil {
  6120. return err
  6121. }
  6122. defer googleapi.CloseBody(res)
  6123. if err := googleapi.CheckResponse(res); err != nil {
  6124. return err
  6125. }
  6126. return nil
  6127. // {
  6128. // "description": "Registers a push token for the current user and application.",
  6129. // "httpMethod": "PUT",
  6130. // "id": "games.pushtokens.update",
  6131. // "path": "pushtokens",
  6132. // "request": {
  6133. // "$ref": "PushToken"
  6134. // },
  6135. // "scopes": [
  6136. // "https://www.googleapis.com/auth/games",
  6137. // "https://www.googleapis.com/auth/plus.login"
  6138. // ]
  6139. // }
  6140. }
  6141. // method id "games.questMilestones.claim":
  6142. type QuestMilestonesClaimCall struct {
  6143. s *Service
  6144. questId string
  6145. milestoneId string
  6146. urlParams_ gensupport.URLParams
  6147. ctx_ context.Context
  6148. }
  6149. // Claim: Report that a reward for the milestone corresponding to
  6150. // milestoneId for the quest corresponding to questId has been claimed
  6151. // by the currently authorized user.
  6152. func (r *QuestMilestonesService) Claim(questId string, milestoneId string, requestId int64) *QuestMilestonesClaimCall {
  6153. c := &QuestMilestonesClaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6154. c.questId = questId
  6155. c.milestoneId = milestoneId
  6156. c.urlParams_.Set("requestId", fmt.Sprint(requestId))
  6157. return c
  6158. }
  6159. // Fields allows partial responses to be retrieved. See
  6160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6161. // for more information.
  6162. func (c *QuestMilestonesClaimCall) Fields(s ...googleapi.Field) *QuestMilestonesClaimCall {
  6163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6164. return c
  6165. }
  6166. // Context sets the context to be used in this call's Do method. Any
  6167. // pending HTTP request will be aborted if the provided context is
  6168. // canceled.
  6169. func (c *QuestMilestonesClaimCall) Context(ctx context.Context) *QuestMilestonesClaimCall {
  6170. c.ctx_ = ctx
  6171. return c
  6172. }
  6173. func (c *QuestMilestonesClaimCall) doRequest(alt string) (*http.Response, error) {
  6174. var body io.Reader = nil
  6175. c.urlParams_.Set("alt", alt)
  6176. urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/milestones/{milestoneId}/claim")
  6177. urls += "?" + c.urlParams_.Encode()
  6178. req, _ := http.NewRequest("PUT", urls, body)
  6179. googleapi.Expand(req.URL, map[string]string{
  6180. "questId": c.questId,
  6181. "milestoneId": c.milestoneId,
  6182. })
  6183. req.Header.Set("User-Agent", c.s.userAgent())
  6184. if c.ctx_ != nil {
  6185. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6186. }
  6187. return c.s.client.Do(req)
  6188. }
  6189. // Do executes the "games.questMilestones.claim" call.
  6190. func (c *QuestMilestonesClaimCall) Do(opts ...googleapi.CallOption) error {
  6191. gensupport.SetOptions(c.urlParams_, opts...)
  6192. res, err := c.doRequest("json")
  6193. if err != nil {
  6194. return err
  6195. }
  6196. defer googleapi.CloseBody(res)
  6197. if err := googleapi.CheckResponse(res); err != nil {
  6198. return err
  6199. }
  6200. return nil
  6201. // {
  6202. // "description": "Report that a reward for the milestone corresponding to milestoneId for the quest corresponding to questId has been claimed by the currently authorized user.",
  6203. // "httpMethod": "PUT",
  6204. // "id": "games.questMilestones.claim",
  6205. // "parameterOrder": [
  6206. // "questId",
  6207. // "milestoneId",
  6208. // "requestId"
  6209. // ],
  6210. // "parameters": {
  6211. // "milestoneId": {
  6212. // "description": "The ID of the milestone.",
  6213. // "location": "path",
  6214. // "required": true,
  6215. // "type": "string"
  6216. // },
  6217. // "questId": {
  6218. // "description": "The ID of the quest.",
  6219. // "location": "path",
  6220. // "required": true,
  6221. // "type": "string"
  6222. // },
  6223. // "requestId": {
  6224. // "description": "A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly.",
  6225. // "format": "int64",
  6226. // "location": "query",
  6227. // "required": true,
  6228. // "type": "string"
  6229. // }
  6230. // },
  6231. // "path": "quests/{questId}/milestones/{milestoneId}/claim",
  6232. // "scopes": [
  6233. // "https://www.googleapis.com/auth/games",
  6234. // "https://www.googleapis.com/auth/plus.login"
  6235. // ]
  6236. // }
  6237. }
  6238. // method id "games.quests.accept":
  6239. type QuestsAcceptCall struct {
  6240. s *Service
  6241. questId string
  6242. urlParams_ gensupport.URLParams
  6243. ctx_ context.Context
  6244. }
  6245. // Accept: Indicates that the currently authorized user will participate
  6246. // in the quest.
  6247. func (r *QuestsService) Accept(questId string) *QuestsAcceptCall {
  6248. c := &QuestsAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6249. c.questId = questId
  6250. return c
  6251. }
  6252. // Language sets the optional parameter "language": The preferred
  6253. // language to use for strings returned by this method.
  6254. func (c *QuestsAcceptCall) Language(language string) *QuestsAcceptCall {
  6255. c.urlParams_.Set("language", language)
  6256. return c
  6257. }
  6258. // Fields allows partial responses to be retrieved. See
  6259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6260. // for more information.
  6261. func (c *QuestsAcceptCall) Fields(s ...googleapi.Field) *QuestsAcceptCall {
  6262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6263. return c
  6264. }
  6265. // Context sets the context to be used in this call's Do method. Any
  6266. // pending HTTP request will be aborted if the provided context is
  6267. // canceled.
  6268. func (c *QuestsAcceptCall) Context(ctx context.Context) *QuestsAcceptCall {
  6269. c.ctx_ = ctx
  6270. return c
  6271. }
  6272. func (c *QuestsAcceptCall) doRequest(alt string) (*http.Response, error) {
  6273. var body io.Reader = nil
  6274. c.urlParams_.Set("alt", alt)
  6275. urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/accept")
  6276. urls += "?" + c.urlParams_.Encode()
  6277. req, _ := http.NewRequest("POST", urls, body)
  6278. googleapi.Expand(req.URL, map[string]string{
  6279. "questId": c.questId,
  6280. })
  6281. req.Header.Set("User-Agent", c.s.userAgent())
  6282. if c.ctx_ != nil {
  6283. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6284. }
  6285. return c.s.client.Do(req)
  6286. }
  6287. // Do executes the "games.quests.accept" call.
  6288. // Exactly one of *Quest or error will be non-nil. Any non-2xx status
  6289. // code is an error. Response headers are in either
  6290. // *Quest.ServerResponse.Header or (if a response was returned at all)
  6291. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6292. // check whether the returned error was because http.StatusNotModified
  6293. // was returned.
  6294. func (c *QuestsAcceptCall) Do(opts ...googleapi.CallOption) (*Quest, error) {
  6295. gensupport.SetOptions(c.urlParams_, opts...)
  6296. res, err := c.doRequest("json")
  6297. if res != nil && res.StatusCode == http.StatusNotModified {
  6298. if res.Body != nil {
  6299. res.Body.Close()
  6300. }
  6301. return nil, &googleapi.Error{
  6302. Code: res.StatusCode,
  6303. Header: res.Header,
  6304. }
  6305. }
  6306. if err != nil {
  6307. return nil, err
  6308. }
  6309. defer googleapi.CloseBody(res)
  6310. if err := googleapi.CheckResponse(res); err != nil {
  6311. return nil, err
  6312. }
  6313. ret := &Quest{
  6314. ServerResponse: googleapi.ServerResponse{
  6315. Header: res.Header,
  6316. HTTPStatusCode: res.StatusCode,
  6317. },
  6318. }
  6319. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6320. return nil, err
  6321. }
  6322. return ret, nil
  6323. // {
  6324. // "description": "Indicates that the currently authorized user will participate in the quest.",
  6325. // "httpMethod": "POST",
  6326. // "id": "games.quests.accept",
  6327. // "parameterOrder": [
  6328. // "questId"
  6329. // ],
  6330. // "parameters": {
  6331. // "language": {
  6332. // "description": "The preferred language to use for strings returned by this method.",
  6333. // "location": "query",
  6334. // "type": "string"
  6335. // },
  6336. // "questId": {
  6337. // "description": "The ID of the quest.",
  6338. // "location": "path",
  6339. // "required": true,
  6340. // "type": "string"
  6341. // }
  6342. // },
  6343. // "path": "quests/{questId}/accept",
  6344. // "response": {
  6345. // "$ref": "Quest"
  6346. // },
  6347. // "scopes": [
  6348. // "https://www.googleapis.com/auth/games",
  6349. // "https://www.googleapis.com/auth/plus.login"
  6350. // ]
  6351. // }
  6352. }
  6353. // method id "games.quests.list":
  6354. type QuestsListCall struct {
  6355. s *Service
  6356. playerId string
  6357. urlParams_ gensupport.URLParams
  6358. ifNoneMatch_ string
  6359. ctx_ context.Context
  6360. }
  6361. // List: Get a list of quests for your application and the currently
  6362. // authenticated player.
  6363. func (r *QuestsService) List(playerId string) *QuestsListCall {
  6364. c := &QuestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6365. c.playerId = playerId
  6366. return c
  6367. }
  6368. // Language sets the optional parameter "language": The preferred
  6369. // language to use for strings returned by this method.
  6370. func (c *QuestsListCall) Language(language string) *QuestsListCall {
  6371. c.urlParams_.Set("language", language)
  6372. return c
  6373. }
  6374. // MaxResults sets the optional parameter "maxResults": The maximum
  6375. // number of quest resources to return in the response, used for paging.
  6376. // For any response, the actual number of quest resources returned may
  6377. // be less than the specified maxResults. Acceptable values are 1 to 50,
  6378. // inclusive. (Default: 50).
  6379. func (c *QuestsListCall) MaxResults(maxResults int64) *QuestsListCall {
  6380. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6381. return c
  6382. }
  6383. // PageToken sets the optional parameter "pageToken": The token returned
  6384. // by the previous request.
  6385. func (c *QuestsListCall) PageToken(pageToken string) *QuestsListCall {
  6386. c.urlParams_.Set("pageToken", pageToken)
  6387. return c
  6388. }
  6389. // Fields allows partial responses to be retrieved. See
  6390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6391. // for more information.
  6392. func (c *QuestsListCall) Fields(s ...googleapi.Field) *QuestsListCall {
  6393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6394. return c
  6395. }
  6396. // IfNoneMatch sets the optional parameter which makes the operation
  6397. // fail if the object's ETag matches the given value. This is useful for
  6398. // getting updates only after the object has changed since the last
  6399. // request. Use googleapi.IsNotModified to check whether the response
  6400. // error from Do is the result of In-None-Match.
  6401. func (c *QuestsListCall) IfNoneMatch(entityTag string) *QuestsListCall {
  6402. c.ifNoneMatch_ = entityTag
  6403. return c
  6404. }
  6405. // Context sets the context to be used in this call's Do method. Any
  6406. // pending HTTP request will be aborted if the provided context is
  6407. // canceled.
  6408. func (c *QuestsListCall) Context(ctx context.Context) *QuestsListCall {
  6409. c.ctx_ = ctx
  6410. return c
  6411. }
  6412. func (c *QuestsListCall) doRequest(alt string) (*http.Response, error) {
  6413. var body io.Reader = nil
  6414. c.urlParams_.Set("alt", alt)
  6415. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/quests")
  6416. urls += "?" + c.urlParams_.Encode()
  6417. req, _ := http.NewRequest("GET", urls, body)
  6418. googleapi.Expand(req.URL, map[string]string{
  6419. "playerId": c.playerId,
  6420. })
  6421. req.Header.Set("User-Agent", c.s.userAgent())
  6422. if c.ifNoneMatch_ != "" {
  6423. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6424. }
  6425. if c.ctx_ != nil {
  6426. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6427. }
  6428. return c.s.client.Do(req)
  6429. }
  6430. // Do executes the "games.quests.list" call.
  6431. // Exactly one of *QuestListResponse or error will be non-nil. Any
  6432. // non-2xx status code is an error. Response headers are in either
  6433. // *QuestListResponse.ServerResponse.Header or (if a response was
  6434. // returned at all) in error.(*googleapi.Error).Header. Use
  6435. // googleapi.IsNotModified to check whether the returned error was
  6436. // because http.StatusNotModified was returned.
  6437. func (c *QuestsListCall) Do(opts ...googleapi.CallOption) (*QuestListResponse, error) {
  6438. gensupport.SetOptions(c.urlParams_, opts...)
  6439. res, err := c.doRequest("json")
  6440. if res != nil && res.StatusCode == http.StatusNotModified {
  6441. if res.Body != nil {
  6442. res.Body.Close()
  6443. }
  6444. return nil, &googleapi.Error{
  6445. Code: res.StatusCode,
  6446. Header: res.Header,
  6447. }
  6448. }
  6449. if err != nil {
  6450. return nil, err
  6451. }
  6452. defer googleapi.CloseBody(res)
  6453. if err := googleapi.CheckResponse(res); err != nil {
  6454. return nil, err
  6455. }
  6456. ret := &QuestListResponse{
  6457. ServerResponse: googleapi.ServerResponse{
  6458. Header: res.Header,
  6459. HTTPStatusCode: res.StatusCode,
  6460. },
  6461. }
  6462. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6463. return nil, err
  6464. }
  6465. return ret, nil
  6466. // {
  6467. // "description": "Get a list of quests for your application and the currently authenticated player.",
  6468. // "httpMethod": "GET",
  6469. // "id": "games.quests.list",
  6470. // "parameterOrder": [
  6471. // "playerId"
  6472. // ],
  6473. // "parameters": {
  6474. // "language": {
  6475. // "description": "The preferred language to use for strings returned by this method.",
  6476. // "location": "query",
  6477. // "type": "string"
  6478. // },
  6479. // "maxResults": {
  6480. // "description": "The maximum number of quest resources to return in the response, used for paging. For any response, the actual number of quest resources returned may be less than the specified maxResults. Acceptable values are 1 to 50, inclusive. (Default: 50).",
  6481. // "format": "int32",
  6482. // "location": "query",
  6483. // "maximum": "50",
  6484. // "minimum": "1",
  6485. // "type": "integer"
  6486. // },
  6487. // "pageToken": {
  6488. // "description": "The token returned by the previous request.",
  6489. // "location": "query",
  6490. // "type": "string"
  6491. // },
  6492. // "playerId": {
  6493. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  6494. // "location": "path",
  6495. // "required": true,
  6496. // "type": "string"
  6497. // }
  6498. // },
  6499. // "path": "players/{playerId}/quests",
  6500. // "response": {
  6501. // "$ref": "QuestListResponse"
  6502. // },
  6503. // "scopes": [
  6504. // "https://www.googleapis.com/auth/games",
  6505. // "https://www.googleapis.com/auth/plus.login"
  6506. // ]
  6507. // }
  6508. }
  6509. // Pages invokes f for each page of results.
  6510. // A non-nil error returned from f will halt the iteration.
  6511. // The provided context supersedes any context provided to the Context method.
  6512. func (c *QuestsListCall) Pages(ctx context.Context, f func(*QuestListResponse) error) error {
  6513. c.ctx_ = ctx
  6514. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6515. for {
  6516. x, err := c.Do()
  6517. if err != nil {
  6518. return err
  6519. }
  6520. if err := f(x); err != nil {
  6521. return err
  6522. }
  6523. if x.NextPageToken == "" {
  6524. return nil
  6525. }
  6526. c.PageToken(x.NextPageToken)
  6527. }
  6528. }
  6529. // method id "games.revisions.check":
  6530. type RevisionsCheckCall struct {
  6531. s *Service
  6532. urlParams_ gensupport.URLParams
  6533. ifNoneMatch_ string
  6534. ctx_ context.Context
  6535. }
  6536. // Check: Checks whether the games client is out of date.
  6537. func (r *RevisionsService) Check(clientRevision string) *RevisionsCheckCall {
  6538. c := &RevisionsCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6539. c.urlParams_.Set("clientRevision", clientRevision)
  6540. return c
  6541. }
  6542. // Fields allows partial responses to be retrieved. See
  6543. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6544. // for more information.
  6545. func (c *RevisionsCheckCall) Fields(s ...googleapi.Field) *RevisionsCheckCall {
  6546. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6547. return c
  6548. }
  6549. // IfNoneMatch sets the optional parameter which makes the operation
  6550. // fail if the object's ETag matches the given value. This is useful for
  6551. // getting updates only after the object has changed since the last
  6552. // request. Use googleapi.IsNotModified to check whether the response
  6553. // error from Do is the result of In-None-Match.
  6554. func (c *RevisionsCheckCall) IfNoneMatch(entityTag string) *RevisionsCheckCall {
  6555. c.ifNoneMatch_ = entityTag
  6556. return c
  6557. }
  6558. // Context sets the context to be used in this call's Do method. Any
  6559. // pending HTTP request will be aborted if the provided context is
  6560. // canceled.
  6561. func (c *RevisionsCheckCall) Context(ctx context.Context) *RevisionsCheckCall {
  6562. c.ctx_ = ctx
  6563. return c
  6564. }
  6565. func (c *RevisionsCheckCall) doRequest(alt string) (*http.Response, error) {
  6566. var body io.Reader = nil
  6567. c.urlParams_.Set("alt", alt)
  6568. urls := googleapi.ResolveRelative(c.s.BasePath, "revisions/check")
  6569. urls += "?" + c.urlParams_.Encode()
  6570. req, _ := http.NewRequest("GET", urls, body)
  6571. googleapi.SetOpaque(req.URL)
  6572. req.Header.Set("User-Agent", c.s.userAgent())
  6573. if c.ifNoneMatch_ != "" {
  6574. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6575. }
  6576. if c.ctx_ != nil {
  6577. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6578. }
  6579. return c.s.client.Do(req)
  6580. }
  6581. // Do executes the "games.revisions.check" call.
  6582. // Exactly one of *RevisionCheckResponse or error will be non-nil. Any
  6583. // non-2xx status code is an error. Response headers are in either
  6584. // *RevisionCheckResponse.ServerResponse.Header or (if a response was
  6585. // returned at all) in error.(*googleapi.Error).Header. Use
  6586. // googleapi.IsNotModified to check whether the returned error was
  6587. // because http.StatusNotModified was returned.
  6588. func (c *RevisionsCheckCall) Do(opts ...googleapi.CallOption) (*RevisionCheckResponse, error) {
  6589. gensupport.SetOptions(c.urlParams_, opts...)
  6590. res, err := c.doRequest("json")
  6591. if res != nil && res.StatusCode == http.StatusNotModified {
  6592. if res.Body != nil {
  6593. res.Body.Close()
  6594. }
  6595. return nil, &googleapi.Error{
  6596. Code: res.StatusCode,
  6597. Header: res.Header,
  6598. }
  6599. }
  6600. if err != nil {
  6601. return nil, err
  6602. }
  6603. defer googleapi.CloseBody(res)
  6604. if err := googleapi.CheckResponse(res); err != nil {
  6605. return nil, err
  6606. }
  6607. ret := &RevisionCheckResponse{
  6608. ServerResponse: googleapi.ServerResponse{
  6609. Header: res.Header,
  6610. HTTPStatusCode: res.StatusCode,
  6611. },
  6612. }
  6613. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6614. return nil, err
  6615. }
  6616. return ret, nil
  6617. // {
  6618. // "description": "Checks whether the games client is out of date.",
  6619. // "httpMethod": "GET",
  6620. // "id": "games.revisions.check",
  6621. // "parameterOrder": [
  6622. // "clientRevision"
  6623. // ],
  6624. // "parameters": {
  6625. // "clientRevision": {
  6626. // "description": "The revision of the client SDK used by your application. Format:\n[PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are:\n \n- \"ANDROID\" - Client is running the Android SDK. \n- \"IOS\" - Client is running the iOS SDK. \n- \"WEB_APP\" - Client is running as a Web App.",
  6627. // "location": "query",
  6628. // "required": true,
  6629. // "type": "string"
  6630. // }
  6631. // },
  6632. // "path": "revisions/check",
  6633. // "response": {
  6634. // "$ref": "RevisionCheckResponse"
  6635. // },
  6636. // "scopes": [
  6637. // "https://www.googleapis.com/auth/games",
  6638. // "https://www.googleapis.com/auth/plus.login"
  6639. // ]
  6640. // }
  6641. }
  6642. // method id "games.rooms.create":
  6643. type RoomsCreateCall struct {
  6644. s *Service
  6645. roomcreaterequest *RoomCreateRequest
  6646. urlParams_ gensupport.URLParams
  6647. ctx_ context.Context
  6648. }
  6649. // Create: Create a room. For internal use by the Games SDK only.
  6650. // Calling this method directly is unsupported.
  6651. func (r *RoomsService) Create(roomcreaterequest *RoomCreateRequest) *RoomsCreateCall {
  6652. c := &RoomsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6653. c.roomcreaterequest = roomcreaterequest
  6654. return c
  6655. }
  6656. // Language sets the optional parameter "language": The preferred
  6657. // language to use for strings returned by this method.
  6658. func (c *RoomsCreateCall) Language(language string) *RoomsCreateCall {
  6659. c.urlParams_.Set("language", language)
  6660. return c
  6661. }
  6662. // Fields allows partial responses to be retrieved. See
  6663. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6664. // for more information.
  6665. func (c *RoomsCreateCall) Fields(s ...googleapi.Field) *RoomsCreateCall {
  6666. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6667. return c
  6668. }
  6669. // Context sets the context to be used in this call's Do method. Any
  6670. // pending HTTP request will be aborted if the provided context is
  6671. // canceled.
  6672. func (c *RoomsCreateCall) Context(ctx context.Context) *RoomsCreateCall {
  6673. c.ctx_ = ctx
  6674. return c
  6675. }
  6676. func (c *RoomsCreateCall) doRequest(alt string) (*http.Response, error) {
  6677. var body io.Reader = nil
  6678. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomcreaterequest)
  6679. if err != nil {
  6680. return nil, err
  6681. }
  6682. ctype := "application/json"
  6683. c.urlParams_.Set("alt", alt)
  6684. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/create")
  6685. urls += "?" + c.urlParams_.Encode()
  6686. req, _ := http.NewRequest("POST", urls, body)
  6687. googleapi.SetOpaque(req.URL)
  6688. req.Header.Set("Content-Type", ctype)
  6689. req.Header.Set("User-Agent", c.s.userAgent())
  6690. if c.ctx_ != nil {
  6691. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6692. }
  6693. return c.s.client.Do(req)
  6694. }
  6695. // Do executes the "games.rooms.create" call.
  6696. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  6697. // code is an error. Response headers are in either
  6698. // *Room.ServerResponse.Header or (if a response was returned at all) in
  6699. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6700. // whether the returned error was because http.StatusNotModified was
  6701. // returned.
  6702. func (c *RoomsCreateCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  6703. gensupport.SetOptions(c.urlParams_, opts...)
  6704. res, err := c.doRequest("json")
  6705. if res != nil && res.StatusCode == http.StatusNotModified {
  6706. if res.Body != nil {
  6707. res.Body.Close()
  6708. }
  6709. return nil, &googleapi.Error{
  6710. Code: res.StatusCode,
  6711. Header: res.Header,
  6712. }
  6713. }
  6714. if err != nil {
  6715. return nil, err
  6716. }
  6717. defer googleapi.CloseBody(res)
  6718. if err := googleapi.CheckResponse(res); err != nil {
  6719. return nil, err
  6720. }
  6721. ret := &Room{
  6722. ServerResponse: googleapi.ServerResponse{
  6723. Header: res.Header,
  6724. HTTPStatusCode: res.StatusCode,
  6725. },
  6726. }
  6727. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6728. return nil, err
  6729. }
  6730. return ret, nil
  6731. // {
  6732. // "description": "Create a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  6733. // "httpMethod": "POST",
  6734. // "id": "games.rooms.create",
  6735. // "parameters": {
  6736. // "language": {
  6737. // "description": "The preferred language to use for strings returned by this method.",
  6738. // "location": "query",
  6739. // "type": "string"
  6740. // }
  6741. // },
  6742. // "path": "rooms/create",
  6743. // "request": {
  6744. // "$ref": "RoomCreateRequest"
  6745. // },
  6746. // "response": {
  6747. // "$ref": "Room"
  6748. // },
  6749. // "scopes": [
  6750. // "https://www.googleapis.com/auth/games",
  6751. // "https://www.googleapis.com/auth/plus.login"
  6752. // ]
  6753. // }
  6754. }
  6755. // method id "games.rooms.decline":
  6756. type RoomsDeclineCall struct {
  6757. s *Service
  6758. roomId string
  6759. urlParams_ gensupport.URLParams
  6760. ctx_ context.Context
  6761. }
  6762. // Decline: Decline an invitation to join a room. For internal use by
  6763. // the Games SDK only. Calling this method directly is unsupported.
  6764. func (r *RoomsService) Decline(roomId string) *RoomsDeclineCall {
  6765. c := &RoomsDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6766. c.roomId = roomId
  6767. return c
  6768. }
  6769. // Language sets the optional parameter "language": The preferred
  6770. // language to use for strings returned by this method.
  6771. func (c *RoomsDeclineCall) Language(language string) *RoomsDeclineCall {
  6772. c.urlParams_.Set("language", language)
  6773. return c
  6774. }
  6775. // Fields allows partial responses to be retrieved. See
  6776. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6777. // for more information.
  6778. func (c *RoomsDeclineCall) Fields(s ...googleapi.Field) *RoomsDeclineCall {
  6779. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6780. return c
  6781. }
  6782. // Context sets the context to be used in this call's Do method. Any
  6783. // pending HTTP request will be aborted if the provided context is
  6784. // canceled.
  6785. func (c *RoomsDeclineCall) Context(ctx context.Context) *RoomsDeclineCall {
  6786. c.ctx_ = ctx
  6787. return c
  6788. }
  6789. func (c *RoomsDeclineCall) doRequest(alt string) (*http.Response, error) {
  6790. var body io.Reader = nil
  6791. c.urlParams_.Set("alt", alt)
  6792. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/decline")
  6793. urls += "?" + c.urlParams_.Encode()
  6794. req, _ := http.NewRequest("POST", urls, body)
  6795. googleapi.Expand(req.URL, map[string]string{
  6796. "roomId": c.roomId,
  6797. })
  6798. req.Header.Set("User-Agent", c.s.userAgent())
  6799. if c.ctx_ != nil {
  6800. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6801. }
  6802. return c.s.client.Do(req)
  6803. }
  6804. // Do executes the "games.rooms.decline" call.
  6805. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  6806. // code is an error. Response headers are in either
  6807. // *Room.ServerResponse.Header or (if a response was returned at all) in
  6808. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6809. // whether the returned error was because http.StatusNotModified was
  6810. // returned.
  6811. func (c *RoomsDeclineCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  6812. gensupport.SetOptions(c.urlParams_, opts...)
  6813. res, err := c.doRequest("json")
  6814. if res != nil && res.StatusCode == http.StatusNotModified {
  6815. if res.Body != nil {
  6816. res.Body.Close()
  6817. }
  6818. return nil, &googleapi.Error{
  6819. Code: res.StatusCode,
  6820. Header: res.Header,
  6821. }
  6822. }
  6823. if err != nil {
  6824. return nil, err
  6825. }
  6826. defer googleapi.CloseBody(res)
  6827. if err := googleapi.CheckResponse(res); err != nil {
  6828. return nil, err
  6829. }
  6830. ret := &Room{
  6831. ServerResponse: googleapi.ServerResponse{
  6832. Header: res.Header,
  6833. HTTPStatusCode: res.StatusCode,
  6834. },
  6835. }
  6836. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6837. return nil, err
  6838. }
  6839. return ret, nil
  6840. // {
  6841. // "description": "Decline an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  6842. // "httpMethod": "POST",
  6843. // "id": "games.rooms.decline",
  6844. // "parameterOrder": [
  6845. // "roomId"
  6846. // ],
  6847. // "parameters": {
  6848. // "language": {
  6849. // "description": "The preferred language to use for strings returned by this method.",
  6850. // "location": "query",
  6851. // "type": "string"
  6852. // },
  6853. // "roomId": {
  6854. // "description": "The ID of the room.",
  6855. // "location": "path",
  6856. // "required": true,
  6857. // "type": "string"
  6858. // }
  6859. // },
  6860. // "path": "rooms/{roomId}/decline",
  6861. // "response": {
  6862. // "$ref": "Room"
  6863. // },
  6864. // "scopes": [
  6865. // "https://www.googleapis.com/auth/games",
  6866. // "https://www.googleapis.com/auth/plus.login"
  6867. // ]
  6868. // }
  6869. }
  6870. // method id "games.rooms.dismiss":
  6871. type RoomsDismissCall struct {
  6872. s *Service
  6873. roomId string
  6874. urlParams_ gensupport.URLParams
  6875. ctx_ context.Context
  6876. }
  6877. // Dismiss: Dismiss an invitation to join a room. For internal use by
  6878. // the Games SDK only. Calling this method directly is unsupported.
  6879. func (r *RoomsService) Dismiss(roomId string) *RoomsDismissCall {
  6880. c := &RoomsDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6881. c.roomId = roomId
  6882. return c
  6883. }
  6884. // Fields allows partial responses to be retrieved. See
  6885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6886. // for more information.
  6887. func (c *RoomsDismissCall) Fields(s ...googleapi.Field) *RoomsDismissCall {
  6888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6889. return c
  6890. }
  6891. // Context sets the context to be used in this call's Do method. Any
  6892. // pending HTTP request will be aborted if the provided context is
  6893. // canceled.
  6894. func (c *RoomsDismissCall) Context(ctx context.Context) *RoomsDismissCall {
  6895. c.ctx_ = ctx
  6896. return c
  6897. }
  6898. func (c *RoomsDismissCall) doRequest(alt string) (*http.Response, error) {
  6899. var body io.Reader = nil
  6900. c.urlParams_.Set("alt", alt)
  6901. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/dismiss")
  6902. urls += "?" + c.urlParams_.Encode()
  6903. req, _ := http.NewRequest("POST", urls, body)
  6904. googleapi.Expand(req.URL, map[string]string{
  6905. "roomId": c.roomId,
  6906. })
  6907. req.Header.Set("User-Agent", c.s.userAgent())
  6908. if c.ctx_ != nil {
  6909. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6910. }
  6911. return c.s.client.Do(req)
  6912. }
  6913. // Do executes the "games.rooms.dismiss" call.
  6914. func (c *RoomsDismissCall) Do(opts ...googleapi.CallOption) error {
  6915. gensupport.SetOptions(c.urlParams_, opts...)
  6916. res, err := c.doRequest("json")
  6917. if err != nil {
  6918. return err
  6919. }
  6920. defer googleapi.CloseBody(res)
  6921. if err := googleapi.CheckResponse(res); err != nil {
  6922. return err
  6923. }
  6924. return nil
  6925. // {
  6926. // "description": "Dismiss an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  6927. // "httpMethod": "POST",
  6928. // "id": "games.rooms.dismiss",
  6929. // "parameterOrder": [
  6930. // "roomId"
  6931. // ],
  6932. // "parameters": {
  6933. // "roomId": {
  6934. // "description": "The ID of the room.",
  6935. // "location": "path",
  6936. // "required": true,
  6937. // "type": "string"
  6938. // }
  6939. // },
  6940. // "path": "rooms/{roomId}/dismiss",
  6941. // "scopes": [
  6942. // "https://www.googleapis.com/auth/games",
  6943. // "https://www.googleapis.com/auth/plus.login"
  6944. // ]
  6945. // }
  6946. }
  6947. // method id "games.rooms.get":
  6948. type RoomsGetCall struct {
  6949. s *Service
  6950. roomId string
  6951. urlParams_ gensupport.URLParams
  6952. ifNoneMatch_ string
  6953. ctx_ context.Context
  6954. }
  6955. // Get: Get the data for a room.
  6956. func (r *RoomsService) Get(roomId string) *RoomsGetCall {
  6957. c := &RoomsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6958. c.roomId = roomId
  6959. return c
  6960. }
  6961. // Language sets the optional parameter "language": The preferred
  6962. // language to use for strings returned by this method.
  6963. func (c *RoomsGetCall) Language(language string) *RoomsGetCall {
  6964. c.urlParams_.Set("language", language)
  6965. return c
  6966. }
  6967. // Fields allows partial responses to be retrieved. See
  6968. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6969. // for more information.
  6970. func (c *RoomsGetCall) Fields(s ...googleapi.Field) *RoomsGetCall {
  6971. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6972. return c
  6973. }
  6974. // IfNoneMatch sets the optional parameter which makes the operation
  6975. // fail if the object's ETag matches the given value. This is useful for
  6976. // getting updates only after the object has changed since the last
  6977. // request. Use googleapi.IsNotModified to check whether the response
  6978. // error from Do is the result of In-None-Match.
  6979. func (c *RoomsGetCall) IfNoneMatch(entityTag string) *RoomsGetCall {
  6980. c.ifNoneMatch_ = entityTag
  6981. return c
  6982. }
  6983. // Context sets the context to be used in this call's Do method. Any
  6984. // pending HTTP request will be aborted if the provided context is
  6985. // canceled.
  6986. func (c *RoomsGetCall) Context(ctx context.Context) *RoomsGetCall {
  6987. c.ctx_ = ctx
  6988. return c
  6989. }
  6990. func (c *RoomsGetCall) doRequest(alt string) (*http.Response, error) {
  6991. var body io.Reader = nil
  6992. c.urlParams_.Set("alt", alt)
  6993. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}")
  6994. urls += "?" + c.urlParams_.Encode()
  6995. req, _ := http.NewRequest("GET", urls, body)
  6996. googleapi.Expand(req.URL, map[string]string{
  6997. "roomId": c.roomId,
  6998. })
  6999. req.Header.Set("User-Agent", c.s.userAgent())
  7000. if c.ifNoneMatch_ != "" {
  7001. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7002. }
  7003. if c.ctx_ != nil {
  7004. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7005. }
  7006. return c.s.client.Do(req)
  7007. }
  7008. // Do executes the "games.rooms.get" call.
  7009. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  7010. // code is an error. Response headers are in either
  7011. // *Room.ServerResponse.Header or (if a response was returned at all) in
  7012. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7013. // whether the returned error was because http.StatusNotModified was
  7014. // returned.
  7015. func (c *RoomsGetCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  7016. gensupport.SetOptions(c.urlParams_, opts...)
  7017. res, err := c.doRequest("json")
  7018. if res != nil && res.StatusCode == http.StatusNotModified {
  7019. if res.Body != nil {
  7020. res.Body.Close()
  7021. }
  7022. return nil, &googleapi.Error{
  7023. Code: res.StatusCode,
  7024. Header: res.Header,
  7025. }
  7026. }
  7027. if err != nil {
  7028. return nil, err
  7029. }
  7030. defer googleapi.CloseBody(res)
  7031. if err := googleapi.CheckResponse(res); err != nil {
  7032. return nil, err
  7033. }
  7034. ret := &Room{
  7035. ServerResponse: googleapi.ServerResponse{
  7036. Header: res.Header,
  7037. HTTPStatusCode: res.StatusCode,
  7038. },
  7039. }
  7040. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7041. return nil, err
  7042. }
  7043. return ret, nil
  7044. // {
  7045. // "description": "Get the data for a room.",
  7046. // "httpMethod": "GET",
  7047. // "id": "games.rooms.get",
  7048. // "parameterOrder": [
  7049. // "roomId"
  7050. // ],
  7051. // "parameters": {
  7052. // "language": {
  7053. // "description": "The preferred language to use for strings returned by this method.",
  7054. // "location": "query",
  7055. // "type": "string"
  7056. // },
  7057. // "roomId": {
  7058. // "description": "The ID of the room.",
  7059. // "location": "path",
  7060. // "required": true,
  7061. // "type": "string"
  7062. // }
  7063. // },
  7064. // "path": "rooms/{roomId}",
  7065. // "response": {
  7066. // "$ref": "Room"
  7067. // },
  7068. // "scopes": [
  7069. // "https://www.googleapis.com/auth/games",
  7070. // "https://www.googleapis.com/auth/plus.login"
  7071. // ]
  7072. // }
  7073. }
  7074. // method id "games.rooms.join":
  7075. type RoomsJoinCall struct {
  7076. s *Service
  7077. roomId string
  7078. roomjoinrequest *RoomJoinRequest
  7079. urlParams_ gensupport.URLParams
  7080. ctx_ context.Context
  7081. }
  7082. // Join: Join a room. For internal use by the Games SDK only. Calling
  7083. // this method directly is unsupported.
  7084. func (r *RoomsService) Join(roomId string, roomjoinrequest *RoomJoinRequest) *RoomsJoinCall {
  7085. c := &RoomsJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7086. c.roomId = roomId
  7087. c.roomjoinrequest = roomjoinrequest
  7088. return c
  7089. }
  7090. // Language sets the optional parameter "language": The preferred
  7091. // language to use for strings returned by this method.
  7092. func (c *RoomsJoinCall) Language(language string) *RoomsJoinCall {
  7093. c.urlParams_.Set("language", language)
  7094. return c
  7095. }
  7096. // Fields allows partial responses to be retrieved. See
  7097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7098. // for more information.
  7099. func (c *RoomsJoinCall) Fields(s ...googleapi.Field) *RoomsJoinCall {
  7100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7101. return c
  7102. }
  7103. // Context sets the context to be used in this call's Do method. Any
  7104. // pending HTTP request will be aborted if the provided context is
  7105. // canceled.
  7106. func (c *RoomsJoinCall) Context(ctx context.Context) *RoomsJoinCall {
  7107. c.ctx_ = ctx
  7108. return c
  7109. }
  7110. func (c *RoomsJoinCall) doRequest(alt string) (*http.Response, error) {
  7111. var body io.Reader = nil
  7112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomjoinrequest)
  7113. if err != nil {
  7114. return nil, err
  7115. }
  7116. ctype := "application/json"
  7117. c.urlParams_.Set("alt", alt)
  7118. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/join")
  7119. urls += "?" + c.urlParams_.Encode()
  7120. req, _ := http.NewRequest("POST", urls, body)
  7121. googleapi.Expand(req.URL, map[string]string{
  7122. "roomId": c.roomId,
  7123. })
  7124. req.Header.Set("Content-Type", ctype)
  7125. req.Header.Set("User-Agent", c.s.userAgent())
  7126. if c.ctx_ != nil {
  7127. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7128. }
  7129. return c.s.client.Do(req)
  7130. }
  7131. // Do executes the "games.rooms.join" call.
  7132. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  7133. // code is an error. Response headers are in either
  7134. // *Room.ServerResponse.Header or (if a response was returned at all) in
  7135. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7136. // whether the returned error was because http.StatusNotModified was
  7137. // returned.
  7138. func (c *RoomsJoinCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  7139. gensupport.SetOptions(c.urlParams_, opts...)
  7140. res, err := c.doRequest("json")
  7141. if res != nil && res.StatusCode == http.StatusNotModified {
  7142. if res.Body != nil {
  7143. res.Body.Close()
  7144. }
  7145. return nil, &googleapi.Error{
  7146. Code: res.StatusCode,
  7147. Header: res.Header,
  7148. }
  7149. }
  7150. if err != nil {
  7151. return nil, err
  7152. }
  7153. defer googleapi.CloseBody(res)
  7154. if err := googleapi.CheckResponse(res); err != nil {
  7155. return nil, err
  7156. }
  7157. ret := &Room{
  7158. ServerResponse: googleapi.ServerResponse{
  7159. Header: res.Header,
  7160. HTTPStatusCode: res.StatusCode,
  7161. },
  7162. }
  7163. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7164. return nil, err
  7165. }
  7166. return ret, nil
  7167. // {
  7168. // "description": "Join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  7169. // "httpMethod": "POST",
  7170. // "id": "games.rooms.join",
  7171. // "parameterOrder": [
  7172. // "roomId"
  7173. // ],
  7174. // "parameters": {
  7175. // "language": {
  7176. // "description": "The preferred language to use for strings returned by this method.",
  7177. // "location": "query",
  7178. // "type": "string"
  7179. // },
  7180. // "roomId": {
  7181. // "description": "The ID of the room.",
  7182. // "location": "path",
  7183. // "required": true,
  7184. // "type": "string"
  7185. // }
  7186. // },
  7187. // "path": "rooms/{roomId}/join",
  7188. // "request": {
  7189. // "$ref": "RoomJoinRequest"
  7190. // },
  7191. // "response": {
  7192. // "$ref": "Room"
  7193. // },
  7194. // "scopes": [
  7195. // "https://www.googleapis.com/auth/games",
  7196. // "https://www.googleapis.com/auth/plus.login"
  7197. // ]
  7198. // }
  7199. }
  7200. // method id "games.rooms.leave":
  7201. type RoomsLeaveCall struct {
  7202. s *Service
  7203. roomId string
  7204. roomleaverequest *RoomLeaveRequest
  7205. urlParams_ gensupport.URLParams
  7206. ctx_ context.Context
  7207. }
  7208. // Leave: Leave a room. For internal use by the Games SDK only. Calling
  7209. // this method directly is unsupported.
  7210. func (r *RoomsService) Leave(roomId string, roomleaverequest *RoomLeaveRequest) *RoomsLeaveCall {
  7211. c := &RoomsLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7212. c.roomId = roomId
  7213. c.roomleaverequest = roomleaverequest
  7214. return c
  7215. }
  7216. // Language sets the optional parameter "language": The preferred
  7217. // language to use for strings returned by this method.
  7218. func (c *RoomsLeaveCall) Language(language string) *RoomsLeaveCall {
  7219. c.urlParams_.Set("language", language)
  7220. return c
  7221. }
  7222. // Fields allows partial responses to be retrieved. See
  7223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7224. // for more information.
  7225. func (c *RoomsLeaveCall) Fields(s ...googleapi.Field) *RoomsLeaveCall {
  7226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7227. return c
  7228. }
  7229. // Context sets the context to be used in this call's Do method. Any
  7230. // pending HTTP request will be aborted if the provided context is
  7231. // canceled.
  7232. func (c *RoomsLeaveCall) Context(ctx context.Context) *RoomsLeaveCall {
  7233. c.ctx_ = ctx
  7234. return c
  7235. }
  7236. func (c *RoomsLeaveCall) doRequest(alt string) (*http.Response, error) {
  7237. var body io.Reader = nil
  7238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomleaverequest)
  7239. if err != nil {
  7240. return nil, err
  7241. }
  7242. ctype := "application/json"
  7243. c.urlParams_.Set("alt", alt)
  7244. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/leave")
  7245. urls += "?" + c.urlParams_.Encode()
  7246. req, _ := http.NewRequest("POST", urls, body)
  7247. googleapi.Expand(req.URL, map[string]string{
  7248. "roomId": c.roomId,
  7249. })
  7250. req.Header.Set("Content-Type", ctype)
  7251. req.Header.Set("User-Agent", c.s.userAgent())
  7252. if c.ctx_ != nil {
  7253. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7254. }
  7255. return c.s.client.Do(req)
  7256. }
  7257. // Do executes the "games.rooms.leave" call.
  7258. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  7259. // code is an error. Response headers are in either
  7260. // *Room.ServerResponse.Header or (if a response was returned at all) in
  7261. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7262. // whether the returned error was because http.StatusNotModified was
  7263. // returned.
  7264. func (c *RoomsLeaveCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  7265. gensupport.SetOptions(c.urlParams_, opts...)
  7266. res, err := c.doRequest("json")
  7267. if res != nil && res.StatusCode == http.StatusNotModified {
  7268. if res.Body != nil {
  7269. res.Body.Close()
  7270. }
  7271. return nil, &googleapi.Error{
  7272. Code: res.StatusCode,
  7273. Header: res.Header,
  7274. }
  7275. }
  7276. if err != nil {
  7277. return nil, err
  7278. }
  7279. defer googleapi.CloseBody(res)
  7280. if err := googleapi.CheckResponse(res); err != nil {
  7281. return nil, err
  7282. }
  7283. ret := &Room{
  7284. ServerResponse: googleapi.ServerResponse{
  7285. Header: res.Header,
  7286. HTTPStatusCode: res.StatusCode,
  7287. },
  7288. }
  7289. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7290. return nil, err
  7291. }
  7292. return ret, nil
  7293. // {
  7294. // "description": "Leave a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  7295. // "httpMethod": "POST",
  7296. // "id": "games.rooms.leave",
  7297. // "parameterOrder": [
  7298. // "roomId"
  7299. // ],
  7300. // "parameters": {
  7301. // "language": {
  7302. // "description": "The preferred language to use for strings returned by this method.",
  7303. // "location": "query",
  7304. // "type": "string"
  7305. // },
  7306. // "roomId": {
  7307. // "description": "The ID of the room.",
  7308. // "location": "path",
  7309. // "required": true,
  7310. // "type": "string"
  7311. // }
  7312. // },
  7313. // "path": "rooms/{roomId}/leave",
  7314. // "request": {
  7315. // "$ref": "RoomLeaveRequest"
  7316. // },
  7317. // "response": {
  7318. // "$ref": "Room"
  7319. // },
  7320. // "scopes": [
  7321. // "https://www.googleapis.com/auth/games",
  7322. // "https://www.googleapis.com/auth/plus.login"
  7323. // ]
  7324. // }
  7325. }
  7326. // method id "games.rooms.list":
  7327. type RoomsListCall struct {
  7328. s *Service
  7329. urlParams_ gensupport.URLParams
  7330. ifNoneMatch_ string
  7331. ctx_ context.Context
  7332. }
  7333. // List: Returns invitations to join rooms.
  7334. func (r *RoomsService) List() *RoomsListCall {
  7335. c := &RoomsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7336. return c
  7337. }
  7338. // Language sets the optional parameter "language": The preferred
  7339. // language to use for strings returned by this method.
  7340. func (c *RoomsListCall) Language(language string) *RoomsListCall {
  7341. c.urlParams_.Set("language", language)
  7342. return c
  7343. }
  7344. // MaxResults sets the optional parameter "maxResults": The maximum
  7345. // number of rooms to return in the response, used for paging. For any
  7346. // response, the actual number of rooms to return may be less than the
  7347. // specified maxResults.
  7348. func (c *RoomsListCall) MaxResults(maxResults int64) *RoomsListCall {
  7349. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7350. return c
  7351. }
  7352. // PageToken sets the optional parameter "pageToken": The token returned
  7353. // by the previous request.
  7354. func (c *RoomsListCall) PageToken(pageToken string) *RoomsListCall {
  7355. c.urlParams_.Set("pageToken", pageToken)
  7356. return c
  7357. }
  7358. // Fields allows partial responses to be retrieved. See
  7359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7360. // for more information.
  7361. func (c *RoomsListCall) Fields(s ...googleapi.Field) *RoomsListCall {
  7362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7363. return c
  7364. }
  7365. // IfNoneMatch sets the optional parameter which makes the operation
  7366. // fail if the object's ETag matches the given value. This is useful for
  7367. // getting updates only after the object has changed since the last
  7368. // request. Use googleapi.IsNotModified to check whether the response
  7369. // error from Do is the result of In-None-Match.
  7370. func (c *RoomsListCall) IfNoneMatch(entityTag string) *RoomsListCall {
  7371. c.ifNoneMatch_ = entityTag
  7372. return c
  7373. }
  7374. // Context sets the context to be used in this call's Do method. Any
  7375. // pending HTTP request will be aborted if the provided context is
  7376. // canceled.
  7377. func (c *RoomsListCall) Context(ctx context.Context) *RoomsListCall {
  7378. c.ctx_ = ctx
  7379. return c
  7380. }
  7381. func (c *RoomsListCall) doRequest(alt string) (*http.Response, error) {
  7382. var body io.Reader = nil
  7383. c.urlParams_.Set("alt", alt)
  7384. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms")
  7385. urls += "?" + c.urlParams_.Encode()
  7386. req, _ := http.NewRequest("GET", urls, body)
  7387. googleapi.SetOpaque(req.URL)
  7388. req.Header.Set("User-Agent", c.s.userAgent())
  7389. if c.ifNoneMatch_ != "" {
  7390. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7391. }
  7392. if c.ctx_ != nil {
  7393. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7394. }
  7395. return c.s.client.Do(req)
  7396. }
  7397. // Do executes the "games.rooms.list" call.
  7398. // Exactly one of *RoomList or error will be non-nil. Any non-2xx status
  7399. // code is an error. Response headers are in either
  7400. // *RoomList.ServerResponse.Header or (if a response was returned at
  7401. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7402. // to check whether the returned error was because
  7403. // http.StatusNotModified was returned.
  7404. func (c *RoomsListCall) Do(opts ...googleapi.CallOption) (*RoomList, error) {
  7405. gensupport.SetOptions(c.urlParams_, opts...)
  7406. res, err := c.doRequest("json")
  7407. if res != nil && res.StatusCode == http.StatusNotModified {
  7408. if res.Body != nil {
  7409. res.Body.Close()
  7410. }
  7411. return nil, &googleapi.Error{
  7412. Code: res.StatusCode,
  7413. Header: res.Header,
  7414. }
  7415. }
  7416. if err != nil {
  7417. return nil, err
  7418. }
  7419. defer googleapi.CloseBody(res)
  7420. if err := googleapi.CheckResponse(res); err != nil {
  7421. return nil, err
  7422. }
  7423. ret := &RoomList{
  7424. ServerResponse: googleapi.ServerResponse{
  7425. Header: res.Header,
  7426. HTTPStatusCode: res.StatusCode,
  7427. },
  7428. }
  7429. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7430. return nil, err
  7431. }
  7432. return ret, nil
  7433. // {
  7434. // "description": "Returns invitations to join rooms.",
  7435. // "httpMethod": "GET",
  7436. // "id": "games.rooms.list",
  7437. // "parameters": {
  7438. // "language": {
  7439. // "description": "The preferred language to use for strings returned by this method.",
  7440. // "location": "query",
  7441. // "type": "string"
  7442. // },
  7443. // "maxResults": {
  7444. // "description": "The maximum number of rooms to return in the response, used for paging. For any response, the actual number of rooms to return may be less than the specified maxResults.",
  7445. // "format": "int32",
  7446. // "location": "query",
  7447. // "maximum": "500",
  7448. // "minimum": "1",
  7449. // "type": "integer"
  7450. // },
  7451. // "pageToken": {
  7452. // "description": "The token returned by the previous request.",
  7453. // "location": "query",
  7454. // "type": "string"
  7455. // }
  7456. // },
  7457. // "path": "rooms",
  7458. // "response": {
  7459. // "$ref": "RoomList"
  7460. // },
  7461. // "scopes": [
  7462. // "https://www.googleapis.com/auth/games",
  7463. // "https://www.googleapis.com/auth/plus.login"
  7464. // ]
  7465. // }
  7466. }
  7467. // Pages invokes f for each page of results.
  7468. // A non-nil error returned from f will halt the iteration.
  7469. // The provided context supersedes any context provided to the Context method.
  7470. func (c *RoomsListCall) Pages(ctx context.Context, f func(*RoomList) error) error {
  7471. c.ctx_ = ctx
  7472. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7473. for {
  7474. x, err := c.Do()
  7475. if err != nil {
  7476. return err
  7477. }
  7478. if err := f(x); err != nil {
  7479. return err
  7480. }
  7481. if x.NextPageToken == "" {
  7482. return nil
  7483. }
  7484. c.PageToken(x.NextPageToken)
  7485. }
  7486. }
  7487. // method id "games.rooms.reportStatus":
  7488. type RoomsReportStatusCall struct {
  7489. s *Service
  7490. roomId string
  7491. roomp2pstatuses *RoomP2PStatuses
  7492. urlParams_ gensupport.URLParams
  7493. ctx_ context.Context
  7494. }
  7495. // ReportStatus: Updates sent by a client reporting the status of peers
  7496. // in a room. For internal use by the Games SDK only. Calling this
  7497. // method directly is unsupported.
  7498. func (r *RoomsService) ReportStatus(roomId string, roomp2pstatuses *RoomP2PStatuses) *RoomsReportStatusCall {
  7499. c := &RoomsReportStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7500. c.roomId = roomId
  7501. c.roomp2pstatuses = roomp2pstatuses
  7502. return c
  7503. }
  7504. // Language sets the optional parameter "language": The preferred
  7505. // language to use for strings returned by this method.
  7506. func (c *RoomsReportStatusCall) Language(language string) *RoomsReportStatusCall {
  7507. c.urlParams_.Set("language", language)
  7508. return c
  7509. }
  7510. // Fields allows partial responses to be retrieved. See
  7511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7512. // for more information.
  7513. func (c *RoomsReportStatusCall) Fields(s ...googleapi.Field) *RoomsReportStatusCall {
  7514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7515. return c
  7516. }
  7517. // Context sets the context to be used in this call's Do method. Any
  7518. // pending HTTP request will be aborted if the provided context is
  7519. // canceled.
  7520. func (c *RoomsReportStatusCall) Context(ctx context.Context) *RoomsReportStatusCall {
  7521. c.ctx_ = ctx
  7522. return c
  7523. }
  7524. func (c *RoomsReportStatusCall) doRequest(alt string) (*http.Response, error) {
  7525. var body io.Reader = nil
  7526. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomp2pstatuses)
  7527. if err != nil {
  7528. return nil, err
  7529. }
  7530. ctype := "application/json"
  7531. c.urlParams_.Set("alt", alt)
  7532. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/reportstatus")
  7533. urls += "?" + c.urlParams_.Encode()
  7534. req, _ := http.NewRequest("POST", urls, body)
  7535. googleapi.Expand(req.URL, map[string]string{
  7536. "roomId": c.roomId,
  7537. })
  7538. req.Header.Set("Content-Type", ctype)
  7539. req.Header.Set("User-Agent", c.s.userAgent())
  7540. if c.ctx_ != nil {
  7541. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7542. }
  7543. return c.s.client.Do(req)
  7544. }
  7545. // Do executes the "games.rooms.reportStatus" call.
  7546. // Exactly one of *RoomStatus or error will be non-nil. Any non-2xx
  7547. // status code is an error. Response headers are in either
  7548. // *RoomStatus.ServerResponse.Header or (if a response was returned at
  7549. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7550. // to check whether the returned error was because
  7551. // http.StatusNotModified was returned.
  7552. func (c *RoomsReportStatusCall) Do(opts ...googleapi.CallOption) (*RoomStatus, error) {
  7553. gensupport.SetOptions(c.urlParams_, opts...)
  7554. res, err := c.doRequest("json")
  7555. if res != nil && res.StatusCode == http.StatusNotModified {
  7556. if res.Body != nil {
  7557. res.Body.Close()
  7558. }
  7559. return nil, &googleapi.Error{
  7560. Code: res.StatusCode,
  7561. Header: res.Header,
  7562. }
  7563. }
  7564. if err != nil {
  7565. return nil, err
  7566. }
  7567. defer googleapi.CloseBody(res)
  7568. if err := googleapi.CheckResponse(res); err != nil {
  7569. return nil, err
  7570. }
  7571. ret := &RoomStatus{
  7572. ServerResponse: googleapi.ServerResponse{
  7573. Header: res.Header,
  7574. HTTPStatusCode: res.StatusCode,
  7575. },
  7576. }
  7577. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7578. return nil, err
  7579. }
  7580. return ret, nil
  7581. // {
  7582. // "description": "Updates sent by a client reporting the status of peers in a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  7583. // "httpMethod": "POST",
  7584. // "id": "games.rooms.reportStatus",
  7585. // "parameterOrder": [
  7586. // "roomId"
  7587. // ],
  7588. // "parameters": {
  7589. // "language": {
  7590. // "description": "The preferred language to use for strings returned by this method.",
  7591. // "location": "query",
  7592. // "type": "string"
  7593. // },
  7594. // "roomId": {
  7595. // "description": "The ID of the room.",
  7596. // "location": "path",
  7597. // "required": true,
  7598. // "type": "string"
  7599. // }
  7600. // },
  7601. // "path": "rooms/{roomId}/reportstatus",
  7602. // "request": {
  7603. // "$ref": "RoomP2PStatuses"
  7604. // },
  7605. // "response": {
  7606. // "$ref": "RoomStatus"
  7607. // },
  7608. // "scopes": [
  7609. // "https://www.googleapis.com/auth/games",
  7610. // "https://www.googleapis.com/auth/plus.login"
  7611. // ]
  7612. // }
  7613. }
  7614. // method id "games.scores.get":
  7615. type ScoresGetCall struct {
  7616. s *Service
  7617. playerId string
  7618. leaderboardId string
  7619. timeSpan string
  7620. urlParams_ gensupport.URLParams
  7621. ifNoneMatch_ string
  7622. ctx_ context.Context
  7623. }
  7624. // Get: Get high scores, and optionally ranks, in leaderboards for the
  7625. // currently authenticated player. For a specific time span,
  7626. // leaderboardId can be set to ALL to retrieve data for all leaderboards
  7627. // in a given time span.
  7628. // NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in
  7629. // the same request; only one parameter may be set to 'ALL'.
  7630. func (r *ScoresService) Get(playerId string, leaderboardId string, timeSpan string) *ScoresGetCall {
  7631. c := &ScoresGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7632. c.playerId = playerId
  7633. c.leaderboardId = leaderboardId
  7634. c.timeSpan = timeSpan
  7635. return c
  7636. }
  7637. // IncludeRankType sets the optional parameter "includeRankType": The
  7638. // types of ranks to return. If the parameter is omitted, no ranks will
  7639. // be returned.
  7640. //
  7641. // Possible values:
  7642. // "ALL" - Retrieve public and social ranks.
  7643. // "PUBLIC" - Retrieve public ranks, if the player is sharing their
  7644. // gameplay activity publicly.
  7645. // "SOCIAL" - Retrieve the social rank.
  7646. func (c *ScoresGetCall) IncludeRankType(includeRankType string) *ScoresGetCall {
  7647. c.urlParams_.Set("includeRankType", includeRankType)
  7648. return c
  7649. }
  7650. // Language sets the optional parameter "language": The preferred
  7651. // language to use for strings returned by this method.
  7652. func (c *ScoresGetCall) Language(language string) *ScoresGetCall {
  7653. c.urlParams_.Set("language", language)
  7654. return c
  7655. }
  7656. // MaxResults sets the optional parameter "maxResults": The maximum
  7657. // number of leaderboard scores to return in the response. For any
  7658. // response, the actual number of leaderboard scores returned may be
  7659. // less than the specified maxResults.
  7660. func (c *ScoresGetCall) MaxResults(maxResults int64) *ScoresGetCall {
  7661. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7662. return c
  7663. }
  7664. // PageToken sets the optional parameter "pageToken": The token returned
  7665. // by the previous request.
  7666. func (c *ScoresGetCall) PageToken(pageToken string) *ScoresGetCall {
  7667. c.urlParams_.Set("pageToken", pageToken)
  7668. return c
  7669. }
  7670. // Fields allows partial responses to be retrieved. See
  7671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7672. // for more information.
  7673. func (c *ScoresGetCall) Fields(s ...googleapi.Field) *ScoresGetCall {
  7674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7675. return c
  7676. }
  7677. // IfNoneMatch sets the optional parameter which makes the operation
  7678. // fail if the object's ETag matches the given value. This is useful for
  7679. // getting updates only after the object has changed since the last
  7680. // request. Use googleapi.IsNotModified to check whether the response
  7681. // error from Do is the result of In-None-Match.
  7682. func (c *ScoresGetCall) IfNoneMatch(entityTag string) *ScoresGetCall {
  7683. c.ifNoneMatch_ = entityTag
  7684. return c
  7685. }
  7686. // Context sets the context to be used in this call's Do method. Any
  7687. // pending HTTP request will be aborted if the provided context is
  7688. // canceled.
  7689. func (c *ScoresGetCall) Context(ctx context.Context) *ScoresGetCall {
  7690. c.ctx_ = ctx
  7691. return c
  7692. }
  7693. func (c *ScoresGetCall) doRequest(alt string) (*http.Response, error) {
  7694. var body io.Reader = nil
  7695. c.urlParams_.Set("alt", alt)
  7696. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}")
  7697. urls += "?" + c.urlParams_.Encode()
  7698. req, _ := http.NewRequest("GET", urls, body)
  7699. googleapi.Expand(req.URL, map[string]string{
  7700. "playerId": c.playerId,
  7701. "leaderboardId": c.leaderboardId,
  7702. "timeSpan": c.timeSpan,
  7703. })
  7704. req.Header.Set("User-Agent", c.s.userAgent())
  7705. if c.ifNoneMatch_ != "" {
  7706. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7707. }
  7708. if c.ctx_ != nil {
  7709. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7710. }
  7711. return c.s.client.Do(req)
  7712. }
  7713. // Do executes the "games.scores.get" call.
  7714. // Exactly one of *PlayerLeaderboardScoreListResponse or error will be
  7715. // non-nil. Any non-2xx status code is an error. Response headers are in
  7716. // either *PlayerLeaderboardScoreListResponse.ServerResponse.Header or
  7717. // (if a response was returned at all) in
  7718. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7719. // whether the returned error was because http.StatusNotModified was
  7720. // returned.
  7721. func (c *ScoresGetCall) Do(opts ...googleapi.CallOption) (*PlayerLeaderboardScoreListResponse, error) {
  7722. gensupport.SetOptions(c.urlParams_, opts...)
  7723. res, err := c.doRequest("json")
  7724. if res != nil && res.StatusCode == http.StatusNotModified {
  7725. if res.Body != nil {
  7726. res.Body.Close()
  7727. }
  7728. return nil, &googleapi.Error{
  7729. Code: res.StatusCode,
  7730. Header: res.Header,
  7731. }
  7732. }
  7733. if err != nil {
  7734. return nil, err
  7735. }
  7736. defer googleapi.CloseBody(res)
  7737. if err := googleapi.CheckResponse(res); err != nil {
  7738. return nil, err
  7739. }
  7740. ret := &PlayerLeaderboardScoreListResponse{
  7741. ServerResponse: googleapi.ServerResponse{
  7742. Header: res.Header,
  7743. HTTPStatusCode: res.StatusCode,
  7744. },
  7745. }
  7746. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7747. return nil, err
  7748. }
  7749. return ret, nil
  7750. // {
  7751. // "description": "Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span.\nNOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'.",
  7752. // "httpMethod": "GET",
  7753. // "id": "games.scores.get",
  7754. // "parameterOrder": [
  7755. // "playerId",
  7756. // "leaderboardId",
  7757. // "timeSpan"
  7758. // ],
  7759. // "parameters": {
  7760. // "includeRankType": {
  7761. // "description": "The types of ranks to return. If the parameter is omitted, no ranks will be returned.",
  7762. // "enum": [
  7763. // "ALL",
  7764. // "PUBLIC",
  7765. // "SOCIAL"
  7766. // ],
  7767. // "enumDescriptions": [
  7768. // "Retrieve public and social ranks.",
  7769. // "Retrieve public ranks, if the player is sharing their gameplay activity publicly.",
  7770. // "Retrieve the social rank."
  7771. // ],
  7772. // "location": "query",
  7773. // "type": "string"
  7774. // },
  7775. // "language": {
  7776. // "description": "The preferred language to use for strings returned by this method.",
  7777. // "location": "query",
  7778. // "type": "string"
  7779. // },
  7780. // "leaderboardId": {
  7781. // "description": "The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.",
  7782. // "location": "path",
  7783. // "required": true,
  7784. // "type": "string"
  7785. // },
  7786. // "maxResults": {
  7787. // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.",
  7788. // "format": "int32",
  7789. // "location": "query",
  7790. // "maximum": "30",
  7791. // "minimum": "1",
  7792. // "type": "integer"
  7793. // },
  7794. // "pageToken": {
  7795. // "description": "The token returned by the previous request.",
  7796. // "location": "query",
  7797. // "type": "string"
  7798. // },
  7799. // "playerId": {
  7800. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  7801. // "location": "path",
  7802. // "required": true,
  7803. // "type": "string"
  7804. // },
  7805. // "timeSpan": {
  7806. // "description": "The time span for the scores and ranks you're requesting.",
  7807. // "enum": [
  7808. // "ALL",
  7809. // "ALL_TIME",
  7810. // "DAILY",
  7811. // "WEEKLY"
  7812. // ],
  7813. // "enumDescriptions": [
  7814. // "Get the high scores for all time spans. If this is used, maxResults values will be ignored.",
  7815. // "Get the all time high score.",
  7816. // "List the top scores for the current day.",
  7817. // "List the top scores for the current week."
  7818. // ],
  7819. // "location": "path",
  7820. // "required": true,
  7821. // "type": "string"
  7822. // }
  7823. // },
  7824. // "path": "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}",
  7825. // "response": {
  7826. // "$ref": "PlayerLeaderboardScoreListResponse"
  7827. // },
  7828. // "scopes": [
  7829. // "https://www.googleapis.com/auth/games",
  7830. // "https://www.googleapis.com/auth/plus.login"
  7831. // ]
  7832. // }
  7833. }
  7834. // Pages invokes f for each page of results.
  7835. // A non-nil error returned from f will halt the iteration.
  7836. // The provided context supersedes any context provided to the Context method.
  7837. func (c *ScoresGetCall) Pages(ctx context.Context, f func(*PlayerLeaderboardScoreListResponse) error) error {
  7838. c.ctx_ = ctx
  7839. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7840. for {
  7841. x, err := c.Do()
  7842. if err != nil {
  7843. return err
  7844. }
  7845. if err := f(x); err != nil {
  7846. return err
  7847. }
  7848. if x.NextPageToken == "" {
  7849. return nil
  7850. }
  7851. c.PageToken(x.NextPageToken)
  7852. }
  7853. }
  7854. // method id "games.scores.list":
  7855. type ScoresListCall struct {
  7856. s *Service
  7857. leaderboardId string
  7858. collection string
  7859. urlParams_ gensupport.URLParams
  7860. ifNoneMatch_ string
  7861. ctx_ context.Context
  7862. }
  7863. // List: Lists the scores in a leaderboard, starting from the top.
  7864. func (r *ScoresService) List(leaderboardId string, collection string, timeSpan string) *ScoresListCall {
  7865. c := &ScoresListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7866. c.leaderboardId = leaderboardId
  7867. c.collection = collection
  7868. c.urlParams_.Set("timeSpan", timeSpan)
  7869. return c
  7870. }
  7871. // Language sets the optional parameter "language": The preferred
  7872. // language to use for strings returned by this method.
  7873. func (c *ScoresListCall) Language(language string) *ScoresListCall {
  7874. c.urlParams_.Set("language", language)
  7875. return c
  7876. }
  7877. // MaxResults sets the optional parameter "maxResults": The maximum
  7878. // number of leaderboard scores to return in the response. For any
  7879. // response, the actual number of leaderboard scores returned may be
  7880. // less than the specified maxResults.
  7881. func (c *ScoresListCall) MaxResults(maxResults int64) *ScoresListCall {
  7882. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7883. return c
  7884. }
  7885. // PageToken sets the optional parameter "pageToken": The token returned
  7886. // by the previous request.
  7887. func (c *ScoresListCall) PageToken(pageToken string) *ScoresListCall {
  7888. c.urlParams_.Set("pageToken", pageToken)
  7889. return c
  7890. }
  7891. // Fields allows partial responses to be retrieved. See
  7892. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7893. // for more information.
  7894. func (c *ScoresListCall) Fields(s ...googleapi.Field) *ScoresListCall {
  7895. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7896. return c
  7897. }
  7898. // IfNoneMatch sets the optional parameter which makes the operation
  7899. // fail if the object's ETag matches the given value. This is useful for
  7900. // getting updates only after the object has changed since the last
  7901. // request. Use googleapi.IsNotModified to check whether the response
  7902. // error from Do is the result of In-None-Match.
  7903. func (c *ScoresListCall) IfNoneMatch(entityTag string) *ScoresListCall {
  7904. c.ifNoneMatch_ = entityTag
  7905. return c
  7906. }
  7907. // Context sets the context to be used in this call's Do method. Any
  7908. // pending HTTP request will be aborted if the provided context is
  7909. // canceled.
  7910. func (c *ScoresListCall) Context(ctx context.Context) *ScoresListCall {
  7911. c.ctx_ = ctx
  7912. return c
  7913. }
  7914. func (c *ScoresListCall) doRequest(alt string) (*http.Response, error) {
  7915. var body io.Reader = nil
  7916. c.urlParams_.Set("alt", alt)
  7917. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/{collection}")
  7918. urls += "?" + c.urlParams_.Encode()
  7919. req, _ := http.NewRequest("GET", urls, body)
  7920. googleapi.Expand(req.URL, map[string]string{
  7921. "leaderboardId": c.leaderboardId,
  7922. "collection": c.collection,
  7923. })
  7924. req.Header.Set("User-Agent", c.s.userAgent())
  7925. if c.ifNoneMatch_ != "" {
  7926. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7927. }
  7928. if c.ctx_ != nil {
  7929. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7930. }
  7931. return c.s.client.Do(req)
  7932. }
  7933. // Do executes the "games.scores.list" call.
  7934. // Exactly one of *LeaderboardScores or error will be non-nil. Any
  7935. // non-2xx status code is an error. Response headers are in either
  7936. // *LeaderboardScores.ServerResponse.Header or (if a response was
  7937. // returned at all) in error.(*googleapi.Error).Header. Use
  7938. // googleapi.IsNotModified to check whether the returned error was
  7939. // because http.StatusNotModified was returned.
  7940. func (c *ScoresListCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) {
  7941. gensupport.SetOptions(c.urlParams_, opts...)
  7942. res, err := c.doRequest("json")
  7943. if res != nil && res.StatusCode == http.StatusNotModified {
  7944. if res.Body != nil {
  7945. res.Body.Close()
  7946. }
  7947. return nil, &googleapi.Error{
  7948. Code: res.StatusCode,
  7949. Header: res.Header,
  7950. }
  7951. }
  7952. if err != nil {
  7953. return nil, err
  7954. }
  7955. defer googleapi.CloseBody(res)
  7956. if err := googleapi.CheckResponse(res); err != nil {
  7957. return nil, err
  7958. }
  7959. ret := &LeaderboardScores{
  7960. ServerResponse: googleapi.ServerResponse{
  7961. Header: res.Header,
  7962. HTTPStatusCode: res.StatusCode,
  7963. },
  7964. }
  7965. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7966. return nil, err
  7967. }
  7968. return ret, nil
  7969. // {
  7970. // "description": "Lists the scores in a leaderboard, starting from the top.",
  7971. // "httpMethod": "GET",
  7972. // "id": "games.scores.list",
  7973. // "parameterOrder": [
  7974. // "leaderboardId",
  7975. // "collection",
  7976. // "timeSpan"
  7977. // ],
  7978. // "parameters": {
  7979. // "collection": {
  7980. // "description": "The collection of scores you're requesting.",
  7981. // "enum": [
  7982. // "PUBLIC",
  7983. // "SOCIAL"
  7984. // ],
  7985. // "enumDescriptions": [
  7986. // "List all scores in the public leaderboard.",
  7987. // "List only social scores."
  7988. // ],
  7989. // "location": "path",
  7990. // "required": true,
  7991. // "type": "string"
  7992. // },
  7993. // "language": {
  7994. // "description": "The preferred language to use for strings returned by this method.",
  7995. // "location": "query",
  7996. // "type": "string"
  7997. // },
  7998. // "leaderboardId": {
  7999. // "description": "The ID of the leaderboard.",
  8000. // "location": "path",
  8001. // "required": true,
  8002. // "type": "string"
  8003. // },
  8004. // "maxResults": {
  8005. // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.",
  8006. // "format": "int32",
  8007. // "location": "query",
  8008. // "maximum": "30",
  8009. // "minimum": "1",
  8010. // "type": "integer"
  8011. // },
  8012. // "pageToken": {
  8013. // "description": "The token returned by the previous request.",
  8014. // "location": "query",
  8015. // "type": "string"
  8016. // },
  8017. // "timeSpan": {
  8018. // "description": "The time span for the scores and ranks you're requesting.",
  8019. // "enum": [
  8020. // "ALL_TIME",
  8021. // "DAILY",
  8022. // "WEEKLY"
  8023. // ],
  8024. // "enumDescriptions": [
  8025. // "List the all-time top scores.",
  8026. // "List the top scores for the current day.",
  8027. // "List the top scores for the current week."
  8028. // ],
  8029. // "location": "query",
  8030. // "required": true,
  8031. // "type": "string"
  8032. // }
  8033. // },
  8034. // "path": "leaderboards/{leaderboardId}/scores/{collection}",
  8035. // "response": {
  8036. // "$ref": "LeaderboardScores"
  8037. // },
  8038. // "scopes": [
  8039. // "https://www.googleapis.com/auth/games",
  8040. // "https://www.googleapis.com/auth/plus.login"
  8041. // ]
  8042. // }
  8043. }
  8044. // Pages invokes f for each page of results.
  8045. // A non-nil error returned from f will halt the iteration.
  8046. // The provided context supersedes any context provided to the Context method.
  8047. func (c *ScoresListCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error {
  8048. c.ctx_ = ctx
  8049. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8050. for {
  8051. x, err := c.Do()
  8052. if err != nil {
  8053. return err
  8054. }
  8055. if err := f(x); err != nil {
  8056. return err
  8057. }
  8058. if x.NextPageToken == "" {
  8059. return nil
  8060. }
  8061. c.PageToken(x.NextPageToken)
  8062. }
  8063. }
  8064. // method id "games.scores.listWindow":
  8065. type ScoresListWindowCall struct {
  8066. s *Service
  8067. leaderboardId string
  8068. collection string
  8069. urlParams_ gensupport.URLParams
  8070. ifNoneMatch_ string
  8071. ctx_ context.Context
  8072. }
  8073. // ListWindow: Lists the scores in a leaderboard around (and including)
  8074. // a player's score.
  8075. func (r *ScoresService) ListWindow(leaderboardId string, collection string, timeSpan string) *ScoresListWindowCall {
  8076. c := &ScoresListWindowCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8077. c.leaderboardId = leaderboardId
  8078. c.collection = collection
  8079. c.urlParams_.Set("timeSpan", timeSpan)
  8080. return c
  8081. }
  8082. // Language sets the optional parameter "language": The preferred
  8083. // language to use for strings returned by this method.
  8084. func (c *ScoresListWindowCall) Language(language string) *ScoresListWindowCall {
  8085. c.urlParams_.Set("language", language)
  8086. return c
  8087. }
  8088. // MaxResults sets the optional parameter "maxResults": The maximum
  8089. // number of leaderboard scores to return in the response. For any
  8090. // response, the actual number of leaderboard scores returned may be
  8091. // less than the specified maxResults.
  8092. func (c *ScoresListWindowCall) MaxResults(maxResults int64) *ScoresListWindowCall {
  8093. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8094. return c
  8095. }
  8096. // PageToken sets the optional parameter "pageToken": The token returned
  8097. // by the previous request.
  8098. func (c *ScoresListWindowCall) PageToken(pageToken string) *ScoresListWindowCall {
  8099. c.urlParams_.Set("pageToken", pageToken)
  8100. return c
  8101. }
  8102. // ResultsAbove sets the optional parameter "resultsAbove": The
  8103. // preferred number of scores to return above the player's score. More
  8104. // scores may be returned if the player is at the bottom of the
  8105. // leaderboard; fewer may be returned if the player is at the top. Must
  8106. // be less than or equal to maxResults.
  8107. func (c *ScoresListWindowCall) ResultsAbove(resultsAbove int64) *ScoresListWindowCall {
  8108. c.urlParams_.Set("resultsAbove", fmt.Sprint(resultsAbove))
  8109. return c
  8110. }
  8111. // ReturnTopIfAbsent sets the optional parameter "returnTopIfAbsent":
  8112. // True if the top scores should be returned when the player is not in
  8113. // the leaderboard. Defaults to true.
  8114. func (c *ScoresListWindowCall) ReturnTopIfAbsent(returnTopIfAbsent bool) *ScoresListWindowCall {
  8115. c.urlParams_.Set("returnTopIfAbsent", fmt.Sprint(returnTopIfAbsent))
  8116. return c
  8117. }
  8118. // Fields allows partial responses to be retrieved. See
  8119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8120. // for more information.
  8121. func (c *ScoresListWindowCall) Fields(s ...googleapi.Field) *ScoresListWindowCall {
  8122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8123. return c
  8124. }
  8125. // IfNoneMatch sets the optional parameter which makes the operation
  8126. // fail if the object's ETag matches the given value. This is useful for
  8127. // getting updates only after the object has changed since the last
  8128. // request. Use googleapi.IsNotModified to check whether the response
  8129. // error from Do is the result of In-None-Match.
  8130. func (c *ScoresListWindowCall) IfNoneMatch(entityTag string) *ScoresListWindowCall {
  8131. c.ifNoneMatch_ = entityTag
  8132. return c
  8133. }
  8134. // Context sets the context to be used in this call's Do method. Any
  8135. // pending HTTP request will be aborted if the provided context is
  8136. // canceled.
  8137. func (c *ScoresListWindowCall) Context(ctx context.Context) *ScoresListWindowCall {
  8138. c.ctx_ = ctx
  8139. return c
  8140. }
  8141. func (c *ScoresListWindowCall) doRequest(alt string) (*http.Response, error) {
  8142. var body io.Reader = nil
  8143. c.urlParams_.Set("alt", alt)
  8144. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/window/{collection}")
  8145. urls += "?" + c.urlParams_.Encode()
  8146. req, _ := http.NewRequest("GET", urls, body)
  8147. googleapi.Expand(req.URL, map[string]string{
  8148. "leaderboardId": c.leaderboardId,
  8149. "collection": c.collection,
  8150. })
  8151. req.Header.Set("User-Agent", c.s.userAgent())
  8152. if c.ifNoneMatch_ != "" {
  8153. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8154. }
  8155. if c.ctx_ != nil {
  8156. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8157. }
  8158. return c.s.client.Do(req)
  8159. }
  8160. // Do executes the "games.scores.listWindow" call.
  8161. // Exactly one of *LeaderboardScores or error will be non-nil. Any
  8162. // non-2xx status code is an error. Response headers are in either
  8163. // *LeaderboardScores.ServerResponse.Header or (if a response was
  8164. // returned at all) in error.(*googleapi.Error).Header. Use
  8165. // googleapi.IsNotModified to check whether the returned error was
  8166. // because http.StatusNotModified was returned.
  8167. func (c *ScoresListWindowCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) {
  8168. gensupport.SetOptions(c.urlParams_, opts...)
  8169. res, err := c.doRequest("json")
  8170. if res != nil && res.StatusCode == http.StatusNotModified {
  8171. if res.Body != nil {
  8172. res.Body.Close()
  8173. }
  8174. return nil, &googleapi.Error{
  8175. Code: res.StatusCode,
  8176. Header: res.Header,
  8177. }
  8178. }
  8179. if err != nil {
  8180. return nil, err
  8181. }
  8182. defer googleapi.CloseBody(res)
  8183. if err := googleapi.CheckResponse(res); err != nil {
  8184. return nil, err
  8185. }
  8186. ret := &LeaderboardScores{
  8187. ServerResponse: googleapi.ServerResponse{
  8188. Header: res.Header,
  8189. HTTPStatusCode: res.StatusCode,
  8190. },
  8191. }
  8192. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8193. return nil, err
  8194. }
  8195. return ret, nil
  8196. // {
  8197. // "description": "Lists the scores in a leaderboard around (and including) a player's score.",
  8198. // "httpMethod": "GET",
  8199. // "id": "games.scores.listWindow",
  8200. // "parameterOrder": [
  8201. // "leaderboardId",
  8202. // "collection",
  8203. // "timeSpan"
  8204. // ],
  8205. // "parameters": {
  8206. // "collection": {
  8207. // "description": "The collection of scores you're requesting.",
  8208. // "enum": [
  8209. // "PUBLIC",
  8210. // "SOCIAL"
  8211. // ],
  8212. // "enumDescriptions": [
  8213. // "List all scores in the public leaderboard.",
  8214. // "List only social scores."
  8215. // ],
  8216. // "location": "path",
  8217. // "required": true,
  8218. // "type": "string"
  8219. // },
  8220. // "language": {
  8221. // "description": "The preferred language to use for strings returned by this method.",
  8222. // "location": "query",
  8223. // "type": "string"
  8224. // },
  8225. // "leaderboardId": {
  8226. // "description": "The ID of the leaderboard.",
  8227. // "location": "path",
  8228. // "required": true,
  8229. // "type": "string"
  8230. // },
  8231. // "maxResults": {
  8232. // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.",
  8233. // "format": "int32",
  8234. // "location": "query",
  8235. // "maximum": "30",
  8236. // "minimum": "1",
  8237. // "type": "integer"
  8238. // },
  8239. // "pageToken": {
  8240. // "description": "The token returned by the previous request.",
  8241. // "location": "query",
  8242. // "type": "string"
  8243. // },
  8244. // "resultsAbove": {
  8245. // "description": "The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults.",
  8246. // "format": "int32",
  8247. // "location": "query",
  8248. // "type": "integer"
  8249. // },
  8250. // "returnTopIfAbsent": {
  8251. // "description": "True if the top scores should be returned when the player is not in the leaderboard. Defaults to true.",
  8252. // "location": "query",
  8253. // "type": "boolean"
  8254. // },
  8255. // "timeSpan": {
  8256. // "description": "The time span for the scores and ranks you're requesting.",
  8257. // "enum": [
  8258. // "ALL_TIME",
  8259. // "DAILY",
  8260. // "WEEKLY"
  8261. // ],
  8262. // "enumDescriptions": [
  8263. // "List the all-time top scores.",
  8264. // "List the top scores for the current day.",
  8265. // "List the top scores for the current week."
  8266. // ],
  8267. // "location": "query",
  8268. // "required": true,
  8269. // "type": "string"
  8270. // }
  8271. // },
  8272. // "path": "leaderboards/{leaderboardId}/window/{collection}",
  8273. // "response": {
  8274. // "$ref": "LeaderboardScores"
  8275. // },
  8276. // "scopes": [
  8277. // "https://www.googleapis.com/auth/games",
  8278. // "https://www.googleapis.com/auth/plus.login"
  8279. // ]
  8280. // }
  8281. }
  8282. // Pages invokes f for each page of results.
  8283. // A non-nil error returned from f will halt the iteration.
  8284. // The provided context supersedes any context provided to the Context method.
  8285. func (c *ScoresListWindowCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error {
  8286. c.ctx_ = ctx
  8287. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8288. for {
  8289. x, err := c.Do()
  8290. if err != nil {
  8291. return err
  8292. }
  8293. if err := f(x); err != nil {
  8294. return err
  8295. }
  8296. if x.NextPageToken == "" {
  8297. return nil
  8298. }
  8299. c.PageToken(x.NextPageToken)
  8300. }
  8301. }
  8302. // method id "games.scores.submit":
  8303. type ScoresSubmitCall struct {
  8304. s *Service
  8305. leaderboardId string
  8306. urlParams_ gensupport.URLParams
  8307. ctx_ context.Context
  8308. }
  8309. // Submit: Submits a score to the specified leaderboard.
  8310. func (r *ScoresService) Submit(leaderboardId string, score int64) *ScoresSubmitCall {
  8311. c := &ScoresSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8312. c.leaderboardId = leaderboardId
  8313. c.urlParams_.Set("score", fmt.Sprint(score))
  8314. return c
  8315. }
  8316. // Language sets the optional parameter "language": The preferred
  8317. // language to use for strings returned by this method.
  8318. func (c *ScoresSubmitCall) Language(language string) *ScoresSubmitCall {
  8319. c.urlParams_.Set("language", language)
  8320. return c
  8321. }
  8322. // ScoreTag sets the optional parameter "scoreTag": Additional
  8323. // information about the score you're submitting. Values must contain no
  8324. // more than 64 URI-safe characters as defined by section 2.3 of RFC
  8325. // 3986.
  8326. func (c *ScoresSubmitCall) ScoreTag(scoreTag string) *ScoresSubmitCall {
  8327. c.urlParams_.Set("scoreTag", scoreTag)
  8328. return c
  8329. }
  8330. // Fields allows partial responses to be retrieved. See
  8331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8332. // for more information.
  8333. func (c *ScoresSubmitCall) Fields(s ...googleapi.Field) *ScoresSubmitCall {
  8334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8335. return c
  8336. }
  8337. // Context sets the context to be used in this call's Do method. Any
  8338. // pending HTTP request will be aborted if the provided context is
  8339. // canceled.
  8340. func (c *ScoresSubmitCall) Context(ctx context.Context) *ScoresSubmitCall {
  8341. c.ctx_ = ctx
  8342. return c
  8343. }
  8344. func (c *ScoresSubmitCall) doRequest(alt string) (*http.Response, error) {
  8345. var body io.Reader = nil
  8346. c.urlParams_.Set("alt", alt)
  8347. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores")
  8348. urls += "?" + c.urlParams_.Encode()
  8349. req, _ := http.NewRequest("POST", urls, body)
  8350. googleapi.Expand(req.URL, map[string]string{
  8351. "leaderboardId": c.leaderboardId,
  8352. })
  8353. req.Header.Set("User-Agent", c.s.userAgent())
  8354. if c.ctx_ != nil {
  8355. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8356. }
  8357. return c.s.client.Do(req)
  8358. }
  8359. // Do executes the "games.scores.submit" call.
  8360. // Exactly one of *PlayerScoreResponse or error will be non-nil. Any
  8361. // non-2xx status code is an error. Response headers are in either
  8362. // *PlayerScoreResponse.ServerResponse.Header or (if a response was
  8363. // returned at all) in error.(*googleapi.Error).Header. Use
  8364. // googleapi.IsNotModified to check whether the returned error was
  8365. // because http.StatusNotModified was returned.
  8366. func (c *ScoresSubmitCall) Do(opts ...googleapi.CallOption) (*PlayerScoreResponse, error) {
  8367. gensupport.SetOptions(c.urlParams_, opts...)
  8368. res, err := c.doRequest("json")
  8369. if res != nil && res.StatusCode == http.StatusNotModified {
  8370. if res.Body != nil {
  8371. res.Body.Close()
  8372. }
  8373. return nil, &googleapi.Error{
  8374. Code: res.StatusCode,
  8375. Header: res.Header,
  8376. }
  8377. }
  8378. if err != nil {
  8379. return nil, err
  8380. }
  8381. defer googleapi.CloseBody(res)
  8382. if err := googleapi.CheckResponse(res); err != nil {
  8383. return nil, err
  8384. }
  8385. ret := &PlayerScoreResponse{
  8386. ServerResponse: googleapi.ServerResponse{
  8387. Header: res.Header,
  8388. HTTPStatusCode: res.StatusCode,
  8389. },
  8390. }
  8391. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8392. return nil, err
  8393. }
  8394. return ret, nil
  8395. // {
  8396. // "description": "Submits a score to the specified leaderboard.",
  8397. // "httpMethod": "POST",
  8398. // "id": "games.scores.submit",
  8399. // "parameterOrder": [
  8400. // "leaderboardId",
  8401. // "score"
  8402. // ],
  8403. // "parameters": {
  8404. // "language": {
  8405. // "description": "The preferred language to use for strings returned by this method.",
  8406. // "location": "query",
  8407. // "type": "string"
  8408. // },
  8409. // "leaderboardId": {
  8410. // "description": "The ID of the leaderboard.",
  8411. // "location": "path",
  8412. // "required": true,
  8413. // "type": "string"
  8414. // },
  8415. // "score": {
  8416. // "description": "The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units.",
  8417. // "format": "int64",
  8418. // "location": "query",
  8419. // "required": true,
  8420. // "type": "string"
  8421. // },
  8422. // "scoreTag": {
  8423. // "description": "Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.",
  8424. // "location": "query",
  8425. // "pattern": "[a-zA-Z0-9-._~]{0,64}",
  8426. // "type": "string"
  8427. // }
  8428. // },
  8429. // "path": "leaderboards/{leaderboardId}/scores",
  8430. // "response": {
  8431. // "$ref": "PlayerScoreResponse"
  8432. // },
  8433. // "scopes": [
  8434. // "https://www.googleapis.com/auth/games",
  8435. // "https://www.googleapis.com/auth/plus.login"
  8436. // ]
  8437. // }
  8438. }
  8439. // method id "games.scores.submitMultiple":
  8440. type ScoresSubmitMultipleCall struct {
  8441. s *Service
  8442. playerscoresubmissionlist *PlayerScoreSubmissionList
  8443. urlParams_ gensupport.URLParams
  8444. ctx_ context.Context
  8445. }
  8446. // SubmitMultiple: Submits multiple scores to leaderboards.
  8447. func (r *ScoresService) SubmitMultiple(playerscoresubmissionlist *PlayerScoreSubmissionList) *ScoresSubmitMultipleCall {
  8448. c := &ScoresSubmitMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8449. c.playerscoresubmissionlist = playerscoresubmissionlist
  8450. return c
  8451. }
  8452. // Language sets the optional parameter "language": The preferred
  8453. // language to use for strings returned by this method.
  8454. func (c *ScoresSubmitMultipleCall) Language(language string) *ScoresSubmitMultipleCall {
  8455. c.urlParams_.Set("language", language)
  8456. return c
  8457. }
  8458. // Fields allows partial responses to be retrieved. See
  8459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8460. // for more information.
  8461. func (c *ScoresSubmitMultipleCall) Fields(s ...googleapi.Field) *ScoresSubmitMultipleCall {
  8462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8463. return c
  8464. }
  8465. // Context sets the context to be used in this call's Do method. Any
  8466. // pending HTTP request will be aborted if the provided context is
  8467. // canceled.
  8468. func (c *ScoresSubmitMultipleCall) Context(ctx context.Context) *ScoresSubmitMultipleCall {
  8469. c.ctx_ = ctx
  8470. return c
  8471. }
  8472. func (c *ScoresSubmitMultipleCall) doRequest(alt string) (*http.Response, error) {
  8473. var body io.Reader = nil
  8474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playerscoresubmissionlist)
  8475. if err != nil {
  8476. return nil, err
  8477. }
  8478. ctype := "application/json"
  8479. c.urlParams_.Set("alt", alt)
  8480. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/scores")
  8481. urls += "?" + c.urlParams_.Encode()
  8482. req, _ := http.NewRequest("POST", urls, body)
  8483. googleapi.SetOpaque(req.URL)
  8484. req.Header.Set("Content-Type", ctype)
  8485. req.Header.Set("User-Agent", c.s.userAgent())
  8486. if c.ctx_ != nil {
  8487. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8488. }
  8489. return c.s.client.Do(req)
  8490. }
  8491. // Do executes the "games.scores.submitMultiple" call.
  8492. // Exactly one of *PlayerScoreListResponse or error will be non-nil. Any
  8493. // non-2xx status code is an error. Response headers are in either
  8494. // *PlayerScoreListResponse.ServerResponse.Header or (if a response was
  8495. // returned at all) in error.(*googleapi.Error).Header. Use
  8496. // googleapi.IsNotModified to check whether the returned error was
  8497. // because http.StatusNotModified was returned.
  8498. func (c *ScoresSubmitMultipleCall) Do(opts ...googleapi.CallOption) (*PlayerScoreListResponse, error) {
  8499. gensupport.SetOptions(c.urlParams_, opts...)
  8500. res, err := c.doRequest("json")
  8501. if res != nil && res.StatusCode == http.StatusNotModified {
  8502. if res.Body != nil {
  8503. res.Body.Close()
  8504. }
  8505. return nil, &googleapi.Error{
  8506. Code: res.StatusCode,
  8507. Header: res.Header,
  8508. }
  8509. }
  8510. if err != nil {
  8511. return nil, err
  8512. }
  8513. defer googleapi.CloseBody(res)
  8514. if err := googleapi.CheckResponse(res); err != nil {
  8515. return nil, err
  8516. }
  8517. ret := &PlayerScoreListResponse{
  8518. ServerResponse: googleapi.ServerResponse{
  8519. Header: res.Header,
  8520. HTTPStatusCode: res.StatusCode,
  8521. },
  8522. }
  8523. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8524. return nil, err
  8525. }
  8526. return ret, nil
  8527. // {
  8528. // "description": "Submits multiple scores to leaderboards.",
  8529. // "httpMethod": "POST",
  8530. // "id": "games.scores.submitMultiple",
  8531. // "parameters": {
  8532. // "language": {
  8533. // "description": "The preferred language to use for strings returned by this method.",
  8534. // "location": "query",
  8535. // "type": "string"
  8536. // }
  8537. // },
  8538. // "path": "leaderboards/scores",
  8539. // "request": {
  8540. // "$ref": "PlayerScoreSubmissionList"
  8541. // },
  8542. // "response": {
  8543. // "$ref": "PlayerScoreListResponse"
  8544. // },
  8545. // "scopes": [
  8546. // "https://www.googleapis.com/auth/games",
  8547. // "https://www.googleapis.com/auth/plus.login"
  8548. // ]
  8549. // }
  8550. }
  8551. // method id "games.snapshots.get":
  8552. type SnapshotsGetCall struct {
  8553. s *Service
  8554. snapshotId string
  8555. urlParams_ gensupport.URLParams
  8556. ifNoneMatch_ string
  8557. ctx_ context.Context
  8558. }
  8559. // Get: Retrieves the metadata for a given snapshot ID.
  8560. func (r *SnapshotsService) Get(snapshotId string) *SnapshotsGetCall {
  8561. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8562. c.snapshotId = snapshotId
  8563. return c
  8564. }
  8565. // Language sets the optional parameter "language": The preferred
  8566. // language to use for strings returned by this method.
  8567. func (c *SnapshotsGetCall) Language(language string) *SnapshotsGetCall {
  8568. c.urlParams_.Set("language", language)
  8569. return c
  8570. }
  8571. // Fields allows partial responses to be retrieved. See
  8572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8573. // for more information.
  8574. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  8575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8576. return c
  8577. }
  8578. // IfNoneMatch sets the optional parameter which makes the operation
  8579. // fail if the object's ETag matches the given value. This is useful for
  8580. // getting updates only after the object has changed since the last
  8581. // request. Use googleapi.IsNotModified to check whether the response
  8582. // error from Do is the result of In-None-Match.
  8583. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  8584. c.ifNoneMatch_ = entityTag
  8585. return c
  8586. }
  8587. // Context sets the context to be used in this call's Do method. Any
  8588. // pending HTTP request will be aborted if the provided context is
  8589. // canceled.
  8590. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  8591. c.ctx_ = ctx
  8592. return c
  8593. }
  8594. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  8595. var body io.Reader = nil
  8596. c.urlParams_.Set("alt", alt)
  8597. urls := googleapi.ResolveRelative(c.s.BasePath, "snapshots/{snapshotId}")
  8598. urls += "?" + c.urlParams_.Encode()
  8599. req, _ := http.NewRequest("GET", urls, body)
  8600. googleapi.Expand(req.URL, map[string]string{
  8601. "snapshotId": c.snapshotId,
  8602. })
  8603. req.Header.Set("User-Agent", c.s.userAgent())
  8604. if c.ifNoneMatch_ != "" {
  8605. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8606. }
  8607. if c.ctx_ != nil {
  8608. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8609. }
  8610. return c.s.client.Do(req)
  8611. }
  8612. // Do executes the "games.snapshots.get" call.
  8613. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  8614. // code is an error. Response headers are in either
  8615. // *Snapshot.ServerResponse.Header or (if a response was returned at
  8616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8617. // to check whether the returned error was because
  8618. // http.StatusNotModified was returned.
  8619. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  8620. gensupport.SetOptions(c.urlParams_, opts...)
  8621. res, err := c.doRequest("json")
  8622. if res != nil && res.StatusCode == http.StatusNotModified {
  8623. if res.Body != nil {
  8624. res.Body.Close()
  8625. }
  8626. return nil, &googleapi.Error{
  8627. Code: res.StatusCode,
  8628. Header: res.Header,
  8629. }
  8630. }
  8631. if err != nil {
  8632. return nil, err
  8633. }
  8634. defer googleapi.CloseBody(res)
  8635. if err := googleapi.CheckResponse(res); err != nil {
  8636. return nil, err
  8637. }
  8638. ret := &Snapshot{
  8639. ServerResponse: googleapi.ServerResponse{
  8640. Header: res.Header,
  8641. HTTPStatusCode: res.StatusCode,
  8642. },
  8643. }
  8644. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8645. return nil, err
  8646. }
  8647. return ret, nil
  8648. // {
  8649. // "description": "Retrieves the metadata for a given snapshot ID.",
  8650. // "httpMethod": "GET",
  8651. // "id": "games.snapshots.get",
  8652. // "parameterOrder": [
  8653. // "snapshotId"
  8654. // ],
  8655. // "parameters": {
  8656. // "language": {
  8657. // "description": "The preferred language to use for strings returned by this method.",
  8658. // "location": "query",
  8659. // "type": "string"
  8660. // },
  8661. // "snapshotId": {
  8662. // "description": "The ID of the snapshot.",
  8663. // "location": "path",
  8664. // "required": true,
  8665. // "type": "string"
  8666. // }
  8667. // },
  8668. // "path": "snapshots/{snapshotId}",
  8669. // "response": {
  8670. // "$ref": "Snapshot"
  8671. // },
  8672. // "scopes": [
  8673. // "https://www.googleapis.com/auth/drive.appdata",
  8674. // "https://www.googleapis.com/auth/games",
  8675. // "https://www.googleapis.com/auth/plus.login"
  8676. // ]
  8677. // }
  8678. }
  8679. // method id "games.snapshots.list":
  8680. type SnapshotsListCall struct {
  8681. s *Service
  8682. playerId string
  8683. urlParams_ gensupport.URLParams
  8684. ifNoneMatch_ string
  8685. ctx_ context.Context
  8686. }
  8687. // List: Retrieves a list of snapshots created by your application for
  8688. // the player corresponding to the player ID.
  8689. func (r *SnapshotsService) List(playerId string) *SnapshotsListCall {
  8690. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8691. c.playerId = playerId
  8692. return c
  8693. }
  8694. // Language sets the optional parameter "language": The preferred
  8695. // language to use for strings returned by this method.
  8696. func (c *SnapshotsListCall) Language(language string) *SnapshotsListCall {
  8697. c.urlParams_.Set("language", language)
  8698. return c
  8699. }
  8700. // MaxResults sets the optional parameter "maxResults": The maximum
  8701. // number of snapshot resources to return in the response, used for
  8702. // paging. For any response, the actual number of snapshot resources
  8703. // returned may be less than the specified maxResults.
  8704. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  8705. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8706. return c
  8707. }
  8708. // PageToken sets the optional parameter "pageToken": The token returned
  8709. // by the previous request.
  8710. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  8711. c.urlParams_.Set("pageToken", pageToken)
  8712. return c
  8713. }
  8714. // Fields allows partial responses to be retrieved. See
  8715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8716. // for more information.
  8717. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  8718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8719. return c
  8720. }
  8721. // IfNoneMatch sets the optional parameter which makes the operation
  8722. // fail if the object's ETag matches the given value. This is useful for
  8723. // getting updates only after the object has changed since the last
  8724. // request. Use googleapi.IsNotModified to check whether the response
  8725. // error from Do is the result of In-None-Match.
  8726. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  8727. c.ifNoneMatch_ = entityTag
  8728. return c
  8729. }
  8730. // Context sets the context to be used in this call's Do method. Any
  8731. // pending HTTP request will be aborted if the provided context is
  8732. // canceled.
  8733. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  8734. c.ctx_ = ctx
  8735. return c
  8736. }
  8737. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  8738. var body io.Reader = nil
  8739. c.urlParams_.Set("alt", alt)
  8740. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/snapshots")
  8741. urls += "?" + c.urlParams_.Encode()
  8742. req, _ := http.NewRequest("GET", urls, body)
  8743. googleapi.Expand(req.URL, map[string]string{
  8744. "playerId": c.playerId,
  8745. })
  8746. req.Header.Set("User-Agent", c.s.userAgent())
  8747. if c.ifNoneMatch_ != "" {
  8748. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8749. }
  8750. if c.ctx_ != nil {
  8751. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8752. }
  8753. return c.s.client.Do(req)
  8754. }
  8755. // Do executes the "games.snapshots.list" call.
  8756. // Exactly one of *SnapshotListResponse or error will be non-nil. Any
  8757. // non-2xx status code is an error. Response headers are in either
  8758. // *SnapshotListResponse.ServerResponse.Header or (if a response was
  8759. // returned at all) in error.(*googleapi.Error).Header. Use
  8760. // googleapi.IsNotModified to check whether the returned error was
  8761. // because http.StatusNotModified was returned.
  8762. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotListResponse, error) {
  8763. gensupport.SetOptions(c.urlParams_, opts...)
  8764. res, err := c.doRequest("json")
  8765. if res != nil && res.StatusCode == http.StatusNotModified {
  8766. if res.Body != nil {
  8767. res.Body.Close()
  8768. }
  8769. return nil, &googleapi.Error{
  8770. Code: res.StatusCode,
  8771. Header: res.Header,
  8772. }
  8773. }
  8774. if err != nil {
  8775. return nil, err
  8776. }
  8777. defer googleapi.CloseBody(res)
  8778. if err := googleapi.CheckResponse(res); err != nil {
  8779. return nil, err
  8780. }
  8781. ret := &SnapshotListResponse{
  8782. ServerResponse: googleapi.ServerResponse{
  8783. Header: res.Header,
  8784. HTTPStatusCode: res.StatusCode,
  8785. },
  8786. }
  8787. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8788. return nil, err
  8789. }
  8790. return ret, nil
  8791. // {
  8792. // "description": "Retrieves a list of snapshots created by your application for the player corresponding to the player ID.",
  8793. // "httpMethod": "GET",
  8794. // "id": "games.snapshots.list",
  8795. // "parameterOrder": [
  8796. // "playerId"
  8797. // ],
  8798. // "parameters": {
  8799. // "language": {
  8800. // "description": "The preferred language to use for strings returned by this method.",
  8801. // "location": "query",
  8802. // "type": "string"
  8803. // },
  8804. // "maxResults": {
  8805. // "description": "The maximum number of snapshot resources to return in the response, used for paging. For any response, the actual number of snapshot resources returned may be less than the specified maxResults.",
  8806. // "format": "int32",
  8807. // "location": "query",
  8808. // "maximum": "25",
  8809. // "minimum": "1",
  8810. // "type": "integer"
  8811. // },
  8812. // "pageToken": {
  8813. // "description": "The token returned by the previous request.",
  8814. // "location": "query",
  8815. // "type": "string"
  8816. // },
  8817. // "playerId": {
  8818. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  8819. // "location": "path",
  8820. // "required": true,
  8821. // "type": "string"
  8822. // }
  8823. // },
  8824. // "path": "players/{playerId}/snapshots",
  8825. // "response": {
  8826. // "$ref": "SnapshotListResponse"
  8827. // },
  8828. // "scopes": [
  8829. // "https://www.googleapis.com/auth/drive.appdata",
  8830. // "https://www.googleapis.com/auth/games",
  8831. // "https://www.googleapis.com/auth/plus.login"
  8832. // ]
  8833. // }
  8834. }
  8835. // Pages invokes f for each page of results.
  8836. // A non-nil error returned from f will halt the iteration.
  8837. // The provided context supersedes any context provided to the Context method.
  8838. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotListResponse) error) error {
  8839. c.ctx_ = ctx
  8840. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8841. for {
  8842. x, err := c.Do()
  8843. if err != nil {
  8844. return err
  8845. }
  8846. if err := f(x); err != nil {
  8847. return err
  8848. }
  8849. if x.NextPageToken == "" {
  8850. return nil
  8851. }
  8852. c.PageToken(x.NextPageToken)
  8853. }
  8854. }
  8855. // method id "games.turnBasedMatches.cancel":
  8856. type TurnBasedMatchesCancelCall struct {
  8857. s *Service
  8858. matchId string
  8859. urlParams_ gensupport.URLParams
  8860. ctx_ context.Context
  8861. }
  8862. // Cancel: Cancel a turn-based match.
  8863. func (r *TurnBasedMatchesService) Cancel(matchId string) *TurnBasedMatchesCancelCall {
  8864. c := &TurnBasedMatchesCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8865. c.matchId = matchId
  8866. return c
  8867. }
  8868. // Fields allows partial responses to be retrieved. See
  8869. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8870. // for more information.
  8871. func (c *TurnBasedMatchesCancelCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCancelCall {
  8872. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8873. return c
  8874. }
  8875. // Context sets the context to be used in this call's Do method. Any
  8876. // pending HTTP request will be aborted if the provided context is
  8877. // canceled.
  8878. func (c *TurnBasedMatchesCancelCall) Context(ctx context.Context) *TurnBasedMatchesCancelCall {
  8879. c.ctx_ = ctx
  8880. return c
  8881. }
  8882. func (c *TurnBasedMatchesCancelCall) doRequest(alt string) (*http.Response, error) {
  8883. var body io.Reader = nil
  8884. c.urlParams_.Set("alt", alt)
  8885. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/cancel")
  8886. urls += "?" + c.urlParams_.Encode()
  8887. req, _ := http.NewRequest("PUT", urls, body)
  8888. googleapi.Expand(req.URL, map[string]string{
  8889. "matchId": c.matchId,
  8890. })
  8891. req.Header.Set("User-Agent", c.s.userAgent())
  8892. if c.ctx_ != nil {
  8893. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8894. }
  8895. return c.s.client.Do(req)
  8896. }
  8897. // Do executes the "games.turnBasedMatches.cancel" call.
  8898. func (c *TurnBasedMatchesCancelCall) Do(opts ...googleapi.CallOption) error {
  8899. gensupport.SetOptions(c.urlParams_, opts...)
  8900. res, err := c.doRequest("json")
  8901. if err != nil {
  8902. return err
  8903. }
  8904. defer googleapi.CloseBody(res)
  8905. if err := googleapi.CheckResponse(res); err != nil {
  8906. return err
  8907. }
  8908. return nil
  8909. // {
  8910. // "description": "Cancel a turn-based match.",
  8911. // "httpMethod": "PUT",
  8912. // "id": "games.turnBasedMatches.cancel",
  8913. // "parameterOrder": [
  8914. // "matchId"
  8915. // ],
  8916. // "parameters": {
  8917. // "matchId": {
  8918. // "description": "The ID of the match.",
  8919. // "location": "path",
  8920. // "required": true,
  8921. // "type": "string"
  8922. // }
  8923. // },
  8924. // "path": "turnbasedmatches/{matchId}/cancel",
  8925. // "scopes": [
  8926. // "https://www.googleapis.com/auth/games",
  8927. // "https://www.googleapis.com/auth/plus.login"
  8928. // ]
  8929. // }
  8930. }
  8931. // method id "games.turnBasedMatches.create":
  8932. type TurnBasedMatchesCreateCall struct {
  8933. s *Service
  8934. turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest
  8935. urlParams_ gensupport.URLParams
  8936. ctx_ context.Context
  8937. }
  8938. // Create: Create a turn-based match.
  8939. func (r *TurnBasedMatchesService) Create(turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest) *TurnBasedMatchesCreateCall {
  8940. c := &TurnBasedMatchesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8941. c.turnbasedmatchcreaterequest = turnbasedmatchcreaterequest
  8942. return c
  8943. }
  8944. // Language sets the optional parameter "language": The preferred
  8945. // language to use for strings returned by this method.
  8946. func (c *TurnBasedMatchesCreateCall) Language(language string) *TurnBasedMatchesCreateCall {
  8947. c.urlParams_.Set("language", language)
  8948. return c
  8949. }
  8950. // Fields allows partial responses to be retrieved. See
  8951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8952. // for more information.
  8953. func (c *TurnBasedMatchesCreateCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCreateCall {
  8954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8955. return c
  8956. }
  8957. // Context sets the context to be used in this call's Do method. Any
  8958. // pending HTTP request will be aborted if the provided context is
  8959. // canceled.
  8960. func (c *TurnBasedMatchesCreateCall) Context(ctx context.Context) *TurnBasedMatchesCreateCall {
  8961. c.ctx_ = ctx
  8962. return c
  8963. }
  8964. func (c *TurnBasedMatchesCreateCall) doRequest(alt string) (*http.Response, error) {
  8965. var body io.Reader = nil
  8966. body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchcreaterequest)
  8967. if err != nil {
  8968. return nil, err
  8969. }
  8970. ctype := "application/json"
  8971. c.urlParams_.Set("alt", alt)
  8972. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/create")
  8973. urls += "?" + c.urlParams_.Encode()
  8974. req, _ := http.NewRequest("POST", urls, body)
  8975. googleapi.SetOpaque(req.URL)
  8976. req.Header.Set("Content-Type", ctype)
  8977. req.Header.Set("User-Agent", c.s.userAgent())
  8978. if c.ctx_ != nil {
  8979. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8980. }
  8981. return c.s.client.Do(req)
  8982. }
  8983. // Do executes the "games.turnBasedMatches.create" call.
  8984. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  8985. // status code is an error. Response headers are in either
  8986. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  8987. // at all) in error.(*googleapi.Error).Header. Use
  8988. // googleapi.IsNotModified to check whether the returned error was
  8989. // because http.StatusNotModified was returned.
  8990. func (c *TurnBasedMatchesCreateCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  8991. gensupport.SetOptions(c.urlParams_, opts...)
  8992. res, err := c.doRequest("json")
  8993. if res != nil && res.StatusCode == http.StatusNotModified {
  8994. if res.Body != nil {
  8995. res.Body.Close()
  8996. }
  8997. return nil, &googleapi.Error{
  8998. Code: res.StatusCode,
  8999. Header: res.Header,
  9000. }
  9001. }
  9002. if err != nil {
  9003. return nil, err
  9004. }
  9005. defer googleapi.CloseBody(res)
  9006. if err := googleapi.CheckResponse(res); err != nil {
  9007. return nil, err
  9008. }
  9009. ret := &TurnBasedMatch{
  9010. ServerResponse: googleapi.ServerResponse{
  9011. Header: res.Header,
  9012. HTTPStatusCode: res.StatusCode,
  9013. },
  9014. }
  9015. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9016. return nil, err
  9017. }
  9018. return ret, nil
  9019. // {
  9020. // "description": "Create a turn-based match.",
  9021. // "httpMethod": "POST",
  9022. // "id": "games.turnBasedMatches.create",
  9023. // "parameters": {
  9024. // "language": {
  9025. // "description": "The preferred language to use for strings returned by this method.",
  9026. // "location": "query",
  9027. // "type": "string"
  9028. // }
  9029. // },
  9030. // "path": "turnbasedmatches/create",
  9031. // "request": {
  9032. // "$ref": "TurnBasedMatchCreateRequest"
  9033. // },
  9034. // "response": {
  9035. // "$ref": "TurnBasedMatch"
  9036. // },
  9037. // "scopes": [
  9038. // "https://www.googleapis.com/auth/games",
  9039. // "https://www.googleapis.com/auth/plus.login"
  9040. // ]
  9041. // }
  9042. }
  9043. // method id "games.turnBasedMatches.decline":
  9044. type TurnBasedMatchesDeclineCall struct {
  9045. s *Service
  9046. matchId string
  9047. urlParams_ gensupport.URLParams
  9048. ctx_ context.Context
  9049. }
  9050. // Decline: Decline an invitation to play a turn-based match.
  9051. func (r *TurnBasedMatchesService) Decline(matchId string) *TurnBasedMatchesDeclineCall {
  9052. c := &TurnBasedMatchesDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9053. c.matchId = matchId
  9054. return c
  9055. }
  9056. // Language sets the optional parameter "language": The preferred
  9057. // language to use for strings returned by this method.
  9058. func (c *TurnBasedMatchesDeclineCall) Language(language string) *TurnBasedMatchesDeclineCall {
  9059. c.urlParams_.Set("language", language)
  9060. return c
  9061. }
  9062. // Fields allows partial responses to be retrieved. See
  9063. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9064. // for more information.
  9065. func (c *TurnBasedMatchesDeclineCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDeclineCall {
  9066. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9067. return c
  9068. }
  9069. // Context sets the context to be used in this call's Do method. Any
  9070. // pending HTTP request will be aborted if the provided context is
  9071. // canceled.
  9072. func (c *TurnBasedMatchesDeclineCall) Context(ctx context.Context) *TurnBasedMatchesDeclineCall {
  9073. c.ctx_ = ctx
  9074. return c
  9075. }
  9076. func (c *TurnBasedMatchesDeclineCall) doRequest(alt string) (*http.Response, error) {
  9077. var body io.Reader = nil
  9078. c.urlParams_.Set("alt", alt)
  9079. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/decline")
  9080. urls += "?" + c.urlParams_.Encode()
  9081. req, _ := http.NewRequest("PUT", urls, body)
  9082. googleapi.Expand(req.URL, map[string]string{
  9083. "matchId": c.matchId,
  9084. })
  9085. req.Header.Set("User-Agent", c.s.userAgent())
  9086. if c.ctx_ != nil {
  9087. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9088. }
  9089. return c.s.client.Do(req)
  9090. }
  9091. // Do executes the "games.turnBasedMatches.decline" call.
  9092. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  9093. // status code is an error. Response headers are in either
  9094. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  9095. // at all) in error.(*googleapi.Error).Header. Use
  9096. // googleapi.IsNotModified to check whether the returned error was
  9097. // because http.StatusNotModified was returned.
  9098. func (c *TurnBasedMatchesDeclineCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  9099. gensupport.SetOptions(c.urlParams_, opts...)
  9100. res, err := c.doRequest("json")
  9101. if res != nil && res.StatusCode == http.StatusNotModified {
  9102. if res.Body != nil {
  9103. res.Body.Close()
  9104. }
  9105. return nil, &googleapi.Error{
  9106. Code: res.StatusCode,
  9107. Header: res.Header,
  9108. }
  9109. }
  9110. if err != nil {
  9111. return nil, err
  9112. }
  9113. defer googleapi.CloseBody(res)
  9114. if err := googleapi.CheckResponse(res); err != nil {
  9115. return nil, err
  9116. }
  9117. ret := &TurnBasedMatch{
  9118. ServerResponse: googleapi.ServerResponse{
  9119. Header: res.Header,
  9120. HTTPStatusCode: res.StatusCode,
  9121. },
  9122. }
  9123. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9124. return nil, err
  9125. }
  9126. return ret, nil
  9127. // {
  9128. // "description": "Decline an invitation to play a turn-based match.",
  9129. // "httpMethod": "PUT",
  9130. // "id": "games.turnBasedMatches.decline",
  9131. // "parameterOrder": [
  9132. // "matchId"
  9133. // ],
  9134. // "parameters": {
  9135. // "language": {
  9136. // "description": "The preferred language to use for strings returned by this method.",
  9137. // "location": "query",
  9138. // "type": "string"
  9139. // },
  9140. // "matchId": {
  9141. // "description": "The ID of the match.",
  9142. // "location": "path",
  9143. // "required": true,
  9144. // "type": "string"
  9145. // }
  9146. // },
  9147. // "path": "turnbasedmatches/{matchId}/decline",
  9148. // "response": {
  9149. // "$ref": "TurnBasedMatch"
  9150. // },
  9151. // "scopes": [
  9152. // "https://www.googleapis.com/auth/games",
  9153. // "https://www.googleapis.com/auth/plus.login"
  9154. // ]
  9155. // }
  9156. }
  9157. // method id "games.turnBasedMatches.dismiss":
  9158. type TurnBasedMatchesDismissCall struct {
  9159. s *Service
  9160. matchId string
  9161. urlParams_ gensupport.URLParams
  9162. ctx_ context.Context
  9163. }
  9164. // Dismiss: Dismiss a turn-based match from the match list. The match
  9165. // will no longer show up in the list and will not generate
  9166. // notifications.
  9167. func (r *TurnBasedMatchesService) Dismiss(matchId string) *TurnBasedMatchesDismissCall {
  9168. c := &TurnBasedMatchesDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9169. c.matchId = matchId
  9170. return c
  9171. }
  9172. // Fields allows partial responses to be retrieved. See
  9173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9174. // for more information.
  9175. func (c *TurnBasedMatchesDismissCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDismissCall {
  9176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9177. return c
  9178. }
  9179. // Context sets the context to be used in this call's Do method. Any
  9180. // pending HTTP request will be aborted if the provided context is
  9181. // canceled.
  9182. func (c *TurnBasedMatchesDismissCall) Context(ctx context.Context) *TurnBasedMatchesDismissCall {
  9183. c.ctx_ = ctx
  9184. return c
  9185. }
  9186. func (c *TurnBasedMatchesDismissCall) doRequest(alt string) (*http.Response, error) {
  9187. var body io.Reader = nil
  9188. c.urlParams_.Set("alt", alt)
  9189. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/dismiss")
  9190. urls += "?" + c.urlParams_.Encode()
  9191. req, _ := http.NewRequest("PUT", urls, body)
  9192. googleapi.Expand(req.URL, map[string]string{
  9193. "matchId": c.matchId,
  9194. })
  9195. req.Header.Set("User-Agent", c.s.userAgent())
  9196. if c.ctx_ != nil {
  9197. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9198. }
  9199. return c.s.client.Do(req)
  9200. }
  9201. // Do executes the "games.turnBasedMatches.dismiss" call.
  9202. func (c *TurnBasedMatchesDismissCall) Do(opts ...googleapi.CallOption) error {
  9203. gensupport.SetOptions(c.urlParams_, opts...)
  9204. res, err := c.doRequest("json")
  9205. if err != nil {
  9206. return err
  9207. }
  9208. defer googleapi.CloseBody(res)
  9209. if err := googleapi.CheckResponse(res); err != nil {
  9210. return err
  9211. }
  9212. return nil
  9213. // {
  9214. // "description": "Dismiss a turn-based match from the match list. The match will no longer show up in the list and will not generate notifications.",
  9215. // "httpMethod": "PUT",
  9216. // "id": "games.turnBasedMatches.dismiss",
  9217. // "parameterOrder": [
  9218. // "matchId"
  9219. // ],
  9220. // "parameters": {
  9221. // "matchId": {
  9222. // "description": "The ID of the match.",
  9223. // "location": "path",
  9224. // "required": true,
  9225. // "type": "string"
  9226. // }
  9227. // },
  9228. // "path": "turnbasedmatches/{matchId}/dismiss",
  9229. // "scopes": [
  9230. // "https://www.googleapis.com/auth/games",
  9231. // "https://www.googleapis.com/auth/plus.login"
  9232. // ]
  9233. // }
  9234. }
  9235. // method id "games.turnBasedMatches.finish":
  9236. type TurnBasedMatchesFinishCall struct {
  9237. s *Service
  9238. matchId string
  9239. turnbasedmatchresults *TurnBasedMatchResults
  9240. urlParams_ gensupport.URLParams
  9241. ctx_ context.Context
  9242. }
  9243. // Finish: Finish a turn-based match. Each player should make this call
  9244. // once, after all results are in. Only the player whose turn it is may
  9245. // make the first call to Finish, and can pass in the final match state.
  9246. func (r *TurnBasedMatchesService) Finish(matchId string, turnbasedmatchresults *TurnBasedMatchResults) *TurnBasedMatchesFinishCall {
  9247. c := &TurnBasedMatchesFinishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9248. c.matchId = matchId
  9249. c.turnbasedmatchresults = turnbasedmatchresults
  9250. return c
  9251. }
  9252. // Language sets the optional parameter "language": The preferred
  9253. // language to use for strings returned by this method.
  9254. func (c *TurnBasedMatchesFinishCall) Language(language string) *TurnBasedMatchesFinishCall {
  9255. c.urlParams_.Set("language", language)
  9256. return c
  9257. }
  9258. // Fields allows partial responses to be retrieved. See
  9259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9260. // for more information.
  9261. func (c *TurnBasedMatchesFinishCall) Fields(s ...googleapi.Field) *TurnBasedMatchesFinishCall {
  9262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9263. return c
  9264. }
  9265. // Context sets the context to be used in this call's Do method. Any
  9266. // pending HTTP request will be aborted if the provided context is
  9267. // canceled.
  9268. func (c *TurnBasedMatchesFinishCall) Context(ctx context.Context) *TurnBasedMatchesFinishCall {
  9269. c.ctx_ = ctx
  9270. return c
  9271. }
  9272. func (c *TurnBasedMatchesFinishCall) doRequest(alt string) (*http.Response, error) {
  9273. var body io.Reader = nil
  9274. body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchresults)
  9275. if err != nil {
  9276. return nil, err
  9277. }
  9278. ctype := "application/json"
  9279. c.urlParams_.Set("alt", alt)
  9280. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/finish")
  9281. urls += "?" + c.urlParams_.Encode()
  9282. req, _ := http.NewRequest("PUT", urls, body)
  9283. googleapi.Expand(req.URL, map[string]string{
  9284. "matchId": c.matchId,
  9285. })
  9286. req.Header.Set("Content-Type", ctype)
  9287. req.Header.Set("User-Agent", c.s.userAgent())
  9288. if c.ctx_ != nil {
  9289. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9290. }
  9291. return c.s.client.Do(req)
  9292. }
  9293. // Do executes the "games.turnBasedMatches.finish" call.
  9294. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  9295. // status code is an error. Response headers are in either
  9296. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  9297. // at all) in error.(*googleapi.Error).Header. Use
  9298. // googleapi.IsNotModified to check whether the returned error was
  9299. // because http.StatusNotModified was returned.
  9300. func (c *TurnBasedMatchesFinishCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  9301. gensupport.SetOptions(c.urlParams_, opts...)
  9302. res, err := c.doRequest("json")
  9303. if res != nil && res.StatusCode == http.StatusNotModified {
  9304. if res.Body != nil {
  9305. res.Body.Close()
  9306. }
  9307. return nil, &googleapi.Error{
  9308. Code: res.StatusCode,
  9309. Header: res.Header,
  9310. }
  9311. }
  9312. if err != nil {
  9313. return nil, err
  9314. }
  9315. defer googleapi.CloseBody(res)
  9316. if err := googleapi.CheckResponse(res); err != nil {
  9317. return nil, err
  9318. }
  9319. ret := &TurnBasedMatch{
  9320. ServerResponse: googleapi.ServerResponse{
  9321. Header: res.Header,
  9322. HTTPStatusCode: res.StatusCode,
  9323. },
  9324. }
  9325. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9326. return nil, err
  9327. }
  9328. return ret, nil
  9329. // {
  9330. // "description": "Finish a turn-based match. Each player should make this call once, after all results are in. Only the player whose turn it is may make the first call to Finish, and can pass in the final match state.",
  9331. // "httpMethod": "PUT",
  9332. // "id": "games.turnBasedMatches.finish",
  9333. // "parameterOrder": [
  9334. // "matchId"
  9335. // ],
  9336. // "parameters": {
  9337. // "language": {
  9338. // "description": "The preferred language to use for strings returned by this method.",
  9339. // "location": "query",
  9340. // "type": "string"
  9341. // },
  9342. // "matchId": {
  9343. // "description": "The ID of the match.",
  9344. // "location": "path",
  9345. // "required": true,
  9346. // "type": "string"
  9347. // }
  9348. // },
  9349. // "path": "turnbasedmatches/{matchId}/finish",
  9350. // "request": {
  9351. // "$ref": "TurnBasedMatchResults"
  9352. // },
  9353. // "response": {
  9354. // "$ref": "TurnBasedMatch"
  9355. // },
  9356. // "scopes": [
  9357. // "https://www.googleapis.com/auth/games",
  9358. // "https://www.googleapis.com/auth/plus.login"
  9359. // ]
  9360. // }
  9361. }
  9362. // method id "games.turnBasedMatches.get":
  9363. type TurnBasedMatchesGetCall struct {
  9364. s *Service
  9365. matchId string
  9366. urlParams_ gensupport.URLParams
  9367. ifNoneMatch_ string
  9368. ctx_ context.Context
  9369. }
  9370. // Get: Get the data for a turn-based match.
  9371. func (r *TurnBasedMatchesService) Get(matchId string) *TurnBasedMatchesGetCall {
  9372. c := &TurnBasedMatchesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9373. c.matchId = matchId
  9374. return c
  9375. }
  9376. // IncludeMatchData sets the optional parameter "includeMatchData": Get
  9377. // match data along with metadata.
  9378. func (c *TurnBasedMatchesGetCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesGetCall {
  9379. c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData))
  9380. return c
  9381. }
  9382. // Language sets the optional parameter "language": The preferred
  9383. // language to use for strings returned by this method.
  9384. func (c *TurnBasedMatchesGetCall) Language(language string) *TurnBasedMatchesGetCall {
  9385. c.urlParams_.Set("language", language)
  9386. return c
  9387. }
  9388. // Fields allows partial responses to be retrieved. See
  9389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9390. // for more information.
  9391. func (c *TurnBasedMatchesGetCall) Fields(s ...googleapi.Field) *TurnBasedMatchesGetCall {
  9392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9393. return c
  9394. }
  9395. // IfNoneMatch sets the optional parameter which makes the operation
  9396. // fail if the object's ETag matches the given value. This is useful for
  9397. // getting updates only after the object has changed since the last
  9398. // request. Use googleapi.IsNotModified to check whether the response
  9399. // error from Do is the result of In-None-Match.
  9400. func (c *TurnBasedMatchesGetCall) IfNoneMatch(entityTag string) *TurnBasedMatchesGetCall {
  9401. c.ifNoneMatch_ = entityTag
  9402. return c
  9403. }
  9404. // Context sets the context to be used in this call's Do method. Any
  9405. // pending HTTP request will be aborted if the provided context is
  9406. // canceled.
  9407. func (c *TurnBasedMatchesGetCall) Context(ctx context.Context) *TurnBasedMatchesGetCall {
  9408. c.ctx_ = ctx
  9409. return c
  9410. }
  9411. func (c *TurnBasedMatchesGetCall) doRequest(alt string) (*http.Response, error) {
  9412. var body io.Reader = nil
  9413. c.urlParams_.Set("alt", alt)
  9414. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}")
  9415. urls += "?" + c.urlParams_.Encode()
  9416. req, _ := http.NewRequest("GET", urls, body)
  9417. googleapi.Expand(req.URL, map[string]string{
  9418. "matchId": c.matchId,
  9419. })
  9420. req.Header.Set("User-Agent", c.s.userAgent())
  9421. if c.ifNoneMatch_ != "" {
  9422. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9423. }
  9424. if c.ctx_ != nil {
  9425. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9426. }
  9427. return c.s.client.Do(req)
  9428. }
  9429. // Do executes the "games.turnBasedMatches.get" call.
  9430. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  9431. // status code is an error. Response headers are in either
  9432. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  9433. // at all) in error.(*googleapi.Error).Header. Use
  9434. // googleapi.IsNotModified to check whether the returned error was
  9435. // because http.StatusNotModified was returned.
  9436. func (c *TurnBasedMatchesGetCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, 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 := &TurnBasedMatch{
  9456. ServerResponse: googleapi.ServerResponse{
  9457. Header: res.Header,
  9458. HTTPStatusCode: res.StatusCode,
  9459. },
  9460. }
  9461. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9462. return nil, err
  9463. }
  9464. return ret, nil
  9465. // {
  9466. // "description": "Get the data for a turn-based match.",
  9467. // "httpMethod": "GET",
  9468. // "id": "games.turnBasedMatches.get",
  9469. // "parameterOrder": [
  9470. // "matchId"
  9471. // ],
  9472. // "parameters": {
  9473. // "includeMatchData": {
  9474. // "description": "Get match data along with metadata.",
  9475. // "location": "query",
  9476. // "type": "boolean"
  9477. // },
  9478. // "language": {
  9479. // "description": "The preferred language to use for strings returned by this method.",
  9480. // "location": "query",
  9481. // "type": "string"
  9482. // },
  9483. // "matchId": {
  9484. // "description": "The ID of the match.",
  9485. // "location": "path",
  9486. // "required": true,
  9487. // "type": "string"
  9488. // }
  9489. // },
  9490. // "path": "turnbasedmatches/{matchId}",
  9491. // "response": {
  9492. // "$ref": "TurnBasedMatch"
  9493. // },
  9494. // "scopes": [
  9495. // "https://www.googleapis.com/auth/games",
  9496. // "https://www.googleapis.com/auth/plus.login"
  9497. // ]
  9498. // }
  9499. }
  9500. // method id "games.turnBasedMatches.join":
  9501. type TurnBasedMatchesJoinCall struct {
  9502. s *Service
  9503. matchId string
  9504. urlParams_ gensupport.URLParams
  9505. ctx_ context.Context
  9506. }
  9507. // Join: Join a turn-based match.
  9508. func (r *TurnBasedMatchesService) Join(matchId string) *TurnBasedMatchesJoinCall {
  9509. c := &TurnBasedMatchesJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9510. c.matchId = matchId
  9511. return c
  9512. }
  9513. // Language sets the optional parameter "language": The preferred
  9514. // language to use for strings returned by this method.
  9515. func (c *TurnBasedMatchesJoinCall) Language(language string) *TurnBasedMatchesJoinCall {
  9516. c.urlParams_.Set("language", language)
  9517. return c
  9518. }
  9519. // Fields allows partial responses to be retrieved. See
  9520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9521. // for more information.
  9522. func (c *TurnBasedMatchesJoinCall) Fields(s ...googleapi.Field) *TurnBasedMatchesJoinCall {
  9523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9524. return c
  9525. }
  9526. // Context sets the context to be used in this call's Do method. Any
  9527. // pending HTTP request will be aborted if the provided context is
  9528. // canceled.
  9529. func (c *TurnBasedMatchesJoinCall) Context(ctx context.Context) *TurnBasedMatchesJoinCall {
  9530. c.ctx_ = ctx
  9531. return c
  9532. }
  9533. func (c *TurnBasedMatchesJoinCall) doRequest(alt string) (*http.Response, error) {
  9534. var body io.Reader = nil
  9535. c.urlParams_.Set("alt", alt)
  9536. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/join")
  9537. urls += "?" + c.urlParams_.Encode()
  9538. req, _ := http.NewRequest("PUT", urls, body)
  9539. googleapi.Expand(req.URL, map[string]string{
  9540. "matchId": c.matchId,
  9541. })
  9542. req.Header.Set("User-Agent", c.s.userAgent())
  9543. if c.ctx_ != nil {
  9544. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9545. }
  9546. return c.s.client.Do(req)
  9547. }
  9548. // Do executes the "games.turnBasedMatches.join" call.
  9549. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  9550. // status code is an error. Response headers are in either
  9551. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  9552. // at all) in error.(*googleapi.Error).Header. Use
  9553. // googleapi.IsNotModified to check whether the returned error was
  9554. // because http.StatusNotModified was returned.
  9555. func (c *TurnBasedMatchesJoinCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  9556. gensupport.SetOptions(c.urlParams_, opts...)
  9557. res, err := c.doRequest("json")
  9558. if res != nil && res.StatusCode == http.StatusNotModified {
  9559. if res.Body != nil {
  9560. res.Body.Close()
  9561. }
  9562. return nil, &googleapi.Error{
  9563. Code: res.StatusCode,
  9564. Header: res.Header,
  9565. }
  9566. }
  9567. if err != nil {
  9568. return nil, err
  9569. }
  9570. defer googleapi.CloseBody(res)
  9571. if err := googleapi.CheckResponse(res); err != nil {
  9572. return nil, err
  9573. }
  9574. ret := &TurnBasedMatch{
  9575. ServerResponse: googleapi.ServerResponse{
  9576. Header: res.Header,
  9577. HTTPStatusCode: res.StatusCode,
  9578. },
  9579. }
  9580. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9581. return nil, err
  9582. }
  9583. return ret, nil
  9584. // {
  9585. // "description": "Join a turn-based match.",
  9586. // "httpMethod": "PUT",
  9587. // "id": "games.turnBasedMatches.join",
  9588. // "parameterOrder": [
  9589. // "matchId"
  9590. // ],
  9591. // "parameters": {
  9592. // "language": {
  9593. // "description": "The preferred language to use for strings returned by this method.",
  9594. // "location": "query",
  9595. // "type": "string"
  9596. // },
  9597. // "matchId": {
  9598. // "description": "The ID of the match.",
  9599. // "location": "path",
  9600. // "required": true,
  9601. // "type": "string"
  9602. // }
  9603. // },
  9604. // "path": "turnbasedmatches/{matchId}/join",
  9605. // "response": {
  9606. // "$ref": "TurnBasedMatch"
  9607. // },
  9608. // "scopes": [
  9609. // "https://www.googleapis.com/auth/games",
  9610. // "https://www.googleapis.com/auth/plus.login"
  9611. // ]
  9612. // }
  9613. }
  9614. // method id "games.turnBasedMatches.leave":
  9615. type TurnBasedMatchesLeaveCall struct {
  9616. s *Service
  9617. matchId string
  9618. urlParams_ gensupport.URLParams
  9619. ctx_ context.Context
  9620. }
  9621. // Leave: Leave a turn-based match when it is not the current player's
  9622. // turn, without canceling the match.
  9623. func (r *TurnBasedMatchesService) Leave(matchId string) *TurnBasedMatchesLeaveCall {
  9624. c := &TurnBasedMatchesLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9625. c.matchId = matchId
  9626. return c
  9627. }
  9628. // Language sets the optional parameter "language": The preferred
  9629. // language to use for strings returned by this method.
  9630. func (c *TurnBasedMatchesLeaveCall) Language(language string) *TurnBasedMatchesLeaveCall {
  9631. c.urlParams_.Set("language", language)
  9632. return c
  9633. }
  9634. // Fields allows partial responses to be retrieved. See
  9635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9636. // for more information.
  9637. func (c *TurnBasedMatchesLeaveCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveCall {
  9638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9639. return c
  9640. }
  9641. // Context sets the context to be used in this call's Do method. Any
  9642. // pending HTTP request will be aborted if the provided context is
  9643. // canceled.
  9644. func (c *TurnBasedMatchesLeaveCall) Context(ctx context.Context) *TurnBasedMatchesLeaveCall {
  9645. c.ctx_ = ctx
  9646. return c
  9647. }
  9648. func (c *TurnBasedMatchesLeaveCall) doRequest(alt string) (*http.Response, error) {
  9649. var body io.Reader = nil
  9650. c.urlParams_.Set("alt", alt)
  9651. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leave")
  9652. urls += "?" + c.urlParams_.Encode()
  9653. req, _ := http.NewRequest("PUT", urls, body)
  9654. googleapi.Expand(req.URL, map[string]string{
  9655. "matchId": c.matchId,
  9656. })
  9657. req.Header.Set("User-Agent", c.s.userAgent())
  9658. if c.ctx_ != nil {
  9659. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9660. }
  9661. return c.s.client.Do(req)
  9662. }
  9663. // Do executes the "games.turnBasedMatches.leave" call.
  9664. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  9665. // status code is an error. Response headers are in either
  9666. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  9667. // at all) in error.(*googleapi.Error).Header. Use
  9668. // googleapi.IsNotModified to check whether the returned error was
  9669. // because http.StatusNotModified was returned.
  9670. func (c *TurnBasedMatchesLeaveCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  9671. gensupport.SetOptions(c.urlParams_, opts...)
  9672. res, err := c.doRequest("json")
  9673. if res != nil && res.StatusCode == http.StatusNotModified {
  9674. if res.Body != nil {
  9675. res.Body.Close()
  9676. }
  9677. return nil, &googleapi.Error{
  9678. Code: res.StatusCode,
  9679. Header: res.Header,
  9680. }
  9681. }
  9682. if err != nil {
  9683. return nil, err
  9684. }
  9685. defer googleapi.CloseBody(res)
  9686. if err := googleapi.CheckResponse(res); err != nil {
  9687. return nil, err
  9688. }
  9689. ret := &TurnBasedMatch{
  9690. ServerResponse: googleapi.ServerResponse{
  9691. Header: res.Header,
  9692. HTTPStatusCode: res.StatusCode,
  9693. },
  9694. }
  9695. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9696. return nil, err
  9697. }
  9698. return ret, nil
  9699. // {
  9700. // "description": "Leave a turn-based match when it is not the current player's turn, without canceling the match.",
  9701. // "httpMethod": "PUT",
  9702. // "id": "games.turnBasedMatches.leave",
  9703. // "parameterOrder": [
  9704. // "matchId"
  9705. // ],
  9706. // "parameters": {
  9707. // "language": {
  9708. // "description": "The preferred language to use for strings returned by this method.",
  9709. // "location": "query",
  9710. // "type": "string"
  9711. // },
  9712. // "matchId": {
  9713. // "description": "The ID of the match.",
  9714. // "location": "path",
  9715. // "required": true,
  9716. // "type": "string"
  9717. // }
  9718. // },
  9719. // "path": "turnbasedmatches/{matchId}/leave",
  9720. // "response": {
  9721. // "$ref": "TurnBasedMatch"
  9722. // },
  9723. // "scopes": [
  9724. // "https://www.googleapis.com/auth/games",
  9725. // "https://www.googleapis.com/auth/plus.login"
  9726. // ]
  9727. // }
  9728. }
  9729. // method id "games.turnBasedMatches.leaveTurn":
  9730. type TurnBasedMatchesLeaveTurnCall struct {
  9731. s *Service
  9732. matchId string
  9733. urlParams_ gensupport.URLParams
  9734. ctx_ context.Context
  9735. }
  9736. // LeaveTurn: Leave a turn-based match during the current player's turn,
  9737. // without canceling the match.
  9738. func (r *TurnBasedMatchesService) LeaveTurn(matchId string, matchVersion int64) *TurnBasedMatchesLeaveTurnCall {
  9739. c := &TurnBasedMatchesLeaveTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9740. c.matchId = matchId
  9741. c.urlParams_.Set("matchVersion", fmt.Sprint(matchVersion))
  9742. return c
  9743. }
  9744. // Language sets the optional parameter "language": The preferred
  9745. // language to use for strings returned by this method.
  9746. func (c *TurnBasedMatchesLeaveTurnCall) Language(language string) *TurnBasedMatchesLeaveTurnCall {
  9747. c.urlParams_.Set("language", language)
  9748. return c
  9749. }
  9750. // PendingParticipantId sets the optional parameter
  9751. // "pendingParticipantId": The ID of another participant who should take
  9752. // their turn next. If not set, the match will wait for other player(s)
  9753. // to join via automatching; this is only valid if automatch criteria is
  9754. // set on the match with remaining slots for automatched players.
  9755. func (c *TurnBasedMatchesLeaveTurnCall) PendingParticipantId(pendingParticipantId string) *TurnBasedMatchesLeaveTurnCall {
  9756. c.urlParams_.Set("pendingParticipantId", pendingParticipantId)
  9757. return c
  9758. }
  9759. // Fields allows partial responses to be retrieved. See
  9760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9761. // for more information.
  9762. func (c *TurnBasedMatchesLeaveTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveTurnCall {
  9763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9764. return c
  9765. }
  9766. // Context sets the context to be used in this call's Do method. Any
  9767. // pending HTTP request will be aborted if the provided context is
  9768. // canceled.
  9769. func (c *TurnBasedMatchesLeaveTurnCall) Context(ctx context.Context) *TurnBasedMatchesLeaveTurnCall {
  9770. c.ctx_ = ctx
  9771. return c
  9772. }
  9773. func (c *TurnBasedMatchesLeaveTurnCall) doRequest(alt string) (*http.Response, error) {
  9774. var body io.Reader = nil
  9775. c.urlParams_.Set("alt", alt)
  9776. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leaveTurn")
  9777. urls += "?" + c.urlParams_.Encode()
  9778. req, _ := http.NewRequest("PUT", urls, body)
  9779. googleapi.Expand(req.URL, map[string]string{
  9780. "matchId": c.matchId,
  9781. })
  9782. req.Header.Set("User-Agent", c.s.userAgent())
  9783. if c.ctx_ != nil {
  9784. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9785. }
  9786. return c.s.client.Do(req)
  9787. }
  9788. // Do executes the "games.turnBasedMatches.leaveTurn" call.
  9789. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  9790. // status code is an error. Response headers are in either
  9791. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  9792. // at all) in error.(*googleapi.Error).Header. Use
  9793. // googleapi.IsNotModified to check whether the returned error was
  9794. // because http.StatusNotModified was returned.
  9795. func (c *TurnBasedMatchesLeaveTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  9796. gensupport.SetOptions(c.urlParams_, opts...)
  9797. res, err := c.doRequest("json")
  9798. if res != nil && res.StatusCode == http.StatusNotModified {
  9799. if res.Body != nil {
  9800. res.Body.Close()
  9801. }
  9802. return nil, &googleapi.Error{
  9803. Code: res.StatusCode,
  9804. Header: res.Header,
  9805. }
  9806. }
  9807. if err != nil {
  9808. return nil, err
  9809. }
  9810. defer googleapi.CloseBody(res)
  9811. if err := googleapi.CheckResponse(res); err != nil {
  9812. return nil, err
  9813. }
  9814. ret := &TurnBasedMatch{
  9815. ServerResponse: googleapi.ServerResponse{
  9816. Header: res.Header,
  9817. HTTPStatusCode: res.StatusCode,
  9818. },
  9819. }
  9820. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9821. return nil, err
  9822. }
  9823. return ret, nil
  9824. // {
  9825. // "description": "Leave a turn-based match during the current player's turn, without canceling the match.",
  9826. // "httpMethod": "PUT",
  9827. // "id": "games.turnBasedMatches.leaveTurn",
  9828. // "parameterOrder": [
  9829. // "matchId",
  9830. // "matchVersion"
  9831. // ],
  9832. // "parameters": {
  9833. // "language": {
  9834. // "description": "The preferred language to use for strings returned by this method.",
  9835. // "location": "query",
  9836. // "type": "string"
  9837. // },
  9838. // "matchId": {
  9839. // "description": "The ID of the match.",
  9840. // "location": "path",
  9841. // "required": true,
  9842. // "type": "string"
  9843. // },
  9844. // "matchVersion": {
  9845. // "description": "The version of the match being updated.",
  9846. // "format": "int32",
  9847. // "location": "query",
  9848. // "required": true,
  9849. // "type": "integer"
  9850. // },
  9851. // "pendingParticipantId": {
  9852. // "description": "The ID of another participant who should take their turn next. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players.",
  9853. // "location": "query",
  9854. // "type": "string"
  9855. // }
  9856. // },
  9857. // "path": "turnbasedmatches/{matchId}/leaveTurn",
  9858. // "response": {
  9859. // "$ref": "TurnBasedMatch"
  9860. // },
  9861. // "scopes": [
  9862. // "https://www.googleapis.com/auth/games",
  9863. // "https://www.googleapis.com/auth/plus.login"
  9864. // ]
  9865. // }
  9866. }
  9867. // method id "games.turnBasedMatches.list":
  9868. type TurnBasedMatchesListCall struct {
  9869. s *Service
  9870. urlParams_ gensupport.URLParams
  9871. ifNoneMatch_ string
  9872. ctx_ context.Context
  9873. }
  9874. // List: Returns turn-based matches the player is or was involved in.
  9875. func (r *TurnBasedMatchesService) List() *TurnBasedMatchesListCall {
  9876. c := &TurnBasedMatchesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9877. return c
  9878. }
  9879. // IncludeMatchData sets the optional parameter "includeMatchData": True
  9880. // if match data should be returned in the response. Note that not all
  9881. // data will necessarily be returned if include_match_data is true; the
  9882. // server may decide to only return data for some of the matches to
  9883. // limit download size for the client. The remainder of the data for
  9884. // these matches will be retrievable on request.
  9885. func (c *TurnBasedMatchesListCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesListCall {
  9886. c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData))
  9887. return c
  9888. }
  9889. // Language sets the optional parameter "language": The preferred
  9890. // language to use for strings returned by this method.
  9891. func (c *TurnBasedMatchesListCall) Language(language string) *TurnBasedMatchesListCall {
  9892. c.urlParams_.Set("language", language)
  9893. return c
  9894. }
  9895. // MaxCompletedMatches sets the optional parameter
  9896. // "maxCompletedMatches": The maximum number of completed or canceled
  9897. // matches to return in the response. If not set, all matches returned
  9898. // could be completed or canceled.
  9899. func (c *TurnBasedMatchesListCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesListCall {
  9900. c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches))
  9901. return c
  9902. }
  9903. // MaxResults sets the optional parameter "maxResults": The maximum
  9904. // number of matches to return in the response, used for paging. For any
  9905. // response, the actual number of matches to return may be less than the
  9906. // specified maxResults.
  9907. func (c *TurnBasedMatchesListCall) MaxResults(maxResults int64) *TurnBasedMatchesListCall {
  9908. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9909. return c
  9910. }
  9911. // PageToken sets the optional parameter "pageToken": The token returned
  9912. // by the previous request.
  9913. func (c *TurnBasedMatchesListCall) PageToken(pageToken string) *TurnBasedMatchesListCall {
  9914. c.urlParams_.Set("pageToken", pageToken)
  9915. return c
  9916. }
  9917. // Fields allows partial responses to be retrieved. See
  9918. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9919. // for more information.
  9920. func (c *TurnBasedMatchesListCall) Fields(s ...googleapi.Field) *TurnBasedMatchesListCall {
  9921. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9922. return c
  9923. }
  9924. // IfNoneMatch sets the optional parameter which makes the operation
  9925. // fail if the object's ETag matches the given value. This is useful for
  9926. // getting updates only after the object has changed since the last
  9927. // request. Use googleapi.IsNotModified to check whether the response
  9928. // error from Do is the result of In-None-Match.
  9929. func (c *TurnBasedMatchesListCall) IfNoneMatch(entityTag string) *TurnBasedMatchesListCall {
  9930. c.ifNoneMatch_ = entityTag
  9931. return c
  9932. }
  9933. // Context sets the context to be used in this call's Do method. Any
  9934. // pending HTTP request will be aborted if the provided context is
  9935. // canceled.
  9936. func (c *TurnBasedMatchesListCall) Context(ctx context.Context) *TurnBasedMatchesListCall {
  9937. c.ctx_ = ctx
  9938. return c
  9939. }
  9940. func (c *TurnBasedMatchesListCall) doRequest(alt string) (*http.Response, error) {
  9941. var body io.Reader = nil
  9942. c.urlParams_.Set("alt", alt)
  9943. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches")
  9944. urls += "?" + c.urlParams_.Encode()
  9945. req, _ := http.NewRequest("GET", urls, body)
  9946. googleapi.SetOpaque(req.URL)
  9947. req.Header.Set("User-Agent", c.s.userAgent())
  9948. if c.ifNoneMatch_ != "" {
  9949. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9950. }
  9951. if c.ctx_ != nil {
  9952. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9953. }
  9954. return c.s.client.Do(req)
  9955. }
  9956. // Do executes the "games.turnBasedMatches.list" call.
  9957. // Exactly one of *TurnBasedMatchList or error will be non-nil. Any
  9958. // non-2xx status code is an error. Response headers are in either
  9959. // *TurnBasedMatchList.ServerResponse.Header or (if a response was
  9960. // returned at all) in error.(*googleapi.Error).Header. Use
  9961. // googleapi.IsNotModified to check whether the returned error was
  9962. // because http.StatusNotModified was returned.
  9963. func (c *TurnBasedMatchesListCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchList, error) {
  9964. gensupport.SetOptions(c.urlParams_, opts...)
  9965. res, err := c.doRequest("json")
  9966. if res != nil && res.StatusCode == http.StatusNotModified {
  9967. if res.Body != nil {
  9968. res.Body.Close()
  9969. }
  9970. return nil, &googleapi.Error{
  9971. Code: res.StatusCode,
  9972. Header: res.Header,
  9973. }
  9974. }
  9975. if err != nil {
  9976. return nil, err
  9977. }
  9978. defer googleapi.CloseBody(res)
  9979. if err := googleapi.CheckResponse(res); err != nil {
  9980. return nil, err
  9981. }
  9982. ret := &TurnBasedMatchList{
  9983. ServerResponse: googleapi.ServerResponse{
  9984. Header: res.Header,
  9985. HTTPStatusCode: res.StatusCode,
  9986. },
  9987. }
  9988. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9989. return nil, err
  9990. }
  9991. return ret, nil
  9992. // {
  9993. // "description": "Returns turn-based matches the player is or was involved in.",
  9994. // "httpMethod": "GET",
  9995. // "id": "games.turnBasedMatches.list",
  9996. // "parameters": {
  9997. // "includeMatchData": {
  9998. // "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.",
  9999. // "location": "query",
  10000. // "type": "boolean"
  10001. // },
  10002. // "language": {
  10003. // "description": "The preferred language to use for strings returned by this method.",
  10004. // "location": "query",
  10005. // "type": "string"
  10006. // },
  10007. // "maxCompletedMatches": {
  10008. // "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.",
  10009. // "format": "int32",
  10010. // "location": "query",
  10011. // "maximum": "500",
  10012. // "minimum": "0",
  10013. // "type": "integer"
  10014. // },
  10015. // "maxResults": {
  10016. // "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.",
  10017. // "format": "int32",
  10018. // "location": "query",
  10019. // "maximum": "500",
  10020. // "minimum": "1",
  10021. // "type": "integer"
  10022. // },
  10023. // "pageToken": {
  10024. // "description": "The token returned by the previous request.",
  10025. // "location": "query",
  10026. // "type": "string"
  10027. // }
  10028. // },
  10029. // "path": "turnbasedmatches",
  10030. // "response": {
  10031. // "$ref": "TurnBasedMatchList"
  10032. // },
  10033. // "scopes": [
  10034. // "https://www.googleapis.com/auth/games",
  10035. // "https://www.googleapis.com/auth/plus.login"
  10036. // ]
  10037. // }
  10038. }
  10039. // Pages invokes f for each page of results.
  10040. // A non-nil error returned from f will halt the iteration.
  10041. // The provided context supersedes any context provided to the Context method.
  10042. func (c *TurnBasedMatchesListCall) Pages(ctx context.Context, f func(*TurnBasedMatchList) error) error {
  10043. c.ctx_ = ctx
  10044. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10045. for {
  10046. x, err := c.Do()
  10047. if err != nil {
  10048. return err
  10049. }
  10050. if err := f(x); err != nil {
  10051. return err
  10052. }
  10053. if x.NextPageToken == "" {
  10054. return nil
  10055. }
  10056. c.PageToken(x.NextPageToken)
  10057. }
  10058. }
  10059. // method id "games.turnBasedMatches.rematch":
  10060. type TurnBasedMatchesRematchCall struct {
  10061. s *Service
  10062. matchId string
  10063. urlParams_ gensupport.URLParams
  10064. ctx_ context.Context
  10065. }
  10066. // Rematch: Create a rematch of a match that was previously completed,
  10067. // with the same participants. This can be called by only one player on
  10068. // a match still in their list; the player must have called Finish
  10069. // first. Returns the newly created match; it will be the caller's turn.
  10070. func (r *TurnBasedMatchesService) Rematch(matchId string) *TurnBasedMatchesRematchCall {
  10071. c := &TurnBasedMatchesRematchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10072. c.matchId = matchId
  10073. return c
  10074. }
  10075. // Language sets the optional parameter "language": The preferred
  10076. // language to use for strings returned by this method.
  10077. func (c *TurnBasedMatchesRematchCall) Language(language string) *TurnBasedMatchesRematchCall {
  10078. c.urlParams_.Set("language", language)
  10079. return c
  10080. }
  10081. // RequestId sets the optional parameter "requestId": A randomly
  10082. // generated numeric ID for each request specified by the caller. This
  10083. // number is used at the server to ensure that the request is handled
  10084. // correctly across retries.
  10085. func (c *TurnBasedMatchesRematchCall) RequestId(requestId int64) *TurnBasedMatchesRematchCall {
  10086. c.urlParams_.Set("requestId", fmt.Sprint(requestId))
  10087. return c
  10088. }
  10089. // Fields allows partial responses to be retrieved. See
  10090. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10091. // for more information.
  10092. func (c *TurnBasedMatchesRematchCall) Fields(s ...googleapi.Field) *TurnBasedMatchesRematchCall {
  10093. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10094. return c
  10095. }
  10096. // Context sets the context to be used in this call's Do method. Any
  10097. // pending HTTP request will be aborted if the provided context is
  10098. // canceled.
  10099. func (c *TurnBasedMatchesRematchCall) Context(ctx context.Context) *TurnBasedMatchesRematchCall {
  10100. c.ctx_ = ctx
  10101. return c
  10102. }
  10103. func (c *TurnBasedMatchesRematchCall) doRequest(alt string) (*http.Response, error) {
  10104. var body io.Reader = nil
  10105. c.urlParams_.Set("alt", alt)
  10106. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/rematch")
  10107. urls += "?" + c.urlParams_.Encode()
  10108. req, _ := http.NewRequest("POST", urls, body)
  10109. googleapi.Expand(req.URL, map[string]string{
  10110. "matchId": c.matchId,
  10111. })
  10112. req.Header.Set("User-Agent", c.s.userAgent())
  10113. if c.ctx_ != nil {
  10114. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10115. }
  10116. return c.s.client.Do(req)
  10117. }
  10118. // Do executes the "games.turnBasedMatches.rematch" call.
  10119. // Exactly one of *TurnBasedMatchRematch or error will be non-nil. Any
  10120. // non-2xx status code is an error. Response headers are in either
  10121. // *TurnBasedMatchRematch.ServerResponse.Header or (if a response was
  10122. // returned at all) in error.(*googleapi.Error).Header. Use
  10123. // googleapi.IsNotModified to check whether the returned error was
  10124. // because http.StatusNotModified was returned.
  10125. func (c *TurnBasedMatchesRematchCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchRematch, error) {
  10126. gensupport.SetOptions(c.urlParams_, opts...)
  10127. res, err := c.doRequest("json")
  10128. if res != nil && res.StatusCode == http.StatusNotModified {
  10129. if res.Body != nil {
  10130. res.Body.Close()
  10131. }
  10132. return nil, &googleapi.Error{
  10133. Code: res.StatusCode,
  10134. Header: res.Header,
  10135. }
  10136. }
  10137. if err != nil {
  10138. return nil, err
  10139. }
  10140. defer googleapi.CloseBody(res)
  10141. if err := googleapi.CheckResponse(res); err != nil {
  10142. return nil, err
  10143. }
  10144. ret := &TurnBasedMatchRematch{
  10145. ServerResponse: googleapi.ServerResponse{
  10146. Header: res.Header,
  10147. HTTPStatusCode: res.StatusCode,
  10148. },
  10149. }
  10150. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10151. return nil, err
  10152. }
  10153. return ret, nil
  10154. // {
  10155. // "description": "Create a rematch of a match that was previously completed, with the same participants. This can be called by only one player on a match still in their list; the player must have called Finish first. Returns the newly created match; it will be the caller's turn.",
  10156. // "httpMethod": "POST",
  10157. // "id": "games.turnBasedMatches.rematch",
  10158. // "parameterOrder": [
  10159. // "matchId"
  10160. // ],
  10161. // "parameters": {
  10162. // "language": {
  10163. // "description": "The preferred language to use for strings returned by this method.",
  10164. // "location": "query",
  10165. // "type": "string"
  10166. // },
  10167. // "matchId": {
  10168. // "description": "The ID of the match.",
  10169. // "location": "path",
  10170. // "required": true,
  10171. // "type": "string"
  10172. // },
  10173. // "requestId": {
  10174. // "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.",
  10175. // "format": "int64",
  10176. // "location": "query",
  10177. // "type": "string"
  10178. // }
  10179. // },
  10180. // "path": "turnbasedmatches/{matchId}/rematch",
  10181. // "response": {
  10182. // "$ref": "TurnBasedMatchRematch"
  10183. // },
  10184. // "scopes": [
  10185. // "https://www.googleapis.com/auth/games",
  10186. // "https://www.googleapis.com/auth/plus.login"
  10187. // ]
  10188. // }
  10189. }
  10190. // method id "games.turnBasedMatches.sync":
  10191. type TurnBasedMatchesSyncCall struct {
  10192. s *Service
  10193. urlParams_ gensupport.URLParams
  10194. ifNoneMatch_ string
  10195. ctx_ context.Context
  10196. }
  10197. // Sync: Returns turn-based matches the player is or was involved in
  10198. // that changed since the last sync call, with the least recent changes
  10199. // coming first. Matches that should be removed from the local cache
  10200. // will have a status of MATCH_DELETED.
  10201. func (r *TurnBasedMatchesService) Sync() *TurnBasedMatchesSyncCall {
  10202. c := &TurnBasedMatchesSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10203. return c
  10204. }
  10205. // IncludeMatchData sets the optional parameter "includeMatchData": True
  10206. // if match data should be returned in the response. Note that not all
  10207. // data will necessarily be returned if include_match_data is true; the
  10208. // server may decide to only return data for some of the matches to
  10209. // limit download size for the client. The remainder of the data for
  10210. // these matches will be retrievable on request.
  10211. func (c *TurnBasedMatchesSyncCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesSyncCall {
  10212. c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData))
  10213. return c
  10214. }
  10215. // Language sets the optional parameter "language": The preferred
  10216. // language to use for strings returned by this method.
  10217. func (c *TurnBasedMatchesSyncCall) Language(language string) *TurnBasedMatchesSyncCall {
  10218. c.urlParams_.Set("language", language)
  10219. return c
  10220. }
  10221. // MaxCompletedMatches sets the optional parameter
  10222. // "maxCompletedMatches": The maximum number of completed or canceled
  10223. // matches to return in the response. If not set, all matches returned
  10224. // could be completed or canceled.
  10225. func (c *TurnBasedMatchesSyncCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesSyncCall {
  10226. c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches))
  10227. return c
  10228. }
  10229. // MaxResults sets the optional parameter "maxResults": The maximum
  10230. // number of matches to return in the response, used for paging. For any
  10231. // response, the actual number of matches to return may be less than the
  10232. // specified maxResults.
  10233. func (c *TurnBasedMatchesSyncCall) MaxResults(maxResults int64) *TurnBasedMatchesSyncCall {
  10234. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10235. return c
  10236. }
  10237. // PageToken sets the optional parameter "pageToken": The token returned
  10238. // by the previous request.
  10239. func (c *TurnBasedMatchesSyncCall) PageToken(pageToken string) *TurnBasedMatchesSyncCall {
  10240. c.urlParams_.Set("pageToken", pageToken)
  10241. return c
  10242. }
  10243. // Fields allows partial responses to be retrieved. See
  10244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10245. // for more information.
  10246. func (c *TurnBasedMatchesSyncCall) Fields(s ...googleapi.Field) *TurnBasedMatchesSyncCall {
  10247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10248. return c
  10249. }
  10250. // IfNoneMatch sets the optional parameter which makes the operation
  10251. // fail if the object's ETag matches the given value. This is useful for
  10252. // getting updates only after the object has changed since the last
  10253. // request. Use googleapi.IsNotModified to check whether the response
  10254. // error from Do is the result of In-None-Match.
  10255. func (c *TurnBasedMatchesSyncCall) IfNoneMatch(entityTag string) *TurnBasedMatchesSyncCall {
  10256. c.ifNoneMatch_ = entityTag
  10257. return c
  10258. }
  10259. // Context sets the context to be used in this call's Do method. Any
  10260. // pending HTTP request will be aborted if the provided context is
  10261. // canceled.
  10262. func (c *TurnBasedMatchesSyncCall) Context(ctx context.Context) *TurnBasedMatchesSyncCall {
  10263. c.ctx_ = ctx
  10264. return c
  10265. }
  10266. func (c *TurnBasedMatchesSyncCall) doRequest(alt string) (*http.Response, error) {
  10267. var body io.Reader = nil
  10268. c.urlParams_.Set("alt", alt)
  10269. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/sync")
  10270. urls += "?" + c.urlParams_.Encode()
  10271. req, _ := http.NewRequest("GET", urls, body)
  10272. googleapi.SetOpaque(req.URL)
  10273. req.Header.Set("User-Agent", c.s.userAgent())
  10274. if c.ifNoneMatch_ != "" {
  10275. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10276. }
  10277. if c.ctx_ != nil {
  10278. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10279. }
  10280. return c.s.client.Do(req)
  10281. }
  10282. // Do executes the "games.turnBasedMatches.sync" call.
  10283. // Exactly one of *TurnBasedMatchSync or error will be non-nil. Any
  10284. // non-2xx status code is an error. Response headers are in either
  10285. // *TurnBasedMatchSync.ServerResponse.Header or (if a response was
  10286. // returned at all) in error.(*googleapi.Error).Header. Use
  10287. // googleapi.IsNotModified to check whether the returned error was
  10288. // because http.StatusNotModified was returned.
  10289. func (c *TurnBasedMatchesSyncCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchSync, error) {
  10290. gensupport.SetOptions(c.urlParams_, opts...)
  10291. res, err := c.doRequest("json")
  10292. if res != nil && res.StatusCode == http.StatusNotModified {
  10293. if res.Body != nil {
  10294. res.Body.Close()
  10295. }
  10296. return nil, &googleapi.Error{
  10297. Code: res.StatusCode,
  10298. Header: res.Header,
  10299. }
  10300. }
  10301. if err != nil {
  10302. return nil, err
  10303. }
  10304. defer googleapi.CloseBody(res)
  10305. if err := googleapi.CheckResponse(res); err != nil {
  10306. return nil, err
  10307. }
  10308. ret := &TurnBasedMatchSync{
  10309. ServerResponse: googleapi.ServerResponse{
  10310. Header: res.Header,
  10311. HTTPStatusCode: res.StatusCode,
  10312. },
  10313. }
  10314. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10315. return nil, err
  10316. }
  10317. return ret, nil
  10318. // {
  10319. // "description": "Returns turn-based matches the player is or was involved in that changed since the last sync call, with the least recent changes coming first. Matches that should be removed from the local cache will have a status of MATCH_DELETED.",
  10320. // "httpMethod": "GET",
  10321. // "id": "games.turnBasedMatches.sync",
  10322. // "parameters": {
  10323. // "includeMatchData": {
  10324. // "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.",
  10325. // "location": "query",
  10326. // "type": "boolean"
  10327. // },
  10328. // "language": {
  10329. // "description": "The preferred language to use for strings returned by this method.",
  10330. // "location": "query",
  10331. // "type": "string"
  10332. // },
  10333. // "maxCompletedMatches": {
  10334. // "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.",
  10335. // "format": "int32",
  10336. // "location": "query",
  10337. // "maximum": "500",
  10338. // "minimum": "0",
  10339. // "type": "integer"
  10340. // },
  10341. // "maxResults": {
  10342. // "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.",
  10343. // "format": "int32",
  10344. // "location": "query",
  10345. // "maximum": "500",
  10346. // "minimum": "1",
  10347. // "type": "integer"
  10348. // },
  10349. // "pageToken": {
  10350. // "description": "The token returned by the previous request.",
  10351. // "location": "query",
  10352. // "type": "string"
  10353. // }
  10354. // },
  10355. // "path": "turnbasedmatches/sync",
  10356. // "response": {
  10357. // "$ref": "TurnBasedMatchSync"
  10358. // },
  10359. // "scopes": [
  10360. // "https://www.googleapis.com/auth/games",
  10361. // "https://www.googleapis.com/auth/plus.login"
  10362. // ]
  10363. // }
  10364. }
  10365. // Pages invokes f for each page of results.
  10366. // A non-nil error returned from f will halt the iteration.
  10367. // The provided context supersedes any context provided to the Context method.
  10368. func (c *TurnBasedMatchesSyncCall) Pages(ctx context.Context, f func(*TurnBasedMatchSync) error) error {
  10369. c.ctx_ = ctx
  10370. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10371. for {
  10372. x, err := c.Do()
  10373. if err != nil {
  10374. return err
  10375. }
  10376. if err := f(x); err != nil {
  10377. return err
  10378. }
  10379. if x.NextPageToken == "" {
  10380. return nil
  10381. }
  10382. c.PageToken(x.NextPageToken)
  10383. }
  10384. }
  10385. // method id "games.turnBasedMatches.takeTurn":
  10386. type TurnBasedMatchesTakeTurnCall struct {
  10387. s *Service
  10388. matchId string
  10389. turnbasedmatchturn *TurnBasedMatchTurn
  10390. urlParams_ gensupport.URLParams
  10391. ctx_ context.Context
  10392. }
  10393. // TakeTurn: Commit the results of a player turn.
  10394. func (r *TurnBasedMatchesService) TakeTurn(matchId string, turnbasedmatchturn *TurnBasedMatchTurn) *TurnBasedMatchesTakeTurnCall {
  10395. c := &TurnBasedMatchesTakeTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10396. c.matchId = matchId
  10397. c.turnbasedmatchturn = turnbasedmatchturn
  10398. return c
  10399. }
  10400. // Language sets the optional parameter "language": The preferred
  10401. // language to use for strings returned by this method.
  10402. func (c *TurnBasedMatchesTakeTurnCall) Language(language string) *TurnBasedMatchesTakeTurnCall {
  10403. c.urlParams_.Set("language", language)
  10404. return c
  10405. }
  10406. // Fields allows partial responses to be retrieved. See
  10407. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10408. // for more information.
  10409. func (c *TurnBasedMatchesTakeTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesTakeTurnCall {
  10410. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10411. return c
  10412. }
  10413. // Context sets the context to be used in this call's Do method. Any
  10414. // pending HTTP request will be aborted if the provided context is
  10415. // canceled.
  10416. func (c *TurnBasedMatchesTakeTurnCall) Context(ctx context.Context) *TurnBasedMatchesTakeTurnCall {
  10417. c.ctx_ = ctx
  10418. return c
  10419. }
  10420. func (c *TurnBasedMatchesTakeTurnCall) doRequest(alt string) (*http.Response, error) {
  10421. var body io.Reader = nil
  10422. body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchturn)
  10423. if err != nil {
  10424. return nil, err
  10425. }
  10426. ctype := "application/json"
  10427. c.urlParams_.Set("alt", alt)
  10428. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/turn")
  10429. urls += "?" + c.urlParams_.Encode()
  10430. req, _ := http.NewRequest("PUT", urls, body)
  10431. googleapi.Expand(req.URL, map[string]string{
  10432. "matchId": c.matchId,
  10433. })
  10434. req.Header.Set("Content-Type", ctype)
  10435. req.Header.Set("User-Agent", c.s.userAgent())
  10436. if c.ctx_ != nil {
  10437. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10438. }
  10439. return c.s.client.Do(req)
  10440. }
  10441. // Do executes the "games.turnBasedMatches.takeTurn" call.
  10442. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10443. // status code is an error. Response headers are in either
  10444. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10445. // at all) in error.(*googleapi.Error).Header. Use
  10446. // googleapi.IsNotModified to check whether the returned error was
  10447. // because http.StatusNotModified was returned.
  10448. func (c *TurnBasedMatchesTakeTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10449. gensupport.SetOptions(c.urlParams_, opts...)
  10450. res, err := c.doRequest("json")
  10451. if res != nil && res.StatusCode == http.StatusNotModified {
  10452. if res.Body != nil {
  10453. res.Body.Close()
  10454. }
  10455. return nil, &googleapi.Error{
  10456. Code: res.StatusCode,
  10457. Header: res.Header,
  10458. }
  10459. }
  10460. if err != nil {
  10461. return nil, err
  10462. }
  10463. defer googleapi.CloseBody(res)
  10464. if err := googleapi.CheckResponse(res); err != nil {
  10465. return nil, err
  10466. }
  10467. ret := &TurnBasedMatch{
  10468. ServerResponse: googleapi.ServerResponse{
  10469. Header: res.Header,
  10470. HTTPStatusCode: res.StatusCode,
  10471. },
  10472. }
  10473. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10474. return nil, err
  10475. }
  10476. return ret, nil
  10477. // {
  10478. // "description": "Commit the results of a player turn.",
  10479. // "httpMethod": "PUT",
  10480. // "id": "games.turnBasedMatches.takeTurn",
  10481. // "parameterOrder": [
  10482. // "matchId"
  10483. // ],
  10484. // "parameters": {
  10485. // "language": {
  10486. // "description": "The preferred language to use for strings returned by this method.",
  10487. // "location": "query",
  10488. // "type": "string"
  10489. // },
  10490. // "matchId": {
  10491. // "description": "The ID of the match.",
  10492. // "location": "path",
  10493. // "required": true,
  10494. // "type": "string"
  10495. // }
  10496. // },
  10497. // "path": "turnbasedmatches/{matchId}/turn",
  10498. // "request": {
  10499. // "$ref": "TurnBasedMatchTurn"
  10500. // },
  10501. // "response": {
  10502. // "$ref": "TurnBasedMatch"
  10503. // },
  10504. // "scopes": [
  10505. // "https://www.googleapis.com/auth/games",
  10506. // "https://www.googleapis.com/auth/plus.login"
  10507. // ]
  10508. // }
  10509. }