Skip to content

Commit 70aafba

Browse files
api-clients-generation-pipeline[bot]therveci.datadog-api-spec
authored
Make param optional in typescript ObjectParamAPI (#158)
* Make param optional * Regenerate client from commit ce05618 of spec repo Co-authored-by: Thomas Hervé <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent f1cf19a commit 70aafba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+601
-629
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev8",
7-
"regenerated": "2021-05-28 09:09:44.724486",
8-
"spec_repo_commit": "2a54e42"
7+
"regenerated": "2021-05-31 10:52:01.415775",
8+
"spec_repo_commit": "ce05618"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev8",
12-
"regenerated": "2021-05-28 09:10:29.513983",
13-
"spec_repo_commit": "2a54e42"
12+
"regenerated": "2021-05-31 10:52:41.450839",
13+
"spec_repo_commit": "ce05618"
1414
}
1515
}
1616
}

.generator/templates/api_doc.mustache

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,15 @@ const configuration = {{{moduleName}}}.createConfiguration();
2929
const apiInstance = new {{{moduleName}}}.{{classname}}(configuration);
3030

3131
{{#hasParams}}
32-
let body:{{{moduleName}}}.{{classname}}{{operationIdCamelCase}}Request = {
32+
let params:{{{moduleName}}}.{{classname}}{{operationIdCamelCase}}Request = {
3333
{{#allParams}}
3434
// {{{dataType}}}{{#description}} | {{{description}}}{{/description}}{{^required}} (optional){{/required}}
3535
{{paramName}}: {{{example}}},
3636
{{/allParams}}
3737
};
3838
{{/hasParams}}
39-
{{^hasParams}}
40-
let body:any = {};
41-
{{/hasParams}}
4239

43-
apiInstance.{{{operationId}}}(body).then((data:any) => {
40+
apiInstance.{{{operationId}}}({{#hasParams}}params{{/hasParams}}).then((data:any) => {
4441
console.log('API called successfully. Returned data: ' + data);
4542
}).catch((error:any) => console.error(error));
4643
```

.generator/templates/types/ObjectParamAPI.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class Object{{classname}} {
4747
{{/summary}}
4848
* @param param the request object
4949
*/
50-
public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
50+
public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request{{^requiredParams}} = {}{{/requiredParams}}, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
5151
return this.api.{{nickname}}({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}};
5252
}
5353

docs/v1/AWSIntegrationApi.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import * as fs from 'fs';
3030
const configuration = v1.createConfiguration();
3131
const apiInstance = new v1.AWSIntegrationApi(configuration);
3232

33-
let body:v1.AWSIntegrationApiCreateAWSAccountRequest = {
33+
let params:v1.AWSIntegrationApiCreateAWSAccountRequest = {
3434
// AWSAccount | AWS Request Object
3535
body: {
3636
accessKeyId: "accessKeyId_example",
@@ -46,7 +46,7 @@ let body:v1.AWSIntegrationApiCreateAWSAccountRequest = {
4646
},
4747
};
4848

49-
apiInstance.createAWSAccount(body).then((data:any) => {
49+
apiInstance.createAWSAccount(params).then((data:any) => {
5050
console.log('API called successfully. Returned data: ' + data);
5151
}).catch((error:any) => console.error(error));
5252
```
@@ -98,7 +98,7 @@ import * as fs from 'fs';
9898
const configuration = v1.createConfiguration();
9999
const apiInstance = new v1.AWSIntegrationApi(configuration);
100100

101-
let body:v1.AWSIntegrationApiCreateAWSTagFilterRequest = {
101+
let params:v1.AWSIntegrationApiCreateAWSTagFilterRequest = {
102102
// AWSTagFilterCreateRequest | Set an AWS tag filter using an `aws_account_identifier`, `namespace`, and filtering string. Namespace options are `application_elb`, `elb`, `lambda`, `network_elb`, `rds`, `sqs`, and `custom`.
103103
body: {
104104
accountId: "1234567",
@@ -107,7 +107,7 @@ let body:v1.AWSIntegrationApiCreateAWSTagFilterRequest = {
107107
},
108108
};
109109

110-
apiInstance.createAWSTagFilter(body).then((data:any) => {
110+
apiInstance.createAWSTagFilter(params).then((data:any) => {
111111
console.log('API called successfully. Returned data: ' + data);
112112
}).catch((error:any) => console.error(error));
113113
```
@@ -158,7 +158,7 @@ import * as fs from 'fs';
158158
const configuration = v1.createConfiguration();
159159
const apiInstance = new v1.AWSIntegrationApi(configuration);
160160

161-
let body:v1.AWSIntegrationApiCreateNewAWSExternalIDRequest = {
161+
let params:v1.AWSIntegrationApiCreateNewAWSExternalIDRequest = {
162162
// AWSAccount | Your Datadog role delegation name. For more information about your AWS account Role name, see the [Datadog AWS integration configuration info](https://github.com/DataDog/documentation/blob/master/integrations/amazon_web_services/#installation).
163163
body: {
164164
accessKeyId: "accessKeyId_example",
@@ -174,7 +174,7 @@ let body:v1.AWSIntegrationApiCreateNewAWSExternalIDRequest = {
174174
},
175175
};
176176

177-
apiInstance.createNewAWSExternalID(body).then((data:any) => {
177+
apiInstance.createNewAWSExternalID(params).then((data:any) => {
178178
console.log('API called successfully. Returned data: ' + data);
179179
}).catch((error:any) => console.error(error));
180180
```
@@ -225,7 +225,7 @@ import * as fs from 'fs';
225225
const configuration = v1.createConfiguration();
226226
const apiInstance = new v1.AWSIntegrationApi(configuration);
227227

228-
let body:v1.AWSIntegrationApiDeleteAWSAccountRequest = {
228+
let params:v1.AWSIntegrationApiDeleteAWSAccountRequest = {
229229
// AWSAccount | AWS request object
230230
body: {
231231
accessKeyId: "accessKeyId_example",
@@ -241,7 +241,7 @@ let body:v1.AWSIntegrationApiDeleteAWSAccountRequest = {
241241
},
242242
};
243243

244-
apiInstance.deleteAWSAccount(body).then((data:any) => {
244+
apiInstance.deleteAWSAccount(params).then((data:any) => {
245245
console.log('API called successfully. Returned data: ' + data);
246246
}).catch((error:any) => console.error(error));
247247
```
@@ -293,15 +293,15 @@ import * as fs from 'fs';
293293
const configuration = v1.createConfiguration();
294294
const apiInstance = new v1.AWSIntegrationApi(configuration);
295295

296-
let body:v1.AWSIntegrationApiDeleteAWSTagFilterRequest = {
296+
let params:v1.AWSIntegrationApiDeleteAWSTagFilterRequest = {
297297
// AWSTagFilterDeleteRequest | Delete a tag filtering entry for a given AWS account and `dd-aws` namespace.
298298
body: {
299299
accountId: "FAKEAC0FAKEAC2FAKEAC",
300300
namespace: "elb",
301301
},
302302
};
303303

304-
apiInstance.deleteAWSTagFilter(body).then((data:any) => {
304+
apiInstance.deleteAWSTagFilter(params).then((data:any) => {
305305
console.log('API called successfully. Returned data: ' + data);
306306
}).catch((error:any) => console.error(error));
307307
```
@@ -352,7 +352,7 @@ import * as fs from 'fs';
352352
const configuration = v1.createConfiguration();
353353
const apiInstance = new v1.AWSIntegrationApi(configuration);
354354

355-
let body:v1.AWSIntegrationApiListAWSAccountsRequest = {
355+
let params:v1.AWSIntegrationApiListAWSAccountsRequest = {
356356
// string | Only return AWS accounts that matches this `account_id`. (optional)
357357
accountId: "account_id_example",
358358
// string | Only return AWS accounts that matches this role_name. (optional)
@@ -361,7 +361,7 @@ let body:v1.AWSIntegrationApiListAWSAccountsRequest = {
361361
accessKeyId: "access_key_id_example",
362362
};
363363

364-
apiInstance.listAWSAccounts(body).then((data:any) => {
364+
apiInstance.listAWSAccounts(params).then((data:any) => {
365365
console.log('API called successfully. Returned data: ' + data);
366366
}).catch((error:any) => console.error(error));
367367
```
@@ -414,12 +414,12 @@ import * as fs from 'fs';
414414
const configuration = v1.createConfiguration();
415415
const apiInstance = new v1.AWSIntegrationApi(configuration);
416416

417-
let body:v1.AWSIntegrationApiListAWSTagFiltersRequest = {
417+
let params:v1.AWSIntegrationApiListAWSTagFiltersRequest = {
418418
// string | Only return AWS filters that matches this `account_id`.
419419
accountId: "account_id_example",
420420
};
421421

422-
apiInstance.listAWSTagFilters(body).then((data:any) => {
422+
apiInstance.listAWSTagFilters(params).then((data:any) => {
423423
console.log('API called successfully. Returned data: ' + data);
424424
}).catch((error:any) => console.error(error));
425425
```
@@ -470,9 +470,8 @@ import * as fs from 'fs';
470470
const configuration = v1.createConfiguration();
471471
const apiInstance = new v1.AWSIntegrationApi(configuration);
472472

473-
let body:any = {};
474473

475-
apiInstance.listAvailableAWSNamespaces(body).then((data:any) => {
474+
apiInstance.listAvailableAWSNamespaces().then((data:any) => {
476475
console.log('API called successfully. Returned data: ' + data);
477476
}).catch((error:any) => console.error(error));
478477
```
@@ -519,7 +518,7 @@ import * as fs from 'fs';
519518
const configuration = v1.createConfiguration();
520519
const apiInstance = new v1.AWSIntegrationApi(configuration);
521520

522-
let body:v1.AWSIntegrationApiUpdateAWSAccountRequest = {
521+
let params:v1.AWSIntegrationApiUpdateAWSAccountRequest = {
523522
// AWSAccount | AWS request object
524523
body: {
525524
accessKeyId: "accessKeyId_example",
@@ -541,7 +540,7 @@ let body:v1.AWSIntegrationApiUpdateAWSAccountRequest = {
541540
accessKeyId: "access_key_id_example",
542541
};
543542

544-
apiInstance.updateAWSAccount(body).then((data:any) => {
543+
apiInstance.updateAWSAccount(params).then((data:any) => {
545544
console.log('API called successfully. Returned data: ' + data);
546545
}).catch((error:any) => console.error(error));
547546
```

docs/v1/AWSLogsIntegrationApi.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ import * as fs from 'fs';
2828
const configuration = v1.createConfiguration();
2929
const apiInstance = new v1.AWSLogsIntegrationApi(configuration);
3030

31-
let body:v1.AWSLogsIntegrationApiCheckAWSLogsLambdaAsyncRequest = {
31+
let params:v1.AWSLogsIntegrationApiCheckAWSLogsLambdaAsyncRequest = {
3232
// AWSAccountAndLambdaRequest | Check AWS Log Lambda Async request body.
3333
body: {
3434
accountId: "1234567",
3535
lambdaArn: "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest",
3636
},
3737
};
3838

39-
apiInstance.checkAWSLogsLambdaAsync(body).then((data:any) => {
39+
apiInstance.checkAWSLogsLambdaAsync(params).then((data:any) => {
4040
console.log('API called successfully. Returned data: ' + data);
4141
}).catch((error:any) => console.error(error));
4242
```
@@ -87,15 +87,15 @@ import * as fs from 'fs';
8787
const configuration = v1.createConfiguration();
8888
const apiInstance = new v1.AWSLogsIntegrationApi(configuration);
8989

90-
let body:v1.AWSLogsIntegrationApiCheckAWSLogsServicesAsyncRequest = {
90+
let params:v1.AWSLogsIntegrationApiCheckAWSLogsServicesAsyncRequest = {
9191
// AWSLogsServicesRequest | Check AWS Logs Async Services request body.
9292
body: {
9393
accountId: "1234567",
9494
services: ["s3","elb","elbv2","cloudfront","redshift","lambda"],
9595
},
9696
};
9797

98-
apiInstance.checkAWSLogsServicesAsync(body).then((data:any) => {
98+
apiInstance.checkAWSLogsServicesAsync(params).then((data:any) => {
9999
console.log('API called successfully. Returned data: ' + data);
100100
}).catch((error:any) => console.error(error));
101101
```
@@ -146,15 +146,15 @@ import * as fs from 'fs';
146146
const configuration = v1.createConfiguration();
147147
const apiInstance = new v1.AWSLogsIntegrationApi(configuration);
148148

149-
let body:v1.AWSLogsIntegrationApiCreateAWSLambdaARNRequest = {
149+
let params:v1.AWSLogsIntegrationApiCreateAWSLambdaARNRequest = {
150150
// AWSAccountAndLambdaRequest | AWS Log Lambda Async request body.
151151
body: {
152152
accountId: "1234567",
153153
lambdaArn: "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest",
154154
},
155155
};
156156

157-
apiInstance.createAWSLambdaARN(body).then((data:any) => {
157+
apiInstance.createAWSLambdaARN(params).then((data:any) => {
158158
console.log('API called successfully. Returned data: ' + data);
159159
}).catch((error:any) => console.error(error));
160160
```
@@ -205,15 +205,15 @@ import * as fs from 'fs';
205205
const configuration = v1.createConfiguration();
206206
const apiInstance = new v1.AWSLogsIntegrationApi(configuration);
207207

208-
let body:v1.AWSLogsIntegrationApiDeleteAWSLambdaARNRequest = {
208+
let params:v1.AWSLogsIntegrationApiDeleteAWSLambdaARNRequest = {
209209
// AWSAccountAndLambdaRequest | Delete AWS Lambda ARN request body.
210210
body: {
211211
accountId: "1234567",
212212
lambdaArn: "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest",
213213
},
214214
};
215215

216-
apiInstance.deleteAWSLambdaARN(body).then((data:any) => {
216+
apiInstance.deleteAWSLambdaARN(params).then((data:any) => {
217217
console.log('API called successfully. Returned data: ' + data);
218218
}).catch((error:any) => console.error(error));
219219
```
@@ -264,15 +264,15 @@ import * as fs from 'fs';
264264
const configuration = v1.createConfiguration();
265265
const apiInstance = new v1.AWSLogsIntegrationApi(configuration);
266266

267-
let body:v1.AWSLogsIntegrationApiEnableAWSLogServicesRequest = {
267+
let params:v1.AWSLogsIntegrationApiEnableAWSLogServicesRequest = {
268268
// AWSLogsServicesRequest | Enable AWS Log Services request body.
269269
body: {
270270
accountId: "1234567",
271271
services: ["s3","elb","elbv2","cloudfront","redshift","lambda"],
272272
},
273273
};
274274

275-
apiInstance.enableAWSLogServices(body).then((data:any) => {
275+
apiInstance.enableAWSLogServices(params).then((data:any) => {
276276
console.log('API called successfully. Returned data: ' + data);
277277
}).catch((error:any) => console.error(error));
278278
```
@@ -323,9 +323,8 @@ import * as fs from 'fs';
323323
const configuration = v1.createConfiguration();
324324
const apiInstance = new v1.AWSLogsIntegrationApi(configuration);
325325

326-
let body:any = {};
327326

328-
apiInstance.listAWSLogsIntegrations(body).then((data:any) => {
327+
apiInstance.listAWSLogsIntegrations().then((data:any) => {
329328
console.log('API called successfully. Returned data: ' + data);
330329
}).catch((error:any) => console.error(error));
331330
```
@@ -373,9 +372,8 @@ import * as fs from 'fs';
373372
const configuration = v1.createConfiguration();
374373
const apiInstance = new v1.AWSLogsIntegrationApi(configuration);
375374

376-
let body:any = {};
377375

378-
apiInstance.listAWSLogsServices(body).then((data:any) => {
376+
apiInstance.listAWSLogsServices().then((data:any) => {
379377
console.log('API called successfully. Returned data: ' + data);
380378
}).catch((error:any) => console.error(error));
381379
```

docs/v1/AuthenticationApi.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ import * as fs from 'fs';
2222
const configuration = v1.createConfiguration();
2323
const apiInstance = new v1.AuthenticationApi(configuration);
2424

25-
let body:any = {};
2625

27-
apiInstance.validate(body).then((data:any) => {
26+
apiInstance.validate().then((data:any) => {
2827
console.log('API called successfully. Returned data: ' + data);
2928
}).catch((error:any) => console.error(error));
3029
```

0 commit comments

Comments
 (0)