googleadsensehost.pp 88 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240
  1. unit googleadsensehost;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TAccount = Class;
  9. TAccounts = Class;
  10. TAdClient = Class;
  11. TAdClients = Class;
  12. TAdCode = Class;
  13. TAdStyle = Class;
  14. TAdUnit = Class;
  15. TAdUnits = Class;
  16. TAssociationSession = Class;
  17. TCustomChannel = Class;
  18. TCustomChannels = Class;
  19. TReport = Class;
  20. TUrlChannel = Class;
  21. TUrlChannels = Class;
  22. TAccountArray = Array of TAccount;
  23. TAccountsArray = Array of TAccounts;
  24. TAdClientArray = Array of TAdClient;
  25. TAdClientsArray = Array of TAdClients;
  26. TAdCodeArray = Array of TAdCode;
  27. TAdStyleArray = Array of TAdStyle;
  28. TAdUnitArray = Array of TAdUnit;
  29. TAdUnitsArray = Array of TAdUnits;
  30. TAssociationSessionArray = Array of TAssociationSession;
  31. TCustomChannelArray = Array of TCustomChannel;
  32. TCustomChannelsArray = Array of TCustomChannels;
  33. TReportArray = Array of TReport;
  34. TUrlChannelArray = Array of TUrlChannel;
  35. TUrlChannelsArray = Array of TUrlChannels;
  36. //Anonymous types, using auto-generated names
  37. TAdStyleTypecolors = Class;
  38. TAdStyleTypefont = Class;
  39. TAdUnitTypecontentAdsSettingsTypebackupOption = Class;
  40. TAdUnitTypecontentAdsSettings = Class;
  41. TAdUnitTypemobileContentAdsSettings = Class;
  42. TReportTypeheadersItem = Class;
  43. TAccountsTypeitemsArray = Array of TAccount;
  44. TAdClientsTypeitemsArray = Array of TAdClient;
  45. TAdUnitsTypeitemsArray = Array of TAdUnit;
  46. TCustomChannelsTypeitemsArray = Array of TCustomChannel;
  47. TReportTypeheadersArray = Array of TReportTypeheadersItem;
  48. TReportTyperowsArray = Array of TStringArray;
  49. TUrlChannelsTypeitemsArray = Array of TUrlChannel;
  50. { --------------------------------------------------------------------
  51. TAccount
  52. --------------------------------------------------------------------}
  53. TAccount = Class(TGoogleBaseObject)
  54. Private
  55. Fid : String;
  56. Fkind : String;
  57. Fname : String;
  58. Fstatus : String;
  59. Protected
  60. //Property setters
  61. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  62. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  63. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  64. Procedure Setstatus(AIndex : Integer; const AValue : String); virtual;
  65. Public
  66. Published
  67. Property id : String Index 0 Read Fid Write Setid;
  68. Property kind : String Index 8 Read Fkind Write Setkind;
  69. Property name : String Index 16 Read Fname Write Setname;
  70. Property status : String Index 24 Read Fstatus Write Setstatus;
  71. end;
  72. TAccountClass = Class of TAccount;
  73. { --------------------------------------------------------------------
  74. TAccounts
  75. --------------------------------------------------------------------}
  76. TAccounts = Class(TGoogleBaseObject)
  77. Private
  78. Fetag : String;
  79. Fitems : TAccountsTypeitemsArray;
  80. Fkind : String;
  81. Protected
  82. //Property setters
  83. Procedure Setetag(AIndex : Integer; const AValue : String); virtual;
  84. Procedure Setitems(AIndex : Integer; const AValue : TAccountsTypeitemsArray); virtual;
  85. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  86. //2.6.4. bug workaround
  87. {$IFDEF VER2_6}
  88. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  89. {$ENDIF VER2_6}
  90. Public
  91. Published
  92. Property etag : String Index 0 Read Fetag Write Setetag;
  93. Property items : TAccountsTypeitemsArray Index 8 Read Fitems Write Setitems;
  94. Property kind : String Index 16 Read Fkind Write Setkind;
  95. end;
  96. TAccountsClass = Class of TAccounts;
  97. { --------------------------------------------------------------------
  98. TAdClient
  99. --------------------------------------------------------------------}
  100. TAdClient = Class(TGoogleBaseObject)
  101. Private
  102. FarcOptIn : boolean;
  103. Fid : String;
  104. Fkind : String;
  105. FproductCode : String;
  106. FsupportsReporting : boolean;
  107. Protected
  108. //Property setters
  109. Procedure SetarcOptIn(AIndex : Integer; const AValue : boolean); virtual;
  110. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  111. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  112. Procedure SetproductCode(AIndex : Integer; const AValue : String); virtual;
  113. Procedure SetsupportsReporting(AIndex : Integer; const AValue : boolean); virtual;
  114. Public
  115. Published
  116. Property arcOptIn : boolean Index 0 Read FarcOptIn Write SetarcOptIn;
  117. Property id : String Index 8 Read Fid Write Setid;
  118. Property kind : String Index 16 Read Fkind Write Setkind;
  119. Property productCode : String Index 24 Read FproductCode Write SetproductCode;
  120. Property supportsReporting : boolean Index 32 Read FsupportsReporting Write SetsupportsReporting;
  121. end;
  122. TAdClientClass = Class of TAdClient;
  123. { --------------------------------------------------------------------
  124. TAdClients
  125. --------------------------------------------------------------------}
  126. TAdClients = Class(TGoogleBaseObject)
  127. Private
  128. Fetag : String;
  129. Fitems : TAdClientsTypeitemsArray;
  130. Fkind : String;
  131. FnextPageToken : String;
  132. Protected
  133. //Property setters
  134. Procedure Setetag(AIndex : Integer; const AValue : String); virtual;
  135. Procedure Setitems(AIndex : Integer; const AValue : TAdClientsTypeitemsArray); virtual;
  136. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  137. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  138. //2.6.4. bug workaround
  139. {$IFDEF VER2_6}
  140. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  141. {$ENDIF VER2_6}
  142. Public
  143. Published
  144. Property etag : String Index 0 Read Fetag Write Setetag;
  145. Property items : TAdClientsTypeitemsArray Index 8 Read Fitems Write Setitems;
  146. Property kind : String Index 16 Read Fkind Write Setkind;
  147. Property nextPageToken : String Index 24 Read FnextPageToken Write SetnextPageToken;
  148. end;
  149. TAdClientsClass = Class of TAdClients;
  150. { --------------------------------------------------------------------
  151. TAdCode
  152. --------------------------------------------------------------------}
  153. TAdCode = Class(TGoogleBaseObject)
  154. Private
  155. FadCode : String;
  156. Fkind : String;
  157. Protected
  158. //Property setters
  159. Procedure SetadCode(AIndex : Integer; const AValue : String); virtual;
  160. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  161. Public
  162. Published
  163. Property adCode : String Index 0 Read FadCode Write SetadCode;
  164. Property kind : String Index 8 Read Fkind Write Setkind;
  165. end;
  166. TAdCodeClass = Class of TAdCode;
  167. { --------------------------------------------------------------------
  168. TAdStyleTypecolors
  169. --------------------------------------------------------------------}
  170. TAdStyleTypecolors = Class(TGoogleBaseObject)
  171. Private
  172. Fbackground : String;
  173. Fborder : String;
  174. Ftext : String;
  175. Ftitle : String;
  176. Furl : String;
  177. Protected
  178. //Property setters
  179. Procedure Setbackground(AIndex : Integer; const AValue : String); virtual;
  180. Procedure Setborder(AIndex : Integer; const AValue : String); virtual;
  181. Procedure Settext(AIndex : Integer; const AValue : String); virtual;
  182. Procedure Settitle(AIndex : Integer; const AValue : String); virtual;
  183. Procedure Seturl(AIndex : Integer; const AValue : String); virtual;
  184. Public
  185. Published
  186. Property background : String Index 0 Read Fbackground Write Setbackground;
  187. Property border : String Index 8 Read Fborder Write Setborder;
  188. Property text : String Index 16 Read Ftext Write Settext;
  189. Property title : String Index 24 Read Ftitle Write Settitle;
  190. Property url : String Index 32 Read Furl Write Seturl;
  191. end;
  192. TAdStyleTypecolorsClass = Class of TAdStyleTypecolors;
  193. { --------------------------------------------------------------------
  194. TAdStyleTypefont
  195. --------------------------------------------------------------------}
  196. TAdStyleTypefont = Class(TGoogleBaseObject)
  197. Private
  198. Ffamily : String;
  199. Fsize : String;
  200. Protected
  201. //Property setters
  202. Procedure Setfamily(AIndex : Integer; const AValue : String); virtual;
  203. Procedure Setsize(AIndex : Integer; const AValue : String); virtual;
  204. Public
  205. Published
  206. Property family : String Index 0 Read Ffamily Write Setfamily;
  207. Property size : String Index 8 Read Fsize Write Setsize;
  208. end;
  209. TAdStyleTypefontClass = Class of TAdStyleTypefont;
  210. { --------------------------------------------------------------------
  211. TAdStyle
  212. --------------------------------------------------------------------}
  213. TAdStyle = Class(TGoogleBaseObject)
  214. Private
  215. Fcolors : TAdStyleTypecolors;
  216. Fcorners : String;
  217. Ffont : TAdStyleTypefont;
  218. Fkind : String;
  219. Protected
  220. //Property setters
  221. Procedure Setcolors(AIndex : Integer; const AValue : TAdStyleTypecolors); virtual;
  222. Procedure Setcorners(AIndex : Integer; const AValue : String); virtual;
  223. Procedure Setfont(AIndex : Integer; const AValue : TAdStyleTypefont); virtual;
  224. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  225. Public
  226. Published
  227. Property colors : TAdStyleTypecolors Index 0 Read Fcolors Write Setcolors;
  228. Property corners : String Index 8 Read Fcorners Write Setcorners;
  229. Property font : TAdStyleTypefont Index 16 Read Ffont Write Setfont;
  230. Property kind : String Index 24 Read Fkind Write Setkind;
  231. end;
  232. TAdStyleClass = Class of TAdStyle;
  233. { --------------------------------------------------------------------
  234. TAdUnitTypecontentAdsSettingsTypebackupOption
  235. --------------------------------------------------------------------}
  236. TAdUnitTypecontentAdsSettingsTypebackupOption = Class(TGoogleBaseObject)
  237. Private
  238. Fcolor : String;
  239. F_type : String;
  240. Furl : String;
  241. Protected
  242. Class Function ExportPropertyName(Const AName : String) : string; override;
  243. //Property setters
  244. Procedure Setcolor(AIndex : Integer; const AValue : String); virtual;
  245. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  246. Procedure Seturl(AIndex : Integer; const AValue : String); virtual;
  247. Public
  248. Published
  249. Property color : String Index 0 Read Fcolor Write Setcolor;
  250. Property _type : String Index 8 Read F_type Write Set_type;
  251. Property url : String Index 16 Read Furl Write Seturl;
  252. end;
  253. TAdUnitTypecontentAdsSettingsTypebackupOptionClass = Class of TAdUnitTypecontentAdsSettingsTypebackupOption;
  254. { --------------------------------------------------------------------
  255. TAdUnitTypecontentAdsSettings
  256. --------------------------------------------------------------------}
  257. TAdUnitTypecontentAdsSettings = Class(TGoogleBaseObject)
  258. Private
  259. FbackupOption : TAdUnitTypecontentAdsSettingsTypebackupOption;
  260. Fsize : String;
  261. F_type : String;
  262. Protected
  263. Class Function ExportPropertyName(Const AName : String) : string; override;
  264. //Property setters
  265. Procedure SetbackupOption(AIndex : Integer; const AValue : TAdUnitTypecontentAdsSettingsTypebackupOption); virtual;
  266. Procedure Setsize(AIndex : Integer; const AValue : String); virtual;
  267. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  268. Public
  269. Published
  270. Property backupOption : TAdUnitTypecontentAdsSettingsTypebackupOption Index 0 Read FbackupOption Write SetbackupOption;
  271. Property size : String Index 8 Read Fsize Write Setsize;
  272. Property _type : String Index 16 Read F_type Write Set_type;
  273. end;
  274. TAdUnitTypecontentAdsSettingsClass = Class of TAdUnitTypecontentAdsSettings;
  275. { --------------------------------------------------------------------
  276. TAdUnitTypemobileContentAdsSettings
  277. --------------------------------------------------------------------}
  278. TAdUnitTypemobileContentAdsSettings = Class(TGoogleBaseObject)
  279. Private
  280. FmarkupLanguage : String;
  281. FscriptingLanguage : String;
  282. Fsize : String;
  283. F_type : String;
  284. Protected
  285. Class Function ExportPropertyName(Const AName : String) : string; override;
  286. //Property setters
  287. Procedure SetmarkupLanguage(AIndex : Integer; const AValue : String); virtual;
  288. Procedure SetscriptingLanguage(AIndex : Integer; const AValue : String); virtual;
  289. Procedure Setsize(AIndex : Integer; const AValue : String); virtual;
  290. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  291. Public
  292. Published
  293. Property markupLanguage : String Index 0 Read FmarkupLanguage Write SetmarkupLanguage;
  294. Property scriptingLanguage : String Index 8 Read FscriptingLanguage Write SetscriptingLanguage;
  295. Property size : String Index 16 Read Fsize Write Setsize;
  296. Property _type : String Index 24 Read F_type Write Set_type;
  297. end;
  298. TAdUnitTypemobileContentAdsSettingsClass = Class of TAdUnitTypemobileContentAdsSettings;
  299. { --------------------------------------------------------------------
  300. TAdUnit
  301. --------------------------------------------------------------------}
  302. TAdUnit = Class(TGoogleBaseObject)
  303. Private
  304. Fcode : String;
  305. FcontentAdsSettings : TAdUnitTypecontentAdsSettings;
  306. FcustomStyle : TAdStyle;
  307. Fid : String;
  308. Fkind : String;
  309. FmobileContentAdsSettings : TAdUnitTypemobileContentAdsSettings;
  310. Fname : String;
  311. Fstatus : String;
  312. Protected
  313. //Property setters
  314. Procedure Setcode(AIndex : Integer; const AValue : String); virtual;
  315. Procedure SetcontentAdsSettings(AIndex : Integer; const AValue : TAdUnitTypecontentAdsSettings); virtual;
  316. Procedure SetcustomStyle(AIndex : Integer; const AValue : TAdStyle); virtual;
  317. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  318. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  319. Procedure SetmobileContentAdsSettings(AIndex : Integer; const AValue : TAdUnitTypemobileContentAdsSettings); virtual;
  320. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  321. Procedure Setstatus(AIndex : Integer; const AValue : String); virtual;
  322. Public
  323. Published
  324. Property code : String Index 0 Read Fcode Write Setcode;
  325. Property contentAdsSettings : TAdUnitTypecontentAdsSettings Index 8 Read FcontentAdsSettings Write SetcontentAdsSettings;
  326. Property customStyle : TAdStyle Index 16 Read FcustomStyle Write SetcustomStyle;
  327. Property id : String Index 24 Read Fid Write Setid;
  328. Property kind : String Index 32 Read Fkind Write Setkind;
  329. Property mobileContentAdsSettings : TAdUnitTypemobileContentAdsSettings Index 40 Read FmobileContentAdsSettings Write SetmobileContentAdsSettings;
  330. Property name : String Index 48 Read Fname Write Setname;
  331. Property status : String Index 56 Read Fstatus Write Setstatus;
  332. end;
  333. TAdUnitClass = Class of TAdUnit;
  334. { --------------------------------------------------------------------
  335. TAdUnits
  336. --------------------------------------------------------------------}
  337. TAdUnits = Class(TGoogleBaseObject)
  338. Private
  339. Fetag : String;
  340. Fitems : TAdUnitsTypeitemsArray;
  341. Fkind : String;
  342. FnextPageToken : String;
  343. Protected
  344. //Property setters
  345. Procedure Setetag(AIndex : Integer; const AValue : String); virtual;
  346. Procedure Setitems(AIndex : Integer; const AValue : TAdUnitsTypeitemsArray); virtual;
  347. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  348. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  349. //2.6.4. bug workaround
  350. {$IFDEF VER2_6}
  351. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  352. {$ENDIF VER2_6}
  353. Public
  354. Published
  355. Property etag : String Index 0 Read Fetag Write Setetag;
  356. Property items : TAdUnitsTypeitemsArray Index 8 Read Fitems Write Setitems;
  357. Property kind : String Index 16 Read Fkind Write Setkind;
  358. Property nextPageToken : String Index 24 Read FnextPageToken Write SetnextPageToken;
  359. end;
  360. TAdUnitsClass = Class of TAdUnits;
  361. { --------------------------------------------------------------------
  362. TAssociationSession
  363. --------------------------------------------------------------------}
  364. TAssociationSession = Class(TGoogleBaseObject)
  365. Private
  366. FaccountId : String;
  367. Fid : String;
  368. Fkind : String;
  369. FproductCodes : TStringArray;
  370. FredirectUrl : String;
  371. Fstatus : String;
  372. FuserLocale : String;
  373. FwebsiteLocale : String;
  374. FwebsiteUrl : String;
  375. Protected
  376. //Property setters
  377. Procedure SetaccountId(AIndex : Integer; const AValue : String); virtual;
  378. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  379. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  380. Procedure SetproductCodes(AIndex : Integer; const AValue : TStringArray); virtual;
  381. Procedure SetredirectUrl(AIndex : Integer; const AValue : String); virtual;
  382. Procedure Setstatus(AIndex : Integer; const AValue : String); virtual;
  383. Procedure SetuserLocale(AIndex : Integer; const AValue : String); virtual;
  384. Procedure SetwebsiteLocale(AIndex : Integer; const AValue : String); virtual;
  385. Procedure SetwebsiteUrl(AIndex : Integer; const AValue : String); virtual;
  386. //2.6.4. bug workaround
  387. {$IFDEF VER2_6}
  388. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  389. {$ENDIF VER2_6}
  390. Public
  391. Published
  392. Property accountId : String Index 0 Read FaccountId Write SetaccountId;
  393. Property id : String Index 8 Read Fid Write Setid;
  394. Property kind : String Index 16 Read Fkind Write Setkind;
  395. Property productCodes : TStringArray Index 24 Read FproductCodes Write SetproductCodes;
  396. Property redirectUrl : String Index 32 Read FredirectUrl Write SetredirectUrl;
  397. Property status : String Index 40 Read Fstatus Write Setstatus;
  398. Property userLocale : String Index 48 Read FuserLocale Write SetuserLocale;
  399. Property websiteLocale : String Index 56 Read FwebsiteLocale Write SetwebsiteLocale;
  400. Property websiteUrl : String Index 64 Read FwebsiteUrl Write SetwebsiteUrl;
  401. end;
  402. TAssociationSessionClass = Class of TAssociationSession;
  403. { --------------------------------------------------------------------
  404. TCustomChannel
  405. --------------------------------------------------------------------}
  406. TCustomChannel = Class(TGoogleBaseObject)
  407. Private
  408. Fcode : String;
  409. Fid : String;
  410. Fkind : String;
  411. Fname : String;
  412. Protected
  413. //Property setters
  414. Procedure Setcode(AIndex : Integer; const AValue : String); virtual;
  415. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  416. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  417. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  418. Public
  419. Published
  420. Property code : String Index 0 Read Fcode Write Setcode;
  421. Property id : String Index 8 Read Fid Write Setid;
  422. Property kind : String Index 16 Read Fkind Write Setkind;
  423. Property name : String Index 24 Read Fname Write Setname;
  424. end;
  425. TCustomChannelClass = Class of TCustomChannel;
  426. { --------------------------------------------------------------------
  427. TCustomChannels
  428. --------------------------------------------------------------------}
  429. TCustomChannels = Class(TGoogleBaseObject)
  430. Private
  431. Fetag : String;
  432. Fitems : TCustomChannelsTypeitemsArray;
  433. Fkind : String;
  434. FnextPageToken : String;
  435. Protected
  436. //Property setters
  437. Procedure Setetag(AIndex : Integer; const AValue : String); virtual;
  438. Procedure Setitems(AIndex : Integer; const AValue : TCustomChannelsTypeitemsArray); virtual;
  439. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  440. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  441. //2.6.4. bug workaround
  442. {$IFDEF VER2_6}
  443. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  444. {$ENDIF VER2_6}
  445. Public
  446. Published
  447. Property etag : String Index 0 Read Fetag Write Setetag;
  448. Property items : TCustomChannelsTypeitemsArray Index 8 Read Fitems Write Setitems;
  449. Property kind : String Index 16 Read Fkind Write Setkind;
  450. Property nextPageToken : String Index 24 Read FnextPageToken Write SetnextPageToken;
  451. end;
  452. TCustomChannelsClass = Class of TCustomChannels;
  453. { --------------------------------------------------------------------
  454. TReportTypeheadersItem
  455. --------------------------------------------------------------------}
  456. TReportTypeheadersItem = Class(TGoogleBaseObject)
  457. Private
  458. Fcurrency : String;
  459. Fname : String;
  460. F_type : String;
  461. Protected
  462. Class Function ExportPropertyName(Const AName : String) : string; override;
  463. //Property setters
  464. Procedure Setcurrency(AIndex : Integer; const AValue : String); virtual;
  465. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  466. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  467. Public
  468. Published
  469. Property currency : String Index 0 Read Fcurrency Write Setcurrency;
  470. Property name : String Index 8 Read Fname Write Setname;
  471. Property _type : String Index 16 Read F_type Write Set_type;
  472. end;
  473. TReportTypeheadersItemClass = Class of TReportTypeheadersItem;
  474. { --------------------------------------------------------------------
  475. TReport
  476. --------------------------------------------------------------------}
  477. TReport = Class(TGoogleBaseObject)
  478. Private
  479. Faverages : TStringArray;
  480. Fheaders : TReportTypeheadersArray;
  481. Fkind : String;
  482. Frows : TReportTyperowsArray;
  483. FtotalMatchedRows : String;
  484. Ftotals : TStringArray;
  485. Fwarnings : TStringArray;
  486. Protected
  487. //Property setters
  488. Procedure Setaverages(AIndex : Integer; const AValue : TStringArray); virtual;
  489. Procedure Setheaders(AIndex : Integer; const AValue : TReportTypeheadersArray); virtual;
  490. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  491. Procedure Setrows(AIndex : Integer; const AValue : TReportTyperowsArray); virtual;
  492. Procedure SettotalMatchedRows(AIndex : Integer; const AValue : String); virtual;
  493. Procedure Settotals(AIndex : Integer; const AValue : TStringArray); virtual;
  494. Procedure Setwarnings(AIndex : Integer; const AValue : TStringArray); virtual;
  495. //2.6.4. bug workaround
  496. {$IFDEF VER2_6}
  497. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  498. {$ENDIF VER2_6}
  499. Public
  500. Published
  501. Property averages : TStringArray Index 0 Read Faverages Write Setaverages;
  502. Property headers : TReportTypeheadersArray Index 8 Read Fheaders Write Setheaders;
  503. Property kind : String Index 16 Read Fkind Write Setkind;
  504. Property rows : TReportTyperowsArray Index 24 Read Frows Write Setrows;
  505. Property totalMatchedRows : String Index 32 Read FtotalMatchedRows Write SettotalMatchedRows;
  506. Property totals : TStringArray Index 40 Read Ftotals Write Settotals;
  507. Property warnings : TStringArray Index 48 Read Fwarnings Write Setwarnings;
  508. end;
  509. TReportClass = Class of TReport;
  510. { --------------------------------------------------------------------
  511. TUrlChannel
  512. --------------------------------------------------------------------}
  513. TUrlChannel = Class(TGoogleBaseObject)
  514. Private
  515. Fid : String;
  516. Fkind : String;
  517. FurlPattern : String;
  518. Protected
  519. //Property setters
  520. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  521. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  522. Procedure SeturlPattern(AIndex : Integer; const AValue : String); virtual;
  523. Public
  524. Published
  525. Property id : String Index 0 Read Fid Write Setid;
  526. Property kind : String Index 8 Read Fkind Write Setkind;
  527. Property urlPattern : String Index 16 Read FurlPattern Write SeturlPattern;
  528. end;
  529. TUrlChannelClass = Class of TUrlChannel;
  530. { --------------------------------------------------------------------
  531. TUrlChannels
  532. --------------------------------------------------------------------}
  533. TUrlChannels = Class(TGoogleBaseObject)
  534. Private
  535. Fetag : String;
  536. Fitems : TUrlChannelsTypeitemsArray;
  537. Fkind : String;
  538. FnextPageToken : String;
  539. Protected
  540. //Property setters
  541. Procedure Setetag(AIndex : Integer; const AValue : String); virtual;
  542. Procedure Setitems(AIndex : Integer; const AValue : TUrlChannelsTypeitemsArray); virtual;
  543. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  544. Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
  545. //2.6.4. bug workaround
  546. {$IFDEF VER2_6}
  547. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  548. {$ENDIF VER2_6}
  549. Public
  550. Published
  551. Property etag : String Index 0 Read Fetag Write Setetag;
  552. Property items : TUrlChannelsTypeitemsArray Index 8 Read Fitems Write Setitems;
  553. Property kind : String Index 16 Read Fkind Write Setkind;
  554. Property nextPageToken : String Index 24 Read FnextPageToken Write SetnextPageToken;
  555. end;
  556. TUrlChannelsClass = Class of TUrlChannels;
  557. { --------------------------------------------------------------------
  558. TAccountsAdclientsResource
  559. --------------------------------------------------------------------}
  560. //Optional query Options for TAccountsAdclientsResource, method List
  561. TAccountsAdclientsListOptions = Record
  562. maxResults : integer;
  563. pageToken : String;
  564. end;
  565. TAccountsAdclientsResource = Class(TGoogleResource)
  566. Public
  567. Class Function ResourceName : String; override;
  568. Class Function DefaultAPI : TGoogleAPIClass; override;
  569. Function Get(accountId: string; adClientId: string) : TAdClient;
  570. Function List(accountId: string; AQuery : string = '') : TAdClients;
  571. Function List(accountId: string; AQuery : TAccountsAdclientslistOptions) : TAdClients;
  572. end;
  573. { --------------------------------------------------------------------
  574. TAccountsAdunitsResource
  575. --------------------------------------------------------------------}
  576. //Optional query Options for TAccountsAdunitsResource, method GetAdCode
  577. TAccountsAdunitsGetAdCodeOptions = Record
  578. hostCustomChannelId : String;
  579. end;
  580. //Optional query Options for TAccountsAdunitsResource, method List
  581. TAccountsAdunitsListOptions = Record
  582. includeInactive : boolean;
  583. maxResults : integer;
  584. pageToken : String;
  585. end;
  586. //Optional query Options for TAccountsAdunitsResource, method Patch
  587. TAccountsAdunitsPatchOptions = Record
  588. adUnitId : String;
  589. end;
  590. TAccountsAdunitsResource = Class(TGoogleResource)
  591. Public
  592. Class Function ResourceName : String; override;
  593. Class Function DefaultAPI : TGoogleAPIClass; override;
  594. Function Delete(accountId: string; adClientId: string; adUnitId: string) : TAdUnit;
  595. Function Get(accountId: string; adClientId: string; adUnitId: string) : TAdUnit;
  596. Function GetAdCode(accountId: string; adClientId: string; adUnitId: string; AQuery : string = '') : TAdCode;
  597. Function GetAdCode(accountId: string; adClientId: string; adUnitId: string; AQuery : TAccountsAdunitsgetAdCodeOptions) : TAdCode;
  598. Function Insert(accountId: string; adClientId: string; aAdUnit : TAdUnit) : TAdUnit;
  599. Function List(accountId: string; adClientId: string; AQuery : string = '') : TAdUnits;
  600. Function List(accountId: string; adClientId: string; AQuery : TAccountsAdunitslistOptions) : TAdUnits;
  601. Function Patch(accountId: string; adClientId: string; aAdUnit : TAdUnit; AQuery : string = '') : TAdUnit;
  602. Function Patch(accountId: string; adClientId: string; aAdUnit : TAdUnit; AQuery : TAccountsAdunitspatchOptions) : TAdUnit;
  603. Function Update(accountId: string; adClientId: string; aAdUnit : TAdUnit) : TAdUnit;
  604. end;
  605. { --------------------------------------------------------------------
  606. TAccountsReportsResource
  607. --------------------------------------------------------------------}
  608. //Optional query Options for TAccountsReportsResource, method Generate
  609. TAccountsReportsGenerateOptions = Record
  610. dimension : String;
  611. endDate : String;
  612. filter : String;
  613. locale : String;
  614. maxResults : integer;
  615. metric : String;
  616. sort : String;
  617. startDate : String;
  618. startIndex : integer;
  619. end;
  620. TAccountsReportsResource = Class(TGoogleResource)
  621. Public
  622. Class Function ResourceName : String; override;
  623. Class Function DefaultAPI : TGoogleAPIClass; override;
  624. Function Generate(accountId: string; AQuery : string = '') : TReport;
  625. Function Generate(accountId: string; AQuery : TAccountsReportsgenerateOptions) : TReport;
  626. end;
  627. { --------------------------------------------------------------------
  628. TAccountsResource
  629. --------------------------------------------------------------------}
  630. //Optional query Options for TAccountsResource, method List
  631. TAccountsListOptions = Record
  632. filterAdClientId : String;
  633. end;
  634. TAccountsResource = Class(TGoogleResource)
  635. Private
  636. FAdclientsInstance : TAccountsAdclientsResource;
  637. FAdunitsInstance : TAccountsAdunitsResource;
  638. FReportsInstance : TAccountsReportsResource;
  639. Function GetAdclientsInstance : TAccountsAdclientsResource;virtual;
  640. Function GetAdunitsInstance : TAccountsAdunitsResource;virtual;
  641. Function GetReportsInstance : TAccountsReportsResource;virtual;
  642. Public
  643. Class Function ResourceName : String; override;
  644. Class Function DefaultAPI : TGoogleAPIClass; override;
  645. Function Get(accountId: string) : TAccount;
  646. Function List(AQuery : string = '') : TAccounts;
  647. Function List(AQuery : TAccountslistOptions) : TAccounts;
  648. Function CreateAdclientsResource(AOwner : TComponent) : TAccountsAdclientsResource;virtual;overload;
  649. Function CreateAdclientsResource : TAccountsAdclientsResource;virtual;overload;
  650. Function CreateAdunitsResource(AOwner : TComponent) : TAccountsAdunitsResource;virtual;overload;
  651. Function CreateAdunitsResource : TAccountsAdunitsResource;virtual;overload;
  652. Function CreateReportsResource(AOwner : TComponent) : TAccountsReportsResource;virtual;overload;
  653. Function CreateReportsResource : TAccountsReportsResource;virtual;overload;
  654. Property AdclientsResource : TAccountsAdclientsResource Read GetAdclientsInstance;
  655. Property AdunitsResource : TAccountsAdunitsResource Read GetAdunitsInstance;
  656. Property ReportsResource : TAccountsReportsResource Read GetReportsInstance;
  657. end;
  658. { --------------------------------------------------------------------
  659. TAdclientsResource
  660. --------------------------------------------------------------------}
  661. //Optional query Options for TAdclientsResource, method List
  662. TAdclientsListOptions = Record
  663. maxResults : integer;
  664. pageToken : String;
  665. end;
  666. TAdclientsResource = Class(TGoogleResource)
  667. Public
  668. Class Function ResourceName : String; override;
  669. Class Function DefaultAPI : TGoogleAPIClass; override;
  670. Function Get(adClientId: string) : TAdClient;
  671. Function List(AQuery : string = '') : TAdClients;
  672. Function List(AQuery : TAdclientslistOptions) : TAdClients;
  673. end;
  674. { --------------------------------------------------------------------
  675. TAssociationsessionsResource
  676. --------------------------------------------------------------------}
  677. //Optional query Options for TAssociationsessionsResource, method Start
  678. TAssociationsessionsStartOptions = Record
  679. productCode : String;
  680. userLocale : String;
  681. websiteLocale : String;
  682. websiteUrl : String;
  683. end;
  684. //Optional query Options for TAssociationsessionsResource, method Verify
  685. TAssociationsessionsVerifyOptions = Record
  686. token : String;
  687. end;
  688. TAssociationsessionsResource = Class(TGoogleResource)
  689. Public
  690. Class Function ResourceName : String; override;
  691. Class Function DefaultAPI : TGoogleAPIClass; override;
  692. Function Start(AQuery : string = '') : TAssociationSession;
  693. Function Start(AQuery : TAssociationsessionsstartOptions) : TAssociationSession;
  694. Function Verify(AQuery : string = '') : TAssociationSession;
  695. Function Verify(AQuery : TAssociationsessionsverifyOptions) : TAssociationSession;
  696. end;
  697. { --------------------------------------------------------------------
  698. TCustomchannelsResource
  699. --------------------------------------------------------------------}
  700. //Optional query Options for TCustomchannelsResource, method List
  701. TCustomchannelsListOptions = Record
  702. maxResults : integer;
  703. pageToken : String;
  704. end;
  705. //Optional query Options for TCustomchannelsResource, method Patch
  706. TCustomchannelsPatchOptions = Record
  707. customChannelId : String;
  708. end;
  709. TCustomchannelsResource = Class(TGoogleResource)
  710. Public
  711. Class Function ResourceName : String; override;
  712. Class Function DefaultAPI : TGoogleAPIClass; override;
  713. Function Delete(adClientId: string; customChannelId: string) : TCustomChannel;
  714. Function Get(adClientId: string; customChannelId: string) : TCustomChannel;
  715. Function Insert(adClientId: string; aCustomChannel : TCustomChannel) : TCustomChannel;
  716. Function List(adClientId: string; AQuery : string = '') : TCustomChannels;
  717. Function List(adClientId: string; AQuery : TCustomchannelslistOptions) : TCustomChannels;
  718. Function Patch(adClientId: string; aCustomChannel : TCustomChannel; AQuery : string = '') : TCustomChannel;
  719. Function Patch(adClientId: string; aCustomChannel : TCustomChannel; AQuery : TCustomchannelspatchOptions) : TCustomChannel;
  720. Function Update(adClientId: string; aCustomChannel : TCustomChannel) : TCustomChannel;
  721. end;
  722. { --------------------------------------------------------------------
  723. TReportsResource
  724. --------------------------------------------------------------------}
  725. //Optional query Options for TReportsResource, method Generate
  726. TReportsGenerateOptions = Record
  727. dimension : String;
  728. endDate : String;
  729. filter : String;
  730. locale : String;
  731. maxResults : integer;
  732. metric : String;
  733. sort : String;
  734. startDate : String;
  735. startIndex : integer;
  736. end;
  737. TReportsResource = Class(TGoogleResource)
  738. Public
  739. Class Function ResourceName : String; override;
  740. Class Function DefaultAPI : TGoogleAPIClass; override;
  741. Function Generate(AQuery : string = '') : TReport;
  742. Function Generate(AQuery : TReportsgenerateOptions) : TReport;
  743. end;
  744. { --------------------------------------------------------------------
  745. TUrlchannelsResource
  746. --------------------------------------------------------------------}
  747. //Optional query Options for TUrlchannelsResource, method List
  748. TUrlchannelsListOptions = Record
  749. maxResults : integer;
  750. pageToken : String;
  751. end;
  752. TUrlchannelsResource = Class(TGoogleResource)
  753. Public
  754. Class Function ResourceName : String; override;
  755. Class Function DefaultAPI : TGoogleAPIClass; override;
  756. Function Delete(adClientId: string; urlChannelId: string) : TUrlChannel;
  757. Function Insert(adClientId: string; aUrlChannel : TUrlChannel) : TUrlChannel;
  758. Function List(adClientId: string; AQuery : string = '') : TUrlChannels;
  759. Function List(adClientId: string; AQuery : TUrlchannelslistOptions) : TUrlChannels;
  760. end;
  761. { --------------------------------------------------------------------
  762. TAdsensehostAPI
  763. --------------------------------------------------------------------}
  764. TAdsensehostAPI = Class(TGoogleAPI)
  765. Private
  766. FAccountsAdclientsInstance : TAccountsAdclientsResource;
  767. FAccountsAdunitsInstance : TAccountsAdunitsResource;
  768. FAccountsReportsInstance : TAccountsReportsResource;
  769. FAccountsInstance : TAccountsResource;
  770. FAdclientsInstance : TAdclientsResource;
  771. FAssociationsessionsInstance : TAssociationsessionsResource;
  772. FCustomchannelsInstance : TCustomchannelsResource;
  773. FReportsInstance : TReportsResource;
  774. FUrlchannelsInstance : TUrlchannelsResource;
  775. Function GetAccountsAdclientsInstance : TAccountsAdclientsResource;virtual;
  776. Function GetAccountsAdunitsInstance : TAccountsAdunitsResource;virtual;
  777. Function GetAccountsReportsInstance : TAccountsReportsResource;virtual;
  778. Function GetAccountsInstance : TAccountsResource;virtual;
  779. Function GetAdclientsInstance : TAdclientsResource;virtual;
  780. Function GetAssociationsessionsInstance : TAssociationsessionsResource;virtual;
  781. Function GetCustomchannelsInstance : TCustomchannelsResource;virtual;
  782. Function GetReportsInstance : TReportsResource;virtual;
  783. Function GetUrlchannelsInstance : TUrlchannelsResource;virtual;
  784. Public
  785. //Override class functions with API info
  786. Class Function APIName : String; override;
  787. Class Function APIVersion : String; override;
  788. Class Function APIRevision : String; override;
  789. Class Function APIID : String; override;
  790. Class Function APITitle : String; override;
  791. Class Function APIDescription : String; override;
  792. Class Function APIOwnerDomain : String; override;
  793. Class Function APIOwnerName : String; override;
  794. Class Function APIIcon16 : String; override;
  795. Class Function APIIcon32 : String; override;
  796. Class Function APIdocumentationLink : String; override;
  797. Class Function APIrootUrl : string; override;
  798. Class Function APIbasePath : string;override;
  799. Class Function APIbaseURL : String;override;
  800. Class Function APIProtocol : string;override;
  801. Class Function APIservicePath : string;override;
  802. Class Function APIbatchPath : String;override;
  803. Class Function APIAuthScopes : TScopeInfoArray;override;
  804. Class Function APINeedsAuth : Boolean;override;
  805. Class Procedure RegisterAPIResources; override;
  806. //Add create function for resources
  807. Function CreateAccountsAdclientsResource(AOwner : TComponent) : TAccountsAdclientsResource;virtual;overload;
  808. Function CreateAccountsAdclientsResource : TAccountsAdclientsResource;virtual;overload;
  809. Function CreateAccountsAdunitsResource(AOwner : TComponent) : TAccountsAdunitsResource;virtual;overload;
  810. Function CreateAccountsAdunitsResource : TAccountsAdunitsResource;virtual;overload;
  811. Function CreateAccountsReportsResource(AOwner : TComponent) : TAccountsReportsResource;virtual;overload;
  812. Function CreateAccountsReportsResource : TAccountsReportsResource;virtual;overload;
  813. Function CreateAccountsResource(AOwner : TComponent) : TAccountsResource;virtual;overload;
  814. Function CreateAccountsResource : TAccountsResource;virtual;overload;
  815. Function CreateAdclientsResource(AOwner : TComponent) : TAdclientsResource;virtual;overload;
  816. Function CreateAdclientsResource : TAdclientsResource;virtual;overload;
  817. Function CreateAssociationsessionsResource(AOwner : TComponent) : TAssociationsessionsResource;virtual;overload;
  818. Function CreateAssociationsessionsResource : TAssociationsessionsResource;virtual;overload;
  819. Function CreateCustomchannelsResource(AOwner : TComponent) : TCustomchannelsResource;virtual;overload;
  820. Function CreateCustomchannelsResource : TCustomchannelsResource;virtual;overload;
  821. Function CreateReportsResource(AOwner : TComponent) : TReportsResource;virtual;overload;
  822. Function CreateReportsResource : TReportsResource;virtual;overload;
  823. Function CreateUrlchannelsResource(AOwner : TComponent) : TUrlchannelsResource;virtual;overload;
  824. Function CreateUrlchannelsResource : TUrlchannelsResource;virtual;overload;
  825. //Add default on-demand instances for resources
  826. Property AccountsAdclientsResource : TAccountsAdclientsResource Read GetAccountsAdclientsInstance;
  827. Property AccountsAdunitsResource : TAccountsAdunitsResource Read GetAccountsAdunitsInstance;
  828. Property AccountsReportsResource : TAccountsReportsResource Read GetAccountsReportsInstance;
  829. Property AccountsResource : TAccountsResource Read GetAccountsInstance;
  830. Property AdclientsResource : TAdclientsResource Read GetAdclientsInstance;
  831. Property AssociationsessionsResource : TAssociationsessionsResource Read GetAssociationsessionsInstance;
  832. Property CustomchannelsResource : TCustomchannelsResource Read GetCustomchannelsInstance;
  833. Property ReportsResource : TReportsResource Read GetReportsInstance;
  834. Property UrlchannelsResource : TUrlchannelsResource Read GetUrlchannelsInstance;
  835. end;
  836. implementation
  837. { --------------------------------------------------------------------
  838. TAccount
  839. --------------------------------------------------------------------}
  840. Procedure TAccount.Setid(AIndex : Integer; const AValue : String);
  841. begin
  842. If (Fid=AValue) then exit;
  843. Fid:=AValue;
  844. MarkPropertyChanged(AIndex);
  845. end;
  846. Procedure TAccount.Setkind(AIndex : Integer; const AValue : String);
  847. begin
  848. If (Fkind=AValue) then exit;
  849. Fkind:=AValue;
  850. MarkPropertyChanged(AIndex);
  851. end;
  852. Procedure TAccount.Setname(AIndex : Integer; const AValue : String);
  853. begin
  854. If (Fname=AValue) then exit;
  855. Fname:=AValue;
  856. MarkPropertyChanged(AIndex);
  857. end;
  858. Procedure TAccount.Setstatus(AIndex : Integer; const AValue : String);
  859. begin
  860. If (Fstatus=AValue) then exit;
  861. Fstatus:=AValue;
  862. MarkPropertyChanged(AIndex);
  863. end;
  864. { --------------------------------------------------------------------
  865. TAccounts
  866. --------------------------------------------------------------------}
  867. Procedure TAccounts.Setetag(AIndex : Integer; const AValue : String);
  868. begin
  869. If (Fetag=AValue) then exit;
  870. Fetag:=AValue;
  871. MarkPropertyChanged(AIndex);
  872. end;
  873. Procedure TAccounts.Setitems(AIndex : Integer; const AValue : TAccountsTypeitemsArray);
  874. begin
  875. If (Fitems=AValue) then exit;
  876. Fitems:=AValue;
  877. MarkPropertyChanged(AIndex);
  878. end;
  879. Procedure TAccounts.Setkind(AIndex : Integer; const AValue : String);
  880. begin
  881. If (Fkind=AValue) then exit;
  882. Fkind:=AValue;
  883. MarkPropertyChanged(AIndex);
  884. end;
  885. //2.6.4. bug workaround
  886. {$IFDEF VER2_6}
  887. Procedure TAccounts.SetArrayLength(Const AName : String; ALength : Longint);
  888. begin
  889. Case AName of
  890. 'items' : SetLength(Fitems,ALength);
  891. else
  892. Inherited SetArrayLength(AName,ALength);
  893. end;
  894. end;
  895. {$ENDIF VER2_6}
  896. { --------------------------------------------------------------------
  897. TAdClient
  898. --------------------------------------------------------------------}
  899. Procedure TAdClient.SetarcOptIn(AIndex : Integer; const AValue : boolean);
  900. begin
  901. If (FarcOptIn=AValue) then exit;
  902. FarcOptIn:=AValue;
  903. MarkPropertyChanged(AIndex);
  904. end;
  905. Procedure TAdClient.Setid(AIndex : Integer; const AValue : String);
  906. begin
  907. If (Fid=AValue) then exit;
  908. Fid:=AValue;
  909. MarkPropertyChanged(AIndex);
  910. end;
  911. Procedure TAdClient.Setkind(AIndex : Integer; const AValue : String);
  912. begin
  913. If (Fkind=AValue) then exit;
  914. Fkind:=AValue;
  915. MarkPropertyChanged(AIndex);
  916. end;
  917. Procedure TAdClient.SetproductCode(AIndex : Integer; const AValue : String);
  918. begin
  919. If (FproductCode=AValue) then exit;
  920. FproductCode:=AValue;
  921. MarkPropertyChanged(AIndex);
  922. end;
  923. Procedure TAdClient.SetsupportsReporting(AIndex : Integer; const AValue : boolean);
  924. begin
  925. If (FsupportsReporting=AValue) then exit;
  926. FsupportsReporting:=AValue;
  927. MarkPropertyChanged(AIndex);
  928. end;
  929. { --------------------------------------------------------------------
  930. TAdClients
  931. --------------------------------------------------------------------}
  932. Procedure TAdClients.Setetag(AIndex : Integer; const AValue : String);
  933. begin
  934. If (Fetag=AValue) then exit;
  935. Fetag:=AValue;
  936. MarkPropertyChanged(AIndex);
  937. end;
  938. Procedure TAdClients.Setitems(AIndex : Integer; const AValue : TAdClientsTypeitemsArray);
  939. begin
  940. If (Fitems=AValue) then exit;
  941. Fitems:=AValue;
  942. MarkPropertyChanged(AIndex);
  943. end;
  944. Procedure TAdClients.Setkind(AIndex : Integer; const AValue : String);
  945. begin
  946. If (Fkind=AValue) then exit;
  947. Fkind:=AValue;
  948. MarkPropertyChanged(AIndex);
  949. end;
  950. Procedure TAdClients.SetnextPageToken(AIndex : Integer; const AValue : String);
  951. begin
  952. If (FnextPageToken=AValue) then exit;
  953. FnextPageToken:=AValue;
  954. MarkPropertyChanged(AIndex);
  955. end;
  956. //2.6.4. bug workaround
  957. {$IFDEF VER2_6}
  958. Procedure TAdClients.SetArrayLength(Const AName : String; ALength : Longint);
  959. begin
  960. Case AName of
  961. 'items' : SetLength(Fitems,ALength);
  962. else
  963. Inherited SetArrayLength(AName,ALength);
  964. end;
  965. end;
  966. {$ENDIF VER2_6}
  967. { --------------------------------------------------------------------
  968. TAdCode
  969. --------------------------------------------------------------------}
  970. Procedure TAdCode.SetadCode(AIndex : Integer; const AValue : String);
  971. begin
  972. If (FadCode=AValue) then exit;
  973. FadCode:=AValue;
  974. MarkPropertyChanged(AIndex);
  975. end;
  976. Procedure TAdCode.Setkind(AIndex : Integer; const AValue : String);
  977. begin
  978. If (Fkind=AValue) then exit;
  979. Fkind:=AValue;
  980. MarkPropertyChanged(AIndex);
  981. end;
  982. { --------------------------------------------------------------------
  983. TAdStyleTypecolors
  984. --------------------------------------------------------------------}
  985. Procedure TAdStyleTypecolors.Setbackground(AIndex : Integer; const AValue : String);
  986. begin
  987. If (Fbackground=AValue) then exit;
  988. Fbackground:=AValue;
  989. MarkPropertyChanged(AIndex);
  990. end;
  991. Procedure TAdStyleTypecolors.Setborder(AIndex : Integer; const AValue : String);
  992. begin
  993. If (Fborder=AValue) then exit;
  994. Fborder:=AValue;
  995. MarkPropertyChanged(AIndex);
  996. end;
  997. Procedure TAdStyleTypecolors.Settext(AIndex : Integer; const AValue : String);
  998. begin
  999. If (Ftext=AValue) then exit;
  1000. Ftext:=AValue;
  1001. MarkPropertyChanged(AIndex);
  1002. end;
  1003. Procedure TAdStyleTypecolors.Settitle(AIndex : Integer; const AValue : String);
  1004. begin
  1005. If (Ftitle=AValue) then exit;
  1006. Ftitle:=AValue;
  1007. MarkPropertyChanged(AIndex);
  1008. end;
  1009. Procedure TAdStyleTypecolors.Seturl(AIndex : Integer; const AValue : String);
  1010. begin
  1011. If (Furl=AValue) then exit;
  1012. Furl:=AValue;
  1013. MarkPropertyChanged(AIndex);
  1014. end;
  1015. { --------------------------------------------------------------------
  1016. TAdStyleTypefont
  1017. --------------------------------------------------------------------}
  1018. Procedure TAdStyleTypefont.Setfamily(AIndex : Integer; const AValue : String);
  1019. begin
  1020. If (Ffamily=AValue) then exit;
  1021. Ffamily:=AValue;
  1022. MarkPropertyChanged(AIndex);
  1023. end;
  1024. Procedure TAdStyleTypefont.Setsize(AIndex : Integer; const AValue : String);
  1025. begin
  1026. If (Fsize=AValue) then exit;
  1027. Fsize:=AValue;
  1028. MarkPropertyChanged(AIndex);
  1029. end;
  1030. { --------------------------------------------------------------------
  1031. TAdStyle
  1032. --------------------------------------------------------------------}
  1033. Procedure TAdStyle.Setcolors(AIndex : Integer; const AValue : TAdStyleTypecolors);
  1034. begin
  1035. If (Fcolors=AValue) then exit;
  1036. Fcolors:=AValue;
  1037. MarkPropertyChanged(AIndex);
  1038. end;
  1039. Procedure TAdStyle.Setcorners(AIndex : Integer; const AValue : String);
  1040. begin
  1041. If (Fcorners=AValue) then exit;
  1042. Fcorners:=AValue;
  1043. MarkPropertyChanged(AIndex);
  1044. end;
  1045. Procedure TAdStyle.Setfont(AIndex : Integer; const AValue : TAdStyleTypefont);
  1046. begin
  1047. If (Ffont=AValue) then exit;
  1048. Ffont:=AValue;
  1049. MarkPropertyChanged(AIndex);
  1050. end;
  1051. Procedure TAdStyle.Setkind(AIndex : Integer; const AValue : String);
  1052. begin
  1053. If (Fkind=AValue) then exit;
  1054. Fkind:=AValue;
  1055. MarkPropertyChanged(AIndex);
  1056. end;
  1057. { --------------------------------------------------------------------
  1058. TAdUnitTypecontentAdsSettingsTypebackupOption
  1059. --------------------------------------------------------------------}
  1060. Procedure TAdUnitTypecontentAdsSettingsTypebackupOption.Setcolor(AIndex : Integer; const AValue : String);
  1061. begin
  1062. If (Fcolor=AValue) then exit;
  1063. Fcolor:=AValue;
  1064. MarkPropertyChanged(AIndex);
  1065. end;
  1066. Procedure TAdUnitTypecontentAdsSettingsTypebackupOption.Set_type(AIndex : Integer; const AValue : String);
  1067. begin
  1068. If (F_type=AValue) then exit;
  1069. F_type:=AValue;
  1070. MarkPropertyChanged(AIndex);
  1071. end;
  1072. Procedure TAdUnitTypecontentAdsSettingsTypebackupOption.Seturl(AIndex : Integer; const AValue : String);
  1073. begin
  1074. If (Furl=AValue) then exit;
  1075. Furl:=AValue;
  1076. MarkPropertyChanged(AIndex);
  1077. end;
  1078. Class Function TAdUnitTypecontentAdsSettingsTypebackupOption.ExportPropertyName(Const AName : String) :String;
  1079. begin
  1080. Case AName of
  1081. '_type' : Result:='type';
  1082. else
  1083. Result:=Inherited ExportPropertyName(AName);
  1084. end;
  1085. end;
  1086. { --------------------------------------------------------------------
  1087. TAdUnitTypecontentAdsSettings
  1088. --------------------------------------------------------------------}
  1089. Procedure TAdUnitTypecontentAdsSettings.SetbackupOption(AIndex : Integer; const AValue : TAdUnitTypecontentAdsSettingsTypebackupOption);
  1090. begin
  1091. If (FbackupOption=AValue) then exit;
  1092. FbackupOption:=AValue;
  1093. MarkPropertyChanged(AIndex);
  1094. end;
  1095. Procedure TAdUnitTypecontentAdsSettings.Setsize(AIndex : Integer; const AValue : String);
  1096. begin
  1097. If (Fsize=AValue) then exit;
  1098. Fsize:=AValue;
  1099. MarkPropertyChanged(AIndex);
  1100. end;
  1101. Procedure TAdUnitTypecontentAdsSettings.Set_type(AIndex : Integer; const AValue : String);
  1102. begin
  1103. If (F_type=AValue) then exit;
  1104. F_type:=AValue;
  1105. MarkPropertyChanged(AIndex);
  1106. end;
  1107. Class Function TAdUnitTypecontentAdsSettings.ExportPropertyName(Const AName : String) :String;
  1108. begin
  1109. Case AName of
  1110. '_type' : Result:='type';
  1111. else
  1112. Result:=Inherited ExportPropertyName(AName);
  1113. end;
  1114. end;
  1115. { --------------------------------------------------------------------
  1116. TAdUnitTypemobileContentAdsSettings
  1117. --------------------------------------------------------------------}
  1118. Procedure TAdUnitTypemobileContentAdsSettings.SetmarkupLanguage(AIndex : Integer; const AValue : String);
  1119. begin
  1120. If (FmarkupLanguage=AValue) then exit;
  1121. FmarkupLanguage:=AValue;
  1122. MarkPropertyChanged(AIndex);
  1123. end;
  1124. Procedure TAdUnitTypemobileContentAdsSettings.SetscriptingLanguage(AIndex : Integer; const AValue : String);
  1125. begin
  1126. If (FscriptingLanguage=AValue) then exit;
  1127. FscriptingLanguage:=AValue;
  1128. MarkPropertyChanged(AIndex);
  1129. end;
  1130. Procedure TAdUnitTypemobileContentAdsSettings.Setsize(AIndex : Integer; const AValue : String);
  1131. begin
  1132. If (Fsize=AValue) then exit;
  1133. Fsize:=AValue;
  1134. MarkPropertyChanged(AIndex);
  1135. end;
  1136. Procedure TAdUnitTypemobileContentAdsSettings.Set_type(AIndex : Integer; const AValue : String);
  1137. begin
  1138. If (F_type=AValue) then exit;
  1139. F_type:=AValue;
  1140. MarkPropertyChanged(AIndex);
  1141. end;
  1142. Class Function TAdUnitTypemobileContentAdsSettings.ExportPropertyName(Const AName : String) :String;
  1143. begin
  1144. Case AName of
  1145. '_type' : Result:='type';
  1146. else
  1147. Result:=Inherited ExportPropertyName(AName);
  1148. end;
  1149. end;
  1150. { --------------------------------------------------------------------
  1151. TAdUnit
  1152. --------------------------------------------------------------------}
  1153. Procedure TAdUnit.Setcode(AIndex : Integer; const AValue : String);
  1154. begin
  1155. If (Fcode=AValue) then exit;
  1156. Fcode:=AValue;
  1157. MarkPropertyChanged(AIndex);
  1158. end;
  1159. Procedure TAdUnit.SetcontentAdsSettings(AIndex : Integer; const AValue : TAdUnitTypecontentAdsSettings);
  1160. begin
  1161. If (FcontentAdsSettings=AValue) then exit;
  1162. FcontentAdsSettings:=AValue;
  1163. MarkPropertyChanged(AIndex);
  1164. end;
  1165. Procedure TAdUnit.SetcustomStyle(AIndex : Integer; const AValue : TAdStyle);
  1166. begin
  1167. If (FcustomStyle=AValue) then exit;
  1168. FcustomStyle:=AValue;
  1169. MarkPropertyChanged(AIndex);
  1170. end;
  1171. Procedure TAdUnit.Setid(AIndex : Integer; const AValue : String);
  1172. begin
  1173. If (Fid=AValue) then exit;
  1174. Fid:=AValue;
  1175. MarkPropertyChanged(AIndex);
  1176. end;
  1177. Procedure TAdUnit.Setkind(AIndex : Integer; const AValue : String);
  1178. begin
  1179. If (Fkind=AValue) then exit;
  1180. Fkind:=AValue;
  1181. MarkPropertyChanged(AIndex);
  1182. end;
  1183. Procedure TAdUnit.SetmobileContentAdsSettings(AIndex : Integer; const AValue : TAdUnitTypemobileContentAdsSettings);
  1184. begin
  1185. If (FmobileContentAdsSettings=AValue) then exit;
  1186. FmobileContentAdsSettings:=AValue;
  1187. MarkPropertyChanged(AIndex);
  1188. end;
  1189. Procedure TAdUnit.Setname(AIndex : Integer; const AValue : String);
  1190. begin
  1191. If (Fname=AValue) then exit;
  1192. Fname:=AValue;
  1193. MarkPropertyChanged(AIndex);
  1194. end;
  1195. Procedure TAdUnit.Setstatus(AIndex : Integer; const AValue : String);
  1196. begin
  1197. If (Fstatus=AValue) then exit;
  1198. Fstatus:=AValue;
  1199. MarkPropertyChanged(AIndex);
  1200. end;
  1201. { --------------------------------------------------------------------
  1202. TAdUnits
  1203. --------------------------------------------------------------------}
  1204. Procedure TAdUnits.Setetag(AIndex : Integer; const AValue : String);
  1205. begin
  1206. If (Fetag=AValue) then exit;
  1207. Fetag:=AValue;
  1208. MarkPropertyChanged(AIndex);
  1209. end;
  1210. Procedure TAdUnits.Setitems(AIndex : Integer; const AValue : TAdUnitsTypeitemsArray);
  1211. begin
  1212. If (Fitems=AValue) then exit;
  1213. Fitems:=AValue;
  1214. MarkPropertyChanged(AIndex);
  1215. end;
  1216. Procedure TAdUnits.Setkind(AIndex : Integer; const AValue : String);
  1217. begin
  1218. If (Fkind=AValue) then exit;
  1219. Fkind:=AValue;
  1220. MarkPropertyChanged(AIndex);
  1221. end;
  1222. Procedure TAdUnits.SetnextPageToken(AIndex : Integer; const AValue : String);
  1223. begin
  1224. If (FnextPageToken=AValue) then exit;
  1225. FnextPageToken:=AValue;
  1226. MarkPropertyChanged(AIndex);
  1227. end;
  1228. //2.6.4. bug workaround
  1229. {$IFDEF VER2_6}
  1230. Procedure TAdUnits.SetArrayLength(Const AName : String; ALength : Longint);
  1231. begin
  1232. Case AName of
  1233. 'items' : SetLength(Fitems,ALength);
  1234. else
  1235. Inherited SetArrayLength(AName,ALength);
  1236. end;
  1237. end;
  1238. {$ENDIF VER2_6}
  1239. { --------------------------------------------------------------------
  1240. TAssociationSession
  1241. --------------------------------------------------------------------}
  1242. Procedure TAssociationSession.SetaccountId(AIndex : Integer; const AValue : String);
  1243. begin
  1244. If (FaccountId=AValue) then exit;
  1245. FaccountId:=AValue;
  1246. MarkPropertyChanged(AIndex);
  1247. end;
  1248. Procedure TAssociationSession.Setid(AIndex : Integer; const AValue : String);
  1249. begin
  1250. If (Fid=AValue) then exit;
  1251. Fid:=AValue;
  1252. MarkPropertyChanged(AIndex);
  1253. end;
  1254. Procedure TAssociationSession.Setkind(AIndex : Integer; const AValue : String);
  1255. begin
  1256. If (Fkind=AValue) then exit;
  1257. Fkind:=AValue;
  1258. MarkPropertyChanged(AIndex);
  1259. end;
  1260. Procedure TAssociationSession.SetproductCodes(AIndex : Integer; const AValue : TStringArray);
  1261. begin
  1262. If (FproductCodes=AValue) then exit;
  1263. FproductCodes:=AValue;
  1264. MarkPropertyChanged(AIndex);
  1265. end;
  1266. Procedure TAssociationSession.SetredirectUrl(AIndex : Integer; const AValue : String);
  1267. begin
  1268. If (FredirectUrl=AValue) then exit;
  1269. FredirectUrl:=AValue;
  1270. MarkPropertyChanged(AIndex);
  1271. end;
  1272. Procedure TAssociationSession.Setstatus(AIndex : Integer; const AValue : String);
  1273. begin
  1274. If (Fstatus=AValue) then exit;
  1275. Fstatus:=AValue;
  1276. MarkPropertyChanged(AIndex);
  1277. end;
  1278. Procedure TAssociationSession.SetuserLocale(AIndex : Integer; const AValue : String);
  1279. begin
  1280. If (FuserLocale=AValue) then exit;
  1281. FuserLocale:=AValue;
  1282. MarkPropertyChanged(AIndex);
  1283. end;
  1284. Procedure TAssociationSession.SetwebsiteLocale(AIndex : Integer; const AValue : String);
  1285. begin
  1286. If (FwebsiteLocale=AValue) then exit;
  1287. FwebsiteLocale:=AValue;
  1288. MarkPropertyChanged(AIndex);
  1289. end;
  1290. Procedure TAssociationSession.SetwebsiteUrl(AIndex : Integer; const AValue : String);
  1291. begin
  1292. If (FwebsiteUrl=AValue) then exit;
  1293. FwebsiteUrl:=AValue;
  1294. MarkPropertyChanged(AIndex);
  1295. end;
  1296. //2.6.4. bug workaround
  1297. {$IFDEF VER2_6}
  1298. Procedure TAssociationSession.SetArrayLength(Const AName : String; ALength : Longint);
  1299. begin
  1300. Case AName of
  1301. 'productcodes' : SetLength(FproductCodes,ALength);
  1302. else
  1303. Inherited SetArrayLength(AName,ALength);
  1304. end;
  1305. end;
  1306. {$ENDIF VER2_6}
  1307. { --------------------------------------------------------------------
  1308. TCustomChannel
  1309. --------------------------------------------------------------------}
  1310. Procedure TCustomChannel.Setcode(AIndex : Integer; const AValue : String);
  1311. begin
  1312. If (Fcode=AValue) then exit;
  1313. Fcode:=AValue;
  1314. MarkPropertyChanged(AIndex);
  1315. end;
  1316. Procedure TCustomChannel.Setid(AIndex : Integer; const AValue : String);
  1317. begin
  1318. If (Fid=AValue) then exit;
  1319. Fid:=AValue;
  1320. MarkPropertyChanged(AIndex);
  1321. end;
  1322. Procedure TCustomChannel.Setkind(AIndex : Integer; const AValue : String);
  1323. begin
  1324. If (Fkind=AValue) then exit;
  1325. Fkind:=AValue;
  1326. MarkPropertyChanged(AIndex);
  1327. end;
  1328. Procedure TCustomChannel.Setname(AIndex : Integer; const AValue : String);
  1329. begin
  1330. If (Fname=AValue) then exit;
  1331. Fname:=AValue;
  1332. MarkPropertyChanged(AIndex);
  1333. end;
  1334. { --------------------------------------------------------------------
  1335. TCustomChannels
  1336. --------------------------------------------------------------------}
  1337. Procedure TCustomChannels.Setetag(AIndex : Integer; const AValue : String);
  1338. begin
  1339. If (Fetag=AValue) then exit;
  1340. Fetag:=AValue;
  1341. MarkPropertyChanged(AIndex);
  1342. end;
  1343. Procedure TCustomChannels.Setitems(AIndex : Integer; const AValue : TCustomChannelsTypeitemsArray);
  1344. begin
  1345. If (Fitems=AValue) then exit;
  1346. Fitems:=AValue;
  1347. MarkPropertyChanged(AIndex);
  1348. end;
  1349. Procedure TCustomChannels.Setkind(AIndex : Integer; const AValue : String);
  1350. begin
  1351. If (Fkind=AValue) then exit;
  1352. Fkind:=AValue;
  1353. MarkPropertyChanged(AIndex);
  1354. end;
  1355. Procedure TCustomChannels.SetnextPageToken(AIndex : Integer; const AValue : String);
  1356. begin
  1357. If (FnextPageToken=AValue) then exit;
  1358. FnextPageToken:=AValue;
  1359. MarkPropertyChanged(AIndex);
  1360. end;
  1361. //2.6.4. bug workaround
  1362. {$IFDEF VER2_6}
  1363. Procedure TCustomChannels.SetArrayLength(Const AName : String; ALength : Longint);
  1364. begin
  1365. Case AName of
  1366. 'items' : SetLength(Fitems,ALength);
  1367. else
  1368. Inherited SetArrayLength(AName,ALength);
  1369. end;
  1370. end;
  1371. {$ENDIF VER2_6}
  1372. { --------------------------------------------------------------------
  1373. TReportTypeheadersItem
  1374. --------------------------------------------------------------------}
  1375. Procedure TReportTypeheadersItem.Setcurrency(AIndex : Integer; const AValue : String);
  1376. begin
  1377. If (Fcurrency=AValue) then exit;
  1378. Fcurrency:=AValue;
  1379. MarkPropertyChanged(AIndex);
  1380. end;
  1381. Procedure TReportTypeheadersItem.Setname(AIndex : Integer; const AValue : String);
  1382. begin
  1383. If (Fname=AValue) then exit;
  1384. Fname:=AValue;
  1385. MarkPropertyChanged(AIndex);
  1386. end;
  1387. Procedure TReportTypeheadersItem.Set_type(AIndex : Integer; const AValue : String);
  1388. begin
  1389. If (F_type=AValue) then exit;
  1390. F_type:=AValue;
  1391. MarkPropertyChanged(AIndex);
  1392. end;
  1393. Class Function TReportTypeheadersItem.ExportPropertyName(Const AName : String) :String;
  1394. begin
  1395. Case AName of
  1396. '_type' : Result:='type';
  1397. else
  1398. Result:=Inherited ExportPropertyName(AName);
  1399. end;
  1400. end;
  1401. { --------------------------------------------------------------------
  1402. TReport
  1403. --------------------------------------------------------------------}
  1404. Procedure TReport.Setaverages(AIndex : Integer; const AValue : TStringArray);
  1405. begin
  1406. If (Faverages=AValue) then exit;
  1407. Faverages:=AValue;
  1408. MarkPropertyChanged(AIndex);
  1409. end;
  1410. Procedure TReport.Setheaders(AIndex : Integer; const AValue : TReportTypeheadersArray);
  1411. begin
  1412. If (Fheaders=AValue) then exit;
  1413. Fheaders:=AValue;
  1414. MarkPropertyChanged(AIndex);
  1415. end;
  1416. Procedure TReport.Setkind(AIndex : Integer; const AValue : String);
  1417. begin
  1418. If (Fkind=AValue) then exit;
  1419. Fkind:=AValue;
  1420. MarkPropertyChanged(AIndex);
  1421. end;
  1422. Procedure TReport.Setrows(AIndex : Integer; const AValue : TReportTyperowsArray);
  1423. begin
  1424. If (Frows=AValue) then exit;
  1425. Frows:=AValue;
  1426. MarkPropertyChanged(AIndex);
  1427. end;
  1428. Procedure TReport.SettotalMatchedRows(AIndex : Integer; const AValue : String);
  1429. begin
  1430. If (FtotalMatchedRows=AValue) then exit;
  1431. FtotalMatchedRows:=AValue;
  1432. MarkPropertyChanged(AIndex);
  1433. end;
  1434. Procedure TReport.Settotals(AIndex : Integer; const AValue : TStringArray);
  1435. begin
  1436. If (Ftotals=AValue) then exit;
  1437. Ftotals:=AValue;
  1438. MarkPropertyChanged(AIndex);
  1439. end;
  1440. Procedure TReport.Setwarnings(AIndex : Integer; const AValue : TStringArray);
  1441. begin
  1442. If (Fwarnings=AValue) then exit;
  1443. Fwarnings:=AValue;
  1444. MarkPropertyChanged(AIndex);
  1445. end;
  1446. //2.6.4. bug workaround
  1447. {$IFDEF VER2_6}
  1448. Procedure TReport.SetArrayLength(Const AName : String; ALength : Longint);
  1449. begin
  1450. Case AName of
  1451. 'averages' : SetLength(Faverages,ALength);
  1452. 'headers' : SetLength(Fheaders,ALength);
  1453. 'rows' : SetLength(Frows,ALength);
  1454. 'totals' : SetLength(Ftotals,ALength);
  1455. 'warnings' : SetLength(Fwarnings,ALength);
  1456. else
  1457. Inherited SetArrayLength(AName,ALength);
  1458. end;
  1459. end;
  1460. {$ENDIF VER2_6}
  1461. { --------------------------------------------------------------------
  1462. TUrlChannel
  1463. --------------------------------------------------------------------}
  1464. Procedure TUrlChannel.Setid(AIndex : Integer; const AValue : String);
  1465. begin
  1466. If (Fid=AValue) then exit;
  1467. Fid:=AValue;
  1468. MarkPropertyChanged(AIndex);
  1469. end;
  1470. Procedure TUrlChannel.Setkind(AIndex : Integer; const AValue : String);
  1471. begin
  1472. If (Fkind=AValue) then exit;
  1473. Fkind:=AValue;
  1474. MarkPropertyChanged(AIndex);
  1475. end;
  1476. Procedure TUrlChannel.SeturlPattern(AIndex : Integer; const AValue : String);
  1477. begin
  1478. If (FurlPattern=AValue) then exit;
  1479. FurlPattern:=AValue;
  1480. MarkPropertyChanged(AIndex);
  1481. end;
  1482. { --------------------------------------------------------------------
  1483. TUrlChannels
  1484. --------------------------------------------------------------------}
  1485. Procedure TUrlChannels.Setetag(AIndex : Integer; const AValue : String);
  1486. begin
  1487. If (Fetag=AValue) then exit;
  1488. Fetag:=AValue;
  1489. MarkPropertyChanged(AIndex);
  1490. end;
  1491. Procedure TUrlChannels.Setitems(AIndex : Integer; const AValue : TUrlChannelsTypeitemsArray);
  1492. begin
  1493. If (Fitems=AValue) then exit;
  1494. Fitems:=AValue;
  1495. MarkPropertyChanged(AIndex);
  1496. end;
  1497. Procedure TUrlChannels.Setkind(AIndex : Integer; const AValue : String);
  1498. begin
  1499. If (Fkind=AValue) then exit;
  1500. Fkind:=AValue;
  1501. MarkPropertyChanged(AIndex);
  1502. end;
  1503. Procedure TUrlChannels.SetnextPageToken(AIndex : Integer; const AValue : String);
  1504. begin
  1505. If (FnextPageToken=AValue) then exit;
  1506. FnextPageToken:=AValue;
  1507. MarkPropertyChanged(AIndex);
  1508. end;
  1509. //2.6.4. bug workaround
  1510. {$IFDEF VER2_6}
  1511. Procedure TUrlChannels.SetArrayLength(Const AName : String; ALength : Longint);
  1512. begin
  1513. Case AName of
  1514. 'items' : SetLength(Fitems,ALength);
  1515. else
  1516. Inherited SetArrayLength(AName,ALength);
  1517. end;
  1518. end;
  1519. {$ENDIF VER2_6}
  1520. { --------------------------------------------------------------------
  1521. TAccountsAdclientsResource
  1522. --------------------------------------------------------------------}
  1523. Class Function TAccountsAdclientsResource.ResourceName : String;
  1524. begin
  1525. Result:='adclients';
  1526. end;
  1527. Class Function TAccountsAdclientsResource.DefaultAPI : TGoogleAPIClass;
  1528. begin
  1529. Result:=TadsensehostAPI;
  1530. end;
  1531. Function TAccountsAdclientsResource.Get(accountId: string; adClientId: string) : TAdClient;
  1532. Const
  1533. _HTTPMethod = 'GET';
  1534. _Path = 'accounts/{accountId}/adclients/{adClientId}';
  1535. _Methodid = 'adsensehost.accounts.adclients.get';
  1536. Var
  1537. _P : String;
  1538. begin
  1539. _P:=SubstitutePath(_Path,['accountId',accountId,'adClientId',adClientId]);
  1540. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TAdClient) as TAdClient;
  1541. end;
  1542. Function TAccountsAdclientsResource.List(accountId: string; AQuery : string = '') : TAdClients;
  1543. Const
  1544. _HTTPMethod = 'GET';
  1545. _Path = 'accounts/{accountId}/adclients';
  1546. _Methodid = 'adsensehost.accounts.adclients.list';
  1547. Var
  1548. _P : String;
  1549. begin
  1550. _P:=SubstitutePath(_Path,['accountId',accountId]);
  1551. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TAdClients) as TAdClients;
  1552. end;
  1553. Function TAccountsAdclientsResource.List(accountId: string; AQuery : TAccountsAdclientslistOptions) : TAdClients;
  1554. Var
  1555. _Q : String;
  1556. begin
  1557. _Q:='';
  1558. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1559. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1560. Result:=List(accountId,_Q);
  1561. end;
  1562. { --------------------------------------------------------------------
  1563. TAccountsAdunitsResource
  1564. --------------------------------------------------------------------}
  1565. Class Function TAccountsAdunitsResource.ResourceName : String;
  1566. begin
  1567. Result:='adunits';
  1568. end;
  1569. Class Function TAccountsAdunitsResource.DefaultAPI : TGoogleAPIClass;
  1570. begin
  1571. Result:=TadsensehostAPI;
  1572. end;
  1573. Function TAccountsAdunitsResource.Delete(accountId: string; adClientId: string; adUnitId: string) : TAdUnit;
  1574. Const
  1575. _HTTPMethod = 'DELETE';
  1576. _Path = 'accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}';
  1577. _Methodid = 'adsensehost.accounts.adunits.delete';
  1578. Var
  1579. _P : String;
  1580. begin
  1581. _P:=SubstitutePath(_Path,['accountId',accountId,'adClientId',adClientId,'adUnitId',adUnitId]);
  1582. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TAdUnit) as TAdUnit;
  1583. end;
  1584. Function TAccountsAdunitsResource.Get(accountId: string; adClientId: string; adUnitId: string) : TAdUnit;
  1585. Const
  1586. _HTTPMethod = 'GET';
  1587. _Path = 'accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}';
  1588. _Methodid = 'adsensehost.accounts.adunits.get';
  1589. Var
  1590. _P : String;
  1591. begin
  1592. _P:=SubstitutePath(_Path,['accountId',accountId,'adClientId',adClientId,'adUnitId',adUnitId]);
  1593. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TAdUnit) as TAdUnit;
  1594. end;
  1595. Function TAccountsAdunitsResource.GetAdCode(accountId: string; adClientId: string; adUnitId: string; AQuery : string = '') : TAdCode;
  1596. Const
  1597. _HTTPMethod = 'GET';
  1598. _Path = 'accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode';
  1599. _Methodid = 'adsensehost.accounts.adunits.getAdCode';
  1600. Var
  1601. _P : String;
  1602. begin
  1603. _P:=SubstitutePath(_Path,['accountId',accountId,'adClientId',adClientId,'adUnitId',adUnitId]);
  1604. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TAdCode) as TAdCode;
  1605. end;
  1606. Function TAccountsAdunitsResource.GetAdCode(accountId: string; adClientId: string; adUnitId: string; AQuery : TAccountsAdunitsgetAdCodeOptions) : TAdCode;
  1607. Var
  1608. _Q : String;
  1609. begin
  1610. _Q:='';
  1611. AddToQuery(_Q,'hostCustomChannelId',AQuery.hostCustomChannelId);
  1612. Result:=GetAdCode(accountId,adClientId,adUnitId,_Q);
  1613. end;
  1614. Function TAccountsAdunitsResource.Insert(accountId: string; adClientId: string; aAdUnit : TAdUnit) : TAdUnit;
  1615. Const
  1616. _HTTPMethod = 'POST';
  1617. _Path = 'accounts/{accountId}/adclients/{adClientId}/adunits';
  1618. _Methodid = 'adsensehost.accounts.adunits.insert';
  1619. Var
  1620. _P : String;
  1621. begin
  1622. _P:=SubstitutePath(_Path,['accountId',accountId,'adClientId',adClientId]);
  1623. Result:=ServiceCall(_HTTPMethod,_P,'',aAdUnit,TAdUnit) as TAdUnit;
  1624. end;
  1625. Function TAccountsAdunitsResource.List(accountId: string; adClientId: string; AQuery : string = '') : TAdUnits;
  1626. Const
  1627. _HTTPMethod = 'GET';
  1628. _Path = 'accounts/{accountId}/adclients/{adClientId}/adunits';
  1629. _Methodid = 'adsensehost.accounts.adunits.list';
  1630. Var
  1631. _P : String;
  1632. begin
  1633. _P:=SubstitutePath(_Path,['accountId',accountId,'adClientId',adClientId]);
  1634. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TAdUnits) as TAdUnits;
  1635. end;
  1636. Function TAccountsAdunitsResource.List(accountId: string; adClientId: string; AQuery : TAccountsAdunitslistOptions) : TAdUnits;
  1637. Var
  1638. _Q : String;
  1639. begin
  1640. _Q:='';
  1641. AddToQuery(_Q,'includeInactive',AQuery.includeInactive);
  1642. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1643. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1644. Result:=List(accountId,adClientId,_Q);
  1645. end;
  1646. Function TAccountsAdunitsResource.Patch(accountId: string; adClientId: string; aAdUnit : TAdUnit; AQuery : string = '') : TAdUnit;
  1647. Const
  1648. _HTTPMethod = 'PATCH';
  1649. _Path = 'accounts/{accountId}/adclients/{adClientId}/adunits';
  1650. _Methodid = 'adsensehost.accounts.adunits.patch';
  1651. Var
  1652. _P : String;
  1653. begin
  1654. _P:=SubstitutePath(_Path,['accountId',accountId,'adClientId',adClientId]);
  1655. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aAdUnit,TAdUnit) as TAdUnit;
  1656. end;
  1657. Function TAccountsAdunitsResource.Patch(accountId: string; adClientId: string; aAdUnit : TAdUnit; AQuery : TAccountsAdunitspatchOptions) : TAdUnit;
  1658. Var
  1659. _Q : String;
  1660. begin
  1661. _Q:='';
  1662. AddToQuery(_Q,'adUnitId',AQuery.adUnitId);
  1663. Result:=Patch(accountId,adClientId,aAdUnit,_Q);
  1664. end;
  1665. Function TAccountsAdunitsResource.Update(accountId: string; adClientId: string; aAdUnit : TAdUnit) : TAdUnit;
  1666. Const
  1667. _HTTPMethod = 'PUT';
  1668. _Path = 'accounts/{accountId}/adclients/{adClientId}/adunits';
  1669. _Methodid = 'adsensehost.accounts.adunits.update';
  1670. Var
  1671. _P : String;
  1672. begin
  1673. _P:=SubstitutePath(_Path,['accountId',accountId,'adClientId',adClientId]);
  1674. Result:=ServiceCall(_HTTPMethod,_P,'',aAdUnit,TAdUnit) as TAdUnit;
  1675. end;
  1676. { --------------------------------------------------------------------
  1677. TAccountsReportsResource
  1678. --------------------------------------------------------------------}
  1679. Class Function TAccountsReportsResource.ResourceName : String;
  1680. begin
  1681. Result:='reports';
  1682. end;
  1683. Class Function TAccountsReportsResource.DefaultAPI : TGoogleAPIClass;
  1684. begin
  1685. Result:=TadsensehostAPI;
  1686. end;
  1687. Function TAccountsReportsResource.Generate(accountId: string; AQuery : string = '') : TReport;
  1688. Const
  1689. _HTTPMethod = 'GET';
  1690. _Path = 'accounts/{accountId}/reports';
  1691. _Methodid = 'adsensehost.accounts.reports.generate';
  1692. Var
  1693. _P : String;
  1694. begin
  1695. _P:=SubstitutePath(_Path,['accountId',accountId]);
  1696. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TReport) as TReport;
  1697. end;
  1698. Function TAccountsReportsResource.Generate(accountId: string; AQuery : TAccountsReportsgenerateOptions) : TReport;
  1699. Var
  1700. _Q : String;
  1701. begin
  1702. _Q:='';
  1703. AddToQuery(_Q,'dimension',AQuery.dimension);
  1704. AddToQuery(_Q,'endDate',AQuery.endDate);
  1705. AddToQuery(_Q,'filter',AQuery.filter);
  1706. AddToQuery(_Q,'locale',AQuery.locale);
  1707. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1708. AddToQuery(_Q,'metric',AQuery.metric);
  1709. AddToQuery(_Q,'sort',AQuery.sort);
  1710. AddToQuery(_Q,'startDate',AQuery.startDate);
  1711. AddToQuery(_Q,'startIndex',AQuery.startIndex);
  1712. Result:=Generate(accountId,_Q);
  1713. end;
  1714. { --------------------------------------------------------------------
  1715. TAccountsResource
  1716. --------------------------------------------------------------------}
  1717. Class Function TAccountsResource.ResourceName : String;
  1718. begin
  1719. Result:='accounts';
  1720. end;
  1721. Class Function TAccountsResource.DefaultAPI : TGoogleAPIClass;
  1722. begin
  1723. Result:=TadsensehostAPI;
  1724. end;
  1725. Function TAccountsResource.Get(accountId: string) : TAccount;
  1726. Const
  1727. _HTTPMethod = 'GET';
  1728. _Path = 'accounts/{accountId}';
  1729. _Methodid = 'adsensehost.accounts.get';
  1730. Var
  1731. _P : String;
  1732. begin
  1733. _P:=SubstitutePath(_Path,['accountId',accountId]);
  1734. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TAccount) as TAccount;
  1735. end;
  1736. Function TAccountsResource.List(AQuery : string = '') : TAccounts;
  1737. Const
  1738. _HTTPMethod = 'GET';
  1739. _Path = 'accounts';
  1740. _Methodid = 'adsensehost.accounts.list';
  1741. begin
  1742. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TAccounts) as TAccounts;
  1743. end;
  1744. Function TAccountsResource.List(AQuery : TAccountslistOptions) : TAccounts;
  1745. Var
  1746. _Q : String;
  1747. begin
  1748. _Q:='';
  1749. AddToQuery(_Q,'filterAdClientId',AQuery.filterAdClientId);
  1750. Result:=List(_Q);
  1751. end;
  1752. Function TAccountsResource.GetAdclientsInstance : TAccountsAdclientsResource;
  1753. begin
  1754. if (FAdclientsInstance=Nil) then
  1755. FAdclientsInstance:=CreateAdclientsResource;
  1756. Result:=FAdclientsInstance;
  1757. end;
  1758. Function TAccountsResource.CreateAdclientsResource : TAccountsAdclientsResource;
  1759. begin
  1760. Result:=CreateAdclientsResource(Self);
  1761. end;
  1762. Function TAccountsResource.CreateAdclientsResource(AOwner : TComponent) : TAccountsAdclientsResource;
  1763. begin
  1764. Result:=TAccountsAdclientsResource.Create(AOwner);
  1765. Result.API:=Self.API;
  1766. end;
  1767. Function TAccountsResource.GetAdunitsInstance : TAccountsAdunitsResource;
  1768. begin
  1769. if (FAdunitsInstance=Nil) then
  1770. FAdunitsInstance:=CreateAdunitsResource;
  1771. Result:=FAdunitsInstance;
  1772. end;
  1773. Function TAccountsResource.CreateAdunitsResource : TAccountsAdunitsResource;
  1774. begin
  1775. Result:=CreateAdunitsResource(Self);
  1776. end;
  1777. Function TAccountsResource.CreateAdunitsResource(AOwner : TComponent) : TAccountsAdunitsResource;
  1778. begin
  1779. Result:=TAccountsAdunitsResource.Create(AOwner);
  1780. Result.API:=Self.API;
  1781. end;
  1782. Function TAccountsResource.GetReportsInstance : TAccountsReportsResource;
  1783. begin
  1784. if (FReportsInstance=Nil) then
  1785. FReportsInstance:=CreateReportsResource;
  1786. Result:=FReportsInstance;
  1787. end;
  1788. Function TAccountsResource.CreateReportsResource : TAccountsReportsResource;
  1789. begin
  1790. Result:=CreateReportsResource(Self);
  1791. end;
  1792. Function TAccountsResource.CreateReportsResource(AOwner : TComponent) : TAccountsReportsResource;
  1793. begin
  1794. Result:=TAccountsReportsResource.Create(AOwner);
  1795. Result.API:=Self.API;
  1796. end;
  1797. { --------------------------------------------------------------------
  1798. TAdclientsResource
  1799. --------------------------------------------------------------------}
  1800. Class Function TAdclientsResource.ResourceName : String;
  1801. begin
  1802. Result:='adclients';
  1803. end;
  1804. Class Function TAdclientsResource.DefaultAPI : TGoogleAPIClass;
  1805. begin
  1806. Result:=TadsensehostAPI;
  1807. end;
  1808. Function TAdclientsResource.Get(adClientId: string) : TAdClient;
  1809. Const
  1810. _HTTPMethod = 'GET';
  1811. _Path = 'adclients/{adClientId}';
  1812. _Methodid = 'adsensehost.adclients.get';
  1813. Var
  1814. _P : String;
  1815. begin
  1816. _P:=SubstitutePath(_Path,['adClientId',adClientId]);
  1817. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TAdClient) as TAdClient;
  1818. end;
  1819. Function TAdclientsResource.List(AQuery : string = '') : TAdClients;
  1820. Const
  1821. _HTTPMethod = 'GET';
  1822. _Path = 'adclients';
  1823. _Methodid = 'adsensehost.adclients.list';
  1824. begin
  1825. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TAdClients) as TAdClients;
  1826. end;
  1827. Function TAdclientsResource.List(AQuery : TAdclientslistOptions) : TAdClients;
  1828. Var
  1829. _Q : String;
  1830. begin
  1831. _Q:='';
  1832. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1833. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1834. Result:=List(_Q);
  1835. end;
  1836. { --------------------------------------------------------------------
  1837. TAssociationsessionsResource
  1838. --------------------------------------------------------------------}
  1839. Class Function TAssociationsessionsResource.ResourceName : String;
  1840. begin
  1841. Result:='associationsessions';
  1842. end;
  1843. Class Function TAssociationsessionsResource.DefaultAPI : TGoogleAPIClass;
  1844. begin
  1845. Result:=TadsensehostAPI;
  1846. end;
  1847. Function TAssociationsessionsResource.Start(AQuery : string = '') : TAssociationSession;
  1848. Const
  1849. _HTTPMethod = 'GET';
  1850. _Path = 'associationsessions/start';
  1851. _Methodid = 'adsensehost.associationsessions.start';
  1852. begin
  1853. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TAssociationSession) as TAssociationSession;
  1854. end;
  1855. Function TAssociationsessionsResource.Start(AQuery : TAssociationsessionsstartOptions) : TAssociationSession;
  1856. Var
  1857. _Q : String;
  1858. begin
  1859. _Q:='';
  1860. AddToQuery(_Q,'productCode',AQuery.productCode);
  1861. AddToQuery(_Q,'userLocale',AQuery.userLocale);
  1862. AddToQuery(_Q,'websiteLocale',AQuery.websiteLocale);
  1863. AddToQuery(_Q,'websiteUrl',AQuery.websiteUrl);
  1864. Result:=Start(_Q);
  1865. end;
  1866. Function TAssociationsessionsResource.Verify(AQuery : string = '') : TAssociationSession;
  1867. Const
  1868. _HTTPMethod = 'GET';
  1869. _Path = 'associationsessions/verify';
  1870. _Methodid = 'adsensehost.associationsessions.verify';
  1871. begin
  1872. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TAssociationSession) as TAssociationSession;
  1873. end;
  1874. Function TAssociationsessionsResource.Verify(AQuery : TAssociationsessionsverifyOptions) : TAssociationSession;
  1875. Var
  1876. _Q : String;
  1877. begin
  1878. _Q:='';
  1879. AddToQuery(_Q,'token',AQuery.token);
  1880. Result:=Verify(_Q);
  1881. end;
  1882. { --------------------------------------------------------------------
  1883. TCustomchannelsResource
  1884. --------------------------------------------------------------------}
  1885. Class Function TCustomchannelsResource.ResourceName : String;
  1886. begin
  1887. Result:='customchannels';
  1888. end;
  1889. Class Function TCustomchannelsResource.DefaultAPI : TGoogleAPIClass;
  1890. begin
  1891. Result:=TadsensehostAPI;
  1892. end;
  1893. Function TCustomchannelsResource.Delete(adClientId: string; customChannelId: string) : TCustomChannel;
  1894. Const
  1895. _HTTPMethod = 'DELETE';
  1896. _Path = 'adclients/{adClientId}/customchannels/{customChannelId}';
  1897. _Methodid = 'adsensehost.customchannels.delete';
  1898. Var
  1899. _P : String;
  1900. begin
  1901. _P:=SubstitutePath(_Path,['adClientId',adClientId,'customChannelId',customChannelId]);
  1902. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TCustomChannel) as TCustomChannel;
  1903. end;
  1904. Function TCustomchannelsResource.Get(adClientId: string; customChannelId: string) : TCustomChannel;
  1905. Const
  1906. _HTTPMethod = 'GET';
  1907. _Path = 'adclients/{adClientId}/customchannels/{customChannelId}';
  1908. _Methodid = 'adsensehost.customchannels.get';
  1909. Var
  1910. _P : String;
  1911. begin
  1912. _P:=SubstitutePath(_Path,['adClientId',adClientId,'customChannelId',customChannelId]);
  1913. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TCustomChannel) as TCustomChannel;
  1914. end;
  1915. Function TCustomchannelsResource.Insert(adClientId: string; aCustomChannel : TCustomChannel) : TCustomChannel;
  1916. Const
  1917. _HTTPMethod = 'POST';
  1918. _Path = 'adclients/{adClientId}/customchannels';
  1919. _Methodid = 'adsensehost.customchannels.insert';
  1920. Var
  1921. _P : String;
  1922. begin
  1923. _P:=SubstitutePath(_Path,['adClientId',adClientId]);
  1924. Result:=ServiceCall(_HTTPMethod,_P,'',aCustomChannel,TCustomChannel) as TCustomChannel;
  1925. end;
  1926. Function TCustomchannelsResource.List(adClientId: string; AQuery : string = '') : TCustomChannels;
  1927. Const
  1928. _HTTPMethod = 'GET';
  1929. _Path = 'adclients/{adClientId}/customchannels';
  1930. _Methodid = 'adsensehost.customchannels.list';
  1931. Var
  1932. _P : String;
  1933. begin
  1934. _P:=SubstitutePath(_Path,['adClientId',adClientId]);
  1935. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TCustomChannels) as TCustomChannels;
  1936. end;
  1937. Function TCustomchannelsResource.List(adClientId: string; AQuery : TCustomchannelslistOptions) : TCustomChannels;
  1938. Var
  1939. _Q : String;
  1940. begin
  1941. _Q:='';
  1942. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1943. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1944. Result:=List(adClientId,_Q);
  1945. end;
  1946. Function TCustomchannelsResource.Patch(adClientId: string; aCustomChannel : TCustomChannel; AQuery : string = '') : TCustomChannel;
  1947. Const
  1948. _HTTPMethod = 'PATCH';
  1949. _Path = 'adclients/{adClientId}/customchannels';
  1950. _Methodid = 'adsensehost.customchannels.patch';
  1951. Var
  1952. _P : String;
  1953. begin
  1954. _P:=SubstitutePath(_Path,['adClientId',adClientId]);
  1955. Result:=ServiceCall(_HTTPMethod,_P,AQuery,aCustomChannel,TCustomChannel) as TCustomChannel;
  1956. end;
  1957. Function TCustomchannelsResource.Patch(adClientId: string; aCustomChannel : TCustomChannel; AQuery : TCustomchannelspatchOptions) : TCustomChannel;
  1958. Var
  1959. _Q : String;
  1960. begin
  1961. _Q:='';
  1962. AddToQuery(_Q,'customChannelId',AQuery.customChannelId);
  1963. Result:=Patch(adClientId,aCustomChannel,_Q);
  1964. end;
  1965. Function TCustomchannelsResource.Update(adClientId: string; aCustomChannel : TCustomChannel) : TCustomChannel;
  1966. Const
  1967. _HTTPMethod = 'PUT';
  1968. _Path = 'adclients/{adClientId}/customchannels';
  1969. _Methodid = 'adsensehost.customchannels.update';
  1970. Var
  1971. _P : String;
  1972. begin
  1973. _P:=SubstitutePath(_Path,['adClientId',adClientId]);
  1974. Result:=ServiceCall(_HTTPMethod,_P,'',aCustomChannel,TCustomChannel) as TCustomChannel;
  1975. end;
  1976. { --------------------------------------------------------------------
  1977. TReportsResource
  1978. --------------------------------------------------------------------}
  1979. Class Function TReportsResource.ResourceName : String;
  1980. begin
  1981. Result:='reports';
  1982. end;
  1983. Class Function TReportsResource.DefaultAPI : TGoogleAPIClass;
  1984. begin
  1985. Result:=TadsensehostAPI;
  1986. end;
  1987. Function TReportsResource.Generate(AQuery : string = '') : TReport;
  1988. Const
  1989. _HTTPMethod = 'GET';
  1990. _Path = 'reports';
  1991. _Methodid = 'adsensehost.reports.generate';
  1992. begin
  1993. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TReport) as TReport;
  1994. end;
  1995. Function TReportsResource.Generate(AQuery : TReportsgenerateOptions) : TReport;
  1996. Var
  1997. _Q : String;
  1998. begin
  1999. _Q:='';
  2000. AddToQuery(_Q,'dimension',AQuery.dimension);
  2001. AddToQuery(_Q,'endDate',AQuery.endDate);
  2002. AddToQuery(_Q,'filter',AQuery.filter);
  2003. AddToQuery(_Q,'locale',AQuery.locale);
  2004. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  2005. AddToQuery(_Q,'metric',AQuery.metric);
  2006. AddToQuery(_Q,'sort',AQuery.sort);
  2007. AddToQuery(_Q,'startDate',AQuery.startDate);
  2008. AddToQuery(_Q,'startIndex',AQuery.startIndex);
  2009. Result:=Generate(_Q);
  2010. end;
  2011. { --------------------------------------------------------------------
  2012. TUrlchannelsResource
  2013. --------------------------------------------------------------------}
  2014. Class Function TUrlchannelsResource.ResourceName : String;
  2015. begin
  2016. Result:='urlchannels';
  2017. end;
  2018. Class Function TUrlchannelsResource.DefaultAPI : TGoogleAPIClass;
  2019. begin
  2020. Result:=TadsensehostAPI;
  2021. end;
  2022. Function TUrlchannelsResource.Delete(adClientId: string; urlChannelId: string) : TUrlChannel;
  2023. Const
  2024. _HTTPMethod = 'DELETE';
  2025. _Path = 'adclients/{adClientId}/urlchannels/{urlChannelId}';
  2026. _Methodid = 'adsensehost.urlchannels.delete';
  2027. Var
  2028. _P : String;
  2029. begin
  2030. _P:=SubstitutePath(_Path,['adClientId',adClientId,'urlChannelId',urlChannelId]);
  2031. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TUrlChannel) as TUrlChannel;
  2032. end;
  2033. Function TUrlchannelsResource.Insert(adClientId: string; aUrlChannel : TUrlChannel) : TUrlChannel;
  2034. Const
  2035. _HTTPMethod = 'POST';
  2036. _Path = 'adclients/{adClientId}/urlchannels';
  2037. _Methodid = 'adsensehost.urlchannels.insert';
  2038. Var
  2039. _P : String;
  2040. begin
  2041. _P:=SubstitutePath(_Path,['adClientId',adClientId]);
  2042. Result:=ServiceCall(_HTTPMethod,_P,'',aUrlChannel,TUrlChannel) as TUrlChannel;
  2043. end;
  2044. Function TUrlchannelsResource.List(adClientId: string; AQuery : string = '') : TUrlChannels;
  2045. Const
  2046. _HTTPMethod = 'GET';
  2047. _Path = 'adclients/{adClientId}/urlchannels';
  2048. _Methodid = 'adsensehost.urlchannels.list';
  2049. Var
  2050. _P : String;
  2051. begin
  2052. _P:=SubstitutePath(_Path,['adClientId',adClientId]);
  2053. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TUrlChannels) as TUrlChannels;
  2054. end;
  2055. Function TUrlchannelsResource.List(adClientId: string; AQuery : TUrlchannelslistOptions) : TUrlChannels;
  2056. Var
  2057. _Q : String;
  2058. begin
  2059. _Q:='';
  2060. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  2061. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  2062. Result:=List(adClientId,_Q);
  2063. end;
  2064. { --------------------------------------------------------------------
  2065. TAdsensehostAPI
  2066. --------------------------------------------------------------------}
  2067. Class Function TAdsensehostAPI.APIName : String;
  2068. begin
  2069. Result:='adsensehost';
  2070. end;
  2071. Class Function TAdsensehostAPI.APIVersion : String;
  2072. begin
  2073. Result:='v4.1';
  2074. end;
  2075. Class Function TAdsensehostAPI.APIRevision : String;
  2076. begin
  2077. Result:='20160522';
  2078. end;
  2079. Class Function TAdsensehostAPI.APIID : String;
  2080. begin
  2081. Result:='adsensehost:v4.1';
  2082. end;
  2083. Class Function TAdsensehostAPI.APITitle : String;
  2084. begin
  2085. Result:='AdSense Host API';
  2086. end;
  2087. Class Function TAdsensehostAPI.APIDescription : String;
  2088. begin
  2089. Result:='Generates performance reports, generates ad codes, and provides publisher management capabilities for AdSense Hosts.';
  2090. end;
  2091. Class Function TAdsensehostAPI.APIOwnerDomain : String;
  2092. begin
  2093. Result:='google.com';
  2094. end;
  2095. Class Function TAdsensehostAPI.APIOwnerName : String;
  2096. begin
  2097. Result:='Google';
  2098. end;
  2099. Class Function TAdsensehostAPI.APIIcon16 : String;
  2100. begin
  2101. Result:='https://www.google.com/images/icons/product/adsense-16.png';
  2102. end;
  2103. Class Function TAdsensehostAPI.APIIcon32 : String;
  2104. begin
  2105. Result:='https://www.google.com/images/icons/product/adsense-32.png';
  2106. end;
  2107. Class Function TAdsensehostAPI.APIdocumentationLink : String;
  2108. begin
  2109. Result:='https://developers.google.com/adsense/host/';
  2110. end;
  2111. Class Function TAdsensehostAPI.APIrootUrl : string;
  2112. begin
  2113. Result:='https://www.googleapis.com/';
  2114. end;
  2115. Class Function TAdsensehostAPI.APIbasePath : string;
  2116. begin
  2117. Result:='/adsensehost/v4.1/';
  2118. end;
  2119. Class Function TAdsensehostAPI.APIbaseURL : String;
  2120. begin
  2121. Result:='https://www.googleapis.com/adsensehost/v4.1/';
  2122. end;
  2123. Class Function TAdsensehostAPI.APIProtocol : string;
  2124. begin
  2125. Result:='rest';
  2126. end;
  2127. Class Function TAdsensehostAPI.APIservicePath : string;
  2128. begin
  2129. Result:='adsensehost/v4.1/';
  2130. end;
  2131. Class Function TAdsensehostAPI.APIbatchPath : String;
  2132. begin
  2133. Result:='batch';
  2134. end;
  2135. Class Function TAdsensehostAPI.APIAuthScopes : TScopeInfoArray;
  2136. begin
  2137. SetLength(Result,1);
  2138. Result[0].Name:='https://www.googleapis.com/auth/adsensehost';
  2139. Result[0].Description:='View and manage your AdSense host data and associated accounts';
  2140. end;
  2141. Class Function TAdsensehostAPI.APINeedsAuth : Boolean;
  2142. begin
  2143. Result:=True;
  2144. end;
  2145. Class Procedure TAdsensehostAPI.RegisterAPIResources;
  2146. begin
  2147. TAccount.RegisterObject;
  2148. TAccounts.RegisterObject;
  2149. TAdClient.RegisterObject;
  2150. TAdClients.RegisterObject;
  2151. TAdCode.RegisterObject;
  2152. TAdStyleTypecolors.RegisterObject;
  2153. TAdStyleTypefont.RegisterObject;
  2154. TAdStyle.RegisterObject;
  2155. TAdUnitTypecontentAdsSettingsTypebackupOption.RegisterObject;
  2156. TAdUnitTypecontentAdsSettings.RegisterObject;
  2157. TAdUnitTypemobileContentAdsSettings.RegisterObject;
  2158. TAdUnit.RegisterObject;
  2159. TAdUnits.RegisterObject;
  2160. TAssociationSession.RegisterObject;
  2161. TCustomChannel.RegisterObject;
  2162. TCustomChannels.RegisterObject;
  2163. TReportTypeheadersItem.RegisterObject;
  2164. TReport.RegisterObject;
  2165. TUrlChannel.RegisterObject;
  2166. TUrlChannels.RegisterObject;
  2167. end;
  2168. Function TAdsensehostAPI.GetAccountsAdclientsInstance : TAccountsAdclientsResource;
  2169. begin
  2170. if (FAccountsAdclientsInstance=Nil) then
  2171. FAccountsAdclientsInstance:=CreateAccountsAdclientsResource;
  2172. Result:=FAccountsAdclientsInstance;
  2173. end;
  2174. Function TAdsensehostAPI.CreateAccountsAdclientsResource : TAccountsAdclientsResource;
  2175. begin
  2176. Result:=CreateAccountsAdclientsResource(Self);
  2177. end;
  2178. Function TAdsensehostAPI.CreateAccountsAdclientsResource(AOwner : TComponent) : TAccountsAdclientsResource;
  2179. begin
  2180. Result:=TAccountsAdclientsResource.Create(AOwner);
  2181. Result.API:=Self.API;
  2182. end;
  2183. Function TAdsensehostAPI.GetAccountsAdunitsInstance : TAccountsAdunitsResource;
  2184. begin
  2185. if (FAccountsAdunitsInstance=Nil) then
  2186. FAccountsAdunitsInstance:=CreateAccountsAdunitsResource;
  2187. Result:=FAccountsAdunitsInstance;
  2188. end;
  2189. Function TAdsensehostAPI.CreateAccountsAdunitsResource : TAccountsAdunitsResource;
  2190. begin
  2191. Result:=CreateAccountsAdunitsResource(Self);
  2192. end;
  2193. Function TAdsensehostAPI.CreateAccountsAdunitsResource(AOwner : TComponent) : TAccountsAdunitsResource;
  2194. begin
  2195. Result:=TAccountsAdunitsResource.Create(AOwner);
  2196. Result.API:=Self.API;
  2197. end;
  2198. Function TAdsensehostAPI.GetAccountsReportsInstance : TAccountsReportsResource;
  2199. begin
  2200. if (FAccountsReportsInstance=Nil) then
  2201. FAccountsReportsInstance:=CreateAccountsReportsResource;
  2202. Result:=FAccountsReportsInstance;
  2203. end;
  2204. Function TAdsensehostAPI.CreateAccountsReportsResource : TAccountsReportsResource;
  2205. begin
  2206. Result:=CreateAccountsReportsResource(Self);
  2207. end;
  2208. Function TAdsensehostAPI.CreateAccountsReportsResource(AOwner : TComponent) : TAccountsReportsResource;
  2209. begin
  2210. Result:=TAccountsReportsResource.Create(AOwner);
  2211. Result.API:=Self.API;
  2212. end;
  2213. Function TAdsensehostAPI.GetAccountsInstance : TAccountsResource;
  2214. begin
  2215. if (FAccountsInstance=Nil) then
  2216. FAccountsInstance:=CreateAccountsResource;
  2217. Result:=FAccountsInstance;
  2218. end;
  2219. Function TAdsensehostAPI.CreateAccountsResource : TAccountsResource;
  2220. begin
  2221. Result:=CreateAccountsResource(Self);
  2222. end;
  2223. Function TAdsensehostAPI.CreateAccountsResource(AOwner : TComponent) : TAccountsResource;
  2224. begin
  2225. Result:=TAccountsResource.Create(AOwner);
  2226. Result.API:=Self.API;
  2227. end;
  2228. Function TAdsensehostAPI.GetAdclientsInstance : TAdclientsResource;
  2229. begin
  2230. if (FAdclientsInstance=Nil) then
  2231. FAdclientsInstance:=CreateAdclientsResource;
  2232. Result:=FAdclientsInstance;
  2233. end;
  2234. Function TAdsensehostAPI.CreateAdclientsResource : TAdclientsResource;
  2235. begin
  2236. Result:=CreateAdclientsResource(Self);
  2237. end;
  2238. Function TAdsensehostAPI.CreateAdclientsResource(AOwner : TComponent) : TAdclientsResource;
  2239. begin
  2240. Result:=TAdclientsResource.Create(AOwner);
  2241. Result.API:=Self.API;
  2242. end;
  2243. Function TAdsensehostAPI.GetAssociationsessionsInstance : TAssociationsessionsResource;
  2244. begin
  2245. if (FAssociationsessionsInstance=Nil) then
  2246. FAssociationsessionsInstance:=CreateAssociationsessionsResource;
  2247. Result:=FAssociationsessionsInstance;
  2248. end;
  2249. Function TAdsensehostAPI.CreateAssociationsessionsResource : TAssociationsessionsResource;
  2250. begin
  2251. Result:=CreateAssociationsessionsResource(Self);
  2252. end;
  2253. Function TAdsensehostAPI.CreateAssociationsessionsResource(AOwner : TComponent) : TAssociationsessionsResource;
  2254. begin
  2255. Result:=TAssociationsessionsResource.Create(AOwner);
  2256. Result.API:=Self.API;
  2257. end;
  2258. Function TAdsensehostAPI.GetCustomchannelsInstance : TCustomchannelsResource;
  2259. begin
  2260. if (FCustomchannelsInstance=Nil) then
  2261. FCustomchannelsInstance:=CreateCustomchannelsResource;
  2262. Result:=FCustomchannelsInstance;
  2263. end;
  2264. Function TAdsensehostAPI.CreateCustomchannelsResource : TCustomchannelsResource;
  2265. begin
  2266. Result:=CreateCustomchannelsResource(Self);
  2267. end;
  2268. Function TAdsensehostAPI.CreateCustomchannelsResource(AOwner : TComponent) : TCustomchannelsResource;
  2269. begin
  2270. Result:=TCustomchannelsResource.Create(AOwner);
  2271. Result.API:=Self.API;
  2272. end;
  2273. Function TAdsensehostAPI.GetReportsInstance : TReportsResource;
  2274. begin
  2275. if (FReportsInstance=Nil) then
  2276. FReportsInstance:=CreateReportsResource;
  2277. Result:=FReportsInstance;
  2278. end;
  2279. Function TAdsensehostAPI.CreateReportsResource : TReportsResource;
  2280. begin
  2281. Result:=CreateReportsResource(Self);
  2282. end;
  2283. Function TAdsensehostAPI.CreateReportsResource(AOwner : TComponent) : TReportsResource;
  2284. begin
  2285. Result:=TReportsResource.Create(AOwner);
  2286. Result.API:=Self.API;
  2287. end;
  2288. Function TAdsensehostAPI.GetUrlchannelsInstance : TUrlchannelsResource;
  2289. begin
  2290. if (FUrlchannelsInstance=Nil) then
  2291. FUrlchannelsInstance:=CreateUrlchannelsResource;
  2292. Result:=FUrlchannelsInstance;
  2293. end;
  2294. Function TAdsensehostAPI.CreateUrlchannelsResource : TUrlchannelsResource;
  2295. begin
  2296. Result:=CreateUrlchannelsResource(Self);
  2297. end;
  2298. Function TAdsensehostAPI.CreateUrlchannelsResource(AOwner : TComponent) : TUrlchannelsResource;
  2299. begin
  2300. Result:=TUrlchannelsResource.Create(AOwner);
  2301. Result.API:=Self.API;
  2302. end;
  2303. initialization
  2304. TAdsensehostAPI.RegisterAPI;
  2305. end.