@@ -10,6 +10,22 @@ use reqwest::header::{HeaderMap, HeaderValue};
10
10
use serde:: { Deserialize , Serialize } ;
11
11
use std:: io:: Write ;
12
12
13
+ /// GetInterfacesOptionalParams is a struct for passing parameters to the method [`NetworkDeviceMonitoringAPI::get_interfaces`]
14
+ #[ non_exhaustive]
15
+ #[ derive( Clone , Default , Debug ) ]
16
+ pub struct GetInterfacesOptionalParams {
17
+ /// Whether to get the IP addresses of the interfaces.
18
+ pub get_ip_addresses : Option < bool > ,
19
+ }
20
+
21
+ impl GetInterfacesOptionalParams {
22
+ /// Whether to get the IP addresses of the interfaces.
23
+ pub fn get_ip_addresses ( mut self , value : bool ) -> Self {
24
+ self . get_ip_addresses = Some ( value) ;
25
+ self
26
+ }
27
+ }
28
+
13
29
/// ListDevicesOptionalParams is a struct for passing parameters to the method [`NetworkDeviceMonitoringAPI::list_devices`]
14
30
#[ non_exhaustive]
15
31
#[ derive( Clone , Default , Debug ) ]
@@ -260,9 +276,10 @@ impl NetworkDeviceMonitoringAPI {
260
276
pub async fn get_interfaces (
261
277
& self ,
262
278
device_id : String ,
279
+ params : GetInterfacesOptionalParams ,
263
280
) -> Result < crate :: datadogV2:: model:: GetInterfacesResponse , datadog:: Error < GetInterfacesError > >
264
281
{
265
- match self . get_interfaces_with_http_info ( device_id) . await {
282
+ match self . get_interfaces_with_http_info ( device_id, params ) . await {
266
283
Ok ( response_content) => {
267
284
if let Some ( e) = response_content. entity {
268
285
Ok ( e)
@@ -280,13 +297,17 @@ impl NetworkDeviceMonitoringAPI {
280
297
pub async fn get_interfaces_with_http_info (
281
298
& self ,
282
299
device_id : String ,
300
+ params : GetInterfacesOptionalParams ,
283
301
) -> Result <
284
302
datadog:: ResponseContent < crate :: datadogV2:: model:: GetInterfacesResponse > ,
285
303
datadog:: Error < GetInterfacesError > ,
286
304
> {
287
305
let local_configuration = & self . config ;
288
306
let operation_id = "v2.get_interfaces" ;
289
307
308
+ // unbox and build optional parameters
309
+ let get_ip_addresses = params. get_ip_addresses ;
310
+
290
311
let local_client = & self . client ;
291
312
292
313
let local_uri_str = format ! (
@@ -297,6 +318,10 @@ impl NetworkDeviceMonitoringAPI {
297
318
local_client. request ( reqwest:: Method :: GET , local_uri_str. as_str ( ) ) ;
298
319
299
320
local_req_builder = local_req_builder. query ( & [ ( "device_id" , & device_id. to_string ( ) ) ] ) ;
321
+ if let Some ( ref local_query_param) = get_ip_addresses {
322
+ local_req_builder =
323
+ local_req_builder. query ( & [ ( "get_ip_addresses" , & local_query_param. to_string ( ) ) ] ) ;
324
+ } ;
300
325
301
326
// build headers
302
327
let mut headers = HeaderMap :: new ( ) ;
0 commit comments