123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691 |
- {$IFNDEF FPC_DOTTEDUNITS}
- unit googlegroupssettings;
- {$ENDIF FPC_DOTTEDUNITS}
- {$MODE objfpc}
- {$H+}
- interface
- {$IFDEF FPC_DOTTEDUNITS}
- uses System.SysUtils, System.Classes, GoogleApi.Service, FpWeb.Rest.Base, GoogleApi.Base;
- {$ELSE FPC_DOTTEDUNITS}
- uses sysutils, classes, googleservice, restbase, googlebase;
- {$ENDIF FPC_DOTTEDUNITS}
- type
-
- //Top-level schema types
- TGroups = Class;
- TGroupsArray = Array of TGroups;
- //Anonymous types, using auto-generated names
-
- { --------------------------------------------------------------------
- TGroups
- --------------------------------------------------------------------}
-
- TGroups = Class(TGoogleBaseObject)
- Private
- FallowExternalMembers : String;
- FallowGoogleCommunication : String;
- FallowWebPosting : String;
- FarchiveOnly : String;
- FcustomReplyTo : String;
- FdefaultMessageDenyNotificationText : String;
- Fdescription : String;
- Femail : String;
- FincludeInGlobalAddressList : String;
- FisArchived : String;
- Fkind : String;
- FmaxMessageBytes : integer;
- FmembersCanPostAsTheGroup : String;
- FmessageDisplayFont : String;
- FmessageModerationLevel : String;
- Fname : String;
- FprimaryLanguage : String;
- FreplyTo : String;
- FsendMessageDenyNotification : String;
- FshowInGroupDirectory : String;
- FspamModerationLevel : String;
- FwhoCanAdd : String;
- FwhoCanContactOwner : String;
- FwhoCanInvite : String;
- FwhoCanJoin : String;
- FwhoCanLeaveGroup : String;
- FwhoCanPostMessage : String;
- FwhoCanViewGroup : String;
- FwhoCanViewMembership : String;
- Protected
- //Property setters
- Procedure SetallowExternalMembers(AIndex : Integer; const AValue : String); virtual;
- Procedure SetallowGoogleCommunication(AIndex : Integer; const AValue : String); virtual;
- Procedure SetallowWebPosting(AIndex : Integer; const AValue : String); virtual;
- Procedure SetarchiveOnly(AIndex : Integer; const AValue : String); virtual;
- Procedure SetcustomReplyTo(AIndex : Integer; const AValue : String); virtual;
- Procedure SetdefaultMessageDenyNotificationText(AIndex : Integer; const AValue : String); virtual;
- Procedure Setdescription(AIndex : Integer; const AValue : String); virtual;
- Procedure Setemail(AIndex : Integer; const AValue : String); virtual;
- Procedure SetincludeInGlobalAddressList(AIndex : Integer; const AValue : String); virtual;
- Procedure SetisArchived(AIndex : Integer; const AValue : String); virtual;
- Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
- Procedure SetmaxMessageBytes(AIndex : Integer; const AValue : integer); virtual;
- Procedure SetmembersCanPostAsTheGroup(AIndex : Integer; const AValue : String); virtual;
- Procedure SetmessageDisplayFont(AIndex : Integer; const AValue : String); virtual;
- Procedure SetmessageModerationLevel(AIndex : Integer; const AValue : String); virtual;
- Procedure Setname(AIndex : Integer; const AValue : String); virtual;
- Procedure SetprimaryLanguage(AIndex : Integer; const AValue : String); virtual;
- Procedure SetreplyTo(AIndex : Integer; const AValue : String); virtual;
- Procedure SetsendMessageDenyNotification(AIndex : Integer; const AValue : String); virtual;
- Procedure SetshowInGroupDirectory(AIndex : Integer; const AValue : String); virtual;
- Procedure SetspamModerationLevel(AIndex : Integer; const AValue : String); virtual;
- Procedure SetwhoCanAdd(AIndex : Integer; const AValue : String); virtual;
- Procedure SetwhoCanContactOwner(AIndex : Integer; const AValue : String); virtual;
- Procedure SetwhoCanInvite(AIndex : Integer; const AValue : String); virtual;
- Procedure SetwhoCanJoin(AIndex : Integer; const AValue : String); virtual;
- Procedure SetwhoCanLeaveGroup(AIndex : Integer; const AValue : String); virtual;
- Procedure SetwhoCanPostMessage(AIndex : Integer; const AValue : String); virtual;
- Procedure SetwhoCanViewGroup(AIndex : Integer; const AValue : String); virtual;
- Procedure SetwhoCanViewMembership(AIndex : Integer; const AValue : String); virtual;
- Public
- Published
- Property allowExternalMembers : String Index 0 Read FallowExternalMembers Write SetallowExternalMembers;
- Property allowGoogleCommunication : String Index 8 Read FallowGoogleCommunication Write SetallowGoogleCommunication;
- Property allowWebPosting : String Index 16 Read FallowWebPosting Write SetallowWebPosting;
- Property archiveOnly : String Index 24 Read FarchiveOnly Write SetarchiveOnly;
- Property customReplyTo : String Index 32 Read FcustomReplyTo Write SetcustomReplyTo;
- Property defaultMessageDenyNotificationText : String Index 40 Read FdefaultMessageDenyNotificationText Write SetdefaultMessageDenyNotificationText;
- Property description : String Index 48 Read Fdescription Write Setdescription;
- Property email : String Index 56 Read Femail Write Setemail;
- Property includeInGlobalAddressList : String Index 64 Read FincludeInGlobalAddressList Write SetincludeInGlobalAddressList;
- Property isArchived : String Index 72 Read FisArchived Write SetisArchived;
- Property kind : String Index 80 Read Fkind Write Setkind;
- Property maxMessageBytes : integer Index 88 Read FmaxMessageBytes Write SetmaxMessageBytes;
- Property membersCanPostAsTheGroup : String Index 96 Read FmembersCanPostAsTheGroup Write SetmembersCanPostAsTheGroup;
- Property messageDisplayFont : String Index 104 Read FmessageDisplayFont Write SetmessageDisplayFont;
- Property messageModerationLevel : String Index 112 Read FmessageModerationLevel Write SetmessageModerationLevel;
- Property name : String Index 120 Read Fname Write Setname;
- Property primaryLanguage : String Index 128 Read FprimaryLanguage Write SetprimaryLanguage;
- Property replyTo : String Index 136 Read FreplyTo Write SetreplyTo;
- Property sendMessageDenyNotification : String Index 144 Read FsendMessageDenyNotification Write SetsendMessageDenyNotification;
- Property showInGroupDirectory : String Index 152 Read FshowInGroupDirectory Write SetshowInGroupDirectory;
- Property spamModerationLevel : String Index 160 Read FspamModerationLevel Write SetspamModerationLevel;
- Property whoCanAdd : String Index 168 Read FwhoCanAdd Write SetwhoCanAdd;
- Property whoCanContactOwner : String Index 176 Read FwhoCanContactOwner Write SetwhoCanContactOwner;
- Property whoCanInvite : String Index 184 Read FwhoCanInvite Write SetwhoCanInvite;
- Property whoCanJoin : String Index 192 Read FwhoCanJoin Write SetwhoCanJoin;
- Property whoCanLeaveGroup : String Index 200 Read FwhoCanLeaveGroup Write SetwhoCanLeaveGroup;
- Property whoCanPostMessage : String Index 208 Read FwhoCanPostMessage Write SetwhoCanPostMessage;
- Property whoCanViewGroup : String Index 216 Read FwhoCanViewGroup Write SetwhoCanViewGroup;
- Property whoCanViewMembership : String Index 224 Read FwhoCanViewMembership Write SetwhoCanViewMembership;
- end;
- TGroupsClass = Class of TGroups;
-
- { --------------------------------------------------------------------
- TGroupsResource
- --------------------------------------------------------------------}
-
- TGroupsResource = Class(TGoogleResource)
- Public
- Class Function ResourceName : String; override;
- Class Function DefaultAPI : TGoogleAPIClass; override;
- Function Get(groupUniqueId: string) : TGroups;
- Function Patch(groupUniqueId: string; aGroups : TGroups) : TGroups;
- Function Update(groupUniqueId: string; aGroups : TGroups) : TGroups;
- end;
-
-
- { --------------------------------------------------------------------
- TGroupssettingsAPI
- --------------------------------------------------------------------}
-
- TGroupssettingsAPI = Class(TGoogleAPI)
- Private
- FGroupsInstance : TGroupsResource;
- Function GetGroupsInstance : TGroupsResource;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 CreateGroupsResource(AOwner : TComponent) : TGroupsResource;virtual;overload;
- Function CreateGroupsResource : TGroupsResource;virtual;overload;
- //Add default on-demand instances for resources
- Property GroupsResource : TGroupsResource Read GetGroupsInstance;
- end;
- implementation
- { --------------------------------------------------------------------
- TGroups
- --------------------------------------------------------------------}
- Procedure TGroups.SetallowExternalMembers(AIndex : Integer; const AValue : String);
- begin
- If (FallowExternalMembers=AValue) then exit;
- FallowExternalMembers:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetallowGoogleCommunication(AIndex : Integer; const AValue : String);
- begin
- If (FallowGoogleCommunication=AValue) then exit;
- FallowGoogleCommunication:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetallowWebPosting(AIndex : Integer; const AValue : String);
- begin
- If (FallowWebPosting=AValue) then exit;
- FallowWebPosting:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetarchiveOnly(AIndex : Integer; const AValue : String);
- begin
- If (FarchiveOnly=AValue) then exit;
- FarchiveOnly:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetcustomReplyTo(AIndex : Integer; const AValue : String);
- begin
- If (FcustomReplyTo=AValue) then exit;
- FcustomReplyTo:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetdefaultMessageDenyNotificationText(AIndex : Integer; const AValue : String);
- begin
- If (FdefaultMessageDenyNotificationText=AValue) then exit;
- FdefaultMessageDenyNotificationText:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.Setdescription(AIndex : Integer; const AValue : String);
- begin
- If (Fdescription=AValue) then exit;
- Fdescription:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.Setemail(AIndex : Integer; const AValue : String);
- begin
- If (Femail=AValue) then exit;
- Femail:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetincludeInGlobalAddressList(AIndex : Integer; const AValue : String);
- begin
- If (FincludeInGlobalAddressList=AValue) then exit;
- FincludeInGlobalAddressList:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetisArchived(AIndex : Integer; const AValue : String);
- begin
- If (FisArchived=AValue) then exit;
- FisArchived:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.Setkind(AIndex : Integer; const AValue : String);
- begin
- If (Fkind=AValue) then exit;
- Fkind:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetmaxMessageBytes(AIndex : Integer; const AValue : integer);
- begin
- If (FmaxMessageBytes=AValue) then exit;
- FmaxMessageBytes:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetmembersCanPostAsTheGroup(AIndex : Integer; const AValue : String);
- begin
- If (FmembersCanPostAsTheGroup=AValue) then exit;
- FmembersCanPostAsTheGroup:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetmessageDisplayFont(AIndex : Integer; const AValue : String);
- begin
- If (FmessageDisplayFont=AValue) then exit;
- FmessageDisplayFont:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetmessageModerationLevel(AIndex : Integer; const AValue : String);
- begin
- If (FmessageModerationLevel=AValue) then exit;
- FmessageModerationLevel:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.Setname(AIndex : Integer; const AValue : String);
- begin
- If (Fname=AValue) then exit;
- Fname:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetprimaryLanguage(AIndex : Integer; const AValue : String);
- begin
- If (FprimaryLanguage=AValue) then exit;
- FprimaryLanguage:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetreplyTo(AIndex : Integer; const AValue : String);
- begin
- If (FreplyTo=AValue) then exit;
- FreplyTo:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetsendMessageDenyNotification(AIndex : Integer; const AValue : String);
- begin
- If (FsendMessageDenyNotification=AValue) then exit;
- FsendMessageDenyNotification:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetshowInGroupDirectory(AIndex : Integer; const AValue : String);
- begin
- If (FshowInGroupDirectory=AValue) then exit;
- FshowInGroupDirectory:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetspamModerationLevel(AIndex : Integer; const AValue : String);
- begin
- If (FspamModerationLevel=AValue) then exit;
- FspamModerationLevel:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetwhoCanAdd(AIndex : Integer; const AValue : String);
- begin
- If (FwhoCanAdd=AValue) then exit;
- FwhoCanAdd:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetwhoCanContactOwner(AIndex : Integer; const AValue : String);
- begin
- If (FwhoCanContactOwner=AValue) then exit;
- FwhoCanContactOwner:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetwhoCanInvite(AIndex : Integer; const AValue : String);
- begin
- If (FwhoCanInvite=AValue) then exit;
- FwhoCanInvite:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetwhoCanJoin(AIndex : Integer; const AValue : String);
- begin
- If (FwhoCanJoin=AValue) then exit;
- FwhoCanJoin:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetwhoCanLeaveGroup(AIndex : Integer; const AValue : String);
- begin
- If (FwhoCanLeaveGroup=AValue) then exit;
- FwhoCanLeaveGroup:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetwhoCanPostMessage(AIndex : Integer; const AValue : String);
- begin
- If (FwhoCanPostMessage=AValue) then exit;
- FwhoCanPostMessage:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetwhoCanViewGroup(AIndex : Integer; const AValue : String);
- begin
- If (FwhoCanViewGroup=AValue) then exit;
- FwhoCanViewGroup:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- Procedure TGroups.SetwhoCanViewMembership(AIndex : Integer; const AValue : String);
- begin
- If (FwhoCanViewMembership=AValue) then exit;
- FwhoCanViewMembership:=AValue;
- MarkPropertyChanged(AIndex);
- end;
- { --------------------------------------------------------------------
- TGroupsResource
- --------------------------------------------------------------------}
- Class Function TGroupsResource.ResourceName : String;
- begin
- Result:='groups';
- end;
- Class Function TGroupsResource.DefaultAPI : TGoogleAPIClass;
- begin
- Result:=TgroupssettingsAPI;
- end;
- Function TGroupsResource.Get(groupUniqueId: string) : TGroups;
- Const
- _HTTPMethod = 'GET';
- _Path = '{groupUniqueId}';
- _Methodid = 'groupsSettings.groups.get';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['groupUniqueId',groupUniqueId]);
- Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TGroups) as TGroups;
- end;
- Function TGroupsResource.Patch(groupUniqueId: string; aGroups : TGroups) : TGroups;
- Const
- _HTTPMethod = 'PATCH';
- _Path = '{groupUniqueId}';
- _Methodid = 'groupsSettings.groups.patch';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['groupUniqueId',groupUniqueId]);
- Result:=ServiceCall(_HTTPMethod,_P,'',aGroups,TGroups) as TGroups;
- end;
- Function TGroupsResource.Update(groupUniqueId: string; aGroups : TGroups) : TGroups;
- Const
- _HTTPMethod = 'PUT';
- _Path = '{groupUniqueId}';
- _Methodid = 'groupsSettings.groups.update';
- Var
- _P : String;
- begin
- _P:=SubstitutePath(_Path,['groupUniqueId',groupUniqueId]);
- Result:=ServiceCall(_HTTPMethod,_P,'',aGroups,TGroups) as TGroups;
- end;
- { --------------------------------------------------------------------
- TGroupssettingsAPI
- --------------------------------------------------------------------}
- Class Function TGroupssettingsAPI.APIName : String;
- begin
- Result:='groupssettings';
- end;
- Class Function TGroupssettingsAPI.APIVersion : String;
- begin
- Result:='v1';
- end;
- Class Function TGroupssettingsAPI.APIRevision : String;
- begin
- Result:='20160323';
- end;
- Class Function TGroupssettingsAPI.APIID : String;
- begin
- Result:='groupssettings:v1';
- end;
- Class Function TGroupssettingsAPI.APITitle : String;
- begin
- Result:='Groups Settings API';
- end;
- Class Function TGroupssettingsAPI.APIDescription : String;
- begin
- Result:='Lets you manage permission levels and related settings of a group.';
- end;
- Class Function TGroupssettingsAPI.APIOwnerDomain : String;
- begin
- Result:='google.com';
- end;
- Class Function TGroupssettingsAPI.APIOwnerName : String;
- begin
- Result:='Google';
- end;
- Class Function TGroupssettingsAPI.APIIcon16 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-16.gif';
- end;
- Class Function TGroupssettingsAPI.APIIcon32 : String;
- begin
- Result:='http://www.google.com/images/icons/product/search-32.gif';
- end;
- Class Function TGroupssettingsAPI.APIdocumentationLink : String;
- begin
- Result:='https://developers.google.com/google-apps/groups-settings/get_started';
- end;
- Class Function TGroupssettingsAPI.APIrootUrl : string;
- begin
- Result:='https://www.googleapis.com/';
- end;
- Class Function TGroupssettingsAPI.APIbasePath : string;
- begin
- Result:='/groups/v1/groups/';
- end;
- Class Function TGroupssettingsAPI.APIbaseURL : String;
- begin
- Result:='https://www.googleapis.com/groups/v1/groups/';
- end;
- Class Function TGroupssettingsAPI.APIProtocol : string;
- begin
- Result:='rest';
- end;
- Class Function TGroupssettingsAPI.APIservicePath : string;
- begin
- Result:='groups/v1/groups/';
- end;
- Class Function TGroupssettingsAPI.APIbatchPath : String;
- begin
- Result:='batch';
- end;
- Class Function TGroupssettingsAPI.APIAuthScopes : TScopeInfoArray;
- begin
- SetLength(Result,1);
- Result[0].Name:='https://www.googleapis.com/auth/apps.groups.settings';
- Result[0].Description:='View and manage the settings of a Google Apps Group';
-
- end;
- Class Function TGroupssettingsAPI.APINeedsAuth : Boolean;
- begin
- Result:=True;
- end;
- Class Procedure TGroupssettingsAPI.RegisterAPIResources;
- begin
- TGroups.RegisterObject;
- end;
- Function TGroupssettingsAPI.GetGroupsInstance : TGroupsResource;
- begin
- if (FGroupsInstance=Nil) then
- FGroupsInstance:=CreateGroupsResource;
- Result:=FGroupsInstance;
- end;
- Function TGroupssettingsAPI.CreateGroupsResource : TGroupsResource;
- begin
- Result:=CreateGroupsResource(Self);
- end;
- Function TGroupssettingsAPI.CreateGroupsResource(AOwner : TComponent) : TGroupsResource;
- begin
- Result:=TGroupsResource.Create(AOwner);
- Result.API:=Self.API;
- end;
- initialization
- TGroupssettingsAPI.RegisterAPI;
- end.
|