123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776 |
- unit googlecloudbilling;
- {$MODE objfpc}
- {$H+}
- interface
- uses sysutils, classes, googleservice, restbase, googlebase;
- type
-
- //Top-level schema types
- TBillingAccount = Class;
- TListBillingAccountsResponse = Class;
- TListProjectBillingInfoResponse = Class;
- TProjectBillingInfo = Class;
- TBillingAccountArray = Array of TBillingAccount;
- TListBillingAccountsResponseArray = Array of TListBillingAccountsResponse;
- TListProjectBillingInfoResponseArray = Array of TListProjectBillingInfoResponse;
- TProjectBillingInfoArray = Array of TProjectBillingInfo;
- //Anonymous types, using auto-generated names
- TListBillingAccountsResponseTypebillingAccountsArray = Array of TBillingAccount;
- TListProjectBillingInfoResponseTypeprojectBillingInfoArray = Array of TProjectBillingInfo;
-
- { --------------------------------------------------------------------
- TBillingAccount
- --------------------------------------------------------------------}
-
- TBillingAccount = Class(TGoogleBaseObject)
- Private
- Fname : String;
- Fopen : boolean;
- FdisplayName : String;
- Protected
- //Property setters
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure Setopen(AIndex : Integer; const AValue : boolean); virtual;
- Procedure SetdisplayName(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property name : String Index 0 Read Fname Write Setname;
- Property open : boolean Index 8 Read Fopen Write Setopen;
- Property displayName : String Index 16 Read FdisplayName Write SetdisplayName;
- end;
- TBillingAccountClass = Class of TBillingAccount;
-
- { --------------------------------------------------------------------
- TListBillingAccountsResponse
- --------------------------------------------------------------------}
-
- TListBillingAccountsResponse = Class(TGoogleBaseObject)
- Private
- FbillingAccounts : TListBillingAccountsResponseTypebillingAccountsArray;
- FnextPageToken : String;
- Protected
- //Property setters
- Procedure SetbillingAccounts(AIndex : Integer; const AValue : TListBillingAccountsResponseTypebillingAccountsArray); 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 billingAccounts : TListBillingAccountsResponseTypebillingAccountsArray Index 0 Read FbillingAccounts Write SetbillingAccounts;
- Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
- end;
- TListBillingAccountsResponseClass = Class of TListBillingAccountsResponse;
-
- { --------------------------------------------------------------------
- TListProjectBillingInfoResponse
- --------------------------------------------------------------------}
-
- TListProjectBillingInfoResponse = Class(TGoogleBaseObject)
- Private
- FprojectBillingInfo : TListProjectBillingInfoResponseTypeprojectBillingInfoArray;
- FnextPageToken : String;
- Protected
- //Property setters
- Procedure SetprojectBillingInfo(AIndex : Integer; const AValue : TListProjectBillingInfoResponseTypeprojectBillingInfoArray); 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 projectBillingInfo : TListProjectBillingInfoResponseTypeprojectBillingInfoArray Index 0 Read FprojectBillingInfo Write SetprojectBillingInfo;
- Property nextPageToken : String Index 8 Read FnextPageToken Write SetnextPageToken;
- end;
- TListProjectBillingInfoResponseClass = Class of TListProjectBillingInfoResponse;
-
- { --------------------------------------------------------------------
- TProjectBillingInfo
- --------------------------------------------------------------------}
-
- TProjectBillingInfo = Class(TGoogleBaseObject)
- Private
- Fname : String;
- FprojectId : String;
- FbillingAccountName : String;
- FbillingEnabled : boolean;
- Protected
- //Property setters
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetprojectId(AIndex : Integer; const AValue : String); virtual;
- Procedure SetbillingAccountName(AIndex : Integer; const AValue : String); virtual;
- Procedure SetbillingEnabled(AIndex : Integer; const AValue : boolean); virtual;
- Public
- Published
- Property name : String Index 0 Read Fname Write Setname;
- Property projectId : String Index 8 Read FprojectId Write SetprojectId;
- Property billingAccountName : String Index 16 Read FbillingAccountName Write SetbillingAccountName;
- Property billingEnabled : boolean Index 24 Read FbillingEnabled Write SetbillingEnabled;
- end;
- TProjectBillingInfoClass = Class of TProjectBillingInfo;
-
- { --------------------------------------------------------------------
- TBillingAccountsProjectsResource
- --------------------------------------------------------------------}
-
-
- //Optional query Options for TBillingAccountsProjectsResource, method List
-
- TBillingAccountsProjectsListOptions = Record
- pageSize : integer;
- pageToken : String;
- end;
-
- TBillingAccountsProjectsResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function List(_name: string; AQuery : string = '') : TListProjectBillingInfoResponse;
- Function List(_name: string; AQuery : TBillingAccountsProjectslistOptions) : TListProjectBillingInfoResponse;
- end;
-
-
- { --------------------------------------------------------------------
- TBillingAccountsResource
- --------------------------------------------------------------------}
-
-
- //Optional query Options for TBillingAccountsResource, method List
-
- TBillingAccountsListOptions = Record
- pageSize : integer;
- pageToken : String;
- end;
-
- TBillingAccountsResource = Class(TGoogleResource)
- Private
- FProjectsInstance : TBillingAccountsProjectsResource;
- Function GetProjectsInstance : TBillingAccountsProjectsResource;virtual;
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function Get(_name: string) : TBillingAccount;
- Function List(AQuery : string = '') : TListBillingAccountsResponse;
- Function List(AQuery : TBillingAccountslistOptions) : TListBillingAccountsResponse;
- Function CreateProjectsResource(AOwner : TComponent) : TBillingAccountsProjectsResource;virtual;overload;
- Function CreateProjectsResource : TBillingAccountsProjectsResource;virtual;overload;
- Property ProjectsResource : TBillingAccountsProjectsResource Read GetProjectsInstance;
- end;
-
-
- { --------------------------------------------------------------------
- TProjectsResource
- --------------------------------------------------------------------}
-
- TProjectsResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function GetBillingInfo(_name: string) : TProjectBillingInfo;
- Function UpdateBillingInfo(_name: string; aProjectBillingInfo : TProjectBillingInfo) : TProjectBillingInfo;
- end;
-
-
- { --------------------------------------------------------------------
- TCloudbillingAPI
- --------------------------------------------------------------------}
-
- TCloudbillingAPI = Class(TGoogleAPI)
- Private
- FBillingAccountsProjectsInstance : TBillingAccountsProjectsResource;
- FBillingAccountsInstance : TBillingAccountsResource;
- FProjectsInstance : TProjectsResource;
- Function GetBillingAccountsProjectsInstance : TBillingAccountsProjectsResource;virtual;
- Function GetBillingAccountsInstance : TBillingAccountsResource;virtual;
- Function GetProjectsInstance : TProjectsResource;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 CreateBillingAccountsProjectsResource(AOwner : TComponent) : TBillingAccountsProjectsResource;virtual;overload;
- Function CreateBillingAccountsProjectsResource : TBillingAccountsProjectsResource;virtual;overload;
- Function CreateBillingAccountsResource(AOwner : TComponent) : TBillingAccountsResource;virtual;overload;
- Function CreateBillingAccountsResource : TBillingAccountsResource;virtual;overload;
- Function CreateProjectsResource(AOwner : TComponent) : TProjectsResource;virtual;overload;
- Function CreateProjectsResource : TProjectsResource;virtual;overload;
- //Add default on-demand instances for resources
- Property BillingAccountsProjectsResource : TBillingAccountsProjectsResource Read GetBillingAccountsProjectsInstance;
- Property BillingAccountsResource : TBillingAccountsResource Read GetBillingAccountsInstance;
- Property ProjectsResource : TProjectsResource Read GetProjectsInstance;
- end;
- implementation
- { --------------------------------------------------------------------
- TBillingAccount
- --------------------------------------------------------------------}
- Procedure TBillingAccount.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TBillingAccount.Setopen(AIndex : Integer; const AValue : boolean);
- begin
- If (Fopen=AValue) then exit;
- Fopen:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TBillingAccount.SetdisplayName(AIndex : Integer; const AValue : String);
- begin
- If (FdisplayName=AValue) then exit;
- FdisplayName:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TListBillingAccountsResponse
- --------------------------------------------------------------------}
- Procedure TListBillingAccountsResponse.SetbillingAccounts(AIndex : Integer; const AValue : TListBillingAccountsResponseTypebillingAccountsArray);
- begin
- If (FbillingAccounts=AValue) then exit;
- FbillingAccounts:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TListBillingAccountsResponse.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 TListBillingAccountsResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'billingaccounts' : SetLength(FbillingAccounts,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TListProjectBillingInfoResponse
- --------------------------------------------------------------------}
- Procedure TListProjectBillingInfoResponse.SetprojectBillingInfo(AIndex : Integer; const AValue : TListProjectBillingInfoResponseTypeprojectBillingInfoArray);
- begin
- If (FprojectBillingInfo=AValue) then exit;
- FprojectBillingInfo:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TListProjectBillingInfoResponse.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 TListProjectBillingInfoResponse.SetArrayLength(Const AName : String; ALength : Longint);
- begin
- Case AName of
- 'projectbillinginfo' : SetLength(FprojectBillingInfo,ALength);
- else
- Inherited SetArrayLength(AName,ALength);
- end;
- end;
- {$ENDIF VER2_6}
- { --------------------------------------------------------------------
- TProjectBillingInfo
- --------------------------------------------------------------------}
- Procedure TProjectBillingInfo.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TProjectBillingInfo.SetprojectId(AIndex : Integer; const AValue : String);
- begin
- If (FprojectId=AValue) then exit;
- FprojectId:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TProjectBillingInfo.SetbillingAccountName(AIndex : Integer; const AValue : String);
- begin
- If (FbillingAccountName=AValue) then exit;
- FbillingAccountName:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TProjectBillingInfo.SetbillingEnabled(AIndex : Integer; const AValue : boolean);
- begin
- If (FbillingEnabled=AValue) then exit;
- FbillingEnabled:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TBillingAccountsProjectsResource
- --------------------------------------------------------------------}
- Class Function TBillingAccountsProjectsResource.ResourceName : String;
- begin
- Result:='projects';
- end;
- Class Function TBillingAccountsProjectsResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TcloudbillingAPI;
- end;
- Function TBillingAccountsProjectsResource.List(_name: string; AQuery : string = '') : TListProjectBillingInfoResponse;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/{+name}/projects';
- _Methodid = 'cloudbilling.billingAccounts.projects.list';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['name',_name]);
- Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TListProjectBillingInfoResponse) as TListProjectBillingInfoResponse;
- end;
- Function TBillingAccountsProjectsResource.List(_name: string; AQuery : TBillingAccountsProjectslistOptions) : TListProjectBillingInfoResponse;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'pageSize',AQuery.pageSize);
- AddToQuery(_Q,'pageToken',AQuery.pageToken);
- Result:=List(_name,_Q);
- end;
- { --------------------------------------------------------------------
- TBillingAccountsResource
- --------------------------------------------------------------------}
- Class Function TBillingAccountsResource.ResourceName : String;
- begin
- Result:='billingAccounts';
- end;
- Class Function TBillingAccountsResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TcloudbillingAPI;
- end;
- Function TBillingAccountsResource.Get(_name: string) : TBillingAccount;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/{+name}';
- _Methodid = 'cloudbilling.billingAccounts.get';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['name',_name]);
- Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TBillingAccount) as TBillingAccount;
- end;
- Function TBillingAccountsResource.List(AQuery : string = '') : TListBillingAccountsResponse;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/billingAccounts';
- _Methodid = 'cloudbilling.billingAccounts.list';
- begin
- Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TListBillingAccountsResponse) as TListBillingAccountsResponse;
- end;
- Function TBillingAccountsResource.List(AQuery : TBillingAccountslistOptions) : TListBillingAccountsResponse;
- Var
- _Q : String;
- begin
- _Q:='';
- AddToQuery(_Q,'pageSize',AQuery.pageSize);
- AddToQuery(_Q,'pageToken',AQuery.pageToken);
- Result:=List(_Q);
- end;
- Function TBillingAccountsResource.GetProjectsInstance : TBillingAccountsProjectsResource;
- begin
- if (FProjectsInstance=Nil) then
- FProjectsInstance:=CreateProjectsResource;
- Result:=FProjectsInstance;
- end;
- Function TBillingAccountsResource.CreateProjectsResource : TBillingAccountsProjectsResource;
- begin
- Result:=CreateProjectsResource(Self);
- end;
- Function TBillingAccountsResource.CreateProjectsResource(AOwner : TComponent) : TBillingAccountsProjectsResource;
- begin
- Result:=TBillingAccountsProjectsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- { --------------------------------------------------------------------
- TProjectsResource
- --------------------------------------------------------------------}
- Class Function TProjectsResource.ResourceName : String;
- begin
- Result:='projects';
- end;
- Class Function TProjectsResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TcloudbillingAPI;
- end;
- Function TProjectsResource.GetBillingInfo(_name: string) : TProjectBillingInfo;
- Const
- _HTTPMethod = 'GET';
- _Path = 'v1/{+name}/billingInfo';
- _Methodid = 'cloudbilling.projects.getBillingInfo';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['name',_name]);
- Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TProjectBillingInfo) as TProjectBillingInfo;
- end;
- Function TProjectsResource.UpdateBillingInfo(_name: string; aProjectBillingInfo : TProjectBillingInfo) : TProjectBillingInfo;
- Const
- _HTTPMethod = 'PUT';
- _Path = 'v1/{+name}/billingInfo';
- _Methodid = 'cloudbilling.projects.updateBillingInfo';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['name',_name]);
- Result:=ServiceCall(_HTTPMethod,_P,'',aProjectBillingInfo,TProjectBillingInfo) as TProjectBillingInfo;
- end;
- { --------------------------------------------------------------------
- TCloudbillingAPI
- --------------------------------------------------------------------}
- Class Function TCloudbillingAPI.APIName : String;
- begin
- Result:='cloudbilling';
- end;
- Class Function TCloudbillingAPI.APIVersion : String;
- begin
- Result:='v1';
- end;
- Class Function TCloudbillingAPI.APIRevision : String;
- begin
- Result:='20151222';
- end;
- Class Function TCloudbillingAPI.APIID : String;
- begin
- Result:='cloudbilling:v1';
- end;
- Class Function TCloudbillingAPI.APITitle : String;
- begin
- Result:='Google Cloud Billing API';
- end;
- Class Function TCloudbillingAPI.APIDescription : String;
- begin
- Result:='Retrieves Google Developers Console billing accounts and associates them with projects.';
- end;
- Class Function TCloudbillingAPI.APIOwnerDomain : String;
- begin
- Result:='google.com';
- end;
- Class Function TCloudbillingAPI.APIOwnerName : String;
- begin
- Result:='Google';
- end;
- Class Function TCloudbillingAPI.APIIcon16 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-16.gif';
- end;
- Class Function TCloudbillingAPI.APIIcon32 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-32.gif';
- end;
- Class Function TCloudbillingAPI.APIdocumentationLink : String;
- begin
- Result:='https://cloud.google.com/billing/';
- end;
- Class Function TCloudbillingAPI.APIrootUrl : string;
- begin
- Result:='https://cloudbilling.googleapis.com/';
- end;
- Class Function TCloudbillingAPI.APIbasePath : string;
- begin
- Result:='';
- end;
- Class Function TCloudbillingAPI.APIbaseURL : String;
- begin
- Result:='https://cloudbilling.googleapis.com/';
- end;
- Class Function TCloudbillingAPI.APIProtocol : string;
- begin
- Result:='rest';
- end;
- Class Function TCloudbillingAPI.APIservicePath : string;
- begin
- Result:='';
- end;
- Class Function TCloudbillingAPI.APIbatchPath : String;
- begin
- Result:='batch';
- end;
- Class Function TCloudbillingAPI.APIAuthScopes : TScopeInfoArray;
- begin
- SetLength(Result,1);
- Result[0].Name:='https://www.googleapis.com/auth/cloud-platform';
- Result[0].Description:='View and manage your data across Google Cloud Platform services';
-
- end;
- Class Function TCloudbillingAPI.APINeedsAuth : Boolean;
- begin
- Result:=True;
- end;
- Class Procedure TCloudbillingAPI.RegisterAPIResources;
- begin
- TBillingAccount.RegisterObject;
- TListBillingAccountsResponse.RegisterObject;
- TListProjectBillingInfoResponse.RegisterObject;
- TProjectBillingInfo.RegisterObject;
- end;
- Function TCloudbillingAPI.GetBillingAccountsProjectsInstance : TBillingAccountsProjectsResource;
- begin
- if (FBillingAccountsProjectsInstance=Nil) then
- FBillingAccountsProjectsInstance:=CreateBillingAccountsProjectsResource;
- Result:=FBillingAccountsProjectsInstance;
- end;
- Function TCloudbillingAPI.CreateBillingAccountsProjectsResource : TBillingAccountsProjectsResource;
- begin
- Result:=CreateBillingAccountsProjectsResource(Self);
- end;
- Function TCloudbillingAPI.CreateBillingAccountsProjectsResource(AOwner : TComponent) : TBillingAccountsProjectsResource;
- begin
- Result:=TBillingAccountsProjectsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- Function TCloudbillingAPI.GetBillingAccountsInstance : TBillingAccountsResource;
- begin
- if (FBillingAccountsInstance=Nil) then
- FBillingAccountsInstance:=CreateBillingAccountsResource;
- Result:=FBillingAccountsInstance;
- end;
- Function TCloudbillingAPI.CreateBillingAccountsResource : TBillingAccountsResource;
- begin
- Result:=CreateBillingAccountsResource(Self);
- end;
- Function TCloudbillingAPI.CreateBillingAccountsResource(AOwner : TComponent) : TBillingAccountsResource;
- begin
- Result:=TBillingAccountsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- Function TCloudbillingAPI.GetProjectsInstance : TProjectsResource;
- begin
- if (FProjectsInstance=Nil) then
- FProjectsInstance:=CreateProjectsResource;
- Result:=FProjectsInstance;
- end;
- Function TCloudbillingAPI.CreateProjectsResource : TProjectsResource;
- begin
- Result:=CreateProjectsResource(Self);
- end;
- Function TCloudbillingAPI.CreateProjectsResource(AOwner : TComponent) : TProjectsResource;
- begin
- Result:=TProjectsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- initialization
- TCloudbillingAPI.RegisterAPI;
- end.
|