Skip to content

Commit 86482fc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Query Parameters to ListOrgConnections Endpoint (#3130)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 6f94192 commit 86482fc

File tree

2 files changed

+146
-7
lines changed

2 files changed

+146
-7
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:

src/main/java/com/datadog/api/client/v2/api/OrgConnectionsApi.java

Lines changed: 113 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import jakarta.ws.rs.core.GenericType;
1313
import java.util.ArrayList;
1414
import java.util.HashMap;
15+
import java.util.List;
1516
import java.util.Map;
1617
import java.util.UUID;
1718
import java.util.concurrent.CompletableFuture;
@@ -321,6 +322,58 @@ public CompletableFuture<ApiResponse<Void>> deleteOrgConnectionsWithHttpInfoAsyn
321322
null);
322323
}
323324

325+
/** Manage optional parameters to listOrgConnections. */
326+
public static class ListOrgConnectionsOptionalParameters {
327+
private String sinkOrgId;
328+
private String sourceOrgId;
329+
private Long limit;
330+
private Long offset;
331+
332+
/**
333+
* Set sinkOrgId.
334+
*
335+
* @param sinkOrgId The Org ID of the sink org. (optional)
336+
* @return ListOrgConnectionsOptionalParameters
337+
*/
338+
public ListOrgConnectionsOptionalParameters sinkOrgId(String sinkOrgId) {
339+
this.sinkOrgId = sinkOrgId;
340+
return this;
341+
}
342+
343+
/**
344+
* Set sourceOrgId.
345+
*
346+
* @param sourceOrgId The Org ID of the source org. (optional)
347+
* @return ListOrgConnectionsOptionalParameters
348+
*/
349+
public ListOrgConnectionsOptionalParameters sourceOrgId(String sourceOrgId) {
350+
this.sourceOrgId = sourceOrgId;
351+
return this;
352+
}
353+
354+
/**
355+
* Set limit.
356+
*
357+
* @param limit The limit of number of entries you want to return. Default is 1000. (optional)
358+
* @return ListOrgConnectionsOptionalParameters
359+
*/
360+
public ListOrgConnectionsOptionalParameters limit(Long limit) {
361+
this.limit = limit;
362+
return this;
363+
}
364+
365+
/**
366+
* Set offset.
367+
*
368+
* @param offset The pagination offset which you want to query from. Default is 0. (optional)
369+
* @return ListOrgConnectionsOptionalParameters
370+
*/
371+
public ListOrgConnectionsOptionalParameters offset(Long offset) {
372+
this.offset = offset;
373+
return this;
374+
}
375+
}
376+
324377
/**
325378
* List Org Connections.
326379
*
@@ -330,7 +383,7 @@ public CompletableFuture<ApiResponse<Void>> deleteOrgConnectionsWithHttpInfoAsyn
330383
* @throws ApiException if fails to make API call
331384
*/
332385
public OrgConnectionListResponse listOrgConnections() throws ApiException {
333-
return listOrgConnectionsWithHttpInfo().getData();
386+
return listOrgConnectionsWithHttpInfo(new ListOrgConnectionsOptionalParameters()).getData();
334387
}
335388

336389
/**
@@ -341,7 +394,38 @@ public OrgConnectionListResponse listOrgConnections() throws ApiException {
341394
* @return CompletableFuture&lt;OrgConnectionListResponse&gt;
342395
*/
343396
public CompletableFuture<OrgConnectionListResponse> listOrgConnectionsAsync() {
344-
return listOrgConnectionsWithHttpInfoAsync()
397+
return listOrgConnectionsWithHttpInfoAsync(new ListOrgConnectionsOptionalParameters())
398+
.thenApply(
399+
response -> {
400+
return response.getData();
401+
});
402+
}
403+
404+
/**
405+
* List Org Connections.
406+
*
407+
* <p>See {@link #listOrgConnectionsWithHttpInfo}.
408+
*
409+
* @param parameters Optional parameters for the request.
410+
* @return OrgConnectionListResponse
411+
* @throws ApiException if fails to make API call
412+
*/
413+
public OrgConnectionListResponse listOrgConnections(
414+
ListOrgConnectionsOptionalParameters parameters) throws ApiException {
415+
return listOrgConnectionsWithHttpInfo(parameters).getData();
416+
}
417+
418+
/**
419+
* List Org Connections.
420+
*
421+
* <p>See {@link #listOrgConnectionsWithHttpInfoAsync}.
422+
*
423+
* @param parameters Optional parameters for the request.
424+
* @return CompletableFuture&lt;OrgConnectionListResponse&gt;
425+
*/
426+
public CompletableFuture<OrgConnectionListResponse> listOrgConnectionsAsync(
427+
ListOrgConnectionsOptionalParameters parameters) {
428+
return listOrgConnectionsWithHttpInfoAsync(parameters)
345429
.thenApply(
346430
response -> {
347431
return response.getData();
@@ -351,6 +435,7 @@ public CompletableFuture<OrgConnectionListResponse> listOrgConnectionsAsync() {
351435
/**
352436
* Returns a list of org connections.
353437
*
438+
* @param parameters Optional parameters for the request.
354439
* @return ApiResponse&lt;OrgConnectionListResponse&gt;
355440
* @throws ApiException if fails to make API call
356441
* @http.response.details
@@ -363,19 +448,29 @@ public CompletableFuture<OrgConnectionListResponse> listOrgConnectionsAsync() {
363448
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
364449
* </table>
365450
*/
366-
public ApiResponse<OrgConnectionListResponse> listOrgConnectionsWithHttpInfo()
367-
throws ApiException {
451+
public ApiResponse<OrgConnectionListResponse> listOrgConnectionsWithHttpInfo(
452+
ListOrgConnectionsOptionalParameters parameters) throws ApiException {
368453
Object localVarPostBody = null;
454+
String sinkOrgId = parameters.sinkOrgId;
455+
String sourceOrgId = parameters.sourceOrgId;
456+
Long limit = parameters.limit;
457+
Long offset = parameters.offset;
369458
// create path and map variables
370459
String localVarPath = "/api/v2/org_connections";
371460

461+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
372462
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
373463

464+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sink_org_id", sinkOrgId));
465+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "source_org_id", sourceOrgId));
466+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
467+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
468+
374469
Invocation.Builder builder =
375470
apiClient.createBuilder(
376471
"v2.OrgConnectionsApi.listOrgConnections",
377472
localVarPath,
378-
new ArrayList<Pair>(),
473+
localVarQueryParams,
379474
localVarHeaderParams,
380475
new HashMap<String, String>(),
381476
new String[] {"application/json"},
@@ -396,23 +491,34 @@ public ApiResponse<OrgConnectionListResponse> listOrgConnectionsWithHttpInfo()
396491
*
397492
* <p>See {@link #listOrgConnectionsWithHttpInfo}.
398493
*
494+
* @param parameters Optional parameters for the request.
399495
* @return CompletableFuture&lt;ApiResponse&lt;OrgConnectionListResponse&gt;&gt;
400496
*/
401497
public CompletableFuture<ApiResponse<OrgConnectionListResponse>>
402-
listOrgConnectionsWithHttpInfoAsync() {
498+
listOrgConnectionsWithHttpInfoAsync(ListOrgConnectionsOptionalParameters parameters) {
403499
Object localVarPostBody = null;
500+
String sinkOrgId = parameters.sinkOrgId;
501+
String sourceOrgId = parameters.sourceOrgId;
502+
Long limit = parameters.limit;
503+
Long offset = parameters.offset;
404504
// create path and map variables
405505
String localVarPath = "/api/v2/org_connections";
406506

507+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
407508
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
408509

510+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sink_org_id", sinkOrgId));
511+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "source_org_id", sourceOrgId));
512+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
513+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
514+
409515
Invocation.Builder builder;
410516
try {
411517
builder =
412518
apiClient.createBuilder(
413519
"v2.OrgConnectionsApi.listOrgConnections",
414520
localVarPath,
415-
new ArrayList<Pair>(),
521+
localVarQueryParams,
416522
localVarHeaderParams,
417523
new HashMap<String, String>(),
418524
new String[] {"application/json"},

0 commit comments

Comments
 (0)