@@ -1275,6 +1275,22 @@ class SchemeTemplate extends BaseModel {
12751275 }
12761276}
12771277
1278+ // src/models/OrganisationMemberStats.ts
1279+ class OrganisationMemberStats extends BaseModel {
1280+ type = "members-stats" ;
1281+ members = {
1282+ users : 0 ,
1283+ service_accounts : 0
1284+ } ;
1285+ constructor ( data ) {
1286+ super ( data ) ;
1287+ this . members = data ?. attributes ?. members || {
1288+ users : 0 ,
1289+ members : 0
1290+ } ;
1291+ }
1292+ }
1293+
12781294// src/utils/Hydrator.ts
12791295class Hydrator {
12801296 modelMap = {
@@ -1293,6 +1309,7 @@ class Hydrator {
12931309 groups : Group ,
12941310 "operation-templates" : OperationTemplate ,
12951311 operations : Operation ,
1312+ "members-stats" : OrganisationMemberStats ,
12961313 permissions : Permission ,
12971314 properties : Property ,
12981315 roles : Role ,
@@ -1562,19 +1579,26 @@ class BaseService extends RequestBuilder {
15621579 } ;
15631580 }
15641581 async create ( model , params ) {
1565- if ( params ) {
1566- }
1582+ if ( params ) { }
15671583 const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
15681584 const payload = jsonApiSerializer . buildCreatePayload ( model ) ;
15691585 return await this . client . makePostRequest ( this . endpoint , payload ) ;
15701586 }
15711587 async update ( id , model , params ) {
1572- if ( params ) {
1573- }
1588+ if ( params ) { }
15741589 const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
15751590 const payload = jsonApiSerializer . buildUpdatePayload ( model ) ;
15761591 return await this . client . makePatchRequest ( `${ this . endpoint } /${ id } ` , payload ) ;
15771592 }
1593+ async stats ( options ) {
1594+ const statsEndpoint = `${ this . endpoint } /stats` ;
1595+ const { requestOptions } = this . buildRequestParams ( "" , options ) ;
1596+ const resp = await this . client . makeGetRequest ( statsEndpoint , requestOptions ) ;
1597+ if ( resp . data && typeof resp . data === "object" ) {
1598+ resp . data = this . hydrator . hydrateResponse ( resp . data , resp . included || [ ] ) ;
1599+ }
1600+ return resp ;
1601+ }
15781602}
15791603
15801604// src/services/FormCategoriesService.ts
@@ -1985,6 +2009,9 @@ class OrganisationMembersService extends BaseService {
19852009 constructor ( client ) {
19862010 super ( client , "/v3/orgs/:orgId/iam/members" ) ;
19872011 }
2012+ stats ( options ) {
2013+ return super . stats ( options ) ;
2014+ }
19882015}
19892016
19902017// src/services/SchemeTemplatesService.ts
@@ -2254,9 +2281,6 @@ class ClientConfig {
22542281}
22552282// src/models/Organisation.ts
22562283class Organisation extends BaseModel {
2257- constructor ( ) {
2258- super ( ...arguments ) ;
2259- }
22602284 type = "organisations" ;
22612285 static relationships = [ ] ;
22622286}
0 commit comments