Skip to content

Commit c35fcd4

Browse files
cloudant-sdks-automationricellis
authored andcommitted
feat(generated): update API definition to 1.0.0-dev0.1.27
Generated SDK source code using: - Generator version 3.101.0 - Specification version 1.0.0-dev0.1.27 - Automation (cloudant-sdks) version 0acdffd
1 parent 568c497 commit c35fcd4

File tree

4 files changed

+378
-2
lines changed

4 files changed

+378
-2
lines changed

cloudant/v1.ts

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7501,6 +7501,98 @@ class CloudantV1 extends CloudantBaseService {
75017501
);
75027502
}
75037503

7504+
/**
7505+
* Retrieve maximum allowed database count.
7506+
*
7507+
* Retrieves the maximum number of databases currently allowed in the instance.
7508+
*
7509+
* @param {Object} [params] - The parameters to send to the service.
7510+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
7511+
* @returns {Promise<CloudantV1.Response<CloudantV1.CapacityDatabasesInformation>>}
7512+
*/
7513+
public getCapacityDatabasesInformation(
7514+
params?: CloudantV1.GetCapacityDatabasesInformationParams
7515+
): Promise<CloudantV1.Response<CloudantV1.CapacityDatabasesInformation>> {
7516+
const _params = { ...params };
7517+
const _requiredParams = [];
7518+
const _validParams = ['headers'];
7519+
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
7520+
if (_validationErrors) {
7521+
return Promise.reject(_validationErrors);
7522+
}
7523+
7524+
const sdkHeaders = getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'getCapacityDatabasesInformation');
7525+
7526+
const parameters = {
7527+
options: {
7528+
url: '/_api/v2/user/capacity/databases',
7529+
method: 'GET',
7530+
},
7531+
defaultOptions: extend(true, {}, this.baseOptions, {
7532+
headers: extend(
7533+
true,
7534+
sdkHeaders,
7535+
this.baseOptions.headers,
7536+
{
7537+
'Accept': 'application/json',
7538+
},
7539+
_params.headers
7540+
),
7541+
}),
7542+
};
7543+
7544+
return this.createRequestAndDeserializeResponse(
7545+
parameters,
7546+
CloudantV1.CapacityDatabasesInformation.deserialize,
7547+
);
7548+
}
7549+
7550+
/**
7551+
* Retrieve current database count.
7552+
*
7553+
* Retrieves the current number of databases that exist in the instance.
7554+
*
7555+
* @param {Object} [params] - The parameters to send to the service.
7556+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
7557+
* @returns {Promise<CloudantV1.Response<CloudantV1.CurrentDatabasesInformation>>}
7558+
*/
7559+
public getCurrentDatabasesInformation(
7560+
params?: CloudantV1.GetCurrentDatabasesInformationParams
7561+
): Promise<CloudantV1.Response<CloudantV1.CurrentDatabasesInformation>> {
7562+
const _params = { ...params };
7563+
const _requiredParams = [];
7564+
const _validParams = ['headers'];
7565+
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
7566+
if (_validationErrors) {
7567+
return Promise.reject(_validationErrors);
7568+
}
7569+
7570+
const sdkHeaders = getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'getCurrentDatabasesInformation');
7571+
7572+
const parameters = {
7573+
options: {
7574+
url: '/_api/v2/user/current/databases',
7575+
method: 'GET',
7576+
},
7577+
defaultOptions: extend(true, {}, this.baseOptions, {
7578+
headers: extend(
7579+
true,
7580+
sdkHeaders,
7581+
this.baseOptions.headers,
7582+
{
7583+
'Accept': 'application/json',
7584+
},
7585+
_params.headers
7586+
),
7587+
}),
7588+
};
7589+
7590+
return this.createRequestAndDeserializeResponse(
7591+
parameters,
7592+
CloudantV1.CurrentDatabasesInformation.deserialize,
7593+
);
7594+
}
7595+
75047596
/**
75057597
* Retrieve the current provisioned throughput capacity consumption.
75067598
*
@@ -10886,6 +10978,16 @@ namespace CloudantV1 {
1088610978
}
1088710979
}
1088810980

10981+
/** Parameters for the `getCapacityDatabasesInformation` operation. */
10982+
export interface GetCapacityDatabasesInformationParams {
10983+
headers?: OutgoingHttpHeaders;
10984+
}
10985+
10986+
/** Parameters for the `getCurrentDatabasesInformation` operation. */
10987+
export interface GetCurrentDatabasesInformationParams {
10988+
headers?: OutgoingHttpHeaders;
10989+
}
10990+
1088910991
/** Parameters for the `getCurrentThroughputInformation` operation. */
1089010992
export interface GetCurrentThroughputInformationParams {
1089110993
headers?: OutgoingHttpHeaders;
@@ -12220,6 +12322,76 @@ namespace CloudantV1 {
1222012322
}
1222112323
}
1222212324

12325+
/**
12326+
* Schema for information about maximum total database count.
12327+
*/
12328+
export class CapacityDatabasesInformation {
12329+
/** Schema for information about the current database capacity. */
12330+
current?: CapacityDatabasesInformationCurrent;
12331+
12332+
static serialize(obj): CapacityDatabasesInformation.Transport {
12333+
if (obj === undefined || obj === null || typeof obj === 'string') {
12334+
return obj;
12335+
}
12336+
let copy: CapacityDatabasesInformation.Transport = <CapacityDatabasesInformation.Transport>{};
12337+
if (obj.current !== undefined) {
12338+
copy.current = CapacityDatabasesInformationCurrent.serialize(obj.current);
12339+
}
12340+
return copy as unknown as CapacityDatabasesInformation.Transport;
12341+
}
12342+
12343+
static deserialize(obj): CapacityDatabasesInformation {
12344+
if (obj === undefined || obj === null || typeof obj === 'string') {
12345+
return obj;
12346+
}
12347+
let copy: CapacityDatabasesInformation = <CapacityDatabasesInformation>{};
12348+
if (obj.current !== undefined) {
12349+
copy.current = CapacityDatabasesInformationCurrent.deserialize(obj.current);
12350+
}
12351+
return copy as unknown as CapacityDatabasesInformation;
12352+
}
12353+
}
12354+
export namespace CapacityDatabasesInformation {
12355+
export interface Transport {
12356+
current?: CapacityDatabasesInformationCurrent.Transport;
12357+
}
12358+
}
12359+
12360+
/**
12361+
* Schema for information about the current database capacity.
12362+
*/
12363+
export class CapacityDatabasesInformationCurrent {
12364+
/** Schema for databases count. */
12365+
databases?: DatabasesCountInformation;
12366+
12367+
static serialize(obj): CapacityDatabasesInformationCurrent.Transport {
12368+
if (obj === undefined || obj === null || typeof obj === 'string') {
12369+
return obj;
12370+
}
12371+
let copy: CapacityDatabasesInformationCurrent.Transport = <CapacityDatabasesInformationCurrent.Transport>{};
12372+
if (obj.databases !== undefined) {
12373+
copy.databases = DatabasesCountInformation.serialize(obj.databases);
12374+
}
12375+
return copy as unknown as CapacityDatabasesInformationCurrent.Transport;
12376+
}
12377+
12378+
static deserialize(obj): CapacityDatabasesInformationCurrent {
12379+
if (obj === undefined || obj === null || typeof obj === 'string') {
12380+
return obj;
12381+
}
12382+
let copy: CapacityDatabasesInformationCurrent = <CapacityDatabasesInformationCurrent>{};
12383+
if (obj.databases !== undefined) {
12384+
copy.databases = DatabasesCountInformation.deserialize(obj.databases);
12385+
}
12386+
return copy as unknown as CapacityDatabasesInformationCurrent;
12387+
}
12388+
}
12389+
export namespace CapacityDatabasesInformationCurrent {
12390+
export interface Transport {
12391+
databases?: DatabasesCountInformation.Transport;
12392+
}
12393+
}
12394+
1222312395
/**
1222412396
* Schema for information about the currently provisioned and target throughput capacity.
1222512397
*/
@@ -12619,6 +12791,41 @@ namespace CloudantV1 {
1261912791
}
1262012792
}
1262112793

12794+
/**
12795+
* Schema for information about the current database counts.
12796+
*/
12797+
export class CurrentDatabasesInformation {
12798+
/** Schema for databases count. */
12799+
databases?: DatabasesCountInformation;
12800+
12801+
static serialize(obj): CurrentDatabasesInformation.Transport {
12802+
if (obj === undefined || obj === null || typeof obj === 'string') {
12803+
return obj;
12804+
}
12805+
let copy: CurrentDatabasesInformation.Transport = <CurrentDatabasesInformation.Transport>{};
12806+
if (obj.databases !== undefined) {
12807+
copy.databases = DatabasesCountInformation.serialize(obj.databases);
12808+
}
12809+
return copy as unknown as CurrentDatabasesInformation.Transport;
12810+
}
12811+
12812+
static deserialize(obj): CurrentDatabasesInformation {
12813+
if (obj === undefined || obj === null || typeof obj === 'string') {
12814+
return obj;
12815+
}
12816+
let copy: CurrentDatabasesInformation = <CurrentDatabasesInformation>{};
12817+
if (obj.databases !== undefined) {
12818+
copy.databases = DatabasesCountInformation.deserialize(obj.databases);
12819+
}
12820+
return copy as unknown as CurrentDatabasesInformation;
12821+
}
12822+
}
12823+
export namespace CurrentDatabasesInformation {
12824+
export interface Transport {
12825+
databases?: DatabasesCountInformation.Transport;
12826+
}
12827+
}
12828+
1262212829
/**
1262312830
* Schema for information about current consumption of a provisioned throughput capacity.
1262412831
*/
@@ -12990,6 +13197,41 @@ namespace CloudantV1 {
1299013197
}
1299113198
}
1299213199

13200+
/**
13201+
* Schema for databases count.
13202+
*/
13203+
export class DatabasesCountInformation {
13204+
/** The total number of databases. */
13205+
total?: number;
13206+
13207+
static serialize(obj): DatabasesCountInformation.Transport {
13208+
if (obj === undefined || obj === null || typeof obj === 'string') {
13209+
return obj;
13210+
}
13211+
let copy: DatabasesCountInformation.Transport = <DatabasesCountInformation.Transport>{};
13212+
if (obj.total !== undefined) {
13213+
copy.total = obj.total;
13214+
}
13215+
return copy as unknown as DatabasesCountInformation.Transport;
13216+
}
13217+
13218+
static deserialize(obj): DatabasesCountInformation {
13219+
if (obj === undefined || obj === null || typeof obj === 'string') {
13220+
return obj;
13221+
}
13222+
let copy: DatabasesCountInformation = <DatabasesCountInformation>{};
13223+
if (obj.total !== undefined) {
13224+
copy.total = obj.total;
13225+
}
13226+
return copy as unknown as DatabasesCountInformation;
13227+
}
13228+
}
13229+
export namespace DatabasesCountInformation {
13230+
export interface Transport {
13231+
total?: number;
13232+
}
13233+
}
13234+
1299313235
/**
1299413236
* Schema for a database change event.
1299513237
*/

stubs/gen-its-mappings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@
445445
"uuid": "a2e4e696-e631-33f8-b168-5015048cdad8"
446446
},
447447
{
448-
"id": "8593b1aa-6297-3120-a04e-c199e2808167",
448+
"id": "8593b1aa-6297-3120-a04e-c199e2808168",
449449
"request": {
450450
"url": "/_api/v2/user/current/databases",
451451
"method": "GET"
@@ -473,7 +473,7 @@
473473
}
474474
}
475475
},
476-
"uuid": "8593b1aa-6297-3120-a04e-c199e2808167"
476+
"uuid": "8593b1aa-6297-3120-a04e-c199e2808168"
477477
},
478478
{
479479
"id": "8c38b725-a6ac-3f63-a723-9f4925ae23fd",

test/integration/cloudant.v1.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,6 +1997,20 @@ describe('CloudantV1_integration', () => {
19971997
expect(res.result).toBeDefined();
19981998
});
19991999

2000+
test('getCapacityDatabasesInformation()', async () => {
2001+
const res = await cloudantService.getCapacityDatabasesInformation();
2002+
expect(res).toBeDefined();
2003+
expect(res.status).toBe(200);
2004+
expect(res.result).toBeDefined();
2005+
});
2006+
2007+
test('getCurrentDatabasesInformation()', async () => {
2008+
const res = await cloudantService.getCurrentDatabasesInformation();
2009+
expect(res).toBeDefined();
2010+
expect(res.status).toBe(200);
2011+
expect(res.result).toBeDefined();
2012+
});
2013+
20002014
test('getCurrentThroughputInformation()', async () => {
20012015
const res = await cloudantService.getCurrentThroughputInformation();
20022016
expect(res).toBeDefined();

0 commit comments

Comments
 (0)