Skip to content

Commit e98e37e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Query Parameters to ListOrgConnections Endpoint (#2783)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 2c4fb44 commit e98e37e

File tree

5 files changed

+117
-3
lines changed

5 files changed

+117
-3
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62417,6 +62417,39 @@ paths:
6241762417
get:
6241862418
description: Returns a list of org connections.
6241962419
operationId: ListOrgConnections
62420+
parameters:
62421+
- description: The Org ID of the sink org.
62422+
example: 0879ce27-29a1-481f-a12e-bc2a48ec9ae1
62423+
in: query
62424+
name: sink_org_id
62425+
required: false
62426+
schema:
62427+
type: string
62428+
- description: The Org ID of the source org.
62429+
example: 0879ce27-29a1-481f-a12e-bc2a48ec9ae1
62430+
in: query
62431+
name: source_org_id
62432+
required: false
62433+
schema:
62434+
type: string
62435+
- description: The limit of number of entries you want to return. Default is
62436+
1000.
62437+
example: 1000
62438+
in: query
62439+
name: limit
62440+
required: false
62441+
schema:
62442+
format: int64
62443+
type: integer
62444+
- description: The pagination offset which you want to query from. Default is
62445+
0.
62446+
example: 0
62447+
in: query
62448+
name: offset
62449+
required: false
62450+
schema:
62451+
format: int64
62452+
type: integer
6242062453
responses:
6242162454
'200':
6242262455
content:

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6781,6 +6781,22 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
67816781
operationResponseType: "{}",
67826782
},
67836783
"OrgConnectionsApi.V2.ListOrgConnections": {
6784+
sinkOrgId: {
6785+
type: "string",
6786+
format: "",
6787+
},
6788+
sourceOrgId: {
6789+
type: "string",
6790+
format: "",
6791+
},
6792+
limit: {
6793+
type: "number",
6794+
format: "int64",
6795+
},
6796+
offset: {
6797+
type: "number",
6798+
format: "int64",
6799+
},
67846800
operationResponseType: "OrgConnectionListResponse",
67856801
},
67866802
"OrgConnectionsApi.V2.CreateOrgConnections": {

services/org_connections/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ import { v2 } from "@datadog/datadog-api-client-org-connections";
2626

2727
const configuration = createConfiguration();
2828
const apiInstance = new OrgConnectionsApiV2(configuration);
29+
const params = {/* parameters */};
2930

30-
apiInstance.listOrgConnections().then((data) => {
31+
apiInstance.listOrgConnections(params).then((data) => {
3132
console.log("API called successfully. Returned data: " + JSON.stringify(data));
3233
}).catch((error) => {
3334
console.error("Error calling API: " + error);

services/org_connections/src/v2/OrgConnectionsApi.ts

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ export class OrgConnectionsApiRequestFactory extends BaseAPIRequestFactory {
135135
}
136136

137137
public async listOrgConnections(
138+
sinkOrgId?: string,
139+
sourceOrgId?: string,
140+
limit?: number,
141+
offset?: number,
138142
_options?: Configuration,
139143
): Promise<RequestContext> {
140144
const _config = _options || this.configuration;
@@ -160,6 +164,36 @@ export class OrgConnectionsApiRequestFactory extends BaseAPIRequestFactory {
160164
requestContext.setHeaderParam("User-Agent", this.userAgent);
161165
}
162166

167+
// Query Params
168+
if (sinkOrgId !== undefined) {
169+
requestContext.setQueryParam(
170+
"sink_org_id",
171+
serialize(sinkOrgId, TypingInfo, "string", ""),
172+
"",
173+
);
174+
}
175+
if (sourceOrgId !== undefined) {
176+
requestContext.setQueryParam(
177+
"source_org_id",
178+
serialize(sourceOrgId, TypingInfo, "string", ""),
179+
"",
180+
);
181+
}
182+
if (limit !== undefined) {
183+
requestContext.setQueryParam(
184+
"limit",
185+
serialize(limit, TypingInfo, "number", "int64"),
186+
"",
187+
);
188+
}
189+
if (offset !== undefined) {
190+
requestContext.setQueryParam(
191+
"offset",
192+
serialize(offset, TypingInfo, "number", "int64"),
193+
"",
194+
);
195+
}
196+
163197
// Apply auth methods
164198
applySecurityAuthentication(_config, requestContext, [
165199
"apiKeyAuth",
@@ -482,6 +516,29 @@ export interface OrgConnectionsApiDeleteOrgConnectionsRequest {
482516
connectionId: string;
483517
}
484518

519+
export interface OrgConnectionsApiListOrgConnectionsRequest {
520+
/**
521+
* The Org ID of the sink org.
522+
* @type string
523+
*/
524+
sinkOrgId?: string;
525+
/**
526+
* The Org ID of the source org.
527+
* @type string
528+
*/
529+
sourceOrgId?: string;
530+
/**
531+
* The limit of number of entries you want to return. Default is 1000.
532+
* @type number
533+
*/
534+
limit?: number;
535+
/**
536+
* The pagination offset which you want to query from. Default is 0.
537+
* @type number
538+
*/
539+
offset?: number;
540+
}
541+
485542
export interface OrgConnectionsApiUpdateOrgConnectionsRequest {
486543
/**
487544
* The unique identifier of the org connection.
@@ -560,10 +617,16 @@ export class OrgConnectionsApi {
560617
* @param param The request object
561618
*/
562619
public listOrgConnections(
620+
param: OrgConnectionsApiListOrgConnectionsRequest = {},
563621
options?: Configuration,
564622
): Promise<OrgConnectionListResponse> {
565-
const requestContextPromise =
566-
this.requestFactory.listOrgConnections(options);
623+
const requestContextPromise = this.requestFactory.listOrgConnections(
624+
param.sinkOrgId,
625+
param.sourceOrgId,
626+
param.limit,
627+
param.offset,
628+
options,
629+
);
567630
return requestContextPromise.then((requestContext) => {
568631
return this.configuration.httpApi
569632
.send(requestContext)

services/org_connections/src/v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export {
22
OrgConnectionsApiCreateOrgConnectionsRequest,
33
OrgConnectionsApiDeleteOrgConnectionsRequest,
4+
OrgConnectionsApiListOrgConnectionsRequest,
45
OrgConnectionsApiUpdateOrgConnectionsRequest,
56
OrgConnectionsApi,
67
} from "./OrgConnectionsApi";

0 commit comments

Comments
 (0)