@@ -14,6 +14,7 @@ import localVarRequest from 'request';
1414import http from 'http' ;
1515
1616/* tslint:disable:no-unused-locals */
17+ import { AcceptAccountRequestResponseModel } from '../model/acceptAccountRequestResponseModel' ;
1718import { IssueApiKeyRequest } from '../model/issueApiKeyRequest' ;
1819import { IssueApiKeyResponse } from '../model/issueApiKeyResponse' ;
1920import { IssueJWTResponse } from '../model/issueJWTResponse' ;
@@ -109,6 +110,121 @@ export class AuthApi {
109110 this . interceptors . push ( interceptor ) ;
110111 }
111112
113+ /**
114+ * Accepts a pending account request: creates the user, optionally creates/links a project (for ADMIN requests with a projectName), and deletes the pending request. Requires admin or superadmin credentials.
115+ * @summary Accept an account request
116+ * @param id ID of the account request to accept
117+ * @param xUserPassword Password of the admin or superadmin user
118+ * @param xUserEmail Email of an admin or superadmin user
119+ */
120+ public async authControllerAcceptAccountRequest (
121+ id : string ,
122+ xUserPassword ?: string ,
123+ xUserEmail ?: string ,
124+ options : { headers : { [ name : string ] : string } } = { headers : { } }
125+ ) : Promise < {
126+ response : http . IncomingMessage ;
127+ body : AcceptAccountRequestResponseModel ;
128+ } > {
129+ const localVarPath =
130+ this . basePath +
131+ '/auth/account-request/{id}/accept' . replace (
132+ '{' + 'id' + '}' ,
133+ encodeURIComponent ( String ( id ) )
134+ ) ;
135+ let localVarQueryParameters : any = { } ;
136+ let localVarHeaderParams : any = ( < any > Object ) . assign (
137+ { } ,
138+ this . _defaultHeaders
139+ ) ;
140+ const produces = [ 'application/json' ] ;
141+ // give precedence to 'application/json'
142+ if ( produces . indexOf ( 'application/json' ) >= 0 ) {
143+ localVarHeaderParams . Accept = 'application/json' ;
144+ } else {
145+ localVarHeaderParams . Accept = produces . join ( ',' ) ;
146+ }
147+ let localVarFormParams : any = { } ;
148+
149+ // verify required parameter 'id' is not null or undefined
150+ if ( id === null || id === undefined ) {
151+ throw new Error (
152+ 'Required parameter id was null or undefined when calling authControllerAcceptAccountRequest.'
153+ ) ;
154+ }
155+
156+ localVarHeaderParams [ 'X-User-Password' ] = ObjectSerializer . serialize (
157+ xUserPassword ,
158+ 'string'
159+ ) ;
160+ localVarHeaderParams [ 'X-User-Email' ] = ObjectSerializer . serialize (
161+ xUserEmail ,
162+ 'string'
163+ ) ;
164+ ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ;
165+
166+ let localVarUseFormData = false ;
167+
168+ let localVarRequestOptions : localVarRequest . Options = {
169+ method : 'POST' ,
170+ qs : localVarQueryParameters ,
171+ headers : localVarHeaderParams ,
172+ uri : localVarPath ,
173+ useQuerystring : this . _useQuerystring ,
174+ json : true ,
175+ } ;
176+
177+ let authenticationPromise = Promise . resolve ( ) ;
178+ if ( this . authentications . API_Key . accessToken ) {
179+ authenticationPromise = authenticationPromise . then ( ( ) =>
180+ this . authentications . API_Key . applyToRequest ( localVarRequestOptions )
181+ ) ;
182+ }
183+ authenticationPromise = authenticationPromise . then ( ( ) =>
184+ this . authentications . default . applyToRequest ( localVarRequestOptions )
185+ ) ;
186+
187+ let interceptorPromise = authenticationPromise ;
188+ for ( const interceptor of this . interceptors ) {
189+ interceptorPromise = interceptorPromise . then ( ( ) =>
190+ interceptor ( localVarRequestOptions )
191+ ) ;
192+ }
193+
194+ return interceptorPromise . then ( ( ) => {
195+ if ( Object . keys ( localVarFormParams ) . length ) {
196+ if ( localVarUseFormData ) {
197+ ( < any > localVarRequestOptions ) . formData = localVarFormParams ;
198+ } else {
199+ localVarRequestOptions . form = localVarFormParams ;
200+ }
201+ }
202+ return new Promise < {
203+ response : http . IncomingMessage ;
204+ body : AcceptAccountRequestResponseModel ;
205+ } > ( ( resolve , reject ) => {
206+ localVarRequest ( localVarRequestOptions , ( error , response , body ) => {
207+ if ( error ) {
208+ reject ( error ) ;
209+ } else {
210+ if (
211+ response . statusCode &&
212+ response . statusCode >= 200 &&
213+ response . statusCode <= 299
214+ ) {
215+ body = ObjectSerializer . deserialize (
216+ body ,
217+ 'AcceptAccountRequestResponseModel'
218+ ) ;
219+ resolve ( { response : response , body : body } ) ;
220+ } else {
221+ reject ( new HttpError ( response , body , response . statusCode ) ) ;
222+ }
223+ }
224+ } ) ;
225+ } ) ;
226+ } ) ;
227+ }
112228 /**
113229 * Allows a prospective user to submit a request for a new account. The request is stored and can be reviewed by an admin.
114230 * @summary Submit a new account request
@@ -335,8 +451,8 @@ export class AuthApi {
335451 */
336452 public async authControllerDeleteAccountRequest (
337453 id : string ,
338- xUserPassword : string ,
339- xUserEmail : string ,
454+ xUserPassword ? : string ,
455+ xUserEmail ? : string ,
340456 options : { headers : { [ name : string ] : string } } = { headers : { } }
341457 ) : Promise < {
342458 response : http . IncomingMessage ;
@@ -369,20 +485,6 @@ export class AuthApi {
369485 ) ;
370486 }
371487
372- // verify required parameter 'xUserPassword' is not null or undefined
373- if ( xUserPassword === null || xUserPassword === undefined ) {
374- throw new Error (
375- 'Required parameter xUserPassword was null or undefined when calling authControllerDeleteAccountRequest.'
376- ) ;
377- }
378-
379- // verify required parameter 'xUserEmail' is not null or undefined
380- if ( xUserEmail === null || xUserEmail === undefined ) {
381- throw new Error (
382- 'Required parameter xUserEmail was null or undefined when calling authControllerDeleteAccountRequest.'
383- ) ;
384- }
385-
386488 localVarHeaderParams [ 'X-User-Password' ] = ObjectSerializer . serialize (
387489 xUserPassword ,
388490 'string'
@@ -549,8 +651,8 @@ export class AuthApi {
549651 * @param xUserEmail Email of an admin or superadmin user
550652 */
551653 public async authControllerGetAllAccountRequests (
552- xUserPassword : string ,
553- xUserEmail : string ,
654+ xUserPassword ? : string ,
655+ xUserEmail ? : string ,
554656 options : { headers : { [ name : string ] : string } } = { headers : { } }
555657 ) : Promise < {
556658 response : http . IncomingMessage ;
@@ -571,20 +673,6 @@ export class AuthApi {
571673 }
572674 let localVarFormParams : any = { } ;
573675
574- // verify required parameter 'xUserPassword' is not null or undefined
575- if ( xUserPassword === null || xUserPassword === undefined ) {
576- throw new Error (
577- 'Required parameter xUserPassword was null or undefined when calling authControllerGetAllAccountRequests.'
578- ) ;
579- }
580-
581- // verify required parameter 'xUserEmail' is not null or undefined
582- if ( xUserEmail === null || xUserEmail === undefined ) {
583- throw new Error (
584- 'Required parameter xUserEmail was null or undefined when calling authControllerGetAllAccountRequests.'
585- ) ;
586- }
587-
588676 localVarHeaderParams [ 'X-User-Password' ] = ObjectSerializer . serialize (
589677 xUserPassword ,
590678 'string'
0 commit comments