Skip to content

Commit 1005038

Browse files
author
LaunchDarklyCI
committed
Version 5.0.1 automatically generated from ld-openapi@b34b97c.
1 parent 0d0ef2e commit 1005038

File tree

2 files changed

+75
-122
lines changed

2 files changed

+75
-122
lines changed

api.ts

Lines changed: 72 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* LaunchDarkly REST API
33
* Build custom integrations with the LaunchDarkly REST API
44
*
5-
* OpenAPI spec version: 5.0.0
5+
* OpenAPI spec version: 5.0.1
66
* Contact: support@launchdarkly.com
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
@@ -10948,124 +10948,6 @@ export class TeamMembersApi {
1094810948
});
1094910949
}
1095010950
}
10951-
export enum UserRecordApiApiKeys {
10952-
Token,
10953-
}
10954-
10955-
export class UserRecordApi {
10956-
protected _basePath = defaultBasePath;
10957-
protected defaultHeaders : any = {};
10958-
protected _useQuerystring : boolean = false;
10959-
10960-
protected authentications = {
10961-
'default': <Authentication>new VoidAuth(),
10962-
'Token': new ApiKeyAuth('header', 'Authorization'),
10963-
}
10964-
10965-
constructor(basePath?: string);
10966-
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
10967-
if (password) {
10968-
if (basePath) {
10969-
this.basePath = basePath;
10970-
}
10971-
} else {
10972-
if (basePathOrUsername) {
10973-
this.basePath = basePathOrUsername
10974-
}
10975-
}
10976-
}
10977-
10978-
set useQuerystring(value: boolean) {
10979-
this._useQuerystring = value;
10980-
}
10981-
10982-
set basePath(basePath: string) {
10983-
this._basePath = basePath;
10984-
}
10985-
10986-
get basePath() {
10987-
return this._basePath;
10988-
}
10989-
10990-
public setDefaultAuthentication(auth: Authentication) {
10991-
this.authentications.default = auth;
10992-
}
10993-
10994-
public setApiKey(key: UserRecordApiApiKeys, value: string) {
10995-
(this.authentications as any)[UserRecordApiApiKeys[key]].apiKey = value;
10996-
}
10997-
/**
10998-
*
10999-
* @summary Get a user by key.
11000-
* @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
11001-
* @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
11002-
* @param userKey The user&#39;s key.
11003-
* @param {*} [options] Override http request options.
11004-
*/
11005-
public getUser (projectKey: string, environmentKey: string, userKey: string, options: any = {}) : Promise<{ response: http.ClientResponse; body: User; }> {
11006-
const localVarPath = this.basePath + '/users/{projectKey}/{environmentKey}/{userKey}'
11007-
.replace('{' + 'projectKey' + '}', encodeURIComponent(String(projectKey)))
11008-
.replace('{' + 'environmentKey' + '}', encodeURIComponent(String(environmentKey)))
11009-
.replace('{' + 'userKey' + '}', encodeURIComponent(String(userKey)));
11010-
let localVarQueryParameters: any = {};
11011-
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
11012-
let localVarFormParams: any = {};
11013-
11014-
// verify required parameter 'projectKey' is not null or undefined
11015-
if (projectKey === null || projectKey === undefined) {
11016-
throw new Error('Required parameter projectKey was null or undefined when calling getUser.');
11017-
}
11018-
11019-
// verify required parameter 'environmentKey' is not null or undefined
11020-
if (environmentKey === null || environmentKey === undefined) {
11021-
throw new Error('Required parameter environmentKey was null or undefined when calling getUser.');
11022-
}
11023-
11024-
// verify required parameter 'userKey' is not null or undefined
11025-
if (userKey === null || userKey === undefined) {
11026-
throw new Error('Required parameter userKey was null or undefined when calling getUser.');
11027-
}
11028-
11029-
(<any>Object).assign(localVarHeaderParams, options.headers);
11030-
11031-
let localVarUseFormData = false;
11032-
11033-
let localVarRequestOptions: localVarRequest.Options = {
11034-
method: 'GET',
11035-
qs: localVarQueryParameters,
11036-
headers: localVarHeaderParams,
11037-
uri: localVarPath,
11038-
useQuerystring: this._useQuerystring,
11039-
json: true,
11040-
};
11041-
11042-
this.authentications.Token.applyToRequest(localVarRequestOptions);
11043-
11044-
this.authentications.default.applyToRequest(localVarRequestOptions);
11045-
11046-
if (Object.keys(localVarFormParams).length) {
11047-
if (localVarUseFormData) {
11048-
(<any>localVarRequestOptions).formData = localVarFormParams;
11049-
} else {
11050-
localVarRequestOptions.form = localVarFormParams;
11051-
}
11052-
}
11053-
return new Promise<{ response: http.ClientResponse; body: User; }>((resolve, reject) => {
11054-
localVarRequest(localVarRequestOptions, (error, response, body) => {
11055-
if (error) {
11056-
reject(error);
11057-
} else {
11058-
body = ObjectSerializer.deserialize(body, "User");
11059-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
11060-
resolve({ response: response, body: body });
11061-
} else {
11062-
reject({ response: response, body: body });
11063-
}
11064-
}
11065-
});
11066-
});
11067-
}
11068-
}
1106910951
export enum UserSegmentsApiApiKeys {
1107010952
Token,
1107110953
}
@@ -12327,6 +12209,77 @@ export class UsersApi {
1232712209
});
1232812210
});
1232912211
}
12212+
/**
12213+
*
12214+
* @summary Get a user by key.
12215+
* @param projectKey The project key, used to tie the flags together under one project so they can be managed together.
12216+
* @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
12217+
* @param userKey The user&#39;s key.
12218+
* @param {*} [options] Override http request options.
12219+
*/
12220+
public getUser (projectKey: string, environmentKey: string, userKey: string, options: any = {}) : Promise<{ response: http.ClientResponse; body: UserRecord; }> {
12221+
const localVarPath = this.basePath + '/users/{projectKey}/{environmentKey}/{userKey}'
12222+
.replace('{' + 'projectKey' + '}', encodeURIComponent(String(projectKey)))
12223+
.replace('{' + 'environmentKey' + '}', encodeURIComponent(String(environmentKey)))
12224+
.replace('{' + 'userKey' + '}', encodeURIComponent(String(userKey)));
12225+
let localVarQueryParameters: any = {};
12226+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
12227+
let localVarFormParams: any = {};
12228+
12229+
// verify required parameter 'projectKey' is not null or undefined
12230+
if (projectKey === null || projectKey === undefined) {
12231+
throw new Error('Required parameter projectKey was null or undefined when calling getUser.');
12232+
}
12233+
12234+
// verify required parameter 'environmentKey' is not null or undefined
12235+
if (environmentKey === null || environmentKey === undefined) {
12236+
throw new Error('Required parameter environmentKey was null or undefined when calling getUser.');
12237+
}
12238+
12239+
// verify required parameter 'userKey' is not null or undefined
12240+
if (userKey === null || userKey === undefined) {
12241+
throw new Error('Required parameter userKey was null or undefined when calling getUser.');
12242+
}
12243+
12244+
(<any>Object).assign(localVarHeaderParams, options.headers);
12245+
12246+
let localVarUseFormData = false;
12247+
12248+
let localVarRequestOptions: localVarRequest.Options = {
12249+
method: 'GET',
12250+
qs: localVarQueryParameters,
12251+
headers: localVarHeaderParams,
12252+
uri: localVarPath,
12253+
useQuerystring: this._useQuerystring,
12254+
json: true,
12255+
};
12256+
12257+
this.authentications.Token.applyToRequest(localVarRequestOptions);
12258+
12259+
this.authentications.default.applyToRequest(localVarRequestOptions);
12260+
12261+
if (Object.keys(localVarFormParams).length) {
12262+
if (localVarUseFormData) {
12263+
(<any>localVarRequestOptions).formData = localVarFormParams;
12264+
} else {
12265+
localVarRequestOptions.form = localVarFormParams;
12266+
}
12267+
}
12268+
return new Promise<{ response: http.ClientResponse; body: UserRecord; }>((resolve, reject) => {
12269+
localVarRequest(localVarRequestOptions, (error, response, body) => {
12270+
if (error) {
12271+
reject(error);
12272+
} else {
12273+
body = ObjectSerializer.deserialize(body, "UserRecord");
12274+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
12275+
resolve({ response: response, body: body });
12276+
} else {
12277+
reject({ response: response, body: body });
12278+
}
12279+
}
12280+
});
12281+
});
12282+
}
1233012283
/**
1233112284
*
1233212285
* @summary List all users in the environment. Includes the total count of users. In each page, there will be up to 'limit' users returned (default 20). This is useful for exporting all users in the system for further analysis. Paginated collections will include a next link containing a URL with the next set of elements in the collection.

openapi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ info:
1010
license:
1111
name: Apache 2.0
1212
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
13-
version: 5.0.0
13+
version: 5.0.1
1414
host: app.launchdarkly.com
1515
basePath: /api/v2
1616
schemes:
@@ -887,13 +887,13 @@ paths:
887887
'200':
888888
description: User response.
889889
schema:
890-
$ref: '#/definitions/User'
890+
$ref: '#/definitions/UserRecord'
891891
'401':
892892
$ref: '#/responses/Standard401'
893893
'404':
894894
$ref: '#/responses/Standard404'
895895
tags:
896-
- UserRecord
896+
- Users
897897
delete:
898898
summary: Delete a user by ID.
899899
operationId: deleteUser

0 commit comments

Comments
 (0)