googledoubleclicksearch.pp 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499
  1. unit googledoubleclicksearch;
  2. {$MODE objfpc}
  3. {$H+}
  4. interface
  5. uses sysutils, classes, googleservice, restbase, googlebase;
  6. type
  7. //Top-level schema types
  8. TAvailability = Class;
  9. TConversion = Class;
  10. TConversionList = Class;
  11. TCustomDimension = Class;
  12. TCustomMetric = Class;
  13. TReport = Class;
  14. TReportApiColumnSpec = Class;
  15. TReportRequest = Class;
  16. TReportRow = Class;
  17. TSavedColumn = Class;
  18. TSavedColumnList = Class;
  19. TUpdateAvailabilityRequest = Class;
  20. TUpdateAvailabilityResponse = Class;
  21. TAvailabilityArray = Array of TAvailability;
  22. TConversionArray = Array of TConversion;
  23. TConversionListArray = Array of TConversionList;
  24. TCustomDimensionArray = Array of TCustomDimension;
  25. TCustomMetricArray = Array of TCustomMetric;
  26. TReportArray = Array of TReport;
  27. TReportApiColumnSpecArray = Array of TReportApiColumnSpec;
  28. TReportRequestArray = Array of TReportRequest;
  29. TReportRowArray = Array of TReportRow;
  30. TSavedColumnArray = Array of TSavedColumn;
  31. TSavedColumnListArray = Array of TSavedColumnList;
  32. TUpdateAvailabilityRequestArray = Array of TUpdateAvailabilityRequest;
  33. TUpdateAvailabilityResponseArray = Array of TUpdateAvailabilityResponse;
  34. //Anonymous types, using auto-generated names
  35. TReportTypefilesItem = Class;
  36. TReportRequestTypefiltersItem = Class;
  37. TReportRequestTypeorderByItem = Class;
  38. TReportRequestTypereportScope = Class;
  39. TReportRequestTypetimeRange = Class;
  40. TConversionTypecustomDimensionArray = Array of TCustomDimension;
  41. TConversionTypecustomMetricArray = Array of TCustomMetric;
  42. TConversionListTypeconversionArray = Array of TConversion;
  43. TReportTypefilesArray = Array of TReportTypefilesItem;
  44. TReportTyperowsArray = Array of TReportRow;
  45. TReportRequestTypecolumnsArray = Array of TReportApiColumnSpec;
  46. TReportRequestTypefiltersArray = Array of TReportRequestTypefiltersItem;
  47. TReportRequestTypeorderByArray = Array of TReportRequestTypeorderByItem;
  48. TSavedColumnListTypeitemsArray = Array of TSavedColumn;
  49. TUpdateAvailabilityRequestTypeavailabilitiesArray = Array of TAvailability;
  50. TUpdateAvailabilityResponseTypeavailabilitiesArray = Array of TAvailability;
  51. { --------------------------------------------------------------------
  52. TAvailability
  53. --------------------------------------------------------------------}
  54. TAvailability = Class(TGoogleBaseObject)
  55. Private
  56. FadvertiserId : String;
  57. FagencyId : String;
  58. FavailabilityTimestamp : String;
  59. FsegmentationId : String;
  60. FsegmentationName : String;
  61. FsegmentationType : String;
  62. Protected
  63. //Property setters
  64. Procedure SetadvertiserId(AIndex : Integer; const AValue : String); virtual;
  65. Procedure SetagencyId(AIndex : Integer; const AValue : String); virtual;
  66. Procedure SetavailabilityTimestamp(AIndex : Integer; const AValue : String); virtual;
  67. Procedure SetsegmentationId(AIndex : Integer; const AValue : String); virtual;
  68. Procedure SetsegmentationName(AIndex : Integer; const AValue : String); virtual;
  69. Procedure SetsegmentationType(AIndex : Integer; const AValue : String); virtual;
  70. Public
  71. Published
  72. Property advertiserId : String Index 0 Read FadvertiserId Write SetadvertiserId;
  73. Property agencyId : String Index 8 Read FagencyId Write SetagencyId;
  74. Property availabilityTimestamp : String Index 16 Read FavailabilityTimestamp Write SetavailabilityTimestamp;
  75. Property segmentationId : String Index 24 Read FsegmentationId Write SetsegmentationId;
  76. Property segmentationName : String Index 32 Read FsegmentationName Write SetsegmentationName;
  77. Property segmentationType : String Index 40 Read FsegmentationType Write SetsegmentationType;
  78. end;
  79. TAvailabilityClass = Class of TAvailability;
  80. { --------------------------------------------------------------------
  81. TConversion
  82. --------------------------------------------------------------------}
  83. TConversion = Class(TGoogleBaseObject)
  84. Private
  85. FadGroupId : String;
  86. FadId : String;
  87. FadvertiserId : String;
  88. FagencyId : String;
  89. FattributionModel : String;
  90. FcampaignId : String;
  91. Fchannel : String;
  92. FclickId : String;
  93. FconversionId : String;
  94. FconversionModifiedTimestamp : String;
  95. FconversionTimestamp : String;
  96. FcountMillis : String;
  97. FcriterionId : String;
  98. FcurrencyCode : String;
  99. FcustomDimension : TConversionTypecustomDimensionArray;
  100. FcustomMetric : TConversionTypecustomMetricArray;
  101. FdeviceType : String;
  102. FdsConversionId : String;
  103. FengineAccountId : String;
  104. FfloodlightOrderId : String;
  105. FinventoryAccountId : String;
  106. FproductCountry : String;
  107. FproductGroupId : String;
  108. FproductId : String;
  109. FproductLanguage : String;
  110. FquantityMillis : String;
  111. FrevenueMicros : String;
  112. FsegmentationId : String;
  113. FsegmentationName : String;
  114. FsegmentationType : String;
  115. Fstate : String;
  116. FstoreId : String;
  117. F_type : String;
  118. Protected
  119. Class Function ExportPropertyName(Const AName : String) : string; override;
  120. //Property setters
  121. Procedure SetadGroupId(AIndex : Integer; const AValue : String); virtual;
  122. Procedure SetadId(AIndex : Integer; const AValue : String); virtual;
  123. Procedure SetadvertiserId(AIndex : Integer; const AValue : String); virtual;
  124. Procedure SetagencyId(AIndex : Integer; const AValue : String); virtual;
  125. Procedure SetattributionModel(AIndex : Integer; const AValue : String); virtual;
  126. Procedure SetcampaignId(AIndex : Integer; const AValue : String); virtual;
  127. Procedure Setchannel(AIndex : Integer; const AValue : String); virtual;
  128. Procedure SetclickId(AIndex : Integer; const AValue : String); virtual;
  129. Procedure SetconversionId(AIndex : Integer; const AValue : String); virtual;
  130. Procedure SetconversionModifiedTimestamp(AIndex : Integer; const AValue : String); virtual;
  131. Procedure SetconversionTimestamp(AIndex : Integer; const AValue : String); virtual;
  132. Procedure SetcountMillis(AIndex : Integer; const AValue : String); virtual;
  133. Procedure SetcriterionId(AIndex : Integer; const AValue : String); virtual;
  134. Procedure SetcurrencyCode(AIndex : Integer; const AValue : String); virtual;
  135. Procedure SetcustomDimension(AIndex : Integer; const AValue : TConversionTypecustomDimensionArray); virtual;
  136. Procedure SetcustomMetric(AIndex : Integer; const AValue : TConversionTypecustomMetricArray); virtual;
  137. Procedure SetdeviceType(AIndex : Integer; const AValue : String); virtual;
  138. Procedure SetdsConversionId(AIndex : Integer; const AValue : String); virtual;
  139. Procedure SetengineAccountId(AIndex : Integer; const AValue : String); virtual;
  140. Procedure SetfloodlightOrderId(AIndex : Integer; const AValue : String); virtual;
  141. Procedure SetinventoryAccountId(AIndex : Integer; const AValue : String); virtual;
  142. Procedure SetproductCountry(AIndex : Integer; const AValue : String); virtual;
  143. Procedure SetproductGroupId(AIndex : Integer; const AValue : String); virtual;
  144. Procedure SetproductId(AIndex : Integer; const AValue : String); virtual;
  145. Procedure SetproductLanguage(AIndex : Integer; const AValue : String); virtual;
  146. Procedure SetquantityMillis(AIndex : Integer; const AValue : String); virtual;
  147. Procedure SetrevenueMicros(AIndex : Integer; const AValue : String); virtual;
  148. Procedure SetsegmentationId(AIndex : Integer; const AValue : String); virtual;
  149. Procedure SetsegmentationName(AIndex : Integer; const AValue : String); virtual;
  150. Procedure SetsegmentationType(AIndex : Integer; const AValue : String); virtual;
  151. Procedure Setstate(AIndex : Integer; const AValue : String); virtual;
  152. Procedure SetstoreId(AIndex : Integer; const AValue : String); virtual;
  153. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  154. //2.6.4. bug workaround
  155. {$IFDEF VER2_6}
  156. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  157. {$ENDIF VER2_6}
  158. Public
  159. Published
  160. Property adGroupId : String Index 0 Read FadGroupId Write SetadGroupId;
  161. Property adId : String Index 8 Read FadId Write SetadId;
  162. Property advertiserId : String Index 16 Read FadvertiserId Write SetadvertiserId;
  163. Property agencyId : String Index 24 Read FagencyId Write SetagencyId;
  164. Property attributionModel : String Index 32 Read FattributionModel Write SetattributionModel;
  165. Property campaignId : String Index 40 Read FcampaignId Write SetcampaignId;
  166. Property channel : String Index 48 Read Fchannel Write Setchannel;
  167. Property clickId : String Index 56 Read FclickId Write SetclickId;
  168. Property conversionId : String Index 64 Read FconversionId Write SetconversionId;
  169. Property conversionModifiedTimestamp : String Index 72 Read FconversionModifiedTimestamp Write SetconversionModifiedTimestamp;
  170. Property conversionTimestamp : String Index 80 Read FconversionTimestamp Write SetconversionTimestamp;
  171. Property countMillis : String Index 88 Read FcountMillis Write SetcountMillis;
  172. Property criterionId : String Index 96 Read FcriterionId Write SetcriterionId;
  173. Property currencyCode : String Index 104 Read FcurrencyCode Write SetcurrencyCode;
  174. Property customDimension : TConversionTypecustomDimensionArray Index 112 Read FcustomDimension Write SetcustomDimension;
  175. Property customMetric : TConversionTypecustomMetricArray Index 120 Read FcustomMetric Write SetcustomMetric;
  176. Property deviceType : String Index 128 Read FdeviceType Write SetdeviceType;
  177. Property dsConversionId : String Index 136 Read FdsConversionId Write SetdsConversionId;
  178. Property engineAccountId : String Index 144 Read FengineAccountId Write SetengineAccountId;
  179. Property floodlightOrderId : String Index 152 Read FfloodlightOrderId Write SetfloodlightOrderId;
  180. Property inventoryAccountId : String Index 160 Read FinventoryAccountId Write SetinventoryAccountId;
  181. Property productCountry : String Index 168 Read FproductCountry Write SetproductCountry;
  182. Property productGroupId : String Index 176 Read FproductGroupId Write SetproductGroupId;
  183. Property productId : String Index 184 Read FproductId Write SetproductId;
  184. Property productLanguage : String Index 192 Read FproductLanguage Write SetproductLanguage;
  185. Property quantityMillis : String Index 200 Read FquantityMillis Write SetquantityMillis;
  186. Property revenueMicros : String Index 208 Read FrevenueMicros Write SetrevenueMicros;
  187. Property segmentationId : String Index 216 Read FsegmentationId Write SetsegmentationId;
  188. Property segmentationName : String Index 224 Read FsegmentationName Write SetsegmentationName;
  189. Property segmentationType : String Index 232 Read FsegmentationType Write SetsegmentationType;
  190. Property state : String Index 240 Read Fstate Write Setstate;
  191. Property storeId : String Index 248 Read FstoreId Write SetstoreId;
  192. Property _type : String Index 256 Read F_type Write Set_type;
  193. end;
  194. TConversionClass = Class of TConversion;
  195. { --------------------------------------------------------------------
  196. TConversionList
  197. --------------------------------------------------------------------}
  198. TConversionList = Class(TGoogleBaseObject)
  199. Private
  200. Fconversion : TConversionListTypeconversionArray;
  201. Fkind : String;
  202. Protected
  203. //Property setters
  204. Procedure Setconversion(AIndex : Integer; const AValue : TConversionListTypeconversionArray); virtual;
  205. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  206. //2.6.4. bug workaround
  207. {$IFDEF VER2_6}
  208. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  209. {$ENDIF VER2_6}
  210. Public
  211. Published
  212. Property conversion : TConversionListTypeconversionArray Index 0 Read Fconversion Write Setconversion;
  213. Property kind : String Index 8 Read Fkind Write Setkind;
  214. end;
  215. TConversionListClass = Class of TConversionList;
  216. { --------------------------------------------------------------------
  217. TCustomDimension
  218. --------------------------------------------------------------------}
  219. TCustomDimension = Class(TGoogleBaseObject)
  220. Private
  221. Fname : String;
  222. Fvalue : String;
  223. Protected
  224. //Property setters
  225. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  226. Procedure Setvalue(AIndex : Integer; const AValue : String); virtual;
  227. Public
  228. Published
  229. Property name : String Index 0 Read Fname Write Setname;
  230. Property value : String Index 8 Read Fvalue Write Setvalue;
  231. end;
  232. TCustomDimensionClass = Class of TCustomDimension;
  233. { --------------------------------------------------------------------
  234. TCustomMetric
  235. --------------------------------------------------------------------}
  236. TCustomMetric = Class(TGoogleBaseObject)
  237. Private
  238. Fname : String;
  239. Fvalue : double;
  240. Protected
  241. //Property setters
  242. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  243. Procedure Setvalue(AIndex : Integer; const AValue : double); virtual;
  244. Public
  245. Published
  246. Property name : String Index 0 Read Fname Write Setname;
  247. Property value : double Index 8 Read Fvalue Write Setvalue;
  248. end;
  249. TCustomMetricClass = Class of TCustomMetric;
  250. { --------------------------------------------------------------------
  251. TReportTypefilesItem
  252. --------------------------------------------------------------------}
  253. TReportTypefilesItem = Class(TGoogleBaseObject)
  254. Private
  255. FbyteCount : String;
  256. Furl : String;
  257. Protected
  258. //Property setters
  259. Procedure SetbyteCount(AIndex : Integer; const AValue : String); virtual;
  260. Procedure Seturl(AIndex : Integer; const AValue : String); virtual;
  261. Public
  262. Published
  263. Property byteCount : String Index 0 Read FbyteCount Write SetbyteCount;
  264. Property url : String Index 8 Read Furl Write Seturl;
  265. end;
  266. TReportTypefilesItemClass = Class of TReportTypefilesItem;
  267. { --------------------------------------------------------------------
  268. TReport
  269. --------------------------------------------------------------------}
  270. TReport = Class(TGoogleBaseObject)
  271. Private
  272. Ffiles : TReportTypefilesArray;
  273. Fid : String;
  274. FisReportReady : boolean;
  275. Fkind : String;
  276. Frequest : TReportRequest;
  277. FrowCount : integer;
  278. Frows : TReportTyperowsArray;
  279. FstatisticsCurrencyCode : String;
  280. FstatisticsTimeZone : String;
  281. Protected
  282. //Property setters
  283. Procedure Setfiles(AIndex : Integer; const AValue : TReportTypefilesArray); virtual;
  284. Procedure Setid(AIndex : Integer; const AValue : String); virtual;
  285. Procedure SetisReportReady(AIndex : Integer; const AValue : boolean); virtual;
  286. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  287. Procedure Setrequest(AIndex : Integer; const AValue : TReportRequest); virtual;
  288. Procedure SetrowCount(AIndex : Integer; const AValue : integer); virtual;
  289. Procedure Setrows(AIndex : Integer; const AValue : TReportTyperowsArray); virtual;
  290. Procedure SetstatisticsCurrencyCode(AIndex : Integer; const AValue : String); virtual;
  291. Procedure SetstatisticsTimeZone(AIndex : Integer; const AValue : String); virtual;
  292. //2.6.4. bug workaround
  293. {$IFDEF VER2_6}
  294. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  295. {$ENDIF VER2_6}
  296. Public
  297. Published
  298. Property files : TReportTypefilesArray Index 0 Read Ffiles Write Setfiles;
  299. Property id : String Index 8 Read Fid Write Setid;
  300. Property isReportReady : boolean Index 16 Read FisReportReady Write SetisReportReady;
  301. Property kind : String Index 24 Read Fkind Write Setkind;
  302. Property request : TReportRequest Index 32 Read Frequest Write Setrequest;
  303. Property rowCount : integer Index 40 Read FrowCount Write SetrowCount;
  304. Property rows : TReportTyperowsArray Index 48 Read Frows Write Setrows;
  305. Property statisticsCurrencyCode : String Index 56 Read FstatisticsCurrencyCode Write SetstatisticsCurrencyCode;
  306. Property statisticsTimeZone : String Index 64 Read FstatisticsTimeZone Write SetstatisticsTimeZone;
  307. end;
  308. TReportClass = Class of TReport;
  309. { --------------------------------------------------------------------
  310. TReportApiColumnSpec
  311. --------------------------------------------------------------------}
  312. TReportApiColumnSpec = Class(TGoogleBaseObject)
  313. Private
  314. FcolumnName : String;
  315. FcustomDimensionName : String;
  316. FcustomMetricName : String;
  317. FendDate : String;
  318. FgroupByColumn : boolean;
  319. FheaderText : String;
  320. FplatformSource : String;
  321. FproductReportPerspective : String;
  322. FsavedColumnName : String;
  323. FstartDate : String;
  324. Protected
  325. //Property setters
  326. Procedure SetcolumnName(AIndex : Integer; const AValue : String); virtual;
  327. Procedure SetcustomDimensionName(AIndex : Integer; const AValue : String); virtual;
  328. Procedure SetcustomMetricName(AIndex : Integer; const AValue : String); virtual;
  329. Procedure SetendDate(AIndex : Integer; const AValue : String); virtual;
  330. Procedure SetgroupByColumn(AIndex : Integer; const AValue : boolean); virtual;
  331. Procedure SetheaderText(AIndex : Integer; const AValue : String); virtual;
  332. Procedure SetplatformSource(AIndex : Integer; const AValue : String); virtual;
  333. Procedure SetproductReportPerspective(AIndex : Integer; const AValue : String); virtual;
  334. Procedure SetsavedColumnName(AIndex : Integer; const AValue : String); virtual;
  335. Procedure SetstartDate(AIndex : Integer; const AValue : String); virtual;
  336. Public
  337. Published
  338. Property columnName : String Index 0 Read FcolumnName Write SetcolumnName;
  339. Property customDimensionName : String Index 8 Read FcustomDimensionName Write SetcustomDimensionName;
  340. Property customMetricName : String Index 16 Read FcustomMetricName Write SetcustomMetricName;
  341. Property endDate : String Index 24 Read FendDate Write SetendDate;
  342. Property groupByColumn : boolean Index 32 Read FgroupByColumn Write SetgroupByColumn;
  343. Property headerText : String Index 40 Read FheaderText Write SetheaderText;
  344. Property platformSource : String Index 48 Read FplatformSource Write SetplatformSource;
  345. Property productReportPerspective : String Index 56 Read FproductReportPerspective Write SetproductReportPerspective;
  346. Property savedColumnName : String Index 64 Read FsavedColumnName Write SetsavedColumnName;
  347. Property startDate : String Index 72 Read FstartDate Write SetstartDate;
  348. end;
  349. TReportApiColumnSpecClass = Class of TReportApiColumnSpec;
  350. { --------------------------------------------------------------------
  351. TReportRequestTypefiltersItem
  352. --------------------------------------------------------------------}
  353. TReportRequestTypefiltersItem = Class(TGoogleBaseObject)
  354. Private
  355. Fcolumn : TReportApiColumnSpec;
  356. F_operator : String;
  357. Fvalues : TTJSONSchemaArray;
  358. Protected
  359. Class Function ExportPropertyName(Const AName : String) : string; override;
  360. //Property setters
  361. Procedure Setcolumn(AIndex : Integer; const AValue : TReportApiColumnSpec); virtual;
  362. Procedure Set_operator(AIndex : Integer; const AValue : String); virtual;
  363. Procedure Setvalues(AIndex : Integer; const AValue : TTJSONSchemaArray); virtual;
  364. //2.6.4. bug workaround
  365. {$IFDEF VER2_6}
  366. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  367. {$ENDIF VER2_6}
  368. Public
  369. Published
  370. Property column : TReportApiColumnSpec Index 0 Read Fcolumn Write Setcolumn;
  371. Property _operator : String Index 8 Read F_operator Write Set_operator;
  372. Property values : TTJSONSchemaArray Index 16 Read Fvalues Write Setvalues;
  373. end;
  374. TReportRequestTypefiltersItemClass = Class of TReportRequestTypefiltersItem;
  375. { --------------------------------------------------------------------
  376. TReportRequestTypeorderByItem
  377. --------------------------------------------------------------------}
  378. TReportRequestTypeorderByItem = Class(TGoogleBaseObject)
  379. Private
  380. Fcolumn : TReportApiColumnSpec;
  381. FsortOrder : String;
  382. Protected
  383. //Property setters
  384. Procedure Setcolumn(AIndex : Integer; const AValue : TReportApiColumnSpec); virtual;
  385. Procedure SetsortOrder(AIndex : Integer; const AValue : String); virtual;
  386. Public
  387. Published
  388. Property column : TReportApiColumnSpec Index 0 Read Fcolumn Write Setcolumn;
  389. Property sortOrder : String Index 8 Read FsortOrder Write SetsortOrder;
  390. end;
  391. TReportRequestTypeorderByItemClass = Class of TReportRequestTypeorderByItem;
  392. { --------------------------------------------------------------------
  393. TReportRequestTypereportScope
  394. --------------------------------------------------------------------}
  395. TReportRequestTypereportScope = Class(TGoogleBaseObject)
  396. Private
  397. FadGroupId : String;
  398. FadId : String;
  399. FadvertiserId : String;
  400. FagencyId : String;
  401. FcampaignId : String;
  402. FengineAccountId : String;
  403. FkeywordId : String;
  404. Protected
  405. //Property setters
  406. Procedure SetadGroupId(AIndex : Integer; const AValue : String); virtual;
  407. Procedure SetadId(AIndex : Integer; const AValue : String); virtual;
  408. Procedure SetadvertiserId(AIndex : Integer; const AValue : String); virtual;
  409. Procedure SetagencyId(AIndex : Integer; const AValue : String); virtual;
  410. Procedure SetcampaignId(AIndex : Integer; const AValue : String); virtual;
  411. Procedure SetengineAccountId(AIndex : Integer; const AValue : String); virtual;
  412. Procedure SetkeywordId(AIndex : Integer; const AValue : String); virtual;
  413. Public
  414. Published
  415. Property adGroupId : String Index 0 Read FadGroupId Write SetadGroupId;
  416. Property adId : String Index 8 Read FadId Write SetadId;
  417. Property advertiserId : String Index 16 Read FadvertiserId Write SetadvertiserId;
  418. Property agencyId : String Index 24 Read FagencyId Write SetagencyId;
  419. Property campaignId : String Index 32 Read FcampaignId Write SetcampaignId;
  420. Property engineAccountId : String Index 40 Read FengineAccountId Write SetengineAccountId;
  421. Property keywordId : String Index 48 Read FkeywordId Write SetkeywordId;
  422. end;
  423. TReportRequestTypereportScopeClass = Class of TReportRequestTypereportScope;
  424. { --------------------------------------------------------------------
  425. TReportRequestTypetimeRange
  426. --------------------------------------------------------------------}
  427. TReportRequestTypetimeRange = Class(TGoogleBaseObject)
  428. Private
  429. FchangedAttributesSinceTimestamp : TDatetime;
  430. FchangedMetricsSinceTimestamp : TDatetime;
  431. FendDate : String;
  432. FstartDate : String;
  433. Protected
  434. //Property setters
  435. Procedure SetchangedAttributesSinceTimestamp(AIndex : Integer; const AValue : TDatetime); virtual;
  436. Procedure SetchangedMetricsSinceTimestamp(AIndex : Integer; const AValue : TDatetime); virtual;
  437. Procedure SetendDate(AIndex : Integer; const AValue : String); virtual;
  438. Procedure SetstartDate(AIndex : Integer; const AValue : String); virtual;
  439. Public
  440. Published
  441. Property changedAttributesSinceTimestamp : TDatetime Index 0 Read FchangedAttributesSinceTimestamp Write SetchangedAttributesSinceTimestamp;
  442. Property changedMetricsSinceTimestamp : TDatetime Index 8 Read FchangedMetricsSinceTimestamp Write SetchangedMetricsSinceTimestamp;
  443. Property endDate : String Index 16 Read FendDate Write SetendDate;
  444. Property startDate : String Index 24 Read FstartDate Write SetstartDate;
  445. end;
  446. TReportRequestTypetimeRangeClass = Class of TReportRequestTypetimeRange;
  447. { --------------------------------------------------------------------
  448. TReportRequest
  449. --------------------------------------------------------------------}
  450. TReportRequest = Class(TGoogleBaseObject)
  451. Private
  452. Fcolumns : TReportRequestTypecolumnsArray;
  453. FdownloadFormat : String;
  454. Ffilters : TReportRequestTypefiltersArray;
  455. FincludeDeletedEntities : boolean;
  456. FincludeRemovedEntities : boolean;
  457. FmaxRowsPerFile : integer;
  458. ForderBy : TReportRequestTypeorderByArray;
  459. FreportScope : TReportRequestTypereportScope;
  460. FreportType : String;
  461. FrowCount : integer;
  462. FstartRow : integer;
  463. FstatisticsCurrency : String;
  464. FtimeRange : TReportRequestTypetimeRange;
  465. FverifySingleTimeZone : boolean;
  466. Protected
  467. //Property setters
  468. Procedure Setcolumns(AIndex : Integer; const AValue : TReportRequestTypecolumnsArray); virtual;
  469. Procedure SetdownloadFormat(AIndex : Integer; const AValue : String); virtual;
  470. Procedure Setfilters(AIndex : Integer; const AValue : TReportRequestTypefiltersArray); virtual;
  471. Procedure SetincludeDeletedEntities(AIndex : Integer; const AValue : boolean); virtual;
  472. Procedure SetincludeRemovedEntities(AIndex : Integer; const AValue : boolean); virtual;
  473. Procedure SetmaxRowsPerFile(AIndex : Integer; const AValue : integer); virtual;
  474. Procedure SetorderBy(AIndex : Integer; const AValue : TReportRequestTypeorderByArray); virtual;
  475. Procedure SetreportScope(AIndex : Integer; const AValue : TReportRequestTypereportScope); virtual;
  476. Procedure SetreportType(AIndex : Integer; const AValue : String); virtual;
  477. Procedure SetrowCount(AIndex : Integer; const AValue : integer); virtual;
  478. Procedure SetstartRow(AIndex : Integer; const AValue : integer); virtual;
  479. Procedure SetstatisticsCurrency(AIndex : Integer; const AValue : String); virtual;
  480. Procedure SettimeRange(AIndex : Integer; const AValue : TReportRequestTypetimeRange); virtual;
  481. Procedure SetverifySingleTimeZone(AIndex : Integer; const AValue : boolean); virtual;
  482. //2.6.4. bug workaround
  483. {$IFDEF VER2_6}
  484. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  485. {$ENDIF VER2_6}
  486. Public
  487. Published
  488. Property columns : TReportRequestTypecolumnsArray Index 0 Read Fcolumns Write Setcolumns;
  489. Property downloadFormat : String Index 8 Read FdownloadFormat Write SetdownloadFormat;
  490. Property filters : TReportRequestTypefiltersArray Index 16 Read Ffilters Write Setfilters;
  491. Property includeDeletedEntities : boolean Index 24 Read FincludeDeletedEntities Write SetincludeDeletedEntities;
  492. Property includeRemovedEntities : boolean Index 32 Read FincludeRemovedEntities Write SetincludeRemovedEntities;
  493. Property maxRowsPerFile : integer Index 40 Read FmaxRowsPerFile Write SetmaxRowsPerFile;
  494. Property orderBy : TReportRequestTypeorderByArray Index 48 Read ForderBy Write SetorderBy;
  495. Property reportScope : TReportRequestTypereportScope Index 56 Read FreportScope Write SetreportScope;
  496. Property reportType : String Index 64 Read FreportType Write SetreportType;
  497. Property rowCount : integer Index 72 Read FrowCount Write SetrowCount;
  498. Property startRow : integer Index 80 Read FstartRow Write SetstartRow;
  499. Property statisticsCurrency : String Index 88 Read FstatisticsCurrency Write SetstatisticsCurrency;
  500. Property timeRange : TReportRequestTypetimeRange Index 96 Read FtimeRange Write SettimeRange;
  501. Property verifySingleTimeZone : boolean Index 104 Read FverifySingleTimeZone Write SetverifySingleTimeZone;
  502. end;
  503. TReportRequestClass = Class of TReportRequest;
  504. { --------------------------------------------------------------------
  505. TReportRow
  506. --------------------------------------------------------------------}
  507. TReportRow = Class(TGoogleBaseObject)
  508. Private
  509. Protected
  510. //Property setters
  511. Public
  512. Class Function AllowAdditionalProperties : Boolean; override;
  513. Published
  514. end;
  515. TReportRowClass = Class of TReportRow;
  516. { --------------------------------------------------------------------
  517. TSavedColumn
  518. --------------------------------------------------------------------}
  519. TSavedColumn = Class(TGoogleBaseObject)
  520. Private
  521. Fkind : String;
  522. FsavedColumnName : String;
  523. F_type : String;
  524. Protected
  525. Class Function ExportPropertyName(Const AName : String) : string; override;
  526. //Property setters
  527. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  528. Procedure SetsavedColumnName(AIndex : Integer; const AValue : String); virtual;
  529. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  530. Public
  531. Published
  532. Property kind : String Index 0 Read Fkind Write Setkind;
  533. Property savedColumnName : String Index 8 Read FsavedColumnName Write SetsavedColumnName;
  534. Property _type : String Index 16 Read F_type Write Set_type;
  535. end;
  536. TSavedColumnClass = Class of TSavedColumn;
  537. { --------------------------------------------------------------------
  538. TSavedColumnList
  539. --------------------------------------------------------------------}
  540. TSavedColumnList = Class(TGoogleBaseObject)
  541. Private
  542. Fitems : TSavedColumnListTypeitemsArray;
  543. Fkind : String;
  544. Protected
  545. //Property setters
  546. Procedure Setitems(AIndex : Integer; const AValue : TSavedColumnListTypeitemsArray); virtual;
  547. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  548. //2.6.4. bug workaround
  549. {$IFDEF VER2_6}
  550. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  551. {$ENDIF VER2_6}
  552. Public
  553. Published
  554. Property items : TSavedColumnListTypeitemsArray Index 0 Read Fitems Write Setitems;
  555. Property kind : String Index 8 Read Fkind Write Setkind;
  556. end;
  557. TSavedColumnListClass = Class of TSavedColumnList;
  558. { --------------------------------------------------------------------
  559. TUpdateAvailabilityRequest
  560. --------------------------------------------------------------------}
  561. TUpdateAvailabilityRequest = Class(TGoogleBaseObject)
  562. Private
  563. Favailabilities : TUpdateAvailabilityRequestTypeavailabilitiesArray;
  564. Protected
  565. //Property setters
  566. Procedure Setavailabilities(AIndex : Integer; const AValue : TUpdateAvailabilityRequestTypeavailabilitiesArray); virtual;
  567. //2.6.4. bug workaround
  568. {$IFDEF VER2_6}
  569. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  570. {$ENDIF VER2_6}
  571. Public
  572. Published
  573. Property availabilities : TUpdateAvailabilityRequestTypeavailabilitiesArray Index 0 Read Favailabilities Write Setavailabilities;
  574. end;
  575. TUpdateAvailabilityRequestClass = Class of TUpdateAvailabilityRequest;
  576. { --------------------------------------------------------------------
  577. TUpdateAvailabilityResponse
  578. --------------------------------------------------------------------}
  579. TUpdateAvailabilityResponse = Class(TGoogleBaseObject)
  580. Private
  581. Favailabilities : TUpdateAvailabilityResponseTypeavailabilitiesArray;
  582. Protected
  583. //Property setters
  584. Procedure Setavailabilities(AIndex : Integer; const AValue : TUpdateAvailabilityResponseTypeavailabilitiesArray); virtual;
  585. //2.6.4. bug workaround
  586. {$IFDEF VER2_6}
  587. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  588. {$ENDIF VER2_6}
  589. Public
  590. Published
  591. Property availabilities : TUpdateAvailabilityResponseTypeavailabilitiesArray Index 0 Read Favailabilities Write Setavailabilities;
  592. end;
  593. TUpdateAvailabilityResponseClass = Class of TUpdateAvailabilityResponse;
  594. { --------------------------------------------------------------------
  595. TConversionResource
  596. --------------------------------------------------------------------}
  597. //Optional query Options for TConversionResource, method Get
  598. TConversionGetOptions = Record
  599. adGroupId : int64;
  600. adId : int64;
  601. campaignId : int64;
  602. criterionId : int64;
  603. endDate : integer;
  604. rowCount : integer;
  605. startDate : integer;
  606. startRow : integer;
  607. end;
  608. //Optional query Options for TConversionResource, method Patch
  609. TConversionPatchOptions = Record
  610. advertiserId : int64;
  611. agencyId : int64;
  612. endDate : integer;
  613. engineAccountId : int64;
  614. rowCount : integer;
  615. startDate : integer;
  616. startRow : integer;
  617. end;
  618. TConversionResource = Class(TGoogleResource)
  619. Public
  620. Class Function ResourceName : String; override;
  621. Class Function DefaultAPI : TGoogleAPIClass; override;
  622. Function Get(advertiserId: string; agencyId: string; engineAccountId: string; AQuery : string = '') : TConversionList;
  623. Function Get(advertiserId: string; agencyId: string; engineAccountId: string; AQuery : TConversiongetOptions) : TConversionList;
  624. Function Insert(aConversionList : TConversionList) : TConversionList;
  625. Function Patch(aConversionList : TConversionList; AQuery : string = '') : TConversionList;
  626. Function Patch(aConversionList : TConversionList; AQuery : TConversionpatchOptions) : TConversionList;
  627. Function Update(aConversionList : TConversionList) : TConversionList;
  628. Function UpdateAvailability(aUpdateAvailabilityRequest : TUpdateAvailabilityRequest) : TUpdateAvailabilityResponse;
  629. end;
  630. { --------------------------------------------------------------------
  631. TReportsResource
  632. --------------------------------------------------------------------}
  633. TReportsResource = Class(TGoogleResource)
  634. Public
  635. Class Function ResourceName : String; override;
  636. Class Function DefaultAPI : TGoogleAPIClass; override;
  637. Function Generate(aReportRequest : TReportRequest) : TReport;
  638. Function Get(reportId: string) : TReport;
  639. Procedure GetFile(reportFragment: integer; reportId: string);
  640. Function Request(aReportRequest : TReportRequest) : TReport;
  641. end;
  642. { --------------------------------------------------------------------
  643. TSavedColumnsResource
  644. --------------------------------------------------------------------}
  645. TSavedColumnsResource = Class(TGoogleResource)
  646. Public
  647. Class Function ResourceName : String; override;
  648. Class Function DefaultAPI : TGoogleAPIClass; override;
  649. Function List(advertiserId: string; agencyId: string) : TSavedColumnList;
  650. end;
  651. { --------------------------------------------------------------------
  652. TDoubleclicksearchAPI
  653. --------------------------------------------------------------------}
  654. TDoubleclicksearchAPI = Class(TGoogleAPI)
  655. Private
  656. FConversionInstance : TConversionResource;
  657. FReportsInstance : TReportsResource;
  658. FSavedColumnsInstance : TSavedColumnsResource;
  659. Function GetConversionInstance : TConversionResource;virtual;
  660. Function GetReportsInstance : TReportsResource;virtual;
  661. Function GetSavedColumnsInstance : TSavedColumnsResource;virtual;
  662. Public
  663. //Override class functions with API info
  664. Class Function APIName : String; override;
  665. Class Function APIVersion : String; override;
  666. Class Function APIRevision : String; override;
  667. Class Function APIID : String; override;
  668. Class Function APITitle : String; override;
  669. Class Function APIDescription : String; override;
  670. Class Function APIOwnerDomain : String; override;
  671. Class Function APIOwnerName : String; override;
  672. Class Function APIIcon16 : String; override;
  673. Class Function APIIcon32 : String; override;
  674. Class Function APIdocumentationLink : String; override;
  675. Class Function APIrootUrl : string; override;
  676. Class Function APIbasePath : string;override;
  677. Class Function APIbaseURL : String;override;
  678. Class Function APIProtocol : string;override;
  679. Class Function APIservicePath : string;override;
  680. Class Function APIbatchPath : String;override;
  681. Class Function APIAuthScopes : TScopeInfoArray;override;
  682. Class Function APINeedsAuth : Boolean;override;
  683. Class Procedure RegisterAPIResources; override;
  684. //Add create function for resources
  685. Function CreateConversionResource(AOwner : TComponent) : TConversionResource;virtual;overload;
  686. Function CreateConversionResource : TConversionResource;virtual;overload;
  687. Function CreateReportsResource(AOwner : TComponent) : TReportsResource;virtual;overload;
  688. Function CreateReportsResource : TReportsResource;virtual;overload;
  689. Function CreateSavedColumnsResource(AOwner : TComponent) : TSavedColumnsResource;virtual;overload;
  690. Function CreateSavedColumnsResource : TSavedColumnsResource;virtual;overload;
  691. //Add default on-demand instances for resources
  692. Property ConversionResource : TConversionResource Read GetConversionInstance;
  693. Property ReportsResource : TReportsResource Read GetReportsInstance;
  694. Property SavedColumnsResource : TSavedColumnsResource Read GetSavedColumnsInstance;
  695. end;
  696. implementation
  697. { --------------------------------------------------------------------
  698. TAvailability
  699. --------------------------------------------------------------------}
  700. Procedure TAvailability.SetadvertiserId(AIndex : Integer; const AValue : String);
  701. begin
  702. If (FadvertiserId=AValue) then exit;
  703. FadvertiserId:=AValue;
  704. MarkPropertyChanged(AIndex);
  705. end;
  706. Procedure TAvailability.SetagencyId(AIndex : Integer; const AValue : String);
  707. begin
  708. If (FagencyId=AValue) then exit;
  709. FagencyId:=AValue;
  710. MarkPropertyChanged(AIndex);
  711. end;
  712. Procedure TAvailability.SetavailabilityTimestamp(AIndex : Integer; const AValue : String);
  713. begin
  714. If (FavailabilityTimestamp=AValue) then exit;
  715. FavailabilityTimestamp:=AValue;
  716. MarkPropertyChanged(AIndex);
  717. end;
  718. Procedure TAvailability.SetsegmentationId(AIndex : Integer; const AValue : String);
  719. begin
  720. If (FsegmentationId=AValue) then exit;
  721. FsegmentationId:=AValue;
  722. MarkPropertyChanged(AIndex);
  723. end;
  724. Procedure TAvailability.SetsegmentationName(AIndex : Integer; const AValue : String);
  725. begin
  726. If (FsegmentationName=AValue) then exit;
  727. FsegmentationName:=AValue;
  728. MarkPropertyChanged(AIndex);
  729. end;
  730. Procedure TAvailability.SetsegmentationType(AIndex : Integer; const AValue : String);
  731. begin
  732. If (FsegmentationType=AValue) then exit;
  733. FsegmentationType:=AValue;
  734. MarkPropertyChanged(AIndex);
  735. end;
  736. { --------------------------------------------------------------------
  737. TConversion
  738. --------------------------------------------------------------------}
  739. Procedure TConversion.SetadGroupId(AIndex : Integer; const AValue : String);
  740. begin
  741. If (FadGroupId=AValue) then exit;
  742. FadGroupId:=AValue;
  743. MarkPropertyChanged(AIndex);
  744. end;
  745. Procedure TConversion.SetadId(AIndex : Integer; const AValue : String);
  746. begin
  747. If (FadId=AValue) then exit;
  748. FadId:=AValue;
  749. MarkPropertyChanged(AIndex);
  750. end;
  751. Procedure TConversion.SetadvertiserId(AIndex : Integer; const AValue : String);
  752. begin
  753. If (FadvertiserId=AValue) then exit;
  754. FadvertiserId:=AValue;
  755. MarkPropertyChanged(AIndex);
  756. end;
  757. Procedure TConversion.SetagencyId(AIndex : Integer; const AValue : String);
  758. begin
  759. If (FagencyId=AValue) then exit;
  760. FagencyId:=AValue;
  761. MarkPropertyChanged(AIndex);
  762. end;
  763. Procedure TConversion.SetattributionModel(AIndex : Integer; const AValue : String);
  764. begin
  765. If (FattributionModel=AValue) then exit;
  766. FattributionModel:=AValue;
  767. MarkPropertyChanged(AIndex);
  768. end;
  769. Procedure TConversion.SetcampaignId(AIndex : Integer; const AValue : String);
  770. begin
  771. If (FcampaignId=AValue) then exit;
  772. FcampaignId:=AValue;
  773. MarkPropertyChanged(AIndex);
  774. end;
  775. Procedure TConversion.Setchannel(AIndex : Integer; const AValue : String);
  776. begin
  777. If (Fchannel=AValue) then exit;
  778. Fchannel:=AValue;
  779. MarkPropertyChanged(AIndex);
  780. end;
  781. Procedure TConversion.SetclickId(AIndex : Integer; const AValue : String);
  782. begin
  783. If (FclickId=AValue) then exit;
  784. FclickId:=AValue;
  785. MarkPropertyChanged(AIndex);
  786. end;
  787. Procedure TConversion.SetconversionId(AIndex : Integer; const AValue : String);
  788. begin
  789. If (FconversionId=AValue) then exit;
  790. FconversionId:=AValue;
  791. MarkPropertyChanged(AIndex);
  792. end;
  793. Procedure TConversion.SetconversionModifiedTimestamp(AIndex : Integer; const AValue : String);
  794. begin
  795. If (FconversionModifiedTimestamp=AValue) then exit;
  796. FconversionModifiedTimestamp:=AValue;
  797. MarkPropertyChanged(AIndex);
  798. end;
  799. Procedure TConversion.SetconversionTimestamp(AIndex : Integer; const AValue : String);
  800. begin
  801. If (FconversionTimestamp=AValue) then exit;
  802. FconversionTimestamp:=AValue;
  803. MarkPropertyChanged(AIndex);
  804. end;
  805. Procedure TConversion.SetcountMillis(AIndex : Integer; const AValue : String);
  806. begin
  807. If (FcountMillis=AValue) then exit;
  808. FcountMillis:=AValue;
  809. MarkPropertyChanged(AIndex);
  810. end;
  811. Procedure TConversion.SetcriterionId(AIndex : Integer; const AValue : String);
  812. begin
  813. If (FcriterionId=AValue) then exit;
  814. FcriterionId:=AValue;
  815. MarkPropertyChanged(AIndex);
  816. end;
  817. Procedure TConversion.SetcurrencyCode(AIndex : Integer; const AValue : String);
  818. begin
  819. If (FcurrencyCode=AValue) then exit;
  820. FcurrencyCode:=AValue;
  821. MarkPropertyChanged(AIndex);
  822. end;
  823. Procedure TConversion.SetcustomDimension(AIndex : Integer; const AValue : TConversionTypecustomDimensionArray);
  824. begin
  825. If (FcustomDimension=AValue) then exit;
  826. FcustomDimension:=AValue;
  827. MarkPropertyChanged(AIndex);
  828. end;
  829. Procedure TConversion.SetcustomMetric(AIndex : Integer; const AValue : TConversionTypecustomMetricArray);
  830. begin
  831. If (FcustomMetric=AValue) then exit;
  832. FcustomMetric:=AValue;
  833. MarkPropertyChanged(AIndex);
  834. end;
  835. Procedure TConversion.SetdeviceType(AIndex : Integer; const AValue : String);
  836. begin
  837. If (FdeviceType=AValue) then exit;
  838. FdeviceType:=AValue;
  839. MarkPropertyChanged(AIndex);
  840. end;
  841. Procedure TConversion.SetdsConversionId(AIndex : Integer; const AValue : String);
  842. begin
  843. If (FdsConversionId=AValue) then exit;
  844. FdsConversionId:=AValue;
  845. MarkPropertyChanged(AIndex);
  846. end;
  847. Procedure TConversion.SetengineAccountId(AIndex : Integer; const AValue : String);
  848. begin
  849. If (FengineAccountId=AValue) then exit;
  850. FengineAccountId:=AValue;
  851. MarkPropertyChanged(AIndex);
  852. end;
  853. Procedure TConversion.SetfloodlightOrderId(AIndex : Integer; const AValue : String);
  854. begin
  855. If (FfloodlightOrderId=AValue) then exit;
  856. FfloodlightOrderId:=AValue;
  857. MarkPropertyChanged(AIndex);
  858. end;
  859. Procedure TConversion.SetinventoryAccountId(AIndex : Integer; const AValue : String);
  860. begin
  861. If (FinventoryAccountId=AValue) then exit;
  862. FinventoryAccountId:=AValue;
  863. MarkPropertyChanged(AIndex);
  864. end;
  865. Procedure TConversion.SetproductCountry(AIndex : Integer; const AValue : String);
  866. begin
  867. If (FproductCountry=AValue) then exit;
  868. FproductCountry:=AValue;
  869. MarkPropertyChanged(AIndex);
  870. end;
  871. Procedure TConversion.SetproductGroupId(AIndex : Integer; const AValue : String);
  872. begin
  873. If (FproductGroupId=AValue) then exit;
  874. FproductGroupId:=AValue;
  875. MarkPropertyChanged(AIndex);
  876. end;
  877. Procedure TConversion.SetproductId(AIndex : Integer; const AValue : String);
  878. begin
  879. If (FproductId=AValue) then exit;
  880. FproductId:=AValue;
  881. MarkPropertyChanged(AIndex);
  882. end;
  883. Procedure TConversion.SetproductLanguage(AIndex : Integer; const AValue : String);
  884. begin
  885. If (FproductLanguage=AValue) then exit;
  886. FproductLanguage:=AValue;
  887. MarkPropertyChanged(AIndex);
  888. end;
  889. Procedure TConversion.SetquantityMillis(AIndex : Integer; const AValue : String);
  890. begin
  891. If (FquantityMillis=AValue) then exit;
  892. FquantityMillis:=AValue;
  893. MarkPropertyChanged(AIndex);
  894. end;
  895. Procedure TConversion.SetrevenueMicros(AIndex : Integer; const AValue : String);
  896. begin
  897. If (FrevenueMicros=AValue) then exit;
  898. FrevenueMicros:=AValue;
  899. MarkPropertyChanged(AIndex);
  900. end;
  901. Procedure TConversion.SetsegmentationId(AIndex : Integer; const AValue : String);
  902. begin
  903. If (FsegmentationId=AValue) then exit;
  904. FsegmentationId:=AValue;
  905. MarkPropertyChanged(AIndex);
  906. end;
  907. Procedure TConversion.SetsegmentationName(AIndex : Integer; const AValue : String);
  908. begin
  909. If (FsegmentationName=AValue) then exit;
  910. FsegmentationName:=AValue;
  911. MarkPropertyChanged(AIndex);
  912. end;
  913. Procedure TConversion.SetsegmentationType(AIndex : Integer; const AValue : String);
  914. begin
  915. If (FsegmentationType=AValue) then exit;
  916. FsegmentationType:=AValue;
  917. MarkPropertyChanged(AIndex);
  918. end;
  919. Procedure TConversion.Setstate(AIndex : Integer; const AValue : String);
  920. begin
  921. If (Fstate=AValue) then exit;
  922. Fstate:=AValue;
  923. MarkPropertyChanged(AIndex);
  924. end;
  925. Procedure TConversion.SetstoreId(AIndex : Integer; const AValue : String);
  926. begin
  927. If (FstoreId=AValue) then exit;
  928. FstoreId:=AValue;
  929. MarkPropertyChanged(AIndex);
  930. end;
  931. Procedure TConversion.Set_type(AIndex : Integer; const AValue : String);
  932. begin
  933. If (F_type=AValue) then exit;
  934. F_type:=AValue;
  935. MarkPropertyChanged(AIndex);
  936. end;
  937. Class Function TConversion.ExportPropertyName(Const AName : String) :String;
  938. begin
  939. Case AName of
  940. '_type' : Result:='type';
  941. else
  942. Result:=Inherited ExportPropertyName(AName);
  943. end;
  944. end;
  945. //2.6.4. bug workaround
  946. {$IFDEF VER2_6}
  947. Procedure TConversion.SetArrayLength(Const AName : String; ALength : Longint);
  948. begin
  949. Case AName of
  950. 'customdimension' : SetLength(FcustomDimension,ALength);
  951. 'custommetric' : SetLength(FcustomMetric,ALength);
  952. else
  953. Inherited SetArrayLength(AName,ALength);
  954. end;
  955. end;
  956. {$ENDIF VER2_6}
  957. { --------------------------------------------------------------------
  958. TConversionList
  959. --------------------------------------------------------------------}
  960. Procedure TConversionList.Setconversion(AIndex : Integer; const AValue : TConversionListTypeconversionArray);
  961. begin
  962. If (Fconversion=AValue) then exit;
  963. Fconversion:=AValue;
  964. MarkPropertyChanged(AIndex);
  965. end;
  966. Procedure TConversionList.Setkind(AIndex : Integer; const AValue : String);
  967. begin
  968. If (Fkind=AValue) then exit;
  969. Fkind:=AValue;
  970. MarkPropertyChanged(AIndex);
  971. end;
  972. //2.6.4. bug workaround
  973. {$IFDEF VER2_6}
  974. Procedure TConversionList.SetArrayLength(Const AName : String; ALength : Longint);
  975. begin
  976. Case AName of
  977. 'conversion' : SetLength(Fconversion,ALength);
  978. else
  979. Inherited SetArrayLength(AName,ALength);
  980. end;
  981. end;
  982. {$ENDIF VER2_6}
  983. { --------------------------------------------------------------------
  984. TCustomDimension
  985. --------------------------------------------------------------------}
  986. Procedure TCustomDimension.Setname(AIndex : Integer; const AValue : String);
  987. begin
  988. If (Fname=AValue) then exit;
  989. Fname:=AValue;
  990. MarkPropertyChanged(AIndex);
  991. end;
  992. Procedure TCustomDimension.Setvalue(AIndex : Integer; const AValue : String);
  993. begin
  994. If (Fvalue=AValue) then exit;
  995. Fvalue:=AValue;
  996. MarkPropertyChanged(AIndex);
  997. end;
  998. { --------------------------------------------------------------------
  999. TCustomMetric
  1000. --------------------------------------------------------------------}
  1001. Procedure TCustomMetric.Setname(AIndex : Integer; const AValue : String);
  1002. begin
  1003. If (Fname=AValue) then exit;
  1004. Fname:=AValue;
  1005. MarkPropertyChanged(AIndex);
  1006. end;
  1007. Procedure TCustomMetric.Setvalue(AIndex : Integer; const AValue : double);
  1008. begin
  1009. If (Fvalue=AValue) then exit;
  1010. Fvalue:=AValue;
  1011. MarkPropertyChanged(AIndex);
  1012. end;
  1013. { --------------------------------------------------------------------
  1014. TReportTypefilesItem
  1015. --------------------------------------------------------------------}
  1016. Procedure TReportTypefilesItem.SetbyteCount(AIndex : Integer; const AValue : String);
  1017. begin
  1018. If (FbyteCount=AValue) then exit;
  1019. FbyteCount:=AValue;
  1020. MarkPropertyChanged(AIndex);
  1021. end;
  1022. Procedure TReportTypefilesItem.Seturl(AIndex : Integer; const AValue : String);
  1023. begin
  1024. If (Furl=AValue) then exit;
  1025. Furl:=AValue;
  1026. MarkPropertyChanged(AIndex);
  1027. end;
  1028. { --------------------------------------------------------------------
  1029. TReport
  1030. --------------------------------------------------------------------}
  1031. Procedure TReport.Setfiles(AIndex : Integer; const AValue : TReportTypefilesArray);
  1032. begin
  1033. If (Ffiles=AValue) then exit;
  1034. Ffiles:=AValue;
  1035. MarkPropertyChanged(AIndex);
  1036. end;
  1037. Procedure TReport.Setid(AIndex : Integer; const AValue : String);
  1038. begin
  1039. If (Fid=AValue) then exit;
  1040. Fid:=AValue;
  1041. MarkPropertyChanged(AIndex);
  1042. end;
  1043. Procedure TReport.SetisReportReady(AIndex : Integer; const AValue : boolean);
  1044. begin
  1045. If (FisReportReady=AValue) then exit;
  1046. FisReportReady:=AValue;
  1047. MarkPropertyChanged(AIndex);
  1048. end;
  1049. Procedure TReport.Setkind(AIndex : Integer; const AValue : String);
  1050. begin
  1051. If (Fkind=AValue) then exit;
  1052. Fkind:=AValue;
  1053. MarkPropertyChanged(AIndex);
  1054. end;
  1055. Procedure TReport.Setrequest(AIndex : Integer; const AValue : TReportRequest);
  1056. begin
  1057. If (Frequest=AValue) then exit;
  1058. Frequest:=AValue;
  1059. MarkPropertyChanged(AIndex);
  1060. end;
  1061. Procedure TReport.SetrowCount(AIndex : Integer; const AValue : integer);
  1062. begin
  1063. If (FrowCount=AValue) then exit;
  1064. FrowCount:=AValue;
  1065. MarkPropertyChanged(AIndex);
  1066. end;
  1067. Procedure TReport.Setrows(AIndex : Integer; const AValue : TReportTyperowsArray);
  1068. begin
  1069. If (Frows=AValue) then exit;
  1070. Frows:=AValue;
  1071. MarkPropertyChanged(AIndex);
  1072. end;
  1073. Procedure TReport.SetstatisticsCurrencyCode(AIndex : Integer; const AValue : String);
  1074. begin
  1075. If (FstatisticsCurrencyCode=AValue) then exit;
  1076. FstatisticsCurrencyCode:=AValue;
  1077. MarkPropertyChanged(AIndex);
  1078. end;
  1079. Procedure TReport.SetstatisticsTimeZone(AIndex : Integer; const AValue : String);
  1080. begin
  1081. If (FstatisticsTimeZone=AValue) then exit;
  1082. FstatisticsTimeZone:=AValue;
  1083. MarkPropertyChanged(AIndex);
  1084. end;
  1085. //2.6.4. bug workaround
  1086. {$IFDEF VER2_6}
  1087. Procedure TReport.SetArrayLength(Const AName : String; ALength : Longint);
  1088. begin
  1089. Case AName of
  1090. 'files' : SetLength(Ffiles,ALength);
  1091. 'rows' : SetLength(Frows,ALength);
  1092. else
  1093. Inherited SetArrayLength(AName,ALength);
  1094. end;
  1095. end;
  1096. {$ENDIF VER2_6}
  1097. { --------------------------------------------------------------------
  1098. TReportApiColumnSpec
  1099. --------------------------------------------------------------------}
  1100. Procedure TReportApiColumnSpec.SetcolumnName(AIndex : Integer; const AValue : String);
  1101. begin
  1102. If (FcolumnName=AValue) then exit;
  1103. FcolumnName:=AValue;
  1104. MarkPropertyChanged(AIndex);
  1105. end;
  1106. Procedure TReportApiColumnSpec.SetcustomDimensionName(AIndex : Integer; const AValue : String);
  1107. begin
  1108. If (FcustomDimensionName=AValue) then exit;
  1109. FcustomDimensionName:=AValue;
  1110. MarkPropertyChanged(AIndex);
  1111. end;
  1112. Procedure TReportApiColumnSpec.SetcustomMetricName(AIndex : Integer; const AValue : String);
  1113. begin
  1114. If (FcustomMetricName=AValue) then exit;
  1115. FcustomMetricName:=AValue;
  1116. MarkPropertyChanged(AIndex);
  1117. end;
  1118. Procedure TReportApiColumnSpec.SetendDate(AIndex : Integer; const AValue : String);
  1119. begin
  1120. If (FendDate=AValue) then exit;
  1121. FendDate:=AValue;
  1122. MarkPropertyChanged(AIndex);
  1123. end;
  1124. Procedure TReportApiColumnSpec.SetgroupByColumn(AIndex : Integer; const AValue : boolean);
  1125. begin
  1126. If (FgroupByColumn=AValue) then exit;
  1127. FgroupByColumn:=AValue;
  1128. MarkPropertyChanged(AIndex);
  1129. end;
  1130. Procedure TReportApiColumnSpec.SetheaderText(AIndex : Integer; const AValue : String);
  1131. begin
  1132. If (FheaderText=AValue) then exit;
  1133. FheaderText:=AValue;
  1134. MarkPropertyChanged(AIndex);
  1135. end;
  1136. Procedure TReportApiColumnSpec.SetplatformSource(AIndex : Integer; const AValue : String);
  1137. begin
  1138. If (FplatformSource=AValue) then exit;
  1139. FplatformSource:=AValue;
  1140. MarkPropertyChanged(AIndex);
  1141. end;
  1142. Procedure TReportApiColumnSpec.SetproductReportPerspective(AIndex : Integer; const AValue : String);
  1143. begin
  1144. If (FproductReportPerspective=AValue) then exit;
  1145. FproductReportPerspective:=AValue;
  1146. MarkPropertyChanged(AIndex);
  1147. end;
  1148. Procedure TReportApiColumnSpec.SetsavedColumnName(AIndex : Integer; const AValue : String);
  1149. begin
  1150. If (FsavedColumnName=AValue) then exit;
  1151. FsavedColumnName:=AValue;
  1152. MarkPropertyChanged(AIndex);
  1153. end;
  1154. Procedure TReportApiColumnSpec.SetstartDate(AIndex : Integer; const AValue : String);
  1155. begin
  1156. If (FstartDate=AValue) then exit;
  1157. FstartDate:=AValue;
  1158. MarkPropertyChanged(AIndex);
  1159. end;
  1160. { --------------------------------------------------------------------
  1161. TReportRequestTypefiltersItem
  1162. --------------------------------------------------------------------}
  1163. Procedure TReportRequestTypefiltersItem.Setcolumn(AIndex : Integer; const AValue : TReportApiColumnSpec);
  1164. begin
  1165. If (Fcolumn=AValue) then exit;
  1166. Fcolumn:=AValue;
  1167. MarkPropertyChanged(AIndex);
  1168. end;
  1169. Procedure TReportRequestTypefiltersItem.Set_operator(AIndex : Integer; const AValue : String);
  1170. begin
  1171. If (F_operator=AValue) then exit;
  1172. F_operator:=AValue;
  1173. MarkPropertyChanged(AIndex);
  1174. end;
  1175. Procedure TReportRequestTypefiltersItem.Setvalues(AIndex : Integer; const AValue : TTJSONSchemaArray);
  1176. begin
  1177. If (Fvalues=AValue) then exit;
  1178. Fvalues:=AValue;
  1179. MarkPropertyChanged(AIndex);
  1180. end;
  1181. Class Function TReportRequestTypefiltersItem.ExportPropertyName(Const AName : String) :String;
  1182. begin
  1183. Case AName of
  1184. '_operator' : Result:='operator';
  1185. else
  1186. Result:=Inherited ExportPropertyName(AName);
  1187. end;
  1188. end;
  1189. //2.6.4. bug workaround
  1190. {$IFDEF VER2_6}
  1191. Procedure TReportRequestTypefiltersItem.SetArrayLength(Const AName : String; ALength : Longint);
  1192. begin
  1193. Case AName of
  1194. 'values' : SetLength(Fvalues,ALength);
  1195. else
  1196. Inherited SetArrayLength(AName,ALength);
  1197. end;
  1198. end;
  1199. {$ENDIF VER2_6}
  1200. { --------------------------------------------------------------------
  1201. TReportRequestTypeorderByItem
  1202. --------------------------------------------------------------------}
  1203. Procedure TReportRequestTypeorderByItem.Setcolumn(AIndex : Integer; const AValue : TReportApiColumnSpec);
  1204. begin
  1205. If (Fcolumn=AValue) then exit;
  1206. Fcolumn:=AValue;
  1207. MarkPropertyChanged(AIndex);
  1208. end;
  1209. Procedure TReportRequestTypeorderByItem.SetsortOrder(AIndex : Integer; const AValue : String);
  1210. begin
  1211. If (FsortOrder=AValue) then exit;
  1212. FsortOrder:=AValue;
  1213. MarkPropertyChanged(AIndex);
  1214. end;
  1215. { --------------------------------------------------------------------
  1216. TReportRequestTypereportScope
  1217. --------------------------------------------------------------------}
  1218. Procedure TReportRequestTypereportScope.SetadGroupId(AIndex : Integer; const AValue : String);
  1219. begin
  1220. If (FadGroupId=AValue) then exit;
  1221. FadGroupId:=AValue;
  1222. MarkPropertyChanged(AIndex);
  1223. end;
  1224. Procedure TReportRequestTypereportScope.SetadId(AIndex : Integer; const AValue : String);
  1225. begin
  1226. If (FadId=AValue) then exit;
  1227. FadId:=AValue;
  1228. MarkPropertyChanged(AIndex);
  1229. end;
  1230. Procedure TReportRequestTypereportScope.SetadvertiserId(AIndex : Integer; const AValue : String);
  1231. begin
  1232. If (FadvertiserId=AValue) then exit;
  1233. FadvertiserId:=AValue;
  1234. MarkPropertyChanged(AIndex);
  1235. end;
  1236. Procedure TReportRequestTypereportScope.SetagencyId(AIndex : Integer; const AValue : String);
  1237. begin
  1238. If (FagencyId=AValue) then exit;
  1239. FagencyId:=AValue;
  1240. MarkPropertyChanged(AIndex);
  1241. end;
  1242. Procedure TReportRequestTypereportScope.SetcampaignId(AIndex : Integer; const AValue : String);
  1243. begin
  1244. If (FcampaignId=AValue) then exit;
  1245. FcampaignId:=AValue;
  1246. MarkPropertyChanged(AIndex);
  1247. end;
  1248. Procedure TReportRequestTypereportScope.SetengineAccountId(AIndex : Integer; const AValue : String);
  1249. begin
  1250. If (FengineAccountId=AValue) then exit;
  1251. FengineAccountId:=AValue;
  1252. MarkPropertyChanged(AIndex);
  1253. end;
  1254. Procedure TReportRequestTypereportScope.SetkeywordId(AIndex : Integer; const AValue : String);
  1255. begin
  1256. If (FkeywordId=AValue) then exit;
  1257. FkeywordId:=AValue;
  1258. MarkPropertyChanged(AIndex);
  1259. end;
  1260. { --------------------------------------------------------------------
  1261. TReportRequestTypetimeRange
  1262. --------------------------------------------------------------------}
  1263. Procedure TReportRequestTypetimeRange.SetchangedAttributesSinceTimestamp(AIndex : Integer; const AValue : TDatetime);
  1264. begin
  1265. If (FchangedAttributesSinceTimestamp=AValue) then exit;
  1266. FchangedAttributesSinceTimestamp:=AValue;
  1267. MarkPropertyChanged(AIndex);
  1268. end;
  1269. Procedure TReportRequestTypetimeRange.SetchangedMetricsSinceTimestamp(AIndex : Integer; const AValue : TDatetime);
  1270. begin
  1271. If (FchangedMetricsSinceTimestamp=AValue) then exit;
  1272. FchangedMetricsSinceTimestamp:=AValue;
  1273. MarkPropertyChanged(AIndex);
  1274. end;
  1275. Procedure TReportRequestTypetimeRange.SetendDate(AIndex : Integer; const AValue : String);
  1276. begin
  1277. If (FendDate=AValue) then exit;
  1278. FendDate:=AValue;
  1279. MarkPropertyChanged(AIndex);
  1280. end;
  1281. Procedure TReportRequestTypetimeRange.SetstartDate(AIndex : Integer; const AValue : String);
  1282. begin
  1283. If (FstartDate=AValue) then exit;
  1284. FstartDate:=AValue;
  1285. MarkPropertyChanged(AIndex);
  1286. end;
  1287. { --------------------------------------------------------------------
  1288. TReportRequest
  1289. --------------------------------------------------------------------}
  1290. Procedure TReportRequest.Setcolumns(AIndex : Integer; const AValue : TReportRequestTypecolumnsArray);
  1291. begin
  1292. If (Fcolumns=AValue) then exit;
  1293. Fcolumns:=AValue;
  1294. MarkPropertyChanged(AIndex);
  1295. end;
  1296. Procedure TReportRequest.SetdownloadFormat(AIndex : Integer; const AValue : String);
  1297. begin
  1298. If (FdownloadFormat=AValue) then exit;
  1299. FdownloadFormat:=AValue;
  1300. MarkPropertyChanged(AIndex);
  1301. end;
  1302. Procedure TReportRequest.Setfilters(AIndex : Integer; const AValue : TReportRequestTypefiltersArray);
  1303. begin
  1304. If (Ffilters=AValue) then exit;
  1305. Ffilters:=AValue;
  1306. MarkPropertyChanged(AIndex);
  1307. end;
  1308. Procedure TReportRequest.SetincludeDeletedEntities(AIndex : Integer; const AValue : boolean);
  1309. begin
  1310. If (FincludeDeletedEntities=AValue) then exit;
  1311. FincludeDeletedEntities:=AValue;
  1312. MarkPropertyChanged(AIndex);
  1313. end;
  1314. Procedure TReportRequest.SetincludeRemovedEntities(AIndex : Integer; const AValue : boolean);
  1315. begin
  1316. If (FincludeRemovedEntities=AValue) then exit;
  1317. FincludeRemovedEntities:=AValue;
  1318. MarkPropertyChanged(AIndex);
  1319. end;
  1320. Procedure TReportRequest.SetmaxRowsPerFile(AIndex : Integer; const AValue : integer);
  1321. begin
  1322. If (FmaxRowsPerFile=AValue) then exit;
  1323. FmaxRowsPerFile:=AValue;
  1324. MarkPropertyChanged(AIndex);
  1325. end;
  1326. Procedure TReportRequest.SetorderBy(AIndex : Integer; const AValue : TReportRequestTypeorderByArray);
  1327. begin
  1328. If (ForderBy=AValue) then exit;
  1329. ForderBy:=AValue;
  1330. MarkPropertyChanged(AIndex);
  1331. end;
  1332. Procedure TReportRequest.SetreportScope(AIndex : Integer; const AValue : TReportRequestTypereportScope);
  1333. begin
  1334. If (FreportScope=AValue) then exit;
  1335. FreportScope:=AValue;
  1336. MarkPropertyChanged(AIndex);
  1337. end;
  1338. Procedure TReportRequest.SetreportType(AIndex : Integer; const AValue : String);
  1339. begin
  1340. If (FreportType=AValue) then exit;
  1341. FreportType:=AValue;
  1342. MarkPropertyChanged(AIndex);
  1343. end;
  1344. Procedure TReportRequest.SetrowCount(AIndex : Integer; const AValue : integer);
  1345. begin
  1346. If (FrowCount=AValue) then exit;
  1347. FrowCount:=AValue;
  1348. MarkPropertyChanged(AIndex);
  1349. end;
  1350. Procedure TReportRequest.SetstartRow(AIndex : Integer; const AValue : integer);
  1351. begin
  1352. If (FstartRow=AValue) then exit;
  1353. FstartRow:=AValue;
  1354. MarkPropertyChanged(AIndex);
  1355. end;
  1356. Procedure TReportRequest.SetstatisticsCurrency(AIndex : Integer; const AValue : String);
  1357. begin
  1358. If (FstatisticsCurrency=AValue) then exit;
  1359. FstatisticsCurrency:=AValue;
  1360. MarkPropertyChanged(AIndex);
  1361. end;
  1362. Procedure TReportRequest.SettimeRange(AIndex : Integer; const AValue : TReportRequestTypetimeRange);
  1363. begin
  1364. If (FtimeRange=AValue) then exit;
  1365. FtimeRange:=AValue;
  1366. MarkPropertyChanged(AIndex);
  1367. end;
  1368. Procedure TReportRequest.SetverifySingleTimeZone(AIndex : Integer; const AValue : boolean);
  1369. begin
  1370. If (FverifySingleTimeZone=AValue) then exit;
  1371. FverifySingleTimeZone:=AValue;
  1372. MarkPropertyChanged(AIndex);
  1373. end;
  1374. //2.6.4. bug workaround
  1375. {$IFDEF VER2_6}
  1376. Procedure TReportRequest.SetArrayLength(Const AName : String; ALength : Longint);
  1377. begin
  1378. Case AName of
  1379. 'columns' : SetLength(Fcolumns,ALength);
  1380. 'filters' : SetLength(Ffilters,ALength);
  1381. 'orderby' : SetLength(ForderBy,ALength);
  1382. else
  1383. Inherited SetArrayLength(AName,ALength);
  1384. end;
  1385. end;
  1386. {$ENDIF VER2_6}
  1387. { --------------------------------------------------------------------
  1388. TReportRow
  1389. --------------------------------------------------------------------}
  1390. Class Function TReportRow.AllowAdditionalProperties : Boolean;
  1391. begin
  1392. Result:=True;
  1393. end;
  1394. { --------------------------------------------------------------------
  1395. TSavedColumn
  1396. --------------------------------------------------------------------}
  1397. Procedure TSavedColumn.Setkind(AIndex : Integer; const AValue : String);
  1398. begin
  1399. If (Fkind=AValue) then exit;
  1400. Fkind:=AValue;
  1401. MarkPropertyChanged(AIndex);
  1402. end;
  1403. Procedure TSavedColumn.SetsavedColumnName(AIndex : Integer; const AValue : String);
  1404. begin
  1405. If (FsavedColumnName=AValue) then exit;
  1406. FsavedColumnName:=AValue;
  1407. MarkPropertyChanged(AIndex);
  1408. end;
  1409. Procedure TSavedColumn.Set_type(AIndex : Integer; const AValue : String);
  1410. begin
  1411. If (F_type=AValue) then exit;
  1412. F_type:=AValue;
  1413. MarkPropertyChanged(AIndex);
  1414. end;
  1415. Class Function TSavedColumn.ExportPropertyName(Const AName : String) :String;
  1416. begin
  1417. Case AName of
  1418. '_type' : Result:='type';
  1419. else
  1420. Result:=Inherited ExportPropertyName(AName);
  1421. end;
  1422. end;
  1423. { --------------------------------------------------------------------
  1424. TSavedColumnList
  1425. --------------------------------------------------------------------}
  1426. Procedure TSavedColumnList.Setitems(AIndex : Integer; const AValue : TSavedColumnListTypeitemsArray);
  1427. begin
  1428. If (Fitems=AValue) then exit;
  1429. Fitems:=AValue;
  1430. MarkPropertyChanged(AIndex);
  1431. end;
  1432. Procedure TSavedColumnList.Setkind(AIndex : Integer; const AValue : String);
  1433. begin
  1434. If (Fkind=AValue) then exit;
  1435. Fkind:=AValue;
  1436. MarkPropertyChanged(AIndex);
  1437. end;
  1438. //2.6.4. bug workaround
  1439. {$IFDEF VER2_6}
  1440. Procedure TSavedColumnList.SetArrayLength(Const AName : String; ALength : Longint);
  1441. begin
  1442. Case AName of
  1443. 'items' : SetLength(Fitems,ALength);
  1444. else
  1445. Inherited SetArrayLength(AName,ALength);
  1446. end;
  1447. end;
  1448. {$ENDIF VER2_6}
  1449. { --------------------------------------------------------------------
  1450. TUpdateAvailabilityRequest
  1451. --------------------------------------------------------------------}
  1452. Procedure TUpdateAvailabilityRequest.Setavailabilities(AIndex : Integer; const AValue : TUpdateAvailabilityRequestTypeavailabilitiesArray);
  1453. begin
  1454. If (Favailabilities=AValue) then exit;
  1455. Favailabilities:=AValue;
  1456. MarkPropertyChanged(AIndex);
  1457. end;
  1458. //2.6.4. bug workaround
  1459. {$IFDEF VER2_6}
  1460. Procedure TUpdateAvailabilityRequest.SetArrayLength(Const AName : String; ALength : Longint);
  1461. begin
  1462. Case AName of
  1463. 'availabilities' : SetLength(Favailabilities,ALength);
  1464. else
  1465. Inherited SetArrayLength(AName,ALength);
  1466. end;
  1467. end;
  1468. {$ENDIF VER2_6}
  1469. { --------------------------------------------------------------------
  1470. TUpdateAvailabilityResponse
  1471. --------------------------------------------------------------------}
  1472. Procedure TUpdateAvailabilityResponse.Setavailabilities(AIndex : Integer; const AValue : TUpdateAvailabilityResponseTypeavailabilitiesArray);
  1473. begin
  1474. If (Favailabilities=AValue) then exit;
  1475. Favailabilities:=AValue;
  1476. MarkPropertyChanged(AIndex);
  1477. end;
  1478. //2.6.4. bug workaround
  1479. {$IFDEF VER2_6}
  1480. Procedure TUpdateAvailabilityResponse.SetArrayLength(Const AName : String; ALength : Longint);
  1481. begin
  1482. Case AName of
  1483. 'availabilities' : SetLength(Favailabilities,ALength);
  1484. else
  1485. Inherited SetArrayLength(AName,ALength);
  1486. end;
  1487. end;
  1488. {$ENDIF VER2_6}
  1489. { --------------------------------------------------------------------
  1490. TConversionResource
  1491. --------------------------------------------------------------------}
  1492. Class Function TConversionResource.ResourceName : String;
  1493. begin
  1494. Result:='conversion';
  1495. end;
  1496. Class Function TConversionResource.DefaultAPI : TGoogleAPIClass;
  1497. begin
  1498. Result:=TdoubleclicksearchAPI;
  1499. end;
  1500. Function TConversionResource.Get(advertiserId: string; agencyId: string; engineAccountId: string; AQuery : string = '') : TConversionList;
  1501. Const
  1502. _HTTPMethod = 'GET';
  1503. _Path = 'agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion';
  1504. _Methodid = 'doubleclicksearch.conversion.get';
  1505. Var
  1506. _P : String;
  1507. begin
  1508. _P:=SubstitutePath(_Path,['advertiserId',advertiserId,'agencyId',agencyId,'engineAccountId',engineAccountId]);
  1509. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TConversionList) as TConversionList;
  1510. end;
  1511. Function TConversionResource.Get(advertiserId: string; agencyId: string; engineAccountId: string; AQuery : TConversiongetOptions) : TConversionList;
  1512. Var
  1513. _Q : String;
  1514. begin
  1515. _Q:='';
  1516. AddToQuery(_Q,'adGroupId',AQuery.adGroupId);
  1517. AddToQuery(_Q,'adId',AQuery.adId);
  1518. AddToQuery(_Q,'campaignId',AQuery.campaignId);
  1519. AddToQuery(_Q,'criterionId',AQuery.criterionId);
  1520. AddToQuery(_Q,'endDate',AQuery.endDate);
  1521. AddToQuery(_Q,'rowCount',AQuery.rowCount);
  1522. AddToQuery(_Q,'startDate',AQuery.startDate);
  1523. AddToQuery(_Q,'startRow',AQuery.startRow);
  1524. Result:=Get(advertiserId,agencyId,engineAccountId,_Q);
  1525. end;
  1526. Function TConversionResource.Insert(aConversionList : TConversionList) : TConversionList;
  1527. Const
  1528. _HTTPMethod = 'POST';
  1529. _Path = 'conversion';
  1530. _Methodid = 'doubleclicksearch.conversion.insert';
  1531. begin
  1532. Result:=ServiceCall(_HTTPMethod,_Path,'',aConversionList,TConversionList) as TConversionList;
  1533. end;
  1534. Function TConversionResource.Patch(aConversionList : TConversionList; AQuery : string = '') : TConversionList;
  1535. Const
  1536. _HTTPMethod = 'PATCH';
  1537. _Path = 'conversion';
  1538. _Methodid = 'doubleclicksearch.conversion.patch';
  1539. begin
  1540. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,aConversionList,TConversionList) as TConversionList;
  1541. end;
  1542. Function TConversionResource.Patch(aConversionList : TConversionList; AQuery : TConversionpatchOptions) : TConversionList;
  1543. Var
  1544. _Q : String;
  1545. begin
  1546. _Q:='';
  1547. AddToQuery(_Q,'advertiserId',AQuery.advertiserId);
  1548. AddToQuery(_Q,'agencyId',AQuery.agencyId);
  1549. AddToQuery(_Q,'endDate',AQuery.endDate);
  1550. AddToQuery(_Q,'engineAccountId',AQuery.engineAccountId);
  1551. AddToQuery(_Q,'rowCount',AQuery.rowCount);
  1552. AddToQuery(_Q,'startDate',AQuery.startDate);
  1553. AddToQuery(_Q,'startRow',AQuery.startRow);
  1554. Result:=Patch(aConversionList,_Q);
  1555. end;
  1556. Function TConversionResource.Update(aConversionList : TConversionList) : TConversionList;
  1557. Const
  1558. _HTTPMethod = 'PUT';
  1559. _Path = 'conversion';
  1560. _Methodid = 'doubleclicksearch.conversion.update';
  1561. begin
  1562. Result:=ServiceCall(_HTTPMethod,_Path,'',aConversionList,TConversionList) as TConversionList;
  1563. end;
  1564. Function TConversionResource.UpdateAvailability(aUpdateAvailabilityRequest : TUpdateAvailabilityRequest) : TUpdateAvailabilityResponse;
  1565. Const
  1566. _HTTPMethod = 'POST';
  1567. _Path = 'conversion/updateAvailability';
  1568. _Methodid = 'doubleclicksearch.conversion.updateAvailability';
  1569. begin
  1570. Result:=ServiceCall(_HTTPMethod,_Path,'',aUpdateAvailabilityRequest,TUpdateAvailabilityResponse) as TUpdateAvailabilityResponse;
  1571. end;
  1572. { --------------------------------------------------------------------
  1573. TReportsResource
  1574. --------------------------------------------------------------------}
  1575. Class Function TReportsResource.ResourceName : String;
  1576. begin
  1577. Result:='reports';
  1578. end;
  1579. Class Function TReportsResource.DefaultAPI : TGoogleAPIClass;
  1580. begin
  1581. Result:=TdoubleclicksearchAPI;
  1582. end;
  1583. Function TReportsResource.Generate(aReportRequest : TReportRequest) : TReport;
  1584. Const
  1585. _HTTPMethod = 'POST';
  1586. _Path = 'reports/generate';
  1587. _Methodid = 'doubleclicksearch.reports.generate';
  1588. begin
  1589. Result:=ServiceCall(_HTTPMethod,_Path,'',aReportRequest,TReport) as TReport;
  1590. end;
  1591. Function TReportsResource.Get(reportId: string) : TReport;
  1592. Const
  1593. _HTTPMethod = 'GET';
  1594. _Path = 'reports/{reportId}';
  1595. _Methodid = 'doubleclicksearch.reports.get';
  1596. Var
  1597. _P : String;
  1598. begin
  1599. _P:=SubstitutePath(_Path,['reportId',reportId]);
  1600. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TReport) as TReport;
  1601. end;
  1602. Procedure TReportsResource.GetFile(reportFragment: integer; reportId: string);
  1603. Const
  1604. _HTTPMethod = 'GET';
  1605. _Path = 'reports/{reportId}/files/{reportFragment}';
  1606. _Methodid = 'doubleclicksearch.reports.getFile';
  1607. Var
  1608. _P : String;
  1609. begin
  1610. _P:=SubstitutePath(_Path,['reportFragment',reportFragment,'reportId',reportId]);
  1611. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  1612. end;
  1613. Function TReportsResource.Request(aReportRequest : TReportRequest) : TReport;
  1614. Const
  1615. _HTTPMethod = 'POST';
  1616. _Path = 'reports';
  1617. _Methodid = 'doubleclicksearch.reports.request';
  1618. begin
  1619. Result:=ServiceCall(_HTTPMethod,_Path,'',aReportRequest,TReport) as TReport;
  1620. end;
  1621. { --------------------------------------------------------------------
  1622. TSavedColumnsResource
  1623. --------------------------------------------------------------------}
  1624. Class Function TSavedColumnsResource.ResourceName : String;
  1625. begin
  1626. Result:='savedColumns';
  1627. end;
  1628. Class Function TSavedColumnsResource.DefaultAPI : TGoogleAPIClass;
  1629. begin
  1630. Result:=TdoubleclicksearchAPI;
  1631. end;
  1632. Function TSavedColumnsResource.List(advertiserId: string; agencyId: string) : TSavedColumnList;
  1633. Const
  1634. _HTTPMethod = 'GET';
  1635. _Path = 'agency/{agencyId}/advertiser/{advertiserId}/savedcolumns';
  1636. _Methodid = 'doubleclicksearch.savedColumns.list';
  1637. Var
  1638. _P : String;
  1639. begin
  1640. _P:=SubstitutePath(_Path,['advertiserId',advertiserId,'agencyId',agencyId]);
  1641. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TSavedColumnList) as TSavedColumnList;
  1642. end;
  1643. { --------------------------------------------------------------------
  1644. TDoubleclicksearchAPI
  1645. --------------------------------------------------------------------}
  1646. Class Function TDoubleclicksearchAPI.APIName : String;
  1647. begin
  1648. Result:='doubleclicksearch';
  1649. end;
  1650. Class Function TDoubleclicksearchAPI.APIVersion : String;
  1651. begin
  1652. Result:='v2';
  1653. end;
  1654. Class Function TDoubleclicksearchAPI.APIRevision : String;
  1655. begin
  1656. Result:='20160519';
  1657. end;
  1658. Class Function TDoubleclicksearchAPI.APIID : String;
  1659. begin
  1660. Result:='doubleclicksearch:v2';
  1661. end;
  1662. Class Function TDoubleclicksearchAPI.APITitle : String;
  1663. begin
  1664. Result:='DoubleClick Search API';
  1665. end;
  1666. Class Function TDoubleclicksearchAPI.APIDescription : String;
  1667. begin
  1668. Result:='Reports and modifies your advertising data in DoubleClick Search (for example, campaigns, ad groups, keywords, and conversions).';
  1669. end;
  1670. Class Function TDoubleclicksearchAPI.APIOwnerDomain : String;
  1671. begin
  1672. Result:='google.com';
  1673. end;
  1674. Class Function TDoubleclicksearchAPI.APIOwnerName : String;
  1675. begin
  1676. Result:='Google';
  1677. end;
  1678. Class Function TDoubleclicksearchAPI.APIIcon16 : String;
  1679. begin
  1680. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1681. end;
  1682. Class Function TDoubleclicksearchAPI.APIIcon32 : String;
  1683. begin
  1684. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1685. end;
  1686. Class Function TDoubleclicksearchAPI.APIdocumentationLink : String;
  1687. begin
  1688. Result:='https://developers.google.com/doubleclick-search/';
  1689. end;
  1690. Class Function TDoubleclicksearchAPI.APIrootUrl : string;
  1691. begin
  1692. Result:='https://www.googleapis.com/';
  1693. end;
  1694. Class Function TDoubleclicksearchAPI.APIbasePath : string;
  1695. begin
  1696. Result:='/doubleclicksearch/v2/';
  1697. end;
  1698. Class Function TDoubleclicksearchAPI.APIbaseURL : String;
  1699. begin
  1700. Result:='https://www.googleapis.com/doubleclicksearch/v2/';
  1701. end;
  1702. Class Function TDoubleclicksearchAPI.APIProtocol : string;
  1703. begin
  1704. Result:='rest';
  1705. end;
  1706. Class Function TDoubleclicksearchAPI.APIservicePath : string;
  1707. begin
  1708. Result:='doubleclicksearch/v2/';
  1709. end;
  1710. Class Function TDoubleclicksearchAPI.APIbatchPath : String;
  1711. begin
  1712. Result:='batch';
  1713. end;
  1714. Class Function TDoubleclicksearchAPI.APIAuthScopes : TScopeInfoArray;
  1715. begin
  1716. SetLength(Result,1);
  1717. Result[0].Name:='https://www.googleapis.com/auth/doubleclicksearch';
  1718. Result[0].Description:='View and manage your advertising data in DoubleClick Search';
  1719. end;
  1720. Class Function TDoubleclicksearchAPI.APINeedsAuth : Boolean;
  1721. begin
  1722. Result:=True;
  1723. end;
  1724. Class Procedure TDoubleclicksearchAPI.RegisterAPIResources;
  1725. begin
  1726. TAvailability.RegisterObject;
  1727. TConversion.RegisterObject;
  1728. TConversionList.RegisterObject;
  1729. TCustomDimension.RegisterObject;
  1730. TCustomMetric.RegisterObject;
  1731. TReportTypefilesItem.RegisterObject;
  1732. TReport.RegisterObject;
  1733. TReportApiColumnSpec.RegisterObject;
  1734. TReportRequestTypefiltersItem.RegisterObject;
  1735. TReportRequestTypeorderByItem.RegisterObject;
  1736. TReportRequestTypereportScope.RegisterObject;
  1737. TReportRequestTypetimeRange.RegisterObject;
  1738. TReportRequest.RegisterObject;
  1739. TReportRow.RegisterObject;
  1740. TSavedColumn.RegisterObject;
  1741. TSavedColumnList.RegisterObject;
  1742. TUpdateAvailabilityRequest.RegisterObject;
  1743. TUpdateAvailabilityResponse.RegisterObject;
  1744. end;
  1745. Function TDoubleclicksearchAPI.GetConversionInstance : TConversionResource;
  1746. begin
  1747. if (FConversionInstance=Nil) then
  1748. FConversionInstance:=CreateConversionResource;
  1749. Result:=FConversionInstance;
  1750. end;
  1751. Function TDoubleclicksearchAPI.CreateConversionResource : TConversionResource;
  1752. begin
  1753. Result:=CreateConversionResource(Self);
  1754. end;
  1755. Function TDoubleclicksearchAPI.CreateConversionResource(AOwner : TComponent) : TConversionResource;
  1756. begin
  1757. Result:=TConversionResource.Create(AOwner);
  1758. Result.API:=Self.API;
  1759. end;
  1760. Function TDoubleclicksearchAPI.GetReportsInstance : TReportsResource;
  1761. begin
  1762. if (FReportsInstance=Nil) then
  1763. FReportsInstance:=CreateReportsResource;
  1764. Result:=FReportsInstance;
  1765. end;
  1766. Function TDoubleclicksearchAPI.CreateReportsResource : TReportsResource;
  1767. begin
  1768. Result:=CreateReportsResource(Self);
  1769. end;
  1770. Function TDoubleclicksearchAPI.CreateReportsResource(AOwner : TComponent) : TReportsResource;
  1771. begin
  1772. Result:=TReportsResource.Create(AOwner);
  1773. Result.API:=Self.API;
  1774. end;
  1775. Function TDoubleclicksearchAPI.GetSavedColumnsInstance : TSavedColumnsResource;
  1776. begin
  1777. if (FSavedColumnsInstance=Nil) then
  1778. FSavedColumnsInstance:=CreateSavedColumnsResource;
  1779. Result:=FSavedColumnsInstance;
  1780. end;
  1781. Function TDoubleclicksearchAPI.CreateSavedColumnsResource : TSavedColumnsResource;
  1782. begin
  1783. Result:=CreateSavedColumnsResource(Self);
  1784. end;
  1785. Function TDoubleclicksearchAPI.CreateSavedColumnsResource(AOwner : TComponent) : TSavedColumnsResource;
  1786. begin
  1787. Result:=TSavedColumnsResource.Create(AOwner);
  1788. Result.API:=Self.API;
  1789. end;
  1790. initialization
  1791. TDoubleclicksearchAPI.RegisterAPI;
  1792. end.