|
2 | 2 | * LaunchDarkly REST API |
3 | 3 | * Build custom integrations with the LaunchDarkly REST API |
4 | 4 | * |
5 | | - * OpenAPI spec version: 3.6.0 |
| 5 | + * OpenAPI spec version: 3.7.0 |
6 | 6 | * Contact: support@launchdarkly.com |
7 | 7 | * |
8 | 8 | * NOTE: This class is auto generated by the swagger code generator program. |
@@ -6611,6 +6611,144 @@ export class EnvironmentsApi { |
6611 | 6611 |
|
6612 | 6612 | this.authentications.default.applyToRequest(localVarRequestOptions); |
6613 | 6613 |
|
| 6614 | + if (Object.keys(localVarFormParams).length) { |
| 6615 | + if (localVarUseFormData) { |
| 6616 | + (<any>localVarRequestOptions).formData = localVarFormParams; |
| 6617 | + } else { |
| 6618 | + localVarRequestOptions.form = localVarFormParams; |
| 6619 | + } |
| 6620 | + } |
| 6621 | + return new Promise<{ response: http.ClientResponse; body: Environment; }>((resolve, reject) => { |
| 6622 | + localVarRequest(localVarRequestOptions, (error, response, body) => { |
| 6623 | + if (error) { |
| 6624 | + reject(error); |
| 6625 | + } else { |
| 6626 | + body = ObjectSerializer.deserialize(body, "Environment"); |
| 6627 | + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { |
| 6628 | + resolve({ response: response, body: body }); |
| 6629 | + } else { |
| 6630 | + reject({ response: response, body: body }); |
| 6631 | + } |
| 6632 | + } |
| 6633 | + }); |
| 6634 | + }); |
| 6635 | + } |
| 6636 | + /** |
| 6637 | + * |
| 6638 | + * @summary Reset an environment's mobile key with an optional expiry time for the old key. |
| 6639 | + * @param projectKey The project key, used to tie the flags together under one project so they can be managed together. |
| 6640 | + * @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together. |
| 6641 | + * @param expiry An expiration time for the old environment SDK or mobile key, expressed as a Unix epoch time in milliseconds. By default, the key will expire immediately |
| 6642 | + * @param {*} [options] Override http request options. |
| 6643 | + */ |
| 6644 | + public resetEnvironmentMobileKey (projectKey: string, environmentKey: string, expiry?: number, options: any = {}) : Promise<{ response: http.ClientResponse; body: Environment; }> { |
| 6645 | + const localVarPath = this.basePath + '/projects/{projectKey}/environments/{environmentKey}/mobileKey' |
| 6646 | + .replace('{' + 'projectKey' + '}', encodeURIComponent(String(projectKey))) |
| 6647 | + .replace('{' + 'environmentKey' + '}', encodeURIComponent(String(environmentKey))); |
| 6648 | + let localVarQueryParameters: any = {}; |
| 6649 | + let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders); |
| 6650 | + let localVarFormParams: any = {}; |
| 6651 | + |
| 6652 | + // verify required parameter 'projectKey' is not null or undefined |
| 6653 | + if (projectKey === null || projectKey === undefined) { |
| 6654 | + throw new Error('Required parameter projectKey was null or undefined when calling resetEnvironmentMobileKey.'); |
| 6655 | + } |
| 6656 | + |
| 6657 | + // verify required parameter 'environmentKey' is not null or undefined |
| 6658 | + if (environmentKey === null || environmentKey === undefined) { |
| 6659 | + throw new Error('Required parameter environmentKey was null or undefined when calling resetEnvironmentMobileKey.'); |
| 6660 | + } |
| 6661 | + |
| 6662 | + if (expiry !== undefined) { |
| 6663 | + localVarQueryParameters['expiry'] = ObjectSerializer.serialize(expiry, "number"); |
| 6664 | + } |
| 6665 | + |
| 6666 | + (<any>Object).assign(localVarHeaderParams, options.headers); |
| 6667 | + |
| 6668 | + let localVarUseFormData = false; |
| 6669 | + |
| 6670 | + let localVarRequestOptions: localVarRequest.Options = { |
| 6671 | + method: 'POST', |
| 6672 | + qs: localVarQueryParameters, |
| 6673 | + headers: localVarHeaderParams, |
| 6674 | + uri: localVarPath, |
| 6675 | + useQuerystring: this._useQuerystring, |
| 6676 | + json: true, |
| 6677 | + }; |
| 6678 | + |
| 6679 | + this.authentications.Token.applyToRequest(localVarRequestOptions); |
| 6680 | + |
| 6681 | + this.authentications.default.applyToRequest(localVarRequestOptions); |
| 6682 | + |
| 6683 | + if (Object.keys(localVarFormParams).length) { |
| 6684 | + if (localVarUseFormData) { |
| 6685 | + (<any>localVarRequestOptions).formData = localVarFormParams; |
| 6686 | + } else { |
| 6687 | + localVarRequestOptions.form = localVarFormParams; |
| 6688 | + } |
| 6689 | + } |
| 6690 | + return new Promise<{ response: http.ClientResponse; body: Environment; }>((resolve, reject) => { |
| 6691 | + localVarRequest(localVarRequestOptions, (error, response, body) => { |
| 6692 | + if (error) { |
| 6693 | + reject(error); |
| 6694 | + } else { |
| 6695 | + body = ObjectSerializer.deserialize(body, "Environment"); |
| 6696 | + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { |
| 6697 | + resolve({ response: response, body: body }); |
| 6698 | + } else { |
| 6699 | + reject({ response: response, body: body }); |
| 6700 | + } |
| 6701 | + } |
| 6702 | + }); |
| 6703 | + }); |
| 6704 | + } |
| 6705 | + /** |
| 6706 | + * |
| 6707 | + * @summary Reset an environment's SDK key with an optional expiry time for the old key. |
| 6708 | + * @param projectKey The project key, used to tie the flags together under one project so they can be managed together. |
| 6709 | + * @param environmentKey The environment key, used to tie together flag configuration and users under one environment so they can be managed together. |
| 6710 | + * @param expiry An expiration time for the old environment SDK or mobile key, expressed as a Unix epoch time in milliseconds. By default, the key will expire immediately |
| 6711 | + * @param {*} [options] Override http request options. |
| 6712 | + */ |
| 6713 | + public resetEnvironmentSDKKey (projectKey: string, environmentKey: string, expiry?: number, options: any = {}) : Promise<{ response: http.ClientResponse; body: Environment; }> { |
| 6714 | + const localVarPath = this.basePath + '/projects/{projectKey}/environments/{environmentKey}/apiKey' |
| 6715 | + .replace('{' + 'projectKey' + '}', encodeURIComponent(String(projectKey))) |
| 6716 | + .replace('{' + 'environmentKey' + '}', encodeURIComponent(String(environmentKey))); |
| 6717 | + let localVarQueryParameters: any = {}; |
| 6718 | + let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders); |
| 6719 | + let localVarFormParams: any = {}; |
| 6720 | + |
| 6721 | + // verify required parameter 'projectKey' is not null or undefined |
| 6722 | + if (projectKey === null || projectKey === undefined) { |
| 6723 | + throw new Error('Required parameter projectKey was null or undefined when calling resetEnvironmentSDKKey.'); |
| 6724 | + } |
| 6725 | + |
| 6726 | + // verify required parameter 'environmentKey' is not null or undefined |
| 6727 | + if (environmentKey === null || environmentKey === undefined) { |
| 6728 | + throw new Error('Required parameter environmentKey was null or undefined when calling resetEnvironmentSDKKey.'); |
| 6729 | + } |
| 6730 | + |
| 6731 | + if (expiry !== undefined) { |
| 6732 | + localVarQueryParameters['expiry'] = ObjectSerializer.serialize(expiry, "number"); |
| 6733 | + } |
| 6734 | + |
| 6735 | + (<any>Object).assign(localVarHeaderParams, options.headers); |
| 6736 | + |
| 6737 | + let localVarUseFormData = false; |
| 6738 | + |
| 6739 | + let localVarRequestOptions: localVarRequest.Options = { |
| 6740 | + method: 'POST', |
| 6741 | + qs: localVarQueryParameters, |
| 6742 | + headers: localVarHeaderParams, |
| 6743 | + uri: localVarPath, |
| 6744 | + useQuerystring: this._useQuerystring, |
| 6745 | + json: true, |
| 6746 | + }; |
| 6747 | + |
| 6748 | + this.authentications.Token.applyToRequest(localVarRequestOptions); |
| 6749 | + |
| 6750 | + this.authentications.default.applyToRequest(localVarRequestOptions); |
| 6751 | + |
6614 | 6752 | if (Object.keys(localVarFormParams).length) { |
6615 | 6753 | if (localVarUseFormData) { |
6616 | 6754 | (<any>localVarRequestOptions).formData = localVarFormParams; |
|
0 commit comments