@@ -10,6 +10,43 @@ use reqwest::header::{HeaderMap, HeaderValue};
1010use serde:: { Deserialize , Serialize } ;
1111use std:: io:: Write ;
1212
13+ /// ListOrgConnectionsOptionalParams is a struct for passing parameters to the method [`OrgConnectionsAPI::list_org_connections`]
14+ #[ non_exhaustive]
15+ #[ derive( Clone , Default , Debug ) ]
16+ pub struct ListOrgConnectionsOptionalParams {
17+ /// The Org ID of the sink org.
18+ pub sink_org_id : Option < String > ,
19+ /// The Org ID of the source org.
20+ pub source_org_id : Option < String > ,
21+ /// The limit of number of entries you want to return. Default is 1000.
22+ pub limit : Option < i64 > ,
23+ /// The pagination offset which you want to query from. Default is 0.
24+ pub offset : Option < i64 > ,
25+ }
26+
27+ impl ListOrgConnectionsOptionalParams {
28+ /// The Org ID of the sink org.
29+ pub fn sink_org_id ( mut self , value : String ) -> Self {
30+ self . sink_org_id = Some ( value) ;
31+ self
32+ }
33+ /// The Org ID of the source org.
34+ pub fn source_org_id ( mut self , value : String ) -> Self {
35+ self . source_org_id = Some ( value) ;
36+ self
37+ }
38+ /// The limit of number of entries you want to return. Default is 1000.
39+ pub fn limit ( mut self , value : i64 ) -> Self {
40+ self . limit = Some ( value) ;
41+ self
42+ }
43+ /// The pagination offset which you want to query from. Default is 0.
44+ pub fn offset ( mut self , value : i64 ) -> Self {
45+ self . offset = Some ( value) ;
46+ self
47+ }
48+ }
49+
1350/// CreateOrgConnectionsError is a struct for typed errors of method [`OrgConnectionsAPI::create_org_connections`]
1451#[ derive( Debug , Clone , Serialize , Deserialize ) ]
1552#[ serde( untagged) ]
@@ -355,11 +392,12 @@ impl OrgConnectionsAPI {
355392 /// Returns a list of org connections.
356393 pub async fn list_org_connections (
357394 & self ,
395+ params : ListOrgConnectionsOptionalParams ,
358396 ) -> Result <
359397 crate :: datadogV2:: model:: OrgConnectionListResponse ,
360398 datadog:: Error < ListOrgConnectionsError > ,
361399 > {
362- match self . list_org_connections_with_http_info ( ) . await {
400+ match self . list_org_connections_with_http_info ( params ) . await {
363401 Ok ( response_content) => {
364402 if let Some ( e) = response_content. entity {
365403 Ok ( e)
@@ -376,13 +414,20 @@ impl OrgConnectionsAPI {
376414 /// Returns a list of org connections.
377415 pub async fn list_org_connections_with_http_info (
378416 & self ,
417+ params : ListOrgConnectionsOptionalParams ,
379418 ) -> Result <
380419 datadog:: ResponseContent < crate :: datadogV2:: model:: OrgConnectionListResponse > ,
381420 datadog:: Error < ListOrgConnectionsError > ,
382421 > {
383422 let local_configuration = & self . config ;
384423 let operation_id = "v2.list_org_connections" ;
385424
425+ // unbox and build optional parameters
426+ let sink_org_id = params. sink_org_id ;
427+ let source_org_id = params. source_org_id ;
428+ let limit = params. limit ;
429+ let offset = params. offset ;
430+
386431 let local_client = & self . client ;
387432
388433 let local_uri_str = format ! (
@@ -392,6 +437,23 @@ impl OrgConnectionsAPI {
392437 let mut local_req_builder =
393438 local_client. request ( reqwest:: Method :: GET , local_uri_str. as_str ( ) ) ;
394439
440+ if let Some ( ref local_query_param) = sink_org_id {
441+ local_req_builder =
442+ local_req_builder. query ( & [ ( "sink_org_id" , & local_query_param. to_string ( ) ) ] ) ;
443+ } ;
444+ if let Some ( ref local_query_param) = source_org_id {
445+ local_req_builder =
446+ local_req_builder. query ( & [ ( "source_org_id" , & local_query_param. to_string ( ) ) ] ) ;
447+ } ;
448+ if let Some ( ref local_query_param) = limit {
449+ local_req_builder =
450+ local_req_builder. query ( & [ ( "limit" , & local_query_param. to_string ( ) ) ] ) ;
451+ } ;
452+ if let Some ( ref local_query_param) = offset {
453+ local_req_builder =
454+ local_req_builder. query ( & [ ( "offset" , & local_query_param. to_string ( ) ) ] ) ;
455+ } ;
456+
395457 // build headers
396458 let mut headers = HeaderMap :: new ( ) ;
397459 headers. insert ( "Accept" , HeaderValue :: from_static ( "application/json" ) ) ;
0 commit comments