12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274 |
- unit googleyoutubereporting;
- {$MODE objfpc}
- {$H+}
- interface
- uses sysutils, classes, googleservice, restbase, googlebase;
- type
-
- //Top-level schema types
- TMedia = Class;
- TListReportTypesResponse = Class;
- TReportType = Class;
- TJob = Class;
- TListJobsResponse = Class;
- TEmpty = Class;
- TListReportsResponse = Class;
- TReport = Class;
- TMediaArray = Array of TMedia;
- TListReportTypesResponseArray = Array of TListReportTypesResponse;
- TReportTypeArray = Array of TReportType;
- TJobArray = Array of TJob;
- TListJobsResponseArray = Array of TListJobsResponse;
- TEmptyArray = Array of TEmpty;
- TListReportsResponseArray = Array of TListReportsResponse;
- TReportArray = Array of TReport;
- //Anonymous types, using auto-generated names
- TListReportTypesResponseTypereportTypesArray = Array of TReportType;
- TListJobsResponseTypejobsArray = Array of TJob;
- TListReportsResponseTypereportsArray = Array of TReport;
-
- { --------------------------------------------------------------------
- TMedia
- --------------------------------------------------------------------}
-
- TMedia = Class(TGoogleBaseObject)
- Private
- FresourceName : String;
- Protected
- //Property setters
- Procedure SetresourceName(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property resourceName : String Index 0 Read FresourceName Write SetresourceName;
- end;
- TMediaClass = Class of TMedia;
-
- { --------------------------------------------------------------------
- TListReportTypesResponse
- --------------------------------------------------------------------}
-
- TListReportTypesResponse = Class(TGoogleBaseObject)
- Private
- FreportTypes : TListReportTypesResponseTypereportTypesArray;
- FnextPageToken : String;
- Protected
- //Property setters
- Procedure SetreportTypes(AIndex : Integer; const AValue : TListReportTypesResponseTypereportTypesArray); virtual;
- Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property reportTypes : TListReportTypesResponseTypereportTypesArray Index 0 Read FreportTypes Write SetreportTypes;
- Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
- end;
- TListReportTypesResponseClass = Class of TListReportTypesResponse;
-
- { --------------------------------------------------------------------
- TReportType
- --------------------------------------------------------------------}
-
- TReportType = Class(TGoogleBaseObject)
- Private
- Fid : String;
- Fname : String;
- FdeprecateTime : String;
- FsystemManaged : boolean;
- Protected
- //Property setters
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetdeprecateTime(AIndex : Integer; const AValue : String); virtual;
- Procedure SetsystemManaged(AIndex : Integer; const AValue : boolean); virtual;
- Public
- Published
- Property id : String Index 0 Read Fid Write Setid;
- Property name : String Index 8 Read Fname Write Setname;
- Property deprecateTime : String Index 16 Read FdeprecateTime Write SetdeprecateTime;
- Property systemManaged : boolean Index 24 Read FsystemManaged Write SetsystemManaged;
- end;
- TReportTypeClass = Class of TReportType;
-
- { --------------------------------------------------------------------
- TJob
- --------------------------------------------------------------------}
-
- TJob = Class(TGoogleBaseObject)
- Private
- Fid : String;
- FreportTypeId : String;
- Fname : String;
- FcreateTime : String;
- FexpireTime : String;
- FsystemManaged : boolean;
- Protected
- //Property setters
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreportTypeId(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetcreateTime(AIndex : Integer; const AValue : String); virtual;
- Procedure SetexpireTime(AIndex : Integer; const AValue : String); virtual;
- Procedure SetsystemManaged(AIndex : Integer; const AValue : boolean); virtual;
- Public
- Published
- Property id : String Index 0 Read Fid Write Setid;
- Property reportTypeId : String Index 8 Read FreportTypeId Write SetreportTypeId;
- Property name : String Index 16 Read Fname Write Setname;
- Property createTime : String Index 24 Read FcreateTime Write SetcreateTime;
- Property expireTime : String Index 32 Read FexpireTime Write SetexpireTime;
- Property systemManaged : boolean Index 40 Read FsystemManaged Write SetsystemManaged;
- end;
- TJobClass = Class of TJob;
-
- { --------------------------------------------------------------------
- TListJobsResponse
- --------------------------------------------------------------------}
-
- TListJobsResponse = Class(TGoogleBaseObject)
- Private
- Fjobs : TListJobsResponseTypejobsArray;
- FnextPageToken : String;
- Protected
- //Property setters
- Procedure Setjobs(AIndex : Integer; const AValue : TListJobsResponseTypejobsArray); virtual;
- Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property jobs : TListJobsResponseTypejobsArray Index 0 Read Fjobs Write Setjobs;
- Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
- end;
- TListJobsResponseClass = Class of TListJobsResponse;
-
- { --------------------------------------------------------------------
- TEmpty
- --------------------------------------------------------------------}
-
- TEmpty = Class(TGoogleBaseObject)
- Private
- Protected
- //Property setters
- Public
- Published
- end;
- TEmptyClass = Class of TEmpty;
-
- { --------------------------------------------------------------------
- TListReportsResponse
- --------------------------------------------------------------------}
-
- TListReportsResponse = Class(TGoogleBaseObject)
- Private
- Freports : TListReportsResponseTypereportsArray;
- FnextPageToken : String;
- Protected
- //Property setters
- Procedure Setreports(AIndex : Integer; const AValue : TListReportsResponseTypereportsArray); virtual;
- Procedure SetnextPageToken(AIndex : Integer; const AValue : String); virtual;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
- {$ENDIF VER2_6}
- Public
- Published
- Property reports : TListReportsResponseTypereportsArray Index 0 Read Freports Write Setreports;
- Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
- end;
- TListReportsResponseClass = Class of TListReportsResponse;
-
- { --------------------------------------------------------------------
- TReport
- --------------------------------------------------------------------}
-
- TReport = Class(TGoogleBaseObject)
- Private
- Fid : String;
- FjobId : String;
- FjobExpireTime : String;
- FstartTime : String;
- FendTime : String;
- FcreateTime : String;
- FdownloadUrl : String;
- Protected
- //Property setters
- Procedure Setid(AIndex : Integer; const AValue : String); virtual;
- Procedure SetjobId(AIndex : Integer; const AValue : String); virtual;
- Procedure SetjobExpireTime(AIndex : Integer; const AValue : String); virtual;
- Procedure SetstartTime(AIndex : Integer; const AValue : String); virtual;
- Procedure SetendTime(AIndex : Integer; const AValue : String); virtual;
- Procedure SetcreateTime(AIndex : Integer; const AValue : String); virtual;
- Procedure SetdownloadUrl(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property id : String Index 0 Read Fid Write Setid;
- Property jobId : String Index 8 Read FjobId Write SetjobId;
- Property jobExpireTime : String Index 16 Read FjobExpireTime Write SetjobExpireTime;
- Property startTime : String Index 24 Read FstartTime Write SetstartTime;
- Property endTime : String Index 32 Read FendTime Write SetendTime;
- Property createTime : String Index 40 Read FcreateTime Write SetcreateTime;
- Property downloadUrl : String Index 48 Read FdownloadUrl Write SetdownloadUrl;
- end;
- TReportClass = Class of TReport;
-
- { --------------------------------------------------------------------
- TMediaResource
- --------------------------------------------------------------------}
-
- TMediaResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function Download(_resourceName: string) : TMedia;
- end;
-
-
- { --------------------------------------------------------------------
- TReportTypesResource
- --------------------------------------------------------------------}
-
-
- //Optional query Options for TReportTypesResource, method List
-
- TReportTypesListOptions = Record
- onBehalfOfContentOwner : String;
- pageSize : integer;
- pageToken : String;
- includeSystemManaged : boolean;
- end;
-
- TReportTypesResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function List(AQuery : string = '') : TListReportTypesResponse;
- Function List(AQuery : TReportTypeslistOptions) : TListReportTypesResponse;
- end;
-
-
- { --------------------------------------------------------------------
- TJobsReportsResource
- --------------------------------------------------------------------}
-
-
- //Optional query Options for TJobsReportsResource, method List
-
- TJobsReportsListOptions = Record
- onBehalfOfContentOwner : String;
- pageSize : integer;
- pageToken : String;
- createdAfter : String;
- startTimeAtOrAfter : String;
- startTimeBefore : String;
- end;
-
-
- //Optional query Options for TJobsReportsResource, method Get
-
- TJobsReportsGetOptions = Record
- onBehalfOfContentOwner : String;
- end;
-
- TJobsReportsResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function List(jobId: string; AQuery : string = '') : TListReportsResponse;
- Function List(jobId: string; AQuery : TJobsReportslistOptions) : TListReportsResponse;
- Function Get(jobId: string; reportId: string; AQuery : string = '') : TReport;
- Function Get(jobId: string; reportId: string; AQuery : TJobsReportsgetOptions) : TReport;
- end;
-
-
- { --------------------------------------------------------------------
- TJobsResource
- --------------------------------------------------------------------}
-
-
- //Optional query Options for TJobsResource, method Create
-
- TJobsCreateOptions = Record
- onBehalfOfContentOwner : String;
- end;
-
-
- //Optional query Options for TJobsResource, method List
-
- TJobsListOptions = Record
- onBehalfOfContentOwner : String;
- pageSize : integer;
- pageToken : String;
- includeSystemManaged : boolean;
- end;
-
-
- //Optional query Options for TJobsResource, method Get
-
- TJobsGetOptions = Record
- onBehalfOfContentOwner : String;
- end;
-
-
- //Optional query Options for TJobsResource, method Delete
-
- TJobsDeleteOptions = Record
- onBehalfOfContentOwner : String;
- end;
-
- TJobsResource = Class(TGoogleResource)
- Private
- FReportsInstance : TJobsReportsResource;
- Function GetReportsInstance : TJobsReportsResource;virtual;
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function Create(aJob : TJob; AQuery : string = '') : TJob;overload;
- Function Create(aJob : TJob; AQuery : TJobscreateOptions) : TJob;overload;
- Function List(AQuery : string = '') : TListJobsResponse;
- Function List(AQuery : TJobslistOptions) : TListJobsResponse;
- Function Get(jobId: string; AQuery : string = '') : TJob;
- Function Get(jobId: string; AQuery : TJobsgetOptions) : TJob;
- Function Delete(jobId: string; AQuery : string = '') : TEmpty;
- Function Delete(jobId: string; AQuery : TJobsdeleteOptions) : TEmpty;
- Function CreateReportsResource(AOwner : TComponent) : TJobsReportsResource;virtual;overload;
- Function CreateReportsResource : TJobsReportsResource;virtual;overload;
- Property ReportsResource : TJobsReportsResource Read GetReportsInstance;
- end;
-
-
- { --------------------------------------------------------------------
- TYoutubereportingAPI
- --------------------------------------------------------------------}
-
- TYoutubereportingAPI = Class(TGoogleAPI)
- Private
- FMediaInstance : TMediaResource;
- FReportTypesInstance : TReportTypesResource;
- FJobsReportsInstance : TJobsReportsResource;
- FJobsInstance : TJobsResource;
- Function GetMediaInstance : TMediaResource;virtual;
- Function GetReportTypesInstance : TReportTypesResource;virtual;
- Function GetJobsReportsInstance : TJobsReportsResource;virtual;
- Function GetJobsInstance : TJobsResource;virtual;
- Public
- //Override class functions with API info
- Class Function APIName : String; override;
- Class Function APIVersion : String; override;
- Class Function APIRevision : String; override;
- Class Function APIID : String; override;
- Class Function APITitle : String; override;
- Class Function APIDescription : String; override;
- Class Function APIOwnerDomain : String; override;
- Class Function APIOwnerName : String; override;
- Class Function APIIcon16 : String; override;
- Class Function APIIcon32 : String; override;
- Class Function APIdocumentationLink : String; override;
- Class Function APIrootUrl : string; override;
- Class Function APIbasePath : string;override;
- Class Function APIbaseURL : String;override;
- Class Function APIProtocol : string;override;
- Class Function APIservicePath : string;override;
- Class Function APIbatchPath : String;override;
- Class Function APIAuthScopes : TScopeInfoArray;override;
- Class Function APINeedsAuth : Boolean;override;
- Class Procedure RegisterAPIResources; override;
- //Add create function for resources
- Function CreateMediaResource(AOwner : TComponent) : TMediaResource;virtual;overload;
- Function CreateMediaResource : TMediaResource;virtual;overload;
- Function CreateReportTypesResource(AOwner : TComponent) : TReportTypesResource;virtual;overload;
- Function CreateReportTypesResource : TReportTypesResource;virtual;overload;
- Function CreateJobsReportsResource(AOwner : TComponent) : TJobsReportsResource;virtual;overload;
- Function CreateJobsReportsResource : TJobsReportsResource;virtual;overload;
- Function CreateJobsResource(AOwner : TComponent) : TJobsResource;virtual;overload;
- Function CreateJobsResource : TJobsResource;virtual;overload;
- //Add default on-demand instances for resources
- Property MediaResource : TMediaResource Read GetMediaInstance;
- Property ReportTypesResource : TReportTypesResource Read GetReportTypesInstance;
- Property JobsReportsResource : TJobsReportsResource Read GetJobsReportsInstance;
- Property JobsResource : TJobsResource Read GetJobsInstance;
- end;
- implementation
- { --------------------------------------------------------------------
- TMedia
- --------------------------------------------------------------------}
- Procedure TMedia.SetresourceName(AIndex : Integer; const AValue : String);
- begin
- If (FresourceName=AValue) then exit;
- FresourceName:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TListReportTypesResponse
- --------------------------------------------------------------------}
- Procedure TListReportTypesResponse.SetreportTypes(AIndex : Integer; const AValue : TListReportTypesResponseTypereportTypesArray);
- begin
- If (FreportTypes=AValue) then exit;
- FreportTypes:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TListReportTypesResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
- begin
- If (FnextPageToken=AValue) then exit;
- FnextPageToken:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TListReportTypesResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'reporttypes' : SetLength(FreportTypes,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TReportType
- --------------------------------------------------------------------}
- Procedure TReportType.Setid(AIndex : Integer; const AValue : String);
- begin
- If (Fid=AValue) then exit;
- Fid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TReportType.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TReportType.SetdeprecateTime(AIndex : Integer; const AValue : String);
- begin
- If (FdeprecateTime=AValue) then exit;
- FdeprecateTime:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TReportType.SetsystemManaged(AIndex : Integer; const AValue : boolean);
- begin
- If (FsystemManaged=AValue) then exit;
- FsystemManaged:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TJob
- --------------------------------------------------------------------}
- Procedure TJob.Setid(AIndex : Integer; const AValue : String);
- begin
- If (Fid=AValue) then exit;
- Fid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TJob.SetreportTypeId(AIndex : Integer; const AValue : String);
- begin
- If (FreportTypeId=AValue) then exit;
- FreportTypeId:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TJob.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TJob.SetcreateTime(AIndex : Integer; const AValue : String);
- begin
- If (FcreateTime=AValue) then exit;
- FcreateTime:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TJob.SetexpireTime(AIndex : Integer; const AValue : String);
- begin
- If (FexpireTime=AValue) then exit;
- FexpireTime:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TJob.SetsystemManaged(AIndex : Integer; const AValue : boolean);
- begin
- If (FsystemManaged=AValue) then exit;
- FsystemManaged:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TListJobsResponse
- --------------------------------------------------------------------}
- Procedure TListJobsResponse.Setjobs(AIndex : Integer; const AValue : TListJobsResponseTypejobsArray);
- begin
- If (Fjobs=AValue) then exit;
- Fjobs:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TListJobsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
- begin
- If (FnextPageToken=AValue) then exit;
- FnextPageToken:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TListJobsResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'jobs' : SetLength(Fjobs,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TEmpty
- --------------------------------------------------------------------}
- { --------------------------------------------------------------------
- TListReportsResponse
- --------------------------------------------------------------------}
- Procedure TListReportsResponse.Setreports(AIndex : Integer; const AValue : TListReportsResponseTypereportsArray);
- begin
- If (Freports=AValue) then exit;
- Freports:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TListReportsResponse.SetnextPageToken(AIndex : Integer; const AValue : String);
- begin
- If (FnextPageToken=AValue) then exit;
- FnextPageToken:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- //2.6.4. bug workaround
- {$IFDEF VER2_6}
- Procedure TListReportsResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'reports' : SetLength(Freports,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TReport
- --------------------------------------------------------------------}
- Procedure TReport.Setid(AIndex : Integer; const AValue : String);
- begin
- If (Fid=AValue) then exit;
- Fid:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TReport.SetjobId(AIndex : Integer; const AValue : String);
- begin
- If (FjobId=AValue) then exit;
- FjobId:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TReport.SetjobExpireTime(AIndex : Integer; const AValue : String);
- begin
- If (FjobExpireTime=AValue) then exit;
- FjobExpireTime:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TReport.SetstartTime(AIndex : Integer; const AValue : String);
- begin
- If (FstartTime=AValue) then exit;
- FstartTime:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TReport.SetendTime(AIndex : Integer; const AValue : String);
- begin
- If (FendTime=AValue) then exit;
- FendTime:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TReport.SetcreateTime(AIndex : Integer; const AValue : String);
- begin
- If (FcreateTime=AValue) then exit;
- FcreateTime:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TReport.SetdownloadUrl(AIndex : Integer; const AValue : String);
- begin
- If (FdownloadUrl=AValue) then exit;
- FdownloadUrl:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TMediaResource
- --------------------------------------------------------------------}
- Class Function TMediaResource.ResourceName : String;
- begin
- Result:='media';
- end;
- Class Function TMediaResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TyoutubereportingAPI;
- end;
- Function TMediaResource.Download(_resourceName: string) : TMedia;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/media/{+resourceName}';
- _Methodid = 'youtubereporting.media.download';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['resourceName',_resourceName]);
- Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TMedia) as TMedia;
- end;
- { --------------------------------------------------------------------
- TReportTypesResource
- --------------------------------------------------------------------}
- Class Function TReportTypesResource.ResourceName : String;
- begin
- Result:='reportTypes';
- end;
- Class Function TReportTypesResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TyoutubereportingAPI;
- end;
- Function TReportTypesResource.List(AQuery : string = '') : TListReportTypesResponse;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/reportTypes';
- _Methodid = 'youtubereporting.reportTypes.list';
- begin
- Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TListReportTypesResponse) as TListReportTypesResponse;
- end;
- Function TReportTypesResource.List(AQuery : TReportTypeslistOptions) : TListReportTypesResponse;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'onBehalfOfContentOwner',AQuery.onBehalfOfContentOwner);
- AddToQuery(_Q,'pageSize',AQuery.pageSize);
- AddToQuery(_Q,'pageToken',AQuery.pageToken);
- AddToQuery(_Q,'includeSystemManaged',AQuery.includeSystemManaged);
- Result:=List(_Q);
- end;
- { --------------------------------------------------------------------
- TJobsReportsResource
- --------------------------------------------------------------------}
- Class Function TJobsReportsResource.ResourceName : String;
- begin
- Result:='reports';
- end;
- Class Function TJobsReportsResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TyoutubereportingAPI;
- end;
- Function TJobsReportsResource.List(jobId: string; AQuery : string = '') : TListReportsResponse;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/jobs/{jobId}/reports';
- _Methodid = 'youtubereporting.jobs.reports.list';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['jobId',jobId]);
- Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListReportsResponse) as TListReportsResponse;
- end;
- Function TJobsReportsResource.List(jobId: string; AQuery : TJobsReportslistOptions) : TListReportsResponse;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'onBehalfOfContentOwner',AQuery.onBehalfOfContentOwner);
- AddToQuery(_Q,'pageSize',AQuery.pageSize);
- AddToQuery(_Q,'pageToken',AQuery.pageToken);
- AddToQuery(_Q,'createdAfter',AQuery.createdAfter);
- AddToQuery(_Q,'startTimeAtOrAfter',AQuery.startTimeAtOrAfter);
- AddToQuery(_Q,'startTimeBefore',AQuery.startTimeBefore);
- Result:=List(jobId,_Q);
- end;
- Function TJobsReportsResource.Get(jobId: string; reportId: string; AQuery : string = '') : TReport;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/jobs/{jobId}/reports/{reportId}';
- _Methodid = 'youtubereporting.jobs.reports.get';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['jobId',jobId,'reportId',reportId]);
- Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TReport) as TReport;
- end;
- Function TJobsReportsResource.Get(jobId: string; reportId: string; AQuery : TJobsReportsgetOptions) : TReport;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'onBehalfOfContentOwner',AQuery.onBehalfOfContentOwner);
- Result:=Get(jobId,reportId,_Q);
- end;
- { --------------------------------------------------------------------
- TJobsResource
- --------------------------------------------------------------------}
- Class Function TJobsResource.ResourceName : String;
- begin
- Result:='jobs';
- end;
- Class Function TJobsResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TyoutubereportingAPI;
- end;
- Function TJobsResource.Create(aJob : TJob; AQuery : string = '') : TJob;
- Const
- _HTTPMethod = 'POST';
- _Path = 'v1/jobs';
- _Methodid = 'youtubereporting.jobs.create';
- begin
- Result:=ServiceCall(_HTTPMethod,_Path,AQuery,aJob,TJob) as TJob;
- end;
- Function TJobsResource.Create(aJob : TJob; AQuery : TJobscreateOptions) : TJob;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'onBehalfOfContentOwner',AQuery.onBehalfOfContentOwner);
- Result:=Create(aJob,_Q);
- end;
- Function TJobsResource.List(AQuery : string = '') : TListJobsResponse;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/jobs';
- _Methodid = 'youtubereporting.jobs.list';
- begin
- Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TListJobsResponse) as TListJobsResponse;
- end;
- Function TJobsResource.List(AQuery : TJobslistOptions) : TListJobsResponse;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'onBehalfOfContentOwner',AQuery.onBehalfOfContentOwner);
- AddToQuery(_Q,'pageSize',AQuery.pageSize);
- AddToQuery(_Q,'pageToken',AQuery.pageToken);
- AddToQuery(_Q,'includeSystemManaged',AQuery.includeSystemManaged);
- Result:=List(_Q);
- end;
- Function TJobsResource.Get(jobId: string; AQuery : string = '') : TJob;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/jobs/{jobId}';
- _Methodid = 'youtubereporting.jobs.get';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['jobId',jobId]);
- Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TJob) as TJob;
- end;
- Function TJobsResource.Get(jobId: string; AQuery : TJobsgetOptions) : TJob;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'onBehalfOfContentOwner',AQuery.onBehalfOfContentOwner);
- Result:=Get(jobId,_Q);
- end;
- Function TJobsResource.Delete(jobId: string; AQuery : string = '') : TEmpty;
- Const
- _HTTPMethod = 'DELETE';
- _Path = 'v1/jobs/{jobId}';
- _Methodid = 'youtubereporting.jobs.delete';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['jobId',jobId]);
- Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TEmpty) as TEmpty;
- end;
- Function TJobsResource.Delete(jobId: string; AQuery : TJobsdeleteOptions) : TEmpty;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'onBehalfOfContentOwner',AQuery.onBehalfOfContentOwner);
- Result:=Delete(jobId,_Q);
- end;
- Function TJobsResource.GetReportsInstance : TJobsReportsResource;
- begin
- if (FReportsInstance=Nil) then
- FReportsInstance:=CreateReportsResource;
- Result:=FReportsInstance;
- end;
- Function TJobsResource.CreateReportsResource : TJobsReportsResource;
- begin
- Result:=CreateReportsResource(Self);
- end;
- Function TJobsResource.CreateReportsResource(AOwner : TComponent) : TJobsReportsResource;
- begin
- Result:=TJobsReportsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- { --------------------------------------------------------------------
- TYoutubereportingAPI
- --------------------------------------------------------------------}
- Class Function TYoutubereportingAPI.APIName : String;
- begin
- Result:='youtubereporting';
- end;
- Class Function TYoutubereportingAPI.APIVersion : String;
- begin
- Result:='v1';
- end;
- Class Function TYoutubereportingAPI.APIRevision : String;
- begin
- Result:='20160517';
- end;
- Class Function TYoutubereportingAPI.APIID : String;
- begin
- Result:='youtubereporting:v1';
- end;
- Class Function TYoutubereportingAPI.APITitle : String;
- begin
- Result:='YouTube Reporting API';
- end;
- Class Function TYoutubereportingAPI.APIDescription : String;
- begin
- Result:='Schedules reporting jobs containing your YouTube Analytics data and downloads the resulting bulk data reports in the form of CSV files.';
- end;
- Class Function TYoutubereportingAPI.APIOwnerDomain : String;
- begin
- Result:='google.com';
- end;
- Class Function TYoutubereportingAPI.APIOwnerName : String;
- begin
- Result:='Google';
- end;
- Class Function TYoutubereportingAPI.APIIcon16 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-16.gif';
- end;
- Class Function TYoutubereportingAPI.APIIcon32 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-32.gif';
- end;
- Class Function TYoutubereportingAPI.APIdocumentationLink : String;
- begin
- Result:='https://developers.google.com/youtube/reporting/v1/reports/';
- end;
- Class Function TYoutubereportingAPI.APIrootUrl : string;
- begin
- Result:='https://youtubereporting.googleapis.com/';
- end;
- Class Function TYoutubereportingAPI.APIbasePath : string;
- begin
- Result:='';
- end;
- Class Function TYoutubereportingAPI.APIbaseURL : String;
- begin
- Result:='https://youtubereporting.googleapis.com/';
- end;
- Class Function TYoutubereportingAPI.APIProtocol : string;
- begin
- Result:='rest';
- end;
- Class Function TYoutubereportingAPI.APIservicePath : string;
- begin
- Result:='';
- end;
- Class Function TYoutubereportingAPI.APIbatchPath : String;
- begin
- Result:='batch';
- end;
- Class Function TYoutubereportingAPI.APIAuthScopes : TScopeInfoArray;
- begin
- SetLength(Result,2);
- Result[0].Name:='https://www.googleapis.com/auth/yt-analytics-monetary.readonly';
- Result[0].Description:='View monetary and non-monetary YouTube Analytics reports for your YouTube content';
- Result[1].Name:='https://www.googleapis.com/auth/yt-analytics.readonly';
- Result[1].Description:='View YouTube Analytics reports for your YouTube content';
-
- end;
- Class Function TYoutubereportingAPI.APINeedsAuth : Boolean;
- begin
- Result:=True;
- end;
- Class Procedure TYoutubereportingAPI.RegisterAPIResources;
- begin
- TMedia.RegisterObject;
- TListReportTypesResponse.RegisterObject;
- TReportType.RegisterObject;
- TJob.RegisterObject;
- TListJobsResponse.RegisterObject;
- TEmpty.RegisterObject;
- TListReportsResponse.RegisterObject;
- TReport.RegisterObject;
- end;
- Function TYoutubereportingAPI.GetMediaInstance : TMediaResource;
- begin
- if (FMediaInstance=Nil) then
- FMediaInstance:=CreateMediaResource;
- Result:=FMediaInstance;
- end;
- Function TYoutubereportingAPI.CreateMediaResource : TMediaResource;
- begin
- Result:=CreateMediaResource(Self);
- end;
- Function TYoutubereportingAPI.CreateMediaResource(AOwner : TComponent) : TMediaResource;
- begin
- Result:=TMediaResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- Function TYoutubereportingAPI.GetReportTypesInstance : TReportTypesResource;
- begin
- if (FReportTypesInstance=Nil) then
- FReportTypesInstance:=CreateReportTypesResource;
- Result:=FReportTypesInstance;
- end;
- Function TYoutubereportingAPI.CreateReportTypesResource : TReportTypesResource;
- begin
- Result:=CreateReportTypesResource(Self);
- end;
- Function TYoutubereportingAPI.CreateReportTypesResource(AOwner : TComponent) : TReportTypesResource;
- begin
- Result:=TReportTypesResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- Function TYoutubereportingAPI.GetJobsReportsInstance : TJobsReportsResource;
- begin
- if (FJobsReportsInstance=Nil) then
- FJobsReportsInstance:=CreateJobsReportsResource;
- Result:=FJobsReportsInstance;
- end;
- Function TYoutubereportingAPI.CreateJobsReportsResource : TJobsReportsResource;
- begin
- Result:=CreateJobsReportsResource(Self);
- end;
- Function TYoutubereportingAPI.CreateJobsReportsResource(AOwner : TComponent) : TJobsReportsResource;
- begin
- Result:=TJobsReportsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- Function TYoutubereportingAPI.GetJobsInstance : TJobsResource;
- begin
- if (FJobsInstance=Nil) then
- FJobsInstance:=CreateJobsResource;
- Result:=FJobsInstance;
- end;
- Function TYoutubereportingAPI.CreateJobsResource : TJobsResource;
- begin
- Result:=CreateJobsResource(Self);
- end;
- Function TYoutubereportingAPI.CreateJobsResource(AOwner : TComponent) : TJobsResource;
- begin
- Result:=TJobsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- initialization
- TYoutubereportingAPI.RegisterAPI;
- end.
|