diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index 7d0e744fc..012a76b02 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -109,10 +109,11 @@ impl {{ structName }} { {{ operation.description | block_comment }} {%- endif %} pub async fn {{operation.operationId | snake_case}}_with_http_info(&self{% for name, parameter in requiredParams %}, {{name|variable_name}}: {{ get_type_for_parameter(parameter, version) }}{% endfor %}{% if operation|has_optional_parameter %}, params: {{operation.operationId}}OptionalParams{% endif %}) -> Result, Error<{{operation.operationId}}Error>> { + let local_configuration = &self.config; + let operation_id = "{{ version }}.{{ operation.operationId | snake_case }}"; {%- if "x-unstable" in operation %} - let operation_id = "{{ version }}.{{ operation.operationId | snake_case }}".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation '{{ version }}.{{ operation.operationId | snake_case }}' is not enabled".to_string(), @@ -121,8 +122,6 @@ impl {{ structName }} { } {%- endif %} - let local_configuration = &self.config; - {% for name, parameter in operation|parameters if parameter.required != true %} {%- if loop.first %} // unbox and build optional parameters @@ -133,8 +132,8 @@ impl {{ structName }} { let local_client = &local_configuration.client; let local_uri_str = format!( - "{}{{path}}", - local_configuration.base_path + "{}{{path}}", + local_configuration.get_operation_host(operation_id) {%- for name, parameter in operation|parameters if parameter.in == "path" %}, {{ name|variable_name }}= {%- if parameter.schema.type == "string" %} urlencode({{ name|variable_name }}{% if not parameter.required %}.unwrap(){% elif parameter.schema.nullable %}.unwrap(){% endif %}{% if parameter.schema.type == "array" %}.join(",").as_ref(){% endif %}) @@ -172,9 +171,7 @@ impl {{ structName }} { {%- endfor %} // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header(reqwest::header::USER_AGENT, local_configuration.user_agent.clone()); // build auth {%- set authMethods = operation.security if "security" in operation else openapi.security %} @@ -183,8 +180,8 @@ impl {{ structName }} { {%- for name in authMethod %} {%- set schema = openapi.components.securitySchemes[name] %} {%- if schema.type == "apiKey" and schema.in != "cookie" %} - if let Some(ref local_apikey) = local_configuration.{{name|variable_name}} { - local_req_builder = local_req_builder.header("{{schema.name}}", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("{{ name }}") { + local_req_builder = local_req_builder.header("{{schema.name}}", &local_key.key); }; {%- endif %} {%- endfor %} diff --git a/.generator/src/generator/templates/configuration.j2 b/.generator/src/generator/templates/configuration.j2 index d12ecbf05..d21d20852 100644 --- a/.generator/src/generator/templates/configuration.j2 +++ b/.generator/src/generator/templates/configuration.j2 @@ -1,30 +1,87 @@ {% include "partial_header.j2" %} +use lazy_static::lazy_static; use std::env; use std::collections::HashMap; use log::warn; #[derive(Debug, Clone)] -pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest_middleware::ClientWithMiddleware, - {%- set authMethods = openapi.security %} - {%- if authMethods %} - {%- for authMethod in authMethods %} - {%- for name in authMethod %} - {%- set schema = openapi.components.securitySchemes[name] %} - {%- if schema.type == "apiKey" and schema.in != "cookie" %} - pub {{name|variable_name}}: Option, - {%- endif %} - {%- endfor %} - {%- endfor %} - {%- endif %} - unstable_operations: HashMap, +pub struct ServerVariable { + pub description: String, + pub default_value: String, + pub enum_values: Vec, +} + +#[derive(Debug, Clone)] +pub struct ServerConfiguration { + pub url: String, + pub description: String, + pub variables: HashMap, +} + +impl ServerConfiguration { + pub fn get_url(&self, variables: &HashMap) -> String { + let mut url = self.url.clone(); + for (name, variable) in &self.variables { + let value = variables.get(name).unwrap_or(&variable.default_value); + if !variable.enum_values.contains(value) && !variable.enum_values.is_empty() { + panic!("Value {value} for variable {name} is not in the enum values"); + } + url = url.replace(&format!("{{ '{{{name}}}' }}"), &value); + } + url + } +} + +#[derive(Debug, Clone)] +pub struct APIKey { + pub key: String, + pub prefix: String, } +#[non_exhaustive] +#[derive(Debug, Clone)] +pub struct Configuration { + pub(crate) user_agent: String, + pub(crate) client: reqwest_middleware::ClientWithMiddleware, + pub(crate) unstable_operations: HashMap, + pub(crate) auth_keys: HashMap, + pub server_index: usize, + pub server_variables: HashMap, + pub server_operation_index: HashMap, + pub server_operation_variables: HashMap>, +} + impl Configuration { - pub fn new() -> Configuration { - Configuration::default() + pub fn new() -> Self { + Self::default() + } + + pub fn client(&mut self, client: reqwest_middleware::ClientWithMiddleware) { + self.client = client; + } + + pub fn get_operation_host(&self, operation_str: &str) -> String { + let operation = operation_str.to_string(); + if let Some(servers) = OPERATION_SERVERS.get(&operation) { + let server_index = self + .server_operation_index + .get(&operation) + .cloned() + .unwrap_or(0); + return servers + .get(server_index) + .expect(&format!("Server index for operation {operation} not found")) + .get_url( + &self + .server_operation_variables + .get(&operation) + .unwrap_or(&HashMap::new()), + ); + } + SERVERS + .get(self.server_index) + .expect("Server index not found.") + .get_url(&self.server_variables) } pub fn set_unstable_operation_enabled(&mut self, operation: &str, enabled: bool) -> bool { @@ -33,11 +90,7 @@ impl Configuration { return true; } - warn!( - "Operation {} is not an unstable operation, can't enable/disable", - operation - ); - + warn!("Operation {operation} is not an unstable operation, can't enable/disable"); false } @@ -46,11 +99,7 @@ impl Configuration { return self.unstable_operations.get(operation).unwrap().clone(); } - warn!( - "Operation {} is not an unstable operation, is always enabled", - operation - ); - + warn!("Operation {operation} is not an unstable operation, is always enabled"); false } @@ -61,11 +110,22 @@ impl Configuration { false } + + pub fn set_auth_key(&mut self, operation_str: &str, api_key: APIKey) { + self.auth_keys.insert(operation_str.to_string(), api_key); + } } impl Default for Configuration { fn default() -> Self { let http_client = reqwest_middleware::ClientBuilder::new(reqwest::Client::new()); + let user_agent = format!( + "datadog-api-client-rust/{} (rust {}; os {}; arch {})", + option_env!("CARGO_PKG_VERSION").unwrap_or("?"), + option_env!("DD_RUSTC_VERSION").unwrap_or("?"), + env::consts::OS, + env::consts::ARCH, + ); let unstable_operations = HashMap::from([ {%- for version, api in apis.items() %} {%- for operations in api.values() %} @@ -77,29 +137,89 @@ impl Default for Configuration { {%- endfor %} {%- endfor %} ]); + let mut auth_keys: HashMap = HashMap::new(); + {%- set authMethods = openapi.security %} + {%- if authMethods %} + {%- for authMethod in authMethods %} + {%- for name in authMethod %} + {%- set schema = openapi.components.securitySchemes[name] %} + {%- if schema.type == "apiKey" and schema.in != "cookie" %} + auth_keys.insert( + "{{ name }}".to_owned(), + APIKey { + key: env::var("{{ schema.get("x-env-name") }}").unwrap_or_default(), + prefix: "".to_owned(), + }, + ); + {%- endif %} + {%- endfor %} + {%- endfor %} + {%- endif %} - Configuration { - base_path: "https://api.datadoghq.com".to_owned(), - user_agent: Some(format!( - "datadog-api-client-rust/{} (rust {}; os {}; arch {})", - option_env!("CARGO_PKG_VERSION").unwrap_or("?"), - option_env!("DD_RUSTC_VERSION").unwrap_or("?"), - env::consts::OS, - env::consts::ARCH, - )), + Self { + user_agent, client: http_client.build(), - {%- set authMethods = openapi.security %} - {%- if authMethods %} - {%- for authMethod in authMethods %} - {%- for name in authMethod %} - {%- set schema = openapi.components.securitySchemes[name] %} - {%- if schema.type == "apiKey" and schema.in != "cookie" %} - {{name|variable_name}}: env::var("{{ schema.get("x-env-name") }}").ok(), - {%- endif %} - {%- endfor %} - {%- endfor %} - {%- endif %} unstable_operations, + auth_keys, + server_index: 0, + server_variables: HashMap::new(), + server_operation_index: HashMap::new(), + server_operation_variables: HashMap::new(), } } } + +{%- macro server_configuration(server) -%} +ServerConfiguration { + url: "{{ server.url }}".into(), + description: "{{ server.description|default("No description provided") }}".into(), + variables: HashMap::from([ + {%- for name, variable in server.get("variables", {}).items() %} + ( + "{{ name }}".into(), + ServerVariable { + description: "{{ variable.description|default("No description provided") }}".into(), + default_value: "{{ variable.default }}".into(), + enum_values: vec![ + {%- for value in variable.enum %} + "{{ value }}".into(), + {%- endfor %} + ], + }, + ), + {%- endfor %} + ]), +}, +{%- endmacro %} + +lazy_static! { + static ref SERVERS: Vec = { + vec![ + {%- for server in openapi.servers %} + {{ server_configuration(server) }} + {%- endfor %} + ] + }; + static ref OPERATION_SERVERS: HashMap> = { + HashMap::from([ + {%- for version, spec in all_specs.items() %} + {%- for path in spec.paths.values() %} + {%- for operation in path.values() %} + {%- for server in operation.servers %} + {% if loop.first %} + ( + "{{ version }}.{{ operation.operationId | snake_case }}".into(), + vec![ + {%- endif %} + {{ server_configuration(server) }} + {%- if loop.last %} + ], + ), + {%- endif %} + {%- endfor %} + {%- endfor %} + {%- endfor %} + {%- endfor %} + ]) + }; +} diff --git a/.generator/src/generator/templates/function_mappings.j2 b/.generator/src/generator/templates/function_mappings.j2 index ece5429f5..1e7d08d8a 100644 --- a/.generator/src/generator/templates/function_mappings.j2 +++ b/.generator/src/generator/templates/function_mappings.j2 @@ -90,7 +90,7 @@ fn test_{{version}}_{{ operation['operationId'] | snake_case }}(world: &mut Data world.response.object = serde_json::to_value(entity).unwrap(); } }, - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; diff --git a/Cargo.toml b/Cargo.toml index 8a159a609..af7ea2e78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ license = "Apache-2.0" edition = "2021" [dependencies] +lazy_static = "1.4.0" log = "0.4.20" reqwest = { version = "^0.11", features = ["multipart"] } reqwest-middleware = "0.1.6" @@ -30,7 +31,6 @@ rvcr = { git = "https://github.com/nkzou/rvcr.git", rev = "b8f84bc0dfacd539fdc6f vcr-cassette = "^2.0" sha256 = "1.4.0" tokio = { version = "1.10", features = ["macros", "rt-multi-thread", "time"] } -lazy_static = "1.4.0" minijinja = "1.0.10" convert_case = "0.6.0" diff --git a/src/datadog/configuration.rs b/src/datadog/configuration.rs index 5ddbb4d58..a01e3c3c2 100644 --- a/src/datadog/configuration.rs +++ b/src/datadog/configuration.rs @@ -1,23 +1,89 @@ // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. +use lazy_static::lazy_static; use log::warn; use std::collections::HashMap; use std::env; +#[derive(Debug, Clone)] +pub struct ServerVariable { + pub description: String, + pub default_value: String, + pub enum_values: Vec, +} + +#[derive(Debug, Clone)] +pub struct ServerConfiguration { + pub url: String, + pub description: String, + pub variables: HashMap, +} + +impl ServerConfiguration { + pub fn get_url(&self, variables: &HashMap) -> String { + let mut url = self.url.clone(); + for (name, variable) in &self.variables { + let value = variables.get(name).unwrap_or(&variable.default_value); + if !variable.enum_values.contains(value) && !variable.enum_values.is_empty() { + panic!("Value {value} for variable {name} is not in the enum values"); + } + url = url.replace(&format!("{{{name}}}"), &value); + } + url + } +} + +#[derive(Debug, Clone)] +pub struct APIKey { + pub key: String, + pub prefix: String, +} + +#[non_exhaustive] #[derive(Debug, Clone)] pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest_middleware::ClientWithMiddleware, - pub api_key_auth: Option, - pub app_key_auth: Option, - unstable_operations: HashMap, + pub(crate) user_agent: String, + pub(crate) client: reqwest_middleware::ClientWithMiddleware, + pub(crate) unstable_operations: HashMap, + pub(crate) auth_keys: HashMap, + pub server_index: usize, + pub server_variables: HashMap, + pub server_operation_index: HashMap, + pub server_operation_variables: HashMap>, } impl Configuration { - pub fn new() -> Configuration { - Configuration::default() + pub fn new() -> Self { + Self::default() + } + + pub fn client(&mut self, client: reqwest_middleware::ClientWithMiddleware) { + self.client = client; + } + + pub fn get_operation_host(&self, operation_str: &str) -> String { + let operation = operation_str.to_string(); + if let Some(servers) = OPERATION_SERVERS.get(&operation) { + let server_index = self + .server_operation_index + .get(&operation) + .cloned() + .unwrap_or(0); + return servers + .get(server_index) + .expect(&format!("Server index for operation {operation} not found")) + .get_url( + &self + .server_operation_variables + .get(&operation) + .unwrap_or(&HashMap::new()), + ); + } + SERVERS + .get(self.server_index) + .expect("Server index not found.") + .get_url(&self.server_variables) } pub fn set_unstable_operation_enabled(&mut self, operation: &str, enabled: bool) -> bool { @@ -27,11 +93,7 @@ impl Configuration { return true; } - warn!( - "Operation {} is not an unstable operation, can't enable/disable", - operation - ); - + warn!("Operation {operation} is not an unstable operation, can't enable/disable"); false } @@ -40,11 +102,7 @@ impl Configuration { return self.unstable_operations.get(operation).unwrap().clone(); } - warn!( - "Operation {} is not an unstable operation, is always enabled", - operation - ); - + warn!("Operation {operation} is not an unstable operation, is always enabled"); false } @@ -55,11 +113,22 @@ impl Configuration { false } + + pub fn set_auth_key(&mut self, operation_str: &str, api_key: APIKey) { + self.auth_keys.insert(operation_str.to_string(), api_key); + } } impl Default for Configuration { fn default() -> Self { let http_client = reqwest_middleware::ClientBuilder::new(reqwest::Client::new()); + let user_agent = format!( + "datadog-api-client-rust/{} (rust {}; os {}; arch {})", + option_env!("CARGO_PKG_VERSION").unwrap_or("?"), + option_env!("DD_RUSTC_VERSION").unwrap_or("?"), + env::consts::OS, + env::consts::ARCH, + ); let unstable_operations = HashMap::from([ ("v2.get_active_billing_dimensions".to_owned(), false), ("v2.get_monthly_cost_attribution".to_owned(), false), @@ -104,20 +173,339 @@ impl Default for Configuration { ("v2.list_incident_teams".to_owned(), false), ("v2.update_incident_team".to_owned(), false), ]); + let mut auth_keys: HashMap = HashMap::new(); + auth_keys.insert( + "apiKeyAuth".to_owned(), + APIKey { + key: env::var("DD_API_KEY").unwrap_or_default(), + prefix: "".to_owned(), + }, + ); + auth_keys.insert( + "appKeyAuth".to_owned(), + APIKey { + key: env::var("DD_APP_KEY").unwrap_or_default(), + prefix: "".to_owned(), + }, + ); - Configuration { - base_path: "https://api.datadoghq.com".to_owned(), - user_agent: Some(format!( - "datadog-api-client-rust/{} (rust {}; os {}; arch {})", - option_env!("CARGO_PKG_VERSION").unwrap_or("?"), - option_env!("DD_RUSTC_VERSION").unwrap_or("?"), - env::consts::OS, - env::consts::ARCH, - )), + Self { + user_agent, client: http_client.build(), - api_key_auth: env::var("DD_API_KEY").ok(), - app_key_auth: env::var("DD_APP_KEY").ok(), unstable_operations, + auth_keys, + server_index: 0, + server_variables: HashMap::new(), + server_operation_index: HashMap::new(), + server_operation_variables: HashMap::new(), } } } + +lazy_static! { + static ref SERVERS: Vec = { + vec![ + ServerConfiguration { + url: "https://{subdomain}.{site}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "site".into(), + ServerVariable { + description: "The regional site for Datadog customers.".into(), + default_value: "datadoghq.com".into(), + enum_values: vec![ + "datadoghq.com".into(), + "us3.datadoghq.com".into(), + "us5.datadoghq.com".into(), + "ap1.datadoghq.com".into(), + "datadoghq.eu".into(), + "ddog-gov.com".into(), + ], + }, + ), + ( + "subdomain".into(), + ServerVariable { + description: "The subdomain where the API is deployed.".into(), + default_value: "api".into(), + enum_values: vec![], + }, + ), + ]), + }, + ServerConfiguration { + url: "{protocol}://{name}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "name".into(), + ServerVariable { + description: "Full site DNS name.".into(), + default_value: "api.datadoghq.com".into(), + enum_values: vec![], + }, + ), + ( + "protocol".into(), + ServerVariable { + description: "The protocol for accessing the API.".into(), + default_value: "https".into(), + enum_values: vec![], + }, + ), + ]), + }, + ServerConfiguration { + url: "https://{subdomain}.{site}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "site".into(), + ServerVariable { + description: "Any Datadog deployment.".into(), + default_value: "datadoghq.com".into(), + enum_values: vec![], + }, + ), + ( + "subdomain".into(), + ServerVariable { + description: "The subdomain where the API is deployed.".into(), + default_value: "api".into(), + enum_values: vec![], + }, + ), + ]), + }, + ] + }; + static ref OPERATION_SERVERS: HashMap> = { + HashMap::from([ + ( + "v1.get_ip_ranges".into(), + vec![ + ServerConfiguration { + url: "https://{subdomain}.{site}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "site".into(), + ServerVariable { + description: "The regional site for Datadog customers.".into(), + default_value: "datadoghq.com".into(), + enum_values: vec![ + "datadoghq.com".into(), + "us3.datadoghq.com".into(), + "us5.datadoghq.com".into(), + "ap1.datadoghq.com".into(), + "datadoghq.eu".into(), + "ddog-gov.com".into(), + ], + }, + ), + ( + "subdomain".into(), + ServerVariable { + description: "The subdomain where the API is deployed.".into(), + default_value: "ip-ranges".into(), + enum_values: vec![], + }, + ), + ]), + }, + ServerConfiguration { + url: "{protocol}://{name}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "name".into(), + ServerVariable { + description: "Full site DNS name.".into(), + default_value: "ip-ranges.datadoghq.com".into(), + enum_values: vec![], + }, + ), + ( + "protocol".into(), + ServerVariable { + description: "The protocol for accessing the API.".into(), + default_value: "https".into(), + enum_values: vec![], + }, + ), + ]), + }, + ServerConfiguration { + url: "https://{subdomain}.datadoghq.com".into(), + description: "No description provided".into(), + variables: HashMap::from([( + "subdomain".into(), + ServerVariable { + description: "The subdomain where the API is deployed.".into(), + default_value: "ip-ranges".into(), + enum_values: vec![], + }, + )]), + }, + ], + ), + ( + "v1.submit_log".into(), + vec![ + ServerConfiguration { + url: "https://{subdomain}.{site}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "site".into(), + ServerVariable { + description: "The regional site for Datadog customers.".into(), + default_value: "datadoghq.com".into(), + enum_values: vec![ + "datadoghq.com".into(), + "us3.datadoghq.com".into(), + "us5.datadoghq.com".into(), + "ap1.datadoghq.com".into(), + "datadoghq.eu".into(), + "ddog-gov.com".into(), + ], + }, + ), + ( + "subdomain".into(), + ServerVariable { + description: "The subdomain where the API is deployed.".into(), + default_value: "http-intake.logs".into(), + enum_values: vec![], + }, + ), + ]), + }, + ServerConfiguration { + url: "{protocol}://{name}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "name".into(), + ServerVariable { + description: "Full site DNS name.".into(), + default_value: "http-intake.logs.datadoghq.com".into(), + enum_values: vec![], + }, + ), + ( + "protocol".into(), + ServerVariable { + description: "The protocol for accessing the API.".into(), + default_value: "https".into(), + enum_values: vec![], + }, + ), + ]), + }, + ServerConfiguration { + url: "https://{subdomain}.{site}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "site".into(), + ServerVariable { + description: "Any Datadog deployment.".into(), + default_value: "datadoghq.com".into(), + enum_values: vec![], + }, + ), + ( + "subdomain".into(), + ServerVariable { + description: "The subdomain where the API is deployed.".into(), + default_value: "http-intake.logs".into(), + enum_values: vec![], + }, + ), + ]), + }, + ], + ), + ( + "v2.submit_log".into(), + vec![ + ServerConfiguration { + url: "https://{subdomain}.{site}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "site".into(), + ServerVariable { + description: "The regional site for customers.".into(), + default_value: "datadoghq.com".into(), + enum_values: vec![ + "datadoghq.com".into(), + "us3.datadoghq.com".into(), + "us5.datadoghq.com".into(), + "ap1.datadoghq.com".into(), + "datadoghq.eu".into(), + "ddog-gov.com".into(), + ], + }, + ), + ( + "subdomain".into(), + ServerVariable { + description: "The subdomain where the API is deployed.".into(), + default_value: "http-intake.logs".into(), + enum_values: vec![], + }, + ), + ]), + }, + ServerConfiguration { + url: "{protocol}://{name}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "name".into(), + ServerVariable { + description: "Full site DNS name.".into(), + default_value: "http-intake.logs.datadoghq.com".into(), + enum_values: vec![], + }, + ), + ( + "protocol".into(), + ServerVariable { + description: "The protocol for accessing the API.".into(), + default_value: "https".into(), + enum_values: vec![], + }, + ), + ]), + }, + ServerConfiguration { + url: "https://{subdomain}.{site}".into(), + description: "No description provided".into(), + variables: HashMap::from([ + ( + "site".into(), + ServerVariable { + description: "Any Datadog deployment.".into(), + default_value: "datadoghq.com".into(), + enum_values: vec![], + }, + ), + ( + "subdomain".into(), + ServerVariable { + description: "The subdomain where the API is deployed.".into(), + default_value: "http-intake.logs".into(), + enum_values: vec![], + }, + ), + ]), + }, + ], + ), + ]) + }; +} diff --git a/src/datadogV1/api/api_authentication.rs b/src/datadogV1/api/api_authentication.rs index e54b83ccd..fd5277387 100644 --- a/src/datadogV1/api/api_authentication.rs +++ b/src/datadogV1/api/api_authentication.rs @@ -56,22 +56,26 @@ impl AuthenticationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.validate"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/validate", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/validate", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV1/api/api_aws_integration.rs b/src/datadogV1/api/api_aws_integration.rs index 482b0ed75..d1d44fbd5 100644 --- a/src/datadogV1/api/api_aws_integration.rs +++ b/src/datadogV1/api/api_aws_integration.rs @@ -241,25 +241,29 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_aws_account"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/aws", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/aws", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -321,28 +325,29 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_aws_event_bridge_source"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/event_bridge", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -401,28 +406,29 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_aws_tag_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/filtering", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -481,28 +487,29 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_new_aws_external_id"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/generate_new_external_id", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -561,25 +568,29 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_aws_account"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/aws", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/aws", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -641,28 +652,29 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_aws_event_bridge_source"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/event_bridge", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -721,28 +733,29 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_aws_tag_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/filtering", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -799,6 +812,7 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_aws_accounts"; // unbox and build optional parameters let account_id = params.account_id; @@ -807,7 +821,10 @@ impl AWSIntegrationAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/aws", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/aws", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -825,17 +842,17 @@ impl AWSIntegrationAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -885,28 +902,29 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_aws_event_bridge_sources"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/event_bridge", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -958,12 +976,13 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_aws_tag_filters"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/filtering", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -971,17 +990,17 @@ impl AWSIntegrationAPI { local_req_builder = local_req_builder.query(&[("account_id", &account_id.to_string())]); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1025,28 +1044,29 @@ impl AWSIntegrationAPI { &self, ) -> Result>, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_available_aws_namespaces"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/available_namespace_rules", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1099,6 +1119,7 @@ impl AWSIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_aws_account"; // unbox and build optional parameters let account_id = params.account_id; @@ -1107,7 +1128,10 @@ impl AWSIntegrationAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/aws", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/aws", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1125,17 +1149,17 @@ impl AWSIntegrationAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_aws_logs_integration.rs b/src/datadogV1/api/api_aws_logs_integration.rs index 31c31610f..a7075c60b 100644 --- a/src/datadogV1/api/api_aws_logs_integration.rs +++ b/src/datadogV1/api/api_aws_logs_integration.rs @@ -132,28 +132,29 @@ impl AWSLogsIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.check_aws_logs_lambda_async"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/logs/check_async", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -233,28 +234,29 @@ impl AWSLogsIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.check_aws_logs_services_async"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/logs/services_async", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -313,28 +315,29 @@ impl AWSLogsIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_aws_lambda_arn"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/logs", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -393,28 +396,29 @@ impl AWSLogsIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_aws_lambda_arn"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/logs", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -473,28 +477,29 @@ impl AWSLogsIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.enable_aws_log_services"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/logs/services", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -551,28 +556,29 @@ impl AWSLogsIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_aws_logs_integrations"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/logs", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -622,28 +628,29 @@ impl AWSLogsIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_aws_logs_services"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/aws/logs/services", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV1/api/api_azure_integration.rs b/src/datadogV1/api/api_azure_integration.rs index 5eeb5b1df..f9f18326a 100644 --- a/src/datadogV1/api/api_azure_integration.rs +++ b/src/datadogV1/api/api_azure_integration.rs @@ -111,25 +111,29 @@ impl AzureIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_azure_integration"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/azure", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/azure", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -188,25 +192,29 @@ impl AzureIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_azure_integration"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/azure", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/azure", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -261,25 +269,29 @@ impl AzureIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_azure_integration"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/azure", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/azure", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -331,28 +343,29 @@ impl AzureIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_azure_host_filters"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/azure/host_filters", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -415,25 +428,29 @@ impl AzureIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_azure_integration"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/azure", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/azure", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_dashboard_lists.rs b/src/datadogV1/api/api_dashboard_lists.rs index e0c21aee3..fe1f23b6a 100644 --- a/src/datadogV1/api/api_dashboard_lists.rs +++ b/src/datadogV1/api/api_dashboard_lists.rs @@ -97,28 +97,29 @@ impl DashboardListsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_dashboard_list"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -177,29 +178,30 @@ impl DashboardListsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_dashboard_list"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual/{list_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), list_id = list_id ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -246,29 +248,30 @@ impl DashboardListsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_dashboard_list"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual/{list_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), list_id = list_id ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -318,28 +321,29 @@ impl DashboardListsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_dashboard_lists"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -394,29 +398,30 @@ impl DashboardListsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_dashboard_list"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual/{list_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), list_id = list_id ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_dashboards.rs b/src/datadogV1/api/api_dashboards.rs index 6fa87b1b9..16c0f4d56 100644 --- a/src/datadogV1/api/api_dashboards.rs +++ b/src/datadogV1/api/api_dashboards.rs @@ -255,25 +255,29 @@ impl DashboardsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.create_dashboard"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/dashboard", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/dashboard", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -330,25 +334,29 @@ impl DashboardsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_public_dashboard"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/dashboard/public", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/dashboard/public", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -405,29 +413,30 @@ impl DashboardsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_dashboard"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/{dashboard_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), dashboard_id = urlencode(dashboard_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -473,25 +482,29 @@ impl DashboardsAPI { body: crate::datadogV1::model::DashboardBulkDeleteRequest, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_dashboards"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/dashboard", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/dashboard", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -548,29 +561,30 @@ impl DashboardsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_public_dashboard"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -621,29 +635,30 @@ impl DashboardsAPI { body: crate::datadogV1::model::SharedDashboardInvites, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_public_dashboard_invitation"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -694,29 +709,30 @@ impl DashboardsAPI { dashboard_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_dashboard"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/{dashboard_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), dashboard_id = urlencode(dashboard_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -765,29 +781,30 @@ impl DashboardsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_public_dashboard"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -844,6 +861,7 @@ impl DashboardsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_public_dashboard_invitations"; // unbox and build optional parameters let page_size = params.page_size; @@ -853,7 +871,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = @@ -869,17 +887,17 @@ impl DashboardsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -934,6 +952,7 @@ impl DashboardsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_dashboards"; // unbox and build optional parameters let filter_shared = params.filter_shared; @@ -943,7 +962,10 @@ impl DashboardsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/dashboard", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/dashboard", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -965,17 +987,17 @@ impl DashboardsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1021,25 +1043,29 @@ impl DashboardsAPI { body: crate::datadogV1::model::DashboardRestoreRequest, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.restore_dashboards"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/dashboard", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/dashboard", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1101,29 +1127,30 @@ impl DashboardsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.send_public_dashboard_invitation"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1182,29 +1209,30 @@ impl DashboardsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_dashboard"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/{dashboard_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), dashboard_id = urlencode(dashboard_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1266,29 +1294,30 @@ impl DashboardsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_public_dashboard"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_downtimes.rs b/src/datadogV1/api/api_downtimes.rs index 844c495ff..9665a3c8a 100644 --- a/src/datadogV1/api/api_downtimes.rs +++ b/src/datadogV1/api/api_downtimes.rs @@ -137,29 +137,30 @@ impl DowntimesAPI { downtime_id: i64, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.cancel_downtime"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), downtime_id = downtime_id ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -209,28 +210,29 @@ impl DowntimesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.cancel_downtimes_by_scope"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/downtime/cancel/by_scope", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -284,25 +286,29 @@ impl DowntimesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.create_downtime"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/downtime", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/downtime", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -355,29 +361,30 @@ impl DowntimesAPI { downtime_id: i64, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_downtime"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), downtime_id = downtime_id ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -423,6 +430,7 @@ impl DowntimesAPI { ) -> Result>, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_downtimes"; // unbox and build optional parameters let current_only = params.current_only; @@ -430,7 +438,10 @@ impl DowntimesAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/downtime", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/downtime", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -444,17 +455,17 @@ impl DowntimesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -504,29 +515,30 @@ impl DowntimesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_monitor_downtimes"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}/downtimes", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -575,29 +587,30 @@ impl DowntimesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_downtime"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), downtime_id = downtime_id ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_events.rs b/src/datadogV1/api/api_events.rs index a00030952..97a581a2b 100644 --- a/src/datadogV1/api/api_events.rs +++ b/src/datadogV1/api/api_events.rs @@ -136,22 +136,26 @@ impl EventsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_event"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/events", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/events", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters @@ -209,29 +213,30 @@ impl EventsAPI { event_id: i64, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_event"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/events/{event_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), event_id = event_id ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -297,6 +302,7 @@ impl EventsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_events"; // unbox and build optional parameters let priority = params.priority; @@ -308,7 +314,10 @@ impl EventsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/events", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/events", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -340,17 +349,17 @@ impl EventsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV1/api/api_gcp_integration.rs b/src/datadogV1/api/api_gcp_integration.rs index cd5863009..2b0eff2c1 100644 --- a/src/datadogV1/api/api_gcp_integration.rs +++ b/src/datadogV1/api/api_gcp_integration.rs @@ -89,25 +89,29 @@ impl GCPIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_gcp_integration"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/gcp", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/gcp", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -166,25 +170,29 @@ impl GCPIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_gcp_integration"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/gcp", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/gcp", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -239,25 +247,29 @@ impl GCPIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_gcp_integration"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/gcp", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/gcp", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -315,25 +327,29 @@ impl GCPIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_gcp_integration"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/integration/gcp", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/integration/gcp", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_hosts.rs b/src/datadogV1/api/api_hosts.rs index fc08f4015..b3166c914 100644 --- a/src/datadogV1/api/api_hosts.rs +++ b/src/datadogV1/api/api_hosts.rs @@ -167,13 +167,17 @@ impl HostsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_host_totals"; // unbox and build optional parameters let from = params.from; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/hosts/totals", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/hosts/totals", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -183,17 +187,17 @@ impl HostsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -246,6 +250,7 @@ impl HostsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_hosts"; // unbox and build optional parameters let filter = params.filter; @@ -259,7 +264,10 @@ impl HostsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/hosts", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/hosts", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -297,17 +305,17 @@ impl HostsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -355,29 +363,30 @@ impl HostsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.mute_host"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/host/{host_name}/mute", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -430,29 +439,30 @@ impl HostsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.unmute_host"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/host/{host_name}/unmute", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV1/api/api_ip_ranges.rs b/src/datadogV1/api/api_ip_ranges.rs index d3817a912..aa40a0a13 100644 --- a/src/datadogV1/api/api_ip_ranges.rs +++ b/src/datadogV1/api/api_ip_ranges.rs @@ -49,18 +49,19 @@ impl IPRangesAPI { &self, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_ip_ranges"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/", local_configuration.base_path); + let local_uri_str = format!("{}/", local_configuration.get_operation_host(operation_id)); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth diff --git a/src/datadogV1/api/api_key_management.rs b/src/datadogV1/api/api_key_management.rs index 660c4701b..5f3dcd8ab 100644 --- a/src/datadogV1/api/api_key_management.rs +++ b/src/datadogV1/api/api_key_management.rs @@ -147,25 +147,29 @@ impl KeyManagementAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.create_api_key"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/api_key", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/api_key", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -223,25 +227,29 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_application_key"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/application_key", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/application_key", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -295,29 +303,30 @@ impl KeyManagementAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_api_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/api_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -368,29 +377,30 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/application_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -437,29 +447,30 @@ impl KeyManagementAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_api_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/api_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -510,29 +521,30 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/application_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -577,25 +589,29 @@ impl KeyManagementAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_api_keys"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/api_key", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/api_key", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -644,25 +660,29 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_application_keys"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/application_key", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/application_key", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -711,29 +731,30 @@ impl KeyManagementAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_api_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/api_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -793,29 +814,30 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/application_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_logs.rs b/src/datadogV1/api/api_logs.rs index 7460e097e..9d728e179 100644 --- a/src/datadogV1/api/api_logs.rs +++ b/src/datadogV1/api/api_logs.rs @@ -105,25 +105,29 @@ impl LogsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_logs"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/logs-queries/list", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/logs-queries/list", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -217,6 +221,7 @@ impl LogsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.submit_log"; // unbox and build optional parameters let content_encoding = params.content_encoding; @@ -224,7 +229,10 @@ impl LogsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/v1/input", local_configuration.base_path); + let local_uri_str = format!( + "{}/v1/input", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -238,14 +246,14 @@ impl LogsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_logs_indexes.rs b/src/datadogV1/api/api_logs_indexes.rs index 829577013..c1c457e18 100644 --- a/src/datadogV1/api/api_logs_indexes.rs +++ b/src/datadogV1/api/api_logs_indexes.rs @@ -102,28 +102,29 @@ impl LogsIndexesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.create_logs_index"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/indexes", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -176,29 +177,30 @@ impl LogsIndexesAPI { name: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_logs_index"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/indexes/{name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), name = urlencode(name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -245,28 +247,29 @@ impl LogsIndexesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_logs_index_order"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/index-order", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -316,28 +319,29 @@ impl LogsIndexesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_log_indexes"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/indexes", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -394,29 +398,30 @@ impl LogsIndexesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_logs_index"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/indexes/{name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), name = urlencode(name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -475,28 +480,29 @@ impl LogsIndexesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_logs_index_order"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/index-order", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_logs_pipelines.rs b/src/datadogV1/api/api_logs_pipelines.rs index 9408c0b6c..3b7dffff5 100644 --- a/src/datadogV1/api/api_logs_pipelines.rs +++ b/src/datadogV1/api/api_logs_pipelines.rs @@ -115,28 +115,29 @@ impl LogsPipelinesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_logs_pipeline"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/pipelines", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -191,29 +192,30 @@ impl LogsPipelinesAPI { pipeline_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_logs_pipeline"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/pipelines/{pipeline_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), pipeline_id = urlencode(pipeline_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -260,29 +262,30 @@ impl LogsPipelinesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_logs_pipeline"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/pipelines/{pipeline_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), pipeline_id = urlencode(pipeline_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -332,28 +335,29 @@ impl LogsPipelinesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_logs_pipeline_order"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/pipeline-order", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -403,28 +407,29 @@ impl LogsPipelinesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_logs_pipelines"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/pipelines", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -484,29 +489,30 @@ impl LogsPipelinesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_logs_pipeline"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/pipelines/{pipeline_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), pipeline_id = urlencode(pipeline_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -573,28 +579,29 @@ impl LogsPipelinesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_logs_pipeline_order"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/logs/config/pipeline-order", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_metrics.rs b/src/datadogV1/api/api_metrics.rs index dd3ed8d5f..a8f903df3 100644 --- a/src/datadogV1/api/api_metrics.rs +++ b/src/datadogV1/api/api_metrics.rs @@ -187,29 +187,30 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_metric_metadata"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/metrics/{metric_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -261,6 +262,7 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_active_metrics"; // unbox and build optional parameters let host = params.host; @@ -268,7 +270,10 @@ impl MetricsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/metrics", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/metrics", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -283,17 +288,17 @@ impl MetricsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -343,27 +348,31 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_metrics"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/search", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/search", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); local_req_builder = local_req_builder.query(&[("q", &q.to_string())]); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -416,10 +425,14 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.query_metrics"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/query", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/query", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -428,17 +441,17 @@ impl MetricsAPI { local_req_builder = local_req_builder.query(&[("query", &query.to_string())]); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -494,6 +507,7 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.submit_distribution_points"; // unbox and build optional parameters let content_encoding = params.content_encoding; @@ -502,7 +516,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v1/distribution_points", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -512,14 +526,14 @@ impl MetricsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters @@ -598,13 +612,17 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.submit_metrics"; // unbox and build optional parameters let content_encoding = params.content_encoding; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/series", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/series", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -613,14 +631,14 @@ impl MetricsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters @@ -682,29 +700,30 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_metric_metadata"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/metrics/{metric_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_monitors.rs b/src/datadogV1/api/api_monitors.rs index f4487b883..bd02f7f8c 100644 --- a/src/datadogV1/api/api_monitors.rs +++ b/src/datadogV1/api/api_monitors.rs @@ -386,12 +386,13 @@ impl MonitorsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.check_can_delete_monitor"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/monitor/can_delete", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -407,17 +408,17 @@ impl MonitorsAPI { )]); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -825,25 +826,29 @@ impl MonitorsAPI { body: crate::datadogV1::model::Monitor, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.create_monitor"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/monitor", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/monitor", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -899,6 +904,7 @@ impl MonitorsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_monitor"; // unbox and build optional parameters let force = params.force; @@ -907,7 +913,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = @@ -919,17 +925,17 @@ impl MonitorsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -977,6 +983,7 @@ impl MonitorsAPI { params: GetMonitorOptionalParams, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_monitor"; // unbox and build optional parameters let group_states = params.group_states; @@ -986,7 +993,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = @@ -1002,17 +1009,17 @@ impl MonitorsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1058,6 +1065,7 @@ impl MonitorsAPI { ) -> Result>, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_monitors"; // unbox and build optional parameters let group_states = params.group_states; @@ -1071,7 +1079,10 @@ impl MonitorsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/monitor", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/monitor", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1109,17 +1120,17 @@ impl MonitorsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1170,6 +1181,7 @@ impl MonitorsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.search_monitor_groups"; // unbox and build optional parameters let query = params.query; @@ -1181,7 +1193,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/groups/search", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1204,17 +1216,17 @@ impl MonitorsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1264,6 +1276,7 @@ impl MonitorsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.search_monitors"; // unbox and build optional parameters let query = params.query; @@ -1273,7 +1286,10 @@ impl MonitorsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/monitor/search", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/monitor/search", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1295,17 +1311,17 @@ impl MonitorsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1353,29 +1369,30 @@ impl MonitorsAPI { body: crate::datadogV1::model::MonitorUpdateRequest, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_monitor"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1439,29 +1456,30 @@ impl MonitorsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.validate_existing_monitor"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}/validate", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1524,25 +1542,29 @@ impl MonitorsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.validate_monitor"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/monitor/validate", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/monitor/validate", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_notebooks.rs b/src/datadogV1/api/api_notebooks.rs index 479dafc90..c1004046c 100644 --- a/src/datadogV1/api/api_notebooks.rs +++ b/src/datadogV1/api/api_notebooks.rs @@ -179,25 +179,29 @@ impl NotebooksAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_notebook"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/notebooks", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/notebooks", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -250,29 +254,30 @@ impl NotebooksAPI { notebook_id: i64, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_notebook"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/notebooks/{notebook_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), notebook_id = notebook_id ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -317,29 +322,30 @@ impl NotebooksAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_notebook"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/notebooks/{notebook_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), notebook_id = notebook_id ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -389,6 +395,7 @@ impl NotebooksAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_notebooks"; // unbox and build optional parameters let author_handle = params.author_handle; @@ -404,7 +411,10 @@ impl NotebooksAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/notebooks", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/notebooks", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -450,17 +460,17 @@ impl NotebooksAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -511,29 +521,30 @@ impl NotebooksAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_notebook"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/notebooks/{notebook_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), notebook_id = notebook_id ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_organizations.rs b/src/datadogV1/api/api_organizations.rs index 689dc05b0..000f1a251 100644 --- a/src/datadogV1/api/api_organizations.rs +++ b/src/datadogV1/api/api_organizations.rs @@ -127,25 +127,29 @@ impl OrganizationsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_child_org"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/org", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/org", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -202,29 +206,30 @@ impl OrganizationsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.downgrade_org"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/org/{public_id}/downgrade", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -270,29 +275,30 @@ impl OrganizationsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_org"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/org/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -339,25 +345,29 @@ impl OrganizationsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_orgs"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/org", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/org", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -405,29 +415,30 @@ impl OrganizationsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_org"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/org/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -495,29 +506,30 @@ impl OrganizationsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.upload_idp_for_org"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/org/{public_id}/idp_metadata", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build form parameters diff --git a/src/datadogV1/api/api_pager_duty_integration.rs b/src/datadogV1/api/api_pager_duty_integration.rs index 02402dc84..a641fb774 100644 --- a/src/datadogV1/api/api_pager_duty_integration.rs +++ b/src/datadogV1/api/api_pager_duty_integration.rs @@ -93,28 +93,29 @@ impl PagerDutyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_pager_duty_integration_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -170,29 +171,30 @@ impl PagerDutyIntegrationAPI { service_name: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_pager_duty_integration_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -245,29 +247,30 @@ impl PagerDutyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_pager_duty_integration_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -318,29 +321,30 @@ impl PagerDutyIntegrationAPI { body: crate::datadogV1::model::PagerDutyServiceKey, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_pager_duty_integration_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_security_monitoring.rs b/src/datadogV1/api/api_security_monitoring.rs index 1700cdddd..377c1dc22 100644 --- a/src/datadogV1/api/api_security_monitoring.rs +++ b/src/datadogV1/api/api_security_monitoring.rs @@ -87,29 +87,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.add_security_monitoring_signal_to_incident"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/security_analytics/signals/{signal_id}/add_to_incident", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -173,29 +174,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.edit_security_monitoring_signal_assignee"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/security_analytics/signals/{signal_id}/assignee", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -259,29 +261,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.edit_security_monitoring_signal_state"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/security_analytics/signals/{signal_id}/state", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_service_checks.rs b/src/datadogV1/api/api_service_checks.rs index 0de99830d..251524dc8 100644 --- a/src/datadogV1/api/api_service_checks.rs +++ b/src/datadogV1/api/api_service_checks.rs @@ -69,22 +69,26 @@ impl ServiceChecksAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.submit_service_check"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/check_run", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/check_run", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_service_level_objective_corrections.rs b/src/datadogV1/api/api_service_level_objective_corrections.rs index 089902063..e86a09b16 100644 --- a/src/datadogV1/api/api_service_level_objective_corrections.rs +++ b/src/datadogV1/api/api_service_level_objective_corrections.rs @@ -123,25 +123,29 @@ impl ServiceLevelObjectiveCorrectionsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_slo_correction"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/slo/correction", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/slo/correction", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -197,29 +201,30 @@ impl ServiceLevelObjectiveCorrectionsAPI { slo_correction_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_slo_correction"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/slo/correction/{slo_correction_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), slo_correction_id = urlencode(slo_correction_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -270,29 +275,30 @@ impl ServiceLevelObjectiveCorrectionsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_slo_correction"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/slo/correction/{slo_correction_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), slo_correction_id = urlencode(slo_correction_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -344,6 +350,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_slo_correction"; // unbox and build optional parameters let offset = params.offset; @@ -351,7 +358,10 @@ impl ServiceLevelObjectiveCorrectionsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/slo/correction", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/slo/correction", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -365,17 +375,17 @@ impl ServiceLevelObjectiveCorrectionsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -432,29 +442,30 @@ impl ServiceLevelObjectiveCorrectionsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_slo_correction"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/slo/correction/{slo_correction_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), slo_correction_id = urlencode(slo_correction_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_service_level_objectives.rs b/src/datadogV1/api/api_service_level_objectives.rs index df3e056f0..875bf98c1 100644 --- a/src/datadogV1/api/api_service_level_objectives.rs +++ b/src/datadogV1/api/api_service_level_objectives.rs @@ -306,27 +306,31 @@ impl ServiceLevelObjectivesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.check_can_delete_slo"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/slo/can_delete", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/slo/can_delete", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); local_req_builder = local_req_builder.query(&[("ids", &ids.to_string())]); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -373,25 +377,29 @@ impl ServiceLevelObjectivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.create_slo"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/slo", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/slo", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -452,6 +460,7 @@ impl ServiceLevelObjectivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_slo"; // unbox and build optional parameters let force = params.force; @@ -460,7 +469,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -472,17 +481,17 @@ impl ServiceLevelObjectivesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -541,25 +550,29 @@ impl ServiceLevelObjectivesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_slo_timeframe_in_bulk"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/slo/bulk_delete", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/slo/bulk_delete", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -614,6 +627,7 @@ impl ServiceLevelObjectivesAPI { params: GetSLOOptionalParams, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_slo"; // unbox and build optional parameters let with_configured_alert_ids = params.with_configured_alert_ids; @@ -622,7 +636,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -634,17 +648,17 @@ impl ServiceLevelObjectivesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -695,29 +709,30 @@ impl ServiceLevelObjectivesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_slo_corrections"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/slo/{slo_id}/corrections", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -790,6 +805,7 @@ impl ServiceLevelObjectivesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_slo_history"; // unbox and build optional parameters let target = params.target; @@ -799,7 +815,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}/history", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -817,17 +833,17 @@ impl ServiceLevelObjectivesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -874,6 +890,7 @@ impl ServiceLevelObjectivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_slos"; // unbox and build optional parameters let ids = params.ids; @@ -885,7 +902,10 @@ impl ServiceLevelObjectivesAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/slo", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/slo", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -914,17 +934,17 @@ impl ServiceLevelObjectivesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -970,6 +990,7 @@ impl ServiceLevelObjectivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.search_slo"; // unbox and build optional parameters let query = params.query; @@ -979,7 +1000,10 @@ impl ServiceLevelObjectivesAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/slo/search", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/slo/search", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1001,17 +1025,17 @@ impl ServiceLevelObjectivesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1059,29 +1083,30 @@ impl ServiceLevelObjectivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_slo"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_slack_integration.rs b/src/datadogV1/api/api_slack_integration.rs index 986cfbbb7..1fd0f04d8 100644 --- a/src/datadogV1/api/api_slack_integration.rs +++ b/src/datadogV1/api/api_slack_integration.rs @@ -109,29 +109,30 @@ impl SlackIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_slack_integration_channel"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_name = urlencode(account_name) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -195,12 +196,13 @@ impl SlackIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_slack_integration_channel"; let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", - local_configuration.base_path, account_name= + "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", + local_configuration.get_operation_host(operation_id), account_name= urlencode(account_name) , channel_name= urlencode(channel_name) @@ -209,17 +211,17 @@ impl SlackIntegrationAPI { local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -274,29 +276,30 @@ impl SlackIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_slack_integration_channels"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_name = urlencode(account_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -347,12 +350,13 @@ impl SlackIntegrationAPI { channel_name: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.remove_slack_integration_channel"; let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", - local_configuration.base_path, account_name= + "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", + local_configuration.get_operation_host(operation_id), account_name= urlencode(account_name) , channel_name= urlencode(channel_name) @@ -361,17 +365,17 @@ impl SlackIntegrationAPI { local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -428,12 +432,13 @@ impl SlackIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_slack_integration_channel"; let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", - local_configuration.base_path, account_name= + "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", + local_configuration.get_operation_host(operation_id), account_name= urlencode(account_name) , channel_name= urlencode(channel_name) @@ -442,17 +447,17 @@ impl SlackIntegrationAPI { local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_snapshots.rs b/src/datadogV1/api/api_snapshots.rs index 2bd08dc16..8d0c00203 100644 --- a/src/datadogV1/api/api_snapshots.rs +++ b/src/datadogV1/api/api_snapshots.rs @@ -118,6 +118,7 @@ impl SnapshotsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_graph_snapshot"; // unbox and build optional parameters let metric_query = params.metric_query; @@ -129,7 +130,10 @@ impl SnapshotsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/graph/snapshot", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/graph/snapshot", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -161,17 +165,17 @@ impl SnapshotsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV1/api/api_synthetics.rs b/src/datadogV1/api/api_synthetics.rs index 97f536f88..650f05d33 100644 --- a/src/datadogV1/api/api_synthetics.rs +++ b/src/datadogV1/api/api_synthetics.rs @@ -419,28 +419,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_global_variable"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/variables", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -499,28 +500,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_private_location"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/private-locations", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -580,28 +582,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_synthetics_api_test"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/api", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -663,28 +666,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_synthetics_browser_test"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -740,29 +744,30 @@ impl SyntheticsAPI { variable_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_global_variable"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/variables/{variable_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), variable_id = urlencode(variable_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -809,29 +814,30 @@ impl SyntheticsAPI { location_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_private_location"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/private-locations/{location_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), location_id = urlencode(location_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -881,28 +887,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.delete_tests"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/delete", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -965,29 +972,30 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.edit_global_variable"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/variables/{variable_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), variable_id = urlencode(variable_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1043,29 +1051,30 @@ impl SyntheticsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_api_test"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/api/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1121,6 +1130,7 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_api_test_latest_results"; // unbox and build optional parameters let from_ts = params.from_ts; @@ -1131,7 +1141,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}/results", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -1158,17 +1168,17 @@ impl SyntheticsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1226,12 +1236,13 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_api_test_result"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}/results/{result_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id), result_id = urlencode(result_id) ); @@ -1239,17 +1250,17 @@ impl SyntheticsAPI { local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1301,29 +1312,30 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_browser_test"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1380,6 +1392,7 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_browser_test_latest_results"; // unbox and build optional parameters let from_ts = params.from_ts; @@ -1390,7 +1403,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}/results", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -1417,17 +1430,17 @@ impl SyntheticsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1485,12 +1498,13 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_browser_test_result"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id), result_id = urlencode(result_id) ); @@ -1498,17 +1512,17 @@ impl SyntheticsAPI { local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1560,29 +1574,30 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_global_variable"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/variables/{variable_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), variable_id = urlencode(variable_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1634,29 +1649,30 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_private_location"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/private-locations/{location_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), location_id = urlencode(location_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1708,29 +1724,30 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_synthetics_ci_batch"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/ci/batch/{batch_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), batch_id = urlencode(batch_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1774,28 +1791,29 @@ impl SyntheticsAPI { &self, ) -> Result>, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_synthetics_default_locations"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/settings/default_locations", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1841,29 +1859,30 @@ impl SyntheticsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_test"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1912,28 +1931,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_global_variables"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/variables", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1984,28 +2004,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_locations"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/locations", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2055,6 +2076,7 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.list_tests"; // unbox and build optional parameters let page_size = params.page_size; @@ -2062,7 +2084,10 @@ impl SyntheticsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/synthetics/tests", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/synthetics/tests", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2076,17 +2101,17 @@ impl SyntheticsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2136,29 +2161,30 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.patch_test"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -2216,28 +2242,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.trigger_ci_tests"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/trigger/ci", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -2296,28 +2323,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.trigger_tests"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/trigger", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -2374,29 +2402,30 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_api_test"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/api/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -2458,29 +2487,30 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_browser_test"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -2544,29 +2574,30 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_private_location"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/private-locations/{location_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), location_id = urlencode(location_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -2624,29 +2655,30 @@ impl SyntheticsAPI { body: crate::datadogV1::model::SyntheticsUpdateTestPauseStatusPayload, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_test_pause_status"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}/status", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_tags.rs b/src/datadogV1/api/api_tags.rs index 43edc3831..abe6156c8 100644 --- a/src/datadogV1/api/api_tags.rs +++ b/src/datadogV1/api/api_tags.rs @@ -189,6 +189,7 @@ impl TagsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.create_host_tags"; // unbox and build optional parameters let source = params.source; @@ -197,7 +198,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -209,17 +210,17 @@ impl TagsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -279,6 +280,7 @@ impl TagsAPI { params: DeleteHostTagsOptionalParams, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_host_tags"; // unbox and build optional parameters let source = params.source; @@ -287,7 +289,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -299,17 +301,17 @@ impl TagsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -355,6 +357,7 @@ impl TagsAPI { params: GetHostTagsOptionalParams, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_host_tags"; // unbox and build optional parameters let source = params.source; @@ -363,7 +366,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -375,17 +378,17 @@ impl TagsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -431,13 +434,17 @@ impl TagsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_host_tags"; // unbox and build optional parameters let source = params.source; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/tags/hosts", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/tags/hosts", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -447,17 +454,17 @@ impl TagsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -512,6 +519,7 @@ impl TagsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_host_tags"; // unbox and build optional parameters let source = params.source; @@ -520,7 +528,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -532,17 +540,17 @@ impl TagsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_usage_metering.rs b/src/datadogV1/api/api_usage_metering.rs index 7e4d2ac4d..bad331637 100644 --- a/src/datadogV1/api/api_usage_metering.rs +++ b/src/datadogV1/api/api_usage_metering.rs @@ -1236,6 +1236,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_daily_custom_reports"; // unbox and build optional parameters let page_size = params.page_size; @@ -1247,7 +1248,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/daily_custom_reports", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1270,17 +1271,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1367,6 +1368,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_hourly_usage_attribution"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -1378,7 +1380,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/hourly-attribution", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1403,17 +1405,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1472,6 +1474,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_incident_management"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -1480,7 +1483,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/incident-management", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1492,17 +1495,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1561,6 +1564,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_ingested_spans"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -1569,7 +1573,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/ingested-spans", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1581,17 +1585,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1647,6 +1651,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_monthly_custom_reports"; // unbox and build optional parameters let page_size = params.page_size; @@ -1658,7 +1663,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/monthly_custom_reports", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1681,17 +1686,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1778,6 +1783,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_monthly_usage_attribution"; // unbox and build optional parameters let end_month = params.end_month; @@ -1791,7 +1797,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/monthly-attribution", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1824,17 +1830,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1893,29 +1899,30 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_specified_daily_custom_reports"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/daily_custom_reports/{report_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), report_id = urlencode(report_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1974,29 +1981,30 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_specified_monthly_custom_reports"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/monthly_custom_reports/{report_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), report_id = urlencode(report_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2055,6 +2063,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_analyzed_logs"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -2063,7 +2072,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/analyzed_logs", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2075,17 +2084,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2148,6 +2157,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_attribution"; // unbox and build optional parameters let end_month = params.end_month; @@ -2159,7 +2169,10 @@ impl UsageMeteringAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/attribution", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/attribution", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2191,17 +2204,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2260,13 +2273,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_audit_logs"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/audit_logs", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/audit_logs", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2277,17 +2294,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2339,6 +2356,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_billable_summary"; // unbox and build optional parameters let month = params.month; @@ -2347,7 +2365,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/billable-summary", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2358,17 +2376,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2422,13 +2440,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_ci_app"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/ci-app", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/ci-app", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2439,17 +2461,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2500,13 +2522,17 @@ impl UsageMeteringAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_usage_cws"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/cws", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/cws", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2517,17 +2543,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2585,13 +2611,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_cloud_security_posture_management"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/cspm", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/cspm", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2602,17 +2632,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2664,13 +2694,17 @@ impl UsageMeteringAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_usage_dbm"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/dbm", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/dbm", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2681,17 +2715,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2747,13 +2781,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_fargate"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/fargate", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/fargate", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2764,17 +2802,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2828,13 +2866,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_hosts"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/hosts", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/hosts", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2845,17 +2887,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2914,6 +2956,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_indexed_spans"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -2922,7 +2965,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/indexed-spans", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2934,17 +2977,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3003,13 +3046,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_internet_of_things"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/iot", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/iot", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3020,17 +3067,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3084,13 +3131,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_lambda"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/aws_lambda", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/aws_lambda", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3101,17 +3152,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3162,13 +3213,17 @@ impl UsageMeteringAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_usage_logs"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/logs", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/logs", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3179,17 +3234,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3245,6 +3300,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_logs_by_index"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -3254,7 +3310,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/logs_by_index", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3277,17 +3333,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3346,6 +3402,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_logs_by_retention"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -3354,7 +3411,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/logs-by-retention", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3366,17 +3423,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3435,6 +3492,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_network_flows"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -3443,7 +3501,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/network_flows", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3455,17 +3513,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3524,6 +3582,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_network_hosts"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -3532,7 +3591,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/network_hosts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3544,17 +3603,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3613,6 +3672,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_online_archive"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -3621,7 +3681,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/online-archive", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3633,17 +3693,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3702,13 +3762,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_profiling"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/profiling", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/profiling", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3719,17 +3783,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3788,6 +3852,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_rum_sessions"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -3797,7 +3862,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/rum_sessions", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3813,17 +3878,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3880,13 +3945,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_rum_units"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/rum", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/rum", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3897,17 +3966,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3958,13 +4027,17 @@ impl UsageMeteringAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_usage_sds"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/sds", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/sds", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3975,17 +4048,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4035,13 +4108,17 @@ impl UsageMeteringAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_usage_snmp"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/snmp", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/snmp", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4052,17 +4129,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4116,6 +4193,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_summary"; // unbox and build optional parameters let end_month = params.end_month; @@ -4123,7 +4201,10 @@ impl UsageMeteringAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/summary", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/summary", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4138,17 +4219,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4207,13 +4288,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_synthetics"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/synthetics", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/synthetics", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4224,17 +4309,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4293,6 +4378,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_synthetics_api"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -4301,7 +4387,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/synthetics_api", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4313,17 +4399,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4382,6 +4468,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_synthetics_browser"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -4390,7 +4477,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/synthetics_browser", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4402,17 +4489,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4471,13 +4558,17 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_timeseries"; // unbox and build optional parameters let end_hr = params.end_hr; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/usage/timeseries", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/usage/timeseries", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4488,17 +4579,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4550,6 +4641,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_usage_top_avg_metrics"; // unbox and build optional parameters let month = params.month; @@ -4562,7 +4654,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/top_avg_metrics", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4595,17 +4687,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV1/api/api_users.rs b/src/datadogV1/api/api_users.rs index 335234736..e02e9e3aa 100644 --- a/src/datadogV1/api/api_users.rs +++ b/src/datadogV1/api/api_users.rs @@ -102,25 +102,29 @@ impl UsersAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.create_user"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/user", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/user", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -181,29 +185,30 @@ impl UsersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.disable_user"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/user/{user_handle}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_handle = urlencode(user_handle) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -248,29 +253,30 @@ impl UsersAPI { user_handle: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.get_user"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/user/{user_handle}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_handle = urlencode(user_handle) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -314,25 +320,29 @@ impl UsersAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_users"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v1/user", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v1/user", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -384,29 +394,30 @@ impl UsersAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.update_user"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/user/{user_handle}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_handle = urlencode(user_handle) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV1/api/api_webhooks_integration.rs b/src/datadogV1/api/api_webhooks_integration.rs index 084d75408..dedb44934 100644 --- a/src/datadogV1/api/api_webhooks_integration.rs +++ b/src/datadogV1/api/api_webhooks_integration.rs @@ -133,28 +133,29 @@ impl WebhooksIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_webhooks_integration"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -216,28 +217,29 @@ impl WebhooksIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.create_webhooks_integration_custom_variable"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -294,29 +296,30 @@ impl WebhooksIntegrationAPI { webhook_name: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_webhooks_integration"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), webhook_name = urlencode(webhook_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -363,29 +366,30 @@ impl WebhooksIntegrationAPI { custom_variable_name: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.delete_webhooks_integration_custom_variable"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), custom_variable_name = urlencode(custom_variable_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -438,29 +442,30 @@ impl WebhooksIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_webhooks_integration"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), webhook_name = urlencode(webhook_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -521,29 +526,30 @@ impl WebhooksIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.get_webhooks_integration_custom_variable"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), custom_variable_name = urlencode(custom_variable_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -601,29 +607,30 @@ impl WebhooksIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_webhooks_integration"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), webhook_name = urlencode(webhook_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -687,29 +694,30 @@ impl WebhooksIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v1.update_webhooks_integration_custom_variable"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), custom_variable_name = urlencode(custom_variable_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_apm_retention_filters.rs b/src/datadogV2/api/api_apm_retention_filters.rs index 5cec2d781..1ac42987b 100644 --- a/src/datadogV2/api/api_apm_retention_filters.rs +++ b/src/datadogV2/api/api_apm_retention_filters.rs @@ -112,28 +112,29 @@ impl APMRetentionFiltersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_apm_retention_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -189,29 +190,30 @@ impl APMRetentionFiltersAPI { filter_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_apm_retention_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters/{filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), filter_id = urlencode(filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -264,29 +266,30 @@ impl APMRetentionFiltersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_apm_retention_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters/{filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), filter_id = urlencode(filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -336,28 +339,29 @@ impl APMRetentionFiltersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_apm_retention_filters"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -406,28 +410,29 @@ impl APMRetentionFiltersAPI { body: crate::datadogV2::model::ReorderRetentionFiltersRequest, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.reorder_apm_retention_filters"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters-execution-order", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -489,29 +494,30 @@ impl APMRetentionFiltersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_apm_retention_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters/{filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), filter_id = urlencode(filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_audit.rs b/src/datadogV2/api/api_audit.rs index 853def6ad..218ccb3be 100644 --- a/src/datadogV2/api/api_audit.rs +++ b/src/datadogV2/api/api_audit.rs @@ -145,6 +145,7 @@ impl AuditAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_audit_logs"; // unbox and build optional parameters let filter_query = params.filter_query; @@ -156,7 +157,10 @@ impl AuditAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/audit/events", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/audit/events", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -186,17 +190,17 @@ impl AuditAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -256,6 +260,7 @@ impl AuditAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.search_audit_logs"; // unbox and build optional parameters let body = params.body; @@ -264,23 +269,23 @@ impl AuditAPI { let local_uri_str = format!( "{}/api/v2/audit/events/search", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_authn_mappings.rs b/src/datadogV2/api/api_authn_mappings.rs index 8917feccc..1b147182e 100644 --- a/src/datadogV2/api/api_authn_mappings.rs +++ b/src/datadogV2/api/api_authn_mappings.rs @@ -137,25 +137,29 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_authn_mapping"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/authn_mappings", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/authn_mappings", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -211,29 +215,30 @@ impl AuthNMappingsAPI { authn_mapping_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_authn_mapping"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), authn_mapping_id = urlencode(authn_mapping_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -284,29 +289,30 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_authn_mapping"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), authn_mapping_id = urlencode(authn_mapping_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -356,6 +362,7 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_authn_mappings"; // unbox and build optional parameters let page_size = params.page_size; @@ -365,7 +372,10 @@ impl AuthNMappingsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/authn_mappings", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/authn_mappings", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -387,17 +397,17 @@ impl AuthNMappingsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -452,29 +462,30 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_authn_mapping"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), authn_mapping_id = urlencode(authn_mapping_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_ci_visibility_pipelines.rs b/src/datadogV2/api/api_ci_visibility_pipelines.rs index eac29cc6b..09dc785d5 100644 --- a/src/datadogV2/api/api_ci_visibility_pipelines.rs +++ b/src/datadogV2/api/api_ci_visibility_pipelines.rs @@ -165,28 +165,29 @@ impl CIVisibilityPipelinesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.aggregate_ci_app_pipeline_events"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/ci/pipelines/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -250,22 +251,26 @@ impl CIVisibilityPipelinesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_ci_app_pipeline_event"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/ci/pipeline", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/ci/pipeline", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters @@ -333,6 +338,7 @@ impl CIVisibilityPipelinesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_ci_app_pipeline_events"; // unbox and build optional parameters let filter_query = params.filter_query; @@ -346,7 +352,7 @@ impl CIVisibilityPipelinesAPI { let local_uri_str = format!( "{}/api/v2/ci/pipelines/events", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -377,17 +383,17 @@ impl CIVisibilityPipelinesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -448,6 +454,7 @@ impl CIVisibilityPipelinesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.search_ci_app_pipeline_events"; // unbox and build optional parameters let body = params.body; @@ -456,23 +463,23 @@ impl CIVisibilityPipelinesAPI { let local_uri_str = format!( "{}/api/v2/ci/pipelines/events/search", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_ci_visibility_tests.rs b/src/datadogV2/api/api_ci_visibility_tests.rs index b3fea3689..f8a05127a 100644 --- a/src/datadogV2/api/api_ci_visibility_tests.rs +++ b/src/datadogV2/api/api_ci_visibility_tests.rs @@ -144,28 +144,29 @@ impl CIVisibilityTestsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.aggregate_ci_app_test_events"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/ci/tests/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -231,6 +232,7 @@ impl CIVisibilityTestsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_ci_app_test_events"; // unbox and build optional parameters let filter_query = params.filter_query; @@ -242,7 +244,10 @@ impl CIVisibilityTestsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/ci/tests/events", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/ci/tests/events", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -272,17 +277,17 @@ impl CIVisibilityTestsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -340,6 +345,7 @@ impl CIVisibilityTestsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.search_ci_app_test_events"; // unbox and build optional parameters let body = params.body; @@ -348,23 +354,23 @@ impl CIVisibilityTestsAPI { let local_uri_str = format!( "{}/api/v2/ci/tests/events/search", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_cloud_cost_management.rs b/src/datadogV2/api/api_cloud_cost_management.rs index 2e417058f..7aa86de8d 100644 --- a/src/datadogV2/api/api_cloud_cost_management.rs +++ b/src/datadogV2/api/api_cloud_cost_management.rs @@ -145,28 +145,29 @@ impl CloudCostManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_cost_awscur_config"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -225,28 +226,29 @@ impl CloudCostManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_cost_azure_uc_configs"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -302,29 +304,30 @@ impl CloudCostManagementAPI { cloud_account_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_cost_awscur_config"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config/{cloud_account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), cloud_account_id = urlencode(cloud_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -371,29 +374,30 @@ impl CloudCostManagementAPI { cloud_account_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_cost_azure_uc_config"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config/{cloud_account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), cloud_account_id = urlencode(cloud_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -441,25 +445,29 @@ impl CloudCostManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_cloud_cost_activity"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/cost/enabled", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/cost/enabled", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -514,12 +522,13 @@ impl CloudCostManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_aws_related_accounts"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost/aws_related_accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -530,17 +539,17 @@ impl CloudCostManagementAPI { )]); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -590,28 +599,29 @@ impl CloudCostManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_cost_awscur_configs"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -661,28 +671,29 @@ impl CloudCostManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_cost_azure_uc_configs"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -739,29 +750,30 @@ impl CloudCostManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_cost_awscur_config"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config/{cloud_account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), cloud_account_id = urlencode(cloud_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -825,29 +837,30 @@ impl CloudCostManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_cost_azure_uc_configs"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config/{cloud_account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), cloud_account_id = urlencode(cloud_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_cloud_workload_security.rs b/src/datadogV2/api/api_cloud_workload_security.rs index 1d8f95eb8..d811f5db8 100644 --- a/src/datadogV2/api/api_cloud_workload_security.rs +++ b/src/datadogV2/api/api_cloud_workload_security.rs @@ -113,28 +113,29 @@ impl CloudWorkloadSecurityAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_cloud_workload_security_agent_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -191,29 +192,30 @@ impl CloudWorkloadSecurityAPI { agent_rule_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_cloud_workload_security_agent_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), agent_rule_id = urlencode(agent_rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -262,28 +264,29 @@ impl CloudWorkloadSecurityAPI { &self, ) -> Result>, Error> { let local_configuration = &self.config; + let operation_id = "v2.download_cloud_workload_policy_file"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security/cloud_workload/policy/download", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -337,29 +340,30 @@ impl CloudWorkloadSecurityAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_cloud_workload_security_agent_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), agent_rule_id = urlencode(agent_rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -413,28 +417,29 @@ impl CloudWorkloadSecurityAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_cloud_workload_security_agent_rules"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -494,29 +499,30 @@ impl CloudWorkloadSecurityAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_cloud_workload_security_agent_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), agent_rule_id = urlencode(agent_rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_cloudflare_integration.rs b/src/datadogV2/api/api_cloudflare_integration.rs index 33d5d3083..dd6619a7a 100644 --- a/src/datadogV2/api/api_cloudflare_integration.rs +++ b/src/datadogV2/api/api_cloudflare_integration.rs @@ -104,28 +104,29 @@ impl CloudflareIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_cloudflare_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -181,29 +182,30 @@ impl CloudflareIntegrationAPI { account_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_cloudflare_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -253,29 +255,30 @@ impl CloudflareIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_cloudflare_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -325,28 +328,29 @@ impl CloudflareIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_cloudflare_accounts"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -403,29 +407,30 @@ impl CloudflareIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_cloudflare_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_confluent_cloud.rs b/src/datadogV2/api/api_confluent_cloud.rs index 50d23b225..280d27328 100644 --- a/src/datadogV2/api/api_confluent_cloud.rs +++ b/src/datadogV2/api/api_confluent_cloud.rs @@ -159,28 +159,29 @@ impl ConfluentCloudAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_confluent_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -244,29 +245,30 @@ impl ConfluentCloudAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_confluent_resource"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -322,29 +324,30 @@ impl ConfluentCloudAPI { account_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_confluent_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -393,12 +396,13 @@ impl ConfluentCloudAPI { resource_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_confluent_resource"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), resource_id = urlencode(resource_id) ); @@ -406,17 +410,17 @@ impl ConfluentCloudAPI { local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -466,29 +470,30 @@ impl ConfluentCloudAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_confluent_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -545,12 +550,13 @@ impl ConfluentCloudAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_confluent_resource"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), resource_id = urlencode(resource_id) ); @@ -558,17 +564,17 @@ impl ConfluentCloudAPI { local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -618,28 +624,29 @@ impl ConfluentCloudAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_confluent_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -694,29 +701,30 @@ impl ConfluentCloudAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_confluent_resource"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -773,29 +781,30 @@ impl ConfluentCloudAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_confluent_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -861,12 +870,13 @@ impl ConfluentCloudAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_confluent_resource"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), resource_id = urlencode(resource_id) ); @@ -874,17 +884,17 @@ impl ConfluentCloudAPI { local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_container_images.rs b/src/datadogV2/api/api_container_images.rs index 8dee6dea9..831b7c213 100644 --- a/src/datadogV2/api/api_container_images.rs +++ b/src/datadogV2/api/api_container_images.rs @@ -105,6 +105,7 @@ impl ContainerImagesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_container_images"; // unbox and build optional parameters let filter_tags = params.filter_tags; @@ -115,7 +116,10 @@ impl ContainerImagesAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/container_images", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/container_images", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -141,17 +145,17 @@ impl ContainerImagesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV2/api/api_containers.rs b/src/datadogV2/api/api_containers.rs index 9473a58be..d2ebd47ec 100644 --- a/src/datadogV2/api/api_containers.rs +++ b/src/datadogV2/api/api_containers.rs @@ -103,6 +103,7 @@ impl ContainersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_containers"; // unbox and build optional parameters let filter_tags = params.filter_tags; @@ -113,7 +114,10 @@ impl ContainersAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/containers", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/containers", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -139,17 +143,17 @@ impl ContainersAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV2/api/api_dashboard_lists.rs b/src/datadogV2/api/api_dashboard_lists.rs index 60f344f79..90648b3ab 100644 --- a/src/datadogV2/api/api_dashboard_lists.rs +++ b/src/datadogV2/api/api_dashboard_lists.rs @@ -97,29 +97,30 @@ impl DashboardListsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_dashboard_list_items"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), dashboard_list_id = dashboard_list_id ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -183,29 +184,30 @@ impl DashboardListsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.delete_dashboard_list_items"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), dashboard_list_id = dashboard_list_id ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -267,29 +269,30 @@ impl DashboardListsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_dashboard_list_items"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), dashboard_list_id = dashboard_list_id ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -346,29 +349,30 @@ impl DashboardListsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_dashboard_list_items"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), dashboard_list_id = dashboard_list_id ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_dora_metrics.rs b/src/datadogV2/api/api_dora_metrics.rs index 5555b23e9..ccf4a3621 100644 --- a/src/datadogV2/api/api_dora_metrics.rs +++ b/src/datadogV2/api/api_dora_metrics.rs @@ -79,9 +79,10 @@ impl DORAMetricsAPI { ResponseContent, Error, > { - let operation_id = "v2.create_dora_deployment".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.create_dora_deployment"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_dora_deployment' is not enabled".to_string(), @@ -89,23 +90,24 @@ impl DORAMetricsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/dora/deployment", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/dora/deployment", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters @@ -169,9 +171,10 @@ impl DORAMetricsAPI { ResponseContent, Error, > { - let operation_id = "v2.create_dora_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.create_dora_incident"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_dora_incident' is not enabled".to_string(), @@ -179,23 +182,24 @@ impl DORAMetricsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/dora/incident", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/dora/incident", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_downtimes.rs b/src/datadogV2/api/api_downtimes.rs index 7cd290e0a..de8e0f18e 100644 --- a/src/datadogV2/api/api_downtimes.rs +++ b/src/datadogV2/api/api_downtimes.rs @@ -183,29 +183,30 @@ impl DowntimesAPI { downtime_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.cancel_downtime"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), downtime_id = urlencode(downtime_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -252,25 +253,29 @@ impl DowntimesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_downtime"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/downtime", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/downtime", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -326,6 +331,7 @@ impl DowntimesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_downtime"; // unbox and build optional parameters let include = params.include; @@ -334,7 +340,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), downtime_id = urlencode(downtime_id) ); let mut local_req_builder = @@ -346,17 +352,17 @@ impl DowntimesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -405,6 +411,7 @@ impl DowntimesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_downtimes"; // unbox and build optional parameters let current_only = params.current_only; @@ -414,7 +421,10 @@ impl DowntimesAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/downtime", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/downtime", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -436,17 +446,17 @@ impl DowntimesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -503,6 +513,7 @@ impl DowntimesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_monitor_downtimes"; // unbox and build optional parameters let page_offset = params.page_offset; @@ -512,7 +523,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/monitor/{monitor_id}/downtime_matches", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = @@ -528,17 +539,17 @@ impl DowntimesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -589,29 +600,30 @@ impl DowntimesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_downtime"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), downtime_id = urlencode(downtime_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_events.rs b/src/datadogV2/api/api_events.rs index c816b18b0..eac5393c4 100644 --- a/src/datadogV2/api/api_events.rs +++ b/src/datadogV2/api/api_events.rs @@ -135,6 +135,7 @@ impl EventsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_events"; // unbox and build optional parameters let filter_query = params.filter_query; @@ -146,7 +147,10 @@ impl EventsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/events", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/events", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -176,17 +180,17 @@ impl EventsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -240,28 +244,32 @@ impl EventsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.search_events"; // unbox and build optional parameters let body = params.body; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/events/search", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/events/search", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_fastly_integration.rs b/src/datadogV2/api/api_fastly_integration.rs index e61dce249..981765718 100644 --- a/src/datadogV2/api/api_fastly_integration.rs +++ b/src/datadogV2/api/api_fastly_integration.rs @@ -159,28 +159,29 @@ impl FastlyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_fastly_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -244,29 +245,30 @@ impl FastlyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_fastly_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -319,29 +321,30 @@ impl FastlyIntegrationAPI { account_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_fastly_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -390,12 +393,13 @@ impl FastlyIntegrationAPI { service_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_fastly_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), service_id = urlencode(service_id) ); @@ -403,17 +407,17 @@ impl FastlyIntegrationAPI { local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -461,29 +465,30 @@ impl FastlyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_fastly_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -538,12 +543,13 @@ impl FastlyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_fastly_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), service_id = urlencode(service_id) ); @@ -551,17 +557,17 @@ impl FastlyIntegrationAPI { local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -611,28 +617,29 @@ impl FastlyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_fastly_accounts"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -684,29 +691,30 @@ impl FastlyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_fastly_services"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -763,29 +771,30 @@ impl FastlyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_fastly_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -851,12 +860,13 @@ impl FastlyIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_fastly_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), service_id = urlencode(service_id) ); @@ -864,17 +874,17 @@ impl FastlyIntegrationAPI { local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_gcp_integration.rs b/src/datadogV2/api/api_gcp_integration.rs index 2affaf730..48a47d49d 100644 --- a/src/datadogV2/api/api_gcp_integration.rs +++ b/src/datadogV2/api/api_gcp_integration.rs @@ -130,28 +130,29 @@ impl GCPIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_gcpsts_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -204,29 +205,30 @@ impl GCPIntegrationAPI { account_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_gcpsts_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -274,28 +276,29 @@ impl GCPIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_gcpsts_delegate"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/gcp/sts_delegate", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -345,28 +348,29 @@ impl GCPIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_gcpsts_accounts"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -418,6 +422,7 @@ impl GCPIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.make_gcpsts_delegate"; // unbox and build optional parameters let body = params.body; @@ -426,23 +431,23 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/sts_delegate", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -506,29 +511,30 @@ impl GCPIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_gcpsts_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_incident_services.rs b/src/datadogV2/api/api_incident_services.rs index 3698735ec..4f181abff 100644 --- a/src/datadogV2/api/api_incident_services.rs +++ b/src/datadogV2/api/api_incident_services.rs @@ -162,9 +162,10 @@ impl IncidentServicesAPI { ResponseContent, Error, > { - let operation_id = "v2.create_incident_service".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.create_incident_service"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_service' is not enabled".to_string(), @@ -172,26 +173,27 @@ impl IncidentServicesAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/services", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/services", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -246,9 +248,10 @@ impl IncidentServicesAPI { &self, service_id: String, ) -> Result, Error> { - let operation_id = "v2.delete_incident_service".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.delete_incident_service"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_service' is not enabled".to_string(), @@ -256,30 +259,28 @@ impl IncidentServicesAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/services/{service_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_id = urlencode(service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -335,9 +336,10 @@ impl IncidentServicesAPI { ResponseContent, Error, > { - let operation_id = "v2.get_incident_service".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.get_incident_service"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_service' is not enabled".to_string(), @@ -345,8 +347,6 @@ impl IncidentServicesAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; @@ -354,7 +354,7 @@ impl IncidentServicesAPI { let local_uri_str = format!( "{}/api/v2/services/{service_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_id = urlencode(service_id) ); let mut local_req_builder = @@ -366,17 +366,17 @@ impl IncidentServicesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -427,9 +427,10 @@ impl IncidentServicesAPI { ResponseContent, Error, > { - let operation_id = "v2.list_incident_services".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.list_incident_services"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_services' is not enabled".to_string(), @@ -437,8 +438,6 @@ impl IncidentServicesAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; let page_size = params.page_size; @@ -447,7 +446,10 @@ impl IncidentServicesAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/services", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/services", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -469,17 +471,17 @@ impl IncidentServicesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -535,9 +537,10 @@ impl IncidentServicesAPI { ResponseContent, Error, > { - let operation_id = "v2.update_incident_service".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.update_incident_service"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_service' is not enabled".to_string(), @@ -545,30 +548,28 @@ impl IncidentServicesAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/services/{service_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_id = urlencode(service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_incident_teams.rs b/src/datadogV2/api/api_incident_teams.rs index 6e2de016a..3cae1c7dc 100644 --- a/src/datadogV2/api/api_incident_teams.rs +++ b/src/datadogV2/api/api_incident_teams.rs @@ -160,9 +160,10 @@ impl IncidentTeamsAPI { ResponseContent, Error, > { - let operation_id = "v2.create_incident_team".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.create_incident_team"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_team' is not enabled".to_string(), @@ -170,26 +171,27 @@ impl IncidentTeamsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/teams", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/teams", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -241,9 +243,10 @@ impl IncidentTeamsAPI { &self, team_id: String, ) -> Result, Error> { - let operation_id = "v2.delete_incident_team".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.delete_incident_team"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_team' is not enabled".to_string(), @@ -251,30 +254,28 @@ impl IncidentTeamsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/teams/{team_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -325,9 +326,10 @@ impl IncidentTeamsAPI { ResponseContent, Error, > { - let operation_id = "v2.get_incident_team".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.get_incident_team"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_team' is not enabled".to_string(), @@ -335,8 +337,6 @@ impl IncidentTeamsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; @@ -344,7 +344,7 @@ impl IncidentTeamsAPI { let local_uri_str = format!( "{}/api/v2/teams/{team_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -356,17 +356,17 @@ impl IncidentTeamsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -415,9 +415,10 @@ impl IncidentTeamsAPI { ResponseContent, Error, > { - let operation_id = "v2.list_incident_teams".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.list_incident_teams"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_teams' is not enabled".to_string(), @@ -425,8 +426,6 @@ impl IncidentTeamsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; let page_size = params.page_size; @@ -435,7 +434,10 @@ impl IncidentTeamsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/teams", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/teams", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -457,17 +459,17 @@ impl IncidentTeamsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -521,9 +523,10 @@ impl IncidentTeamsAPI { ResponseContent, Error, > { - let operation_id = "v2.update_incident_team".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.update_incident_team"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_team' is not enabled".to_string(), @@ -531,30 +534,28 @@ impl IncidentTeamsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/teams/{team_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_incidents.rs b/src/datadogV2/api/api_incidents.rs index a8ec61469..04ebbe713 100644 --- a/src/datadogV2/api/api_incidents.rs +++ b/src/datadogV2/api/api_incidents.rs @@ -419,9 +419,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.create_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.create_incident"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident' is not enabled".to_string(), @@ -429,26 +430,27 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/incidents", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/incidents", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -511,9 +513,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.create_incident_integration".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.create_incident_integration"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_integration' is not enabled".to_string(), @@ -521,30 +524,28 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -605,9 +606,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.create_incident_todo".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.create_incident_todo"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_todo' is not enabled".to_string(), @@ -615,30 +617,28 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -690,9 +690,10 @@ impl IncidentsAPI { &self, incident_id: String, ) -> Result, Error> { - let operation_id = "v2.delete_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.delete_incident"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident' is not enabled".to_string(), @@ -700,30 +701,28 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -771,9 +770,10 @@ impl IncidentsAPI { incident_id: String, integration_metadata_id: String, ) -> Result, Error> { - let operation_id = "v2.delete_incident_integration".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.delete_incident_integration"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_integration' is not enabled".to_string(), @@ -781,13 +781,11 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", - local_configuration.base_path, incident_id= + "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", + local_configuration.get_operation_host(operation_id), incident_id= urlencode(incident_id) , integration_metadata_id= urlencode(integration_metadata_id) @@ -796,17 +794,17 @@ impl IncidentsAPI { local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -854,9 +852,10 @@ impl IncidentsAPI { incident_id: String, todo_id: String, ) -> Result, Error> { - let operation_id = "v2.delete_incident_todo".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.delete_incident_todo"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_todo' is not enabled".to_string(), @@ -864,13 +863,11 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id), todo_id = urlencode(todo_id) ); @@ -878,17 +875,17 @@ impl IncidentsAPI { local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -934,9 +931,10 @@ impl IncidentsAPI { params: GetIncidentOptionalParams, ) -> Result, Error> { - let operation_id = "v2.get_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.get_incident"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident' is not enabled".to_string(), @@ -944,8 +942,6 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; @@ -953,7 +949,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -972,17 +968,17 @@ impl IncidentsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1037,9 +1033,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.get_incident_integration".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.get_incident_integration"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_integration' is not enabled".to_string(), @@ -1047,13 +1044,11 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", - local_configuration.base_path, incident_id= + "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", + local_configuration.get_operation_host(operation_id), incident_id= urlencode(incident_id) , integration_metadata_id= urlencode(integration_metadata_id) @@ -1062,17 +1057,17 @@ impl IncidentsAPI { local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1126,9 +1121,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.get_incident_todo".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.get_incident_todo"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_todo' is not enabled".to_string(), @@ -1136,13 +1132,11 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id), todo_id = urlencode(todo_id) ); @@ -1150,17 +1144,17 @@ impl IncidentsAPI { local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1216,9 +1210,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.list_incident_attachments".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.list_incident_attachments"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_attachments' is not enabled".to_string(), @@ -1226,8 +1221,6 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; let filter_attachment_type = params.filter_attachment_type; @@ -1236,7 +1229,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/attachments", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1266,17 +1259,17 @@ impl IncidentsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1330,9 +1323,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.list_incident_integrations".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.list_incident_integrations"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_integrations' is not enabled".to_string(), @@ -1340,30 +1334,28 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1415,9 +1407,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.list_incident_todos".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.list_incident_todos"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_todos' is not enabled".to_string(), @@ -1425,30 +1418,28 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1496,9 +1487,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.list_incidents".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.list_incidents"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incidents' is not enabled".to_string(), @@ -1506,8 +1498,6 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; let page_size = params.page_size; @@ -1515,7 +1505,10 @@ impl IncidentsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/incidents", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/incidents", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1540,17 +1533,17 @@ impl IncidentsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1601,9 +1594,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.search_incidents".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.search_incidents"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.search_incidents' is not enabled".to_string(), @@ -1611,8 +1605,6 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; let sort = params.sort; @@ -1621,7 +1613,10 @@ impl IncidentsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/incidents/search", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/incidents/search", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1644,17 +1639,17 @@ impl IncidentsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1709,9 +1704,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.update_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.update_incident"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident' is not enabled".to_string(), @@ -1719,8 +1715,6 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; @@ -1728,7 +1722,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1747,17 +1741,17 @@ impl IncidentsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1822,9 +1816,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.update_incident_attachments".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.update_incident_attachments"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_attachments' is not enabled".to_string(), @@ -1832,8 +1827,6 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let include = params.include; @@ -1841,7 +1834,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/attachments", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1860,17 +1853,17 @@ impl IncidentsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1935,9 +1928,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.update_incident_integration".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.update_incident_integration"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_integration' is not enabled".to_string(), @@ -1945,13 +1939,11 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", - local_configuration.base_path, incident_id= + "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", + local_configuration.get_operation_host(operation_id), incident_id= urlencode(incident_id) , integration_metadata_id= urlencode(integration_metadata_id) @@ -1960,17 +1952,17 @@ impl IncidentsAPI { local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -2033,9 +2025,10 @@ impl IncidentsAPI { ResponseContent, Error, > { - let operation_id = "v2.update_incident_todo".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.update_incident_todo"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_todo' is not enabled".to_string(), @@ -2043,13 +2036,11 @@ impl IncidentsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id), todo_id = urlencode(todo_id) ); @@ -2057,17 +2048,17 @@ impl IncidentsAPI { local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_ip_allowlist.rs b/src/datadogV2/api/api_ip_allowlist.rs index 84308c8c0..f18c92a76 100644 --- a/src/datadogV2/api/api_ip_allowlist.rs +++ b/src/datadogV2/api/api_ip_allowlist.rs @@ -66,25 +66,29 @@ impl IPAllowlistAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_ip_allowlist"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/ip_allowlist", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/ip_allowlist", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -134,25 +138,29 @@ impl IPAllowlistAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_ip_allowlist"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/ip_allowlist", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/ip_allowlist", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_key_management.rs b/src/datadogV2/api/api_key_management.rs index cda4f0809..0ea7d86c6 100644 --- a/src/datadogV2/api/api_key_management.rs +++ b/src/datadogV2/api/api_key_management.rs @@ -436,25 +436,29 @@ impl KeyManagementAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.create_api_key"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/api_keys", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/api_keys", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -515,28 +519,29 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_current_user_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/current_user/application_keys", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -589,29 +594,30 @@ impl KeyManagementAPI { api_key_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_api_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), api_key_id = urlencode(api_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -654,29 +660,30 @@ impl KeyManagementAPI { app_key_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -723,29 +730,30 @@ impl KeyManagementAPI { app_key_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_current_user_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/current_user/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -792,6 +800,7 @@ impl KeyManagementAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_api_key"; // unbox and build optional parameters let include = params.include; @@ -800,7 +809,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), api_key_id = urlencode(api_key_id) ); let mut local_req_builder = @@ -812,17 +821,17 @@ impl KeyManagementAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -878,6 +887,7 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_application_key"; // unbox and build optional parameters let include = params.include; @@ -886,7 +896,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = @@ -898,17 +908,17 @@ impl KeyManagementAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -963,29 +973,30 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_current_user_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/current_user/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1032,6 +1043,7 @@ impl KeyManagementAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_api_keys"; // unbox and build optional parameters let page_size = params.page_size; @@ -1048,7 +1060,10 @@ impl KeyManagementAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/api_keys", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/api_keys", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1100,17 +1115,17 @@ impl KeyManagementAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1161,6 +1176,7 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_application_keys"; // unbox and build optional parameters let page_size = params.page_size; @@ -1173,7 +1189,10 @@ impl KeyManagementAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/application_keys", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/application_keys", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1207,17 +1226,17 @@ impl KeyManagementAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1272,6 +1291,7 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_current_user_application_keys"; // unbox and build optional parameters let page_size = params.page_size; @@ -1286,7 +1306,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1321,17 +1341,17 @@ impl KeyManagementAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1380,29 +1400,30 @@ impl KeyManagementAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.update_api_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), api_key_id = urlencode(api_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1465,29 +1486,30 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1551,29 +1573,30 @@ impl KeyManagementAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_current_user_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/current_user/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_logs.rs b/src/datadogV2/api/api_logs.rs index d8a00398e..5a9723bec 100644 --- a/src/datadogV2/api/api_logs.rs +++ b/src/datadogV2/api/api_logs.rs @@ -202,28 +202,29 @@ impl LogsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.aggregate_logs"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -297,6 +298,7 @@ impl LogsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_logs"; // unbox and build optional parameters let body = params.body; @@ -305,23 +307,23 @@ impl LogsAPI { let local_uri_str = format!( "{}/api/v2/logs/events/search", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -394,6 +396,7 @@ impl LogsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_logs_get"; // unbox and build optional parameters let filter_query = params.filter_query; @@ -407,7 +410,10 @@ impl LogsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/logs/events", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/logs/events", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -452,17 +458,17 @@ impl LogsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -559,6 +565,7 @@ impl LogsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.submit_log"; // unbox and build optional parameters let content_encoding = params.content_encoding; @@ -566,7 +573,10 @@ impl LogsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/logs", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/logs", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -580,14 +590,14 @@ impl LogsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_logs_archives.rs b/src/datadogV2/api/api_logs_archives.rs index 1b4a75b65..b7f03af63 100644 --- a/src/datadogV2/api/api_logs_archives.rs +++ b/src/datadogV2/api/api_logs_archives.rs @@ -153,29 +153,30 @@ impl LogsArchivesAPI { body: crate::datadogV2::model::RelationshipToRole, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.add_read_role_to_archive"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}/readers", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -227,28 +228,29 @@ impl LogsArchivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.create_logs_archive"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archives", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -301,29 +303,30 @@ impl LogsArchivesAPI { archive_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_logs_archive"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -368,29 +371,30 @@ impl LogsArchivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_logs_archive"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -440,28 +444,29 @@ impl LogsArchivesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_logs_archive_order"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archive-order", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -514,29 +519,30 @@ impl LogsArchivesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_archive_read_roles"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}/readers", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -581,28 +587,29 @@ impl LogsArchivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_logs_archives"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archives", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -653,29 +660,30 @@ impl LogsArchivesAPI { body: crate::datadogV2::model::RelationshipToRole, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.remove_role_from_archive"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}/readers", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -738,29 +746,30 @@ impl LogsArchivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.update_logs_archive"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -825,28 +834,29 @@ impl LogsArchivesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_logs_archive_order"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/archive-order", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_logs_metrics.rs b/src/datadogV2/api/api_logs_metrics.rs index 848339f59..6cd86d89a 100644 --- a/src/datadogV2/api/api_logs_metrics.rs +++ b/src/datadogV2/api/api_logs_metrics.rs @@ -100,28 +100,29 @@ impl LogsMetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_logs_metric"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/metrics", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -174,29 +175,30 @@ impl LogsMetricsAPI { metric_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_logs_metric"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -244,29 +246,30 @@ impl LogsMetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_logs_metric"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -314,28 +317,29 @@ impl LogsMetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_logs_metrics"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/metrics", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -392,29 +396,30 @@ impl LogsMetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_logs_metric"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/logs/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_metrics.rs b/src/datadogV2/api/api_metrics.rs index 84d983478..9859cdbd8 100644 --- a/src/datadogV2/api/api_metrics.rs +++ b/src/datadogV2/api/api_metrics.rs @@ -367,28 +367,29 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_bulk_tags_metrics_configuration"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/metrics/config/bulk-tags", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -460,29 +461,30 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_tag_configuration"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -550,28 +552,29 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.delete_bulk_tags_metrics_configuration"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/metrics/config/bulk-tags", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -629,29 +632,30 @@ impl MetricsAPI { metric_name: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_tag_configuration"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -706,6 +710,7 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.estimate_metrics_output_series"; // unbox and build optional parameters let filter_groups = params.filter_groups; @@ -718,7 +723,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/estimate", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -746,17 +751,17 @@ impl MetricsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -813,6 +818,7 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_active_metric_configurations"; // unbox and build optional parameters let window_seconds = params.window_seconds; @@ -821,7 +827,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/active-configurations", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -833,17 +839,17 @@ impl MetricsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -899,29 +905,30 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_tag_configuration_by_name"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -973,6 +980,7 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_tag_configurations"; // unbox and build optional parameters let filter_configured = params.filter_configured; @@ -985,7 +993,10 @@ impl MetricsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/metrics", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/metrics", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1021,17 +1032,17 @@ impl MetricsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1087,29 +1098,30 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_tags_by_metric_name"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/all-tags", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1168,29 +1180,30 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_volumes_by_metric_name"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/volumes", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1245,9 +1258,10 @@ impl MetricsAPI { ResponseContent, Error, > { - let operation_id = "v2.query_scalar_data".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.query_scalar_data"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.query_scalar_data' is not enabled".to_string(), @@ -1255,26 +1269,27 @@ impl MetricsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/query/scalar", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/query/scalar", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1334,9 +1349,10 @@ impl MetricsAPI { ResponseContent, Error, > { - let operation_id = "v2.query_timeseries_data".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.query_timeseries_data"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.query_timeseries_data' is not enabled".to_string(), @@ -1344,26 +1360,27 @@ impl MetricsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/query/timeseries", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/query/timeseries", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1444,13 +1461,17 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.submit_metrics"; // unbox and build optional parameters let content_encoding = params.content_encoding; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/series", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/series", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1459,14 +1480,14 @@ impl MetricsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; // build body parameters @@ -1538,29 +1559,30 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_tag_configuration"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_monitors.rs b/src/datadogV2/api/api_monitors.rs index c9ee5736b..d9e54c00a 100644 --- a/src/datadogV2/api/api_monitors.rs +++ b/src/datadogV2/api/api_monitors.rs @@ -100,25 +100,29 @@ impl MonitorsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_monitor_config_policy"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/monitor/policy", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/monitor/policy", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -174,29 +178,30 @@ impl MonitorsAPI { policy_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_monitor_config_policy"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/monitor/policy/{policy_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), policy_id = urlencode(policy_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -249,29 +254,30 @@ impl MonitorsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_monitor_config_policy"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/monitor/policy/{policy_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), policy_id = urlencode(policy_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -321,25 +327,29 @@ impl MonitorsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_monitor_config_policies"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/monitor/policy", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/monitor/policy", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -396,29 +406,30 @@ impl MonitorsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_monitor_config_policy"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/monitor/policy/{policy_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), policy_id = urlencode(policy_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_okta_integration.rs b/src/datadogV2/api/api_okta_integration.rs index c089d88c6..5fd77759a 100644 --- a/src/datadogV2/api/api_okta_integration.rs +++ b/src/datadogV2/api/api_okta_integration.rs @@ -102,28 +102,29 @@ impl OktaIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_okta_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -176,29 +177,30 @@ impl OktaIntegrationAPI { account_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_okta_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -246,29 +248,30 @@ impl OktaIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_okta_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -316,28 +319,29 @@ impl OktaIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_okta_accounts"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -392,29 +396,30 @@ impl OktaIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_okta_account"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_opsgenie_integration.rs b/src/datadogV2/api/api_opsgenie_integration.rs index 419a6e506..c72c619cc 100644 --- a/src/datadogV2/api/api_opsgenie_integration.rs +++ b/src/datadogV2/api/api_opsgenie_integration.rs @@ -104,28 +104,29 @@ impl OpsgenieIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_opsgenie_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -181,29 +182,30 @@ impl OpsgenieIntegrationAPI { integration_service_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_opsgenie_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services/{integration_service_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), integration_service_id = urlencode(integration_service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -256,29 +258,30 @@ impl OpsgenieIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_opsgenie_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services/{integration_service_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), integration_service_id = urlencode(integration_service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -328,28 +331,29 @@ impl OpsgenieIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_opsgenie_services"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -406,29 +410,30 @@ impl OpsgenieIntegrationAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_opsgenie_service"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services/{integration_service_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), integration_service_id = urlencode(integration_service_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_organizations.rs b/src/datadogV2/api/api_organizations.rs index 3316ffa58..e741ff6c5 100644 --- a/src/datadogV2/api/api_organizations.rs +++ b/src/datadogV2/api/api_organizations.rs @@ -73,6 +73,7 @@ impl OrganizationsAPI { params: UploadIdPMetadataOptionalParams, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.upload_idp_metadata"; // unbox and build optional parameters let idp_file = params.idp_file; @@ -81,23 +82,23 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v2/saml_configurations/idp_metadata", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build form parameters diff --git a/src/datadogV2/api/api_powerpack.rs b/src/datadogV2/api/api_powerpack.rs index 3906c647f..47b6b2087 100644 --- a/src/datadogV2/api/api_powerpack.rs +++ b/src/datadogV2/api/api_powerpack.rs @@ -115,25 +115,29 @@ impl PowerpackAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_powerpack"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/powerpacks", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/powerpacks", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -186,29 +190,30 @@ impl PowerpackAPI { powerpack_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_powerpack"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/powerpacks/{powerpack_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), powerpack_id = urlencode(powerpack_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -253,29 +258,30 @@ impl PowerpackAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_powerpack"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/powerpacks/{powerpack_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), powerpack_id = urlencode(powerpack_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -324,6 +330,7 @@ impl PowerpackAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_powerpacks"; // unbox and build optional parameters let page_limit = params.page_limit; @@ -331,7 +338,10 @@ impl PowerpackAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/powerpacks", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/powerpacks", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -345,17 +355,17 @@ impl PowerpackAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -410,29 +420,30 @@ impl PowerpackAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_powerpack"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/powerpacks/{powerpack_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), powerpack_id = urlencode(powerpack_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_processes.rs b/src/datadogV2/api/api_processes.rs index 41cb9bf28..b6618fbcc 100644 --- a/src/datadogV2/api/api_processes.rs +++ b/src/datadogV2/api/api_processes.rs @@ -118,6 +118,7 @@ impl ProcessesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_processes"; // unbox and build optional parameters let search = params.search; @@ -129,7 +130,10 @@ impl ProcessesAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/processes", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/processes", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -158,17 +162,17 @@ impl ProcessesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV2/api/api_restriction_policies.rs b/src/datadogV2/api/api_restriction_policies.rs index 4354e8f2c..5ab18b5c2 100644 --- a/src/datadogV2/api/api_restriction_policies.rs +++ b/src/datadogV2/api/api_restriction_policies.rs @@ -76,29 +76,30 @@ impl RestrictionPoliciesAPI { resource_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_restriction_policy"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/restriction_policy/{resource_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), resource_id = urlencode(resource_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -151,29 +152,30 @@ impl RestrictionPoliciesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_restriction_policy"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/restriction_policy/{resource_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), resource_id = urlencode(resource_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -264,29 +266,30 @@ impl RestrictionPoliciesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_restriction_policy"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/restriction_policy/{resource_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), resource_id = urlencode(resource_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_roles.rs b/src/datadogV2/api/api_roles.rs index 2212c3d41..dad692234 100644 --- a/src/datadogV2/api/api_roles.rs +++ b/src/datadogV2/api/api_roles.rs @@ -278,29 +278,30 @@ impl RolesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.add_permission_to_role"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/roles/{role_id}/permissions", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -356,29 +357,30 @@ impl RolesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.add_user_to_role"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -433,29 +435,30 @@ impl RolesAPI { body: crate::datadogV2::model::RoleCloneRequest, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.clone_role"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/roles/{role_id}/clone", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -508,25 +511,29 @@ impl RolesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.create_role"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/roles", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/roles", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -575,29 +582,30 @@ impl RolesAPI { role_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_role"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/roles/{role_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -640,29 +648,30 @@ impl RolesAPI { role_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_role"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/roles/{role_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -709,25 +718,29 @@ impl RolesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_permissions"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/permissions", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/permissions", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -777,29 +790,30 @@ impl RolesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_role_permissions"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/roles/{role_id}/permissions", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -848,6 +862,7 @@ impl RolesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_role_users"; // unbox and build optional parameters let page_size = params.page_size; @@ -859,7 +874,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -883,17 +898,17 @@ impl RolesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -940,6 +955,7 @@ impl RolesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_roles"; // unbox and build optional parameters let page_size = params.page_size; @@ -950,7 +966,10 @@ impl RolesAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/roles", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/roles", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -976,17 +995,17 @@ impl RolesAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1042,29 +1061,30 @@ impl RolesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.remove_permission_from_role"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/roles/{role_id}/permissions", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1126,29 +1146,30 @@ impl RolesAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.remove_user_from_role"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1204,29 +1225,30 @@ impl RolesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.update_role"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/roles/{role_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_rum.rs b/src/datadogV2/api/api_rum.rs index 73d7b4685..2bacf73af 100644 --- a/src/datadogV2/api/api_rum.rs +++ b/src/datadogV2/api/api_rum.rs @@ -177,28 +177,29 @@ impl RUMAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.aggregate_rum_events"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/rum/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -257,25 +258,29 @@ impl RUMAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_rum_application"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/rum/applications", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/rum/applications", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -328,29 +333,30 @@ impl RUMAPI { id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_rum_application"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/rum/applications/{id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), id = urlencode(id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -400,29 +406,30 @@ impl RUMAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_rum_application"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/rum/applications/{id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), id = urlencode(id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -472,25 +479,29 @@ impl RUMAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_rum_applications"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/rum/applications", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/rum/applications", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -549,6 +560,7 @@ impl RUMAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_rum_events"; // unbox and build optional parameters let filter_query = params.filter_query; @@ -560,7 +572,10 @@ impl RUMAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/rum/events", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/rum/events", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -590,17 +605,17 @@ impl RUMAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -660,25 +675,29 @@ impl RUMAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.search_rum_events"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/rum/events/search", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/rum/events/search", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -739,29 +758,30 @@ impl RUMAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_rum_application"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/rum/applications/{id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), id = urlencode(id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_security_monitoring.rs b/src/datadogV2/api/api_security_monitoring.rs index 3ac491b34..d07407c8d 100644 --- a/src/datadogV2/api/api_security_monitoring.rs +++ b/src/datadogV2/api/api_security_monitoring.rs @@ -460,28 +460,29 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_security_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -543,28 +544,29 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_security_monitoring_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/rules", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -620,29 +622,30 @@ impl SecurityMonitoringAPI { security_filter_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_security_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), security_filter_id = urlencode(security_filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -689,29 +692,30 @@ impl SecurityMonitoringAPI { rule_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_security_monitoring_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -766,29 +770,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.edit_security_monitoring_signal_assignee"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}/assignee", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -853,29 +858,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.edit_security_monitoring_signal_incidents"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}/incidents", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -940,29 +946,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.edit_security_monitoring_signal_state"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}/state", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1018,9 +1025,10 @@ impl SecurityMonitoringAPI { params: GetFindingOptionalParams, ) -> Result, Error> { - let operation_id = "v2.get_finding".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.get_finding"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_finding' is not enabled".to_string(), @@ -1028,8 +1036,6 @@ impl SecurityMonitoringAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let snapshot_timestamp = params.snapshot_timestamp; @@ -1037,7 +1043,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/posture_management/findings/{finding_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), finding_id = urlencode(finding_id) ); let mut local_req_builder = @@ -1049,17 +1055,17 @@ impl SecurityMonitoringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1119,29 +1125,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_security_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), security_filter_id = urlencode(security_filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1196,29 +1203,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_security_monitoring_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1273,29 +1281,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_security_monitoring_signal"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1404,9 +1413,10 @@ impl SecurityMonitoringAPI { ResponseContent, Error, > { - let operation_id = "v2.list_findings".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.list_findings"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_findings' is not enabled".to_string(), @@ -1414,8 +1424,6 @@ impl SecurityMonitoringAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let page_limit = params.page_limit; let snapshot_timestamp = params.snapshot_timestamp; @@ -1434,7 +1442,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/posture_management/findings", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1493,17 +1501,17 @@ impl SecurityMonitoringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1552,28 +1560,29 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_security_filters"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1628,6 +1637,7 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_security_monitoring_rules"; // unbox and build optional parameters let page_size = params.page_size; @@ -1637,7 +1647,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1652,17 +1662,17 @@ impl SecurityMonitoringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1721,6 +1731,7 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_security_monitoring_signals"; // unbox and build optional parameters let filter_query = params.filter_query; @@ -1734,7 +1745,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1765,17 +1776,17 @@ impl SecurityMonitoringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1825,9 +1836,10 @@ impl SecurityMonitoringAPI { ResponseContent, Error, > { - let operation_id = "v2.mute_findings".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.mute_findings"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.mute_findings' is not enabled".to_string(), @@ -1835,29 +1847,27 @@ impl SecurityMonitoringAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/posture_management/findings", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1922,6 +1932,7 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.search_security_monitoring_signals"; // unbox and build optional parameters let body = params.body; @@ -1930,23 +1941,23 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/search", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -2013,29 +2024,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_security_filter"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), security_filter_id = urlencode(security_filter_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -2103,29 +2115,30 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_security_monitoring_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/security_monitoring/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_sensitive_data_scanner.rs b/src/datadogV2/api/api_sensitive_data_scanner.rs index 5dc41c08c..acae2e0b9 100644 --- a/src/datadogV2/api/api_sensitive_data_scanner.rs +++ b/src/datadogV2/api/api_sensitive_data_scanner.rs @@ -151,28 +151,29 @@ impl SensitiveDataScannerAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_scanning_group"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/groups", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -240,28 +241,29 @@ impl SensitiveDataScannerAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_scanning_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/rules", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -326,29 +328,30 @@ impl SensitiveDataScannerAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.delete_scanning_group"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/groups/{group_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), group_id = urlencode(group_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -413,29 +416,30 @@ impl SensitiveDataScannerAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.delete_scanning_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -493,28 +497,29 @@ impl SensitiveDataScannerAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_scanning_groups"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -565,28 +570,29 @@ impl SensitiveDataScannerAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_standard_patterns"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/standard-patterns", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -639,28 +645,29 @@ impl SensitiveDataScannerAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.reorder_scanning_groups"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -731,29 +738,30 @@ impl SensitiveDataScannerAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_scanning_group"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/groups/{group_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), group_id = urlencode(group_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -824,29 +832,30 @@ impl SensitiveDataScannerAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_scanning_rule"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_service_accounts.rs b/src/datadogV2/api/api_service_accounts.rs index 05693cdc8..4bbaf5bb0 100644 --- a/src/datadogV2/api/api_service_accounts.rs +++ b/src/datadogV2/api/api_service_accounts.rs @@ -164,25 +164,29 @@ impl ServiceAccountsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_service_account"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/service_accounts", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/service_accounts", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -246,29 +250,30 @@ impl ServiceAccountsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_service_account_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -326,12 +331,13 @@ impl ServiceAccountsAPI { app_key_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_service_account_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id), app_key_id = urlencode(app_key_id) ); @@ -339,17 +345,17 @@ impl ServiceAccountsAPI { local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -404,12 +410,13 @@ impl ServiceAccountsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_service_account_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id), app_key_id = urlencode(app_key_id) ); @@ -417,17 +424,17 @@ impl ServiceAccountsAPI { local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -484,6 +491,7 @@ impl ServiceAccountsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_service_account_application_keys"; // unbox and build optional parameters let page_size = params.page_size; @@ -497,7 +505,7 @@ impl ServiceAccountsAPI { let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id) ); let mut local_req_builder = @@ -529,17 +537,17 @@ impl ServiceAccountsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -602,12 +610,13 @@ impl ServiceAccountsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_service_account_application_key"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id), app_key_id = urlencode(app_key_id) ); @@ -615,17 +624,17 @@ impl ServiceAccountsAPI { local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_service_definition.rs b/src/datadogV2/api/api_service_definition.rs index 4b2d88ca7..658e8d6cd 100644 --- a/src/datadogV2/api/api_service_definition.rs +++ b/src/datadogV2/api/api_service_definition.rs @@ -147,28 +147,29 @@ impl ServiceDefinitionAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_or_update_service_definitions"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/services/definitions", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -224,29 +225,30 @@ impl ServiceDefinitionAPI { service_name: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_service_definition"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/services/definitions/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -301,6 +303,7 @@ impl ServiceDefinitionAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_service_definition"; // unbox and build optional parameters let schema_version = params.schema_version; @@ -309,7 +312,7 @@ impl ServiceDefinitionAPI { let local_uri_str = format!( "{}/api/v2/services/definitions/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = @@ -321,17 +324,17 @@ impl ServiceDefinitionAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -383,6 +386,7 @@ impl ServiceDefinitionAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_service_definitions"; // unbox and build optional parameters let page_size = params.page_size; @@ -393,7 +397,7 @@ impl ServiceDefinitionAPI { let local_uri_str = format!( "{}/api/v2/services/definitions", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -412,17 +416,17 @@ impl ServiceDefinitionAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV2/api/api_service_scorecards.rs b/src/datadogV2/api/api_service_scorecards.rs index 6c08367f2..a94fef4ed 100644 --- a/src/datadogV2/api/api_service_scorecards.rs +++ b/src/datadogV2/api/api_service_scorecards.rs @@ -261,9 +261,10 @@ impl ServiceScorecardsAPI { ResponseContent, Error, > { - let operation_id = "v2.create_scorecard_outcomes_batch".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.create_scorecard_outcomes_batch"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_scorecard_outcomes_batch' is not enabled".to_string(), @@ -271,29 +272,27 @@ impl ServiceScorecardsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/scorecard/outcomes/batch", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -349,9 +348,10 @@ impl ServiceScorecardsAPI { ResponseContent, Error, > { - let operation_id = "v2.create_scorecard_rule".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.create_scorecard_rule"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_scorecard_rule' is not enabled".to_string(), @@ -359,26 +359,27 @@ impl ServiceScorecardsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/scorecard/rules", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/scorecard/rules", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -430,9 +431,10 @@ impl ServiceScorecardsAPI { &self, rule_id: String, ) -> Result, Error> { - let operation_id = "v2.delete_scorecard_rule".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.delete_scorecard_rule"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_scorecard_rule' is not enabled".to_string(), @@ -440,30 +442,28 @@ impl ServiceScorecardsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/scorecard/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -510,9 +510,10 @@ impl ServiceScorecardsAPI { ResponseContent, Error, > { - let operation_id = "v2.list_scorecard_outcomes".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.list_scorecard_outcomes"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_scorecard_outcomes' is not enabled".to_string(), @@ -520,8 +521,6 @@ impl ServiceScorecardsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let page_size = params.page_size; let page_offset = params.page_offset; @@ -538,7 +537,7 @@ impl ServiceScorecardsAPI { let local_uri_str = format!( "{}/api/v2/scorecard/outcomes", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -587,17 +586,17 @@ impl ServiceScorecardsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -646,9 +645,10 @@ impl ServiceScorecardsAPI { ResponseContent, Error, > { - let operation_id = "v2.list_scorecard_rules".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.list_scorecard_rules"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_scorecard_rules' is not enabled".to_string(), @@ -656,8 +656,6 @@ impl ServiceScorecardsAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let page_size = params.page_size; let page_offset = params.page_offset; @@ -672,7 +670,10 @@ impl ServiceScorecardsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/scorecard/rules", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/scorecard/rules", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -718,17 +719,17 @@ impl ServiceScorecardsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV2/api/api_spans.rs b/src/datadogV2/api/api_spans.rs index 824f3fea9..c3330d75b 100644 --- a/src/datadogV2/api/api_spans.rs +++ b/src/datadogV2/api/api_spans.rs @@ -132,28 +132,29 @@ impl SpansAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.aggregate_spans"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/spans/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -219,28 +220,29 @@ impl SpansAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_spans"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/spans/events/search", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -305,6 +307,7 @@ impl SpansAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_spans_get"; // unbox and build optional parameters let filter_query = params.filter_query; @@ -316,7 +319,10 @@ impl SpansAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/spans/events", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/spans/events", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -346,17 +352,17 @@ impl SpansAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV2/api/api_spans_metrics.rs b/src/datadogV2/api/api_spans_metrics.rs index eb4f8b4ba..ea96eb28d 100644 --- a/src/datadogV2/api/api_spans_metrics.rs +++ b/src/datadogV2/api/api_spans_metrics.rs @@ -100,28 +100,29 @@ impl SpansMetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_spans_metric"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/metrics", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -174,29 +175,30 @@ impl SpansMetricsAPI { metric_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_spans_metric"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -244,29 +246,30 @@ impl SpansMetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_spans_metric"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -314,28 +317,29 @@ impl SpansMetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_spans_metrics"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/metrics", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -392,29 +396,30 @@ impl SpansMetricsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_spans_metric"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/apm/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_synthetics.rs b/src/datadogV2/api/api_synthetics.rs index 82613bedc..ee10b0836 100644 --- a/src/datadogV2/api/api_synthetics.rs +++ b/src/datadogV2/api/api_synthetics.rs @@ -63,28 +63,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_on_demand_concurrency_cap"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/synthetics/settings/on_demand_concurrency_cap", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -139,28 +140,29 @@ impl SyntheticsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.set_on_demand_concurrency_cap"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/synthetics/settings/on_demand_concurrency_cap", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_teams.rs b/src/datadogV2/api/api_teams.rs index 5f4a72644..69fc00eda 100644 --- a/src/datadogV2/api/api_teams.rs +++ b/src/datadogV2/api/api_teams.rs @@ -313,25 +313,29 @@ impl TeamsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.create_team"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/team", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/team", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -388,29 +392,30 @@ impl TeamsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_team_link"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/links", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -472,29 +477,30 @@ impl TeamsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_team_membership"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -544,29 +550,30 @@ impl TeamsAPI { team_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_team"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -611,12 +618,13 @@ impl TeamsAPI { link_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_team_link"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/links/{link_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), link_id = urlencode(link_id) ); @@ -624,17 +632,17 @@ impl TeamsAPI { local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -683,12 +691,13 @@ impl TeamsAPI { user_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_team_membership"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), user_id = urlencode(user_id) ); @@ -696,17 +705,17 @@ impl TeamsAPI { local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -750,29 +759,30 @@ impl TeamsAPI { team_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_team"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -820,12 +830,13 @@ impl TeamsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_team_link"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/links/{link_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), link_id = urlencode(link_id) ); @@ -833,17 +844,17 @@ impl TeamsAPI { local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -889,29 +900,30 @@ impl TeamsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_team_links"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/links", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -965,6 +977,7 @@ impl TeamsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_team_memberships"; // unbox and build optional parameters let page_size = params.page_size; @@ -976,7 +989,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -1000,17 +1013,17 @@ impl TeamsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1065,29 +1078,30 @@ impl TeamsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_team_permission_settings"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/permission-settings", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1137,29 +1151,30 @@ impl TeamsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_user_memberships"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/users/{user_uuid}/memberships", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_uuid = urlencode(user_uuid) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1208,6 +1223,7 @@ impl TeamsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_teams"; // unbox and build optional parameters let page_number = params.page_number; @@ -1220,7 +1236,10 @@ impl TeamsAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/team", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/team", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1268,17 +1287,17 @@ impl TeamsAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1328,29 +1347,30 @@ impl TeamsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.update_team"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1412,12 +1432,13 @@ impl TeamsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_team_link"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/links/{link_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), link_id = urlencode(link_id) ); @@ -1425,17 +1446,17 @@ impl TeamsAPI { local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1499,12 +1520,13 @@ impl TeamsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_team_membership"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), user_id = urlencode(user_id) ); @@ -1512,17 +1534,17 @@ impl TeamsAPI { local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -1588,12 +1610,13 @@ impl TeamsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_team_permission_setting"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/team/{team_id}/permission-settings/{action}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), action = urlencode(action) ); @@ -1601,17 +1624,17 @@ impl TeamsAPI { local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/src/datadogV2/api/api_usage_metering.rs b/src/datadogV2/api/api_usage_metering.rs index c50a93623..249756311 100644 --- a/src/datadogV2/api/api_usage_metering.rs +++ b/src/datadogV2/api/api_usage_metering.rs @@ -401,9 +401,10 @@ impl UsageMeteringAPI { ResponseContent, Error, > { - let operation_id = "v2.get_active_billing_dimensions".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.get_active_billing_dimensions"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_active_billing_dimensions' is not enabled".to_string(), @@ -411,29 +412,27 @@ impl UsageMeteringAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/cost_by_tag/active_billing_dimensions", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -493,13 +492,17 @@ impl UsageMeteringAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_cost_by_org"; // unbox and build optional parameters let end_month = params.end_month; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/usage/cost_by_org", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/usage/cost_by_org", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -510,17 +513,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -575,6 +578,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_estimated_cost_by_org"; // unbox and build optional parameters let view = params.view; @@ -587,7 +591,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/estimated_cost", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -614,17 +618,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -683,6 +687,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_historical_cost_by_org"; // unbox and build optional parameters let view = params.view; @@ -692,7 +697,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/historical_cost", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -708,17 +713,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -779,6 +784,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_hourly_usage"; // unbox and build optional parameters let filter_timestamp_end = params.filter_timestamp_end; @@ -792,7 +798,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/hourly_usage", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -833,17 +839,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -929,9 +935,10 @@ impl UsageMeteringAPI { ResponseContent, Error, > { - let operation_id = "v2.get_monthly_cost_attribution".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { - warn!("Using unstable operation {}", operation_id); + let local_configuration = &self.config; + let operation_id = "v2.get_monthly_cost_attribution"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_monthly_cost_attribution' is not enabled".to_string(), @@ -939,8 +946,6 @@ impl UsageMeteringAPI { return Err(Error::UnstableOperationDisabledError(local_error)); } - let local_configuration = &self.config; - // unbox and build optional parameters let sort_direction = params.sort_direction; let sort_name = params.sort_name; @@ -952,7 +957,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/cost_by_tag/monthly_cost_attribution", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -982,17 +987,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1046,6 +1051,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_projected_cost"; // unbox and build optional parameters let view = params.view; @@ -1054,7 +1060,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/projected_cost", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1065,17 +1071,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1134,6 +1140,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_usage_application_security_monitoring"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -1142,7 +1149,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/application_security", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1154,17 +1161,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1224,6 +1231,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_usage_lambda_traced_invocations"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -1232,7 +1240,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/lambda_traced_invocations", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1244,17 +1252,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1314,6 +1322,7 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_usage_observability_pipelines"; // unbox and build optional parameters let end_hr = params.end_hr; @@ -1322,7 +1331,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/observability_pipelines", - local_configuration.base_path + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1334,17 +1343,17 @@ impl UsageMeteringAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; diff --git a/src/datadogV2/api/api_users.rs b/src/datadogV2/api/api_users.rs index 4b2391e7a..acf344b73 100644 --- a/src/datadogV2/api/api_users.rs +++ b/src/datadogV2/api/api_users.rs @@ -197,25 +197,29 @@ impl UsersAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.create_user"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/users", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/users", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -269,29 +273,30 @@ impl UsersAPI { user_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.disable_user"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/users/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -341,29 +346,30 @@ impl UsersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_invitation"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/user_invitations/{user_invitation_uuid}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_invitation_uuid = urlencode(user_invitation_uuid) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -409,29 +415,30 @@ impl UsersAPI { user_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.get_user"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/users/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -482,29 +489,30 @@ impl UsersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_user_organizations"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/users/{user_id}/orgs", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -556,29 +564,30 @@ impl UsersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_user_permissions"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/users/{user_id}/permissions", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -627,6 +636,7 @@ impl UsersAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.list_users"; // unbox and build optional parameters let page_size = params.page_size; @@ -638,7 +648,10 @@ impl UsersAPI { let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/users", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/users", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -668,17 +681,17 @@ impl UsersAPI { }; // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -727,25 +740,29 @@ impl UsersAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.send_invitations"; let local_client = &local_configuration.client; - let local_uri_str = format!("{}/api/v2/user_invitations", local_configuration.base_path); + let local_uri_str = format!( + "{}/api/v2/user_invitations", + local_configuration.get_operation_host(operation_id) + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters @@ -803,29 +820,30 @@ impl UsersAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.update_user"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/users/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); // build user agent - if let Some(ref local_user_agent) = local_configuration.user_agent { - local_req_builder = - local_req_builder.header(reqwest::header::USER_AGENT, local_user_agent.clone()); - } + local_req_builder = local_req_builder.header( + reqwest::header::USER_AGENT, + local_configuration.user_agent.clone(), + ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; // build body parameters diff --git a/tests/main.rs b/tests/main.rs index 343b797e5..89c14f33e 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -56,10 +56,15 @@ async fn main() { .unwrap_or("false".to_string()) .to_lowercase(); let is_replay = !record_mode.eq("true") && !record_mode.eq("none"); + let concurrent_scenarios = match is_replay { + true => 64, + false => 1, + }; let parsed_cli: cli::Opts = cli::Opts::parsed(); let mut cucumber = DatadogWorld::cucumber() .with_default_cli() + .max_concurrent_scenarios(Some(concurrent_scenarios)) .repeat_failed() .fail_on_skipped() .before(move |feature, rule, scenario, world| { @@ -90,27 +95,20 @@ async fn main() { .filter_run("tests/scenarios/features/".to_string(), move |_, _, sc| { let name_re = parsed_cli.re_filter.clone(); let name_match = name_re - .and_then(|filter| { - if filter.is_match(sc.name.as_str()) { - Some(true) - } else { - Some(false) - } - }) + .and_then(|filter| Some(filter.is_match(sc.name.as_str()))) .unwrap_or(true); if !name_match { - return false; - } - if sc.tags.contains(&"skip".into()) || sc.tags.contains(&"skip-rust".into()) { - return false; + false + } else if sc.tags.contains(&"skip".into()) || sc.tags.contains(&"skip-rust".into()) { + false } else if !is_replay && sc.tags.contains(&"replay-only".into()) { - return false; + false } else if is_replay && sc.tags.contains(&"integration-only".into()) { - return false; + false } else if sc.tags.contains(&"with-pagination".into()) { - return false; + false } else { - return true; + true } }) .await; diff --git a/tests/scenarios/fixtures.rs b/tests/scenarios/fixtures.rs index bba275e09..19a908d58 100644 --- a/tests/scenarios/fixtures.rs +++ b/tests/scenarios/fixtures.rs @@ -9,7 +9,7 @@ use cucumber::{ gherkin::{Feature, Rule, Scenario}, given, then, when, World, }; -use datadog_api_client::datadog::configuration::Configuration; +use datadog_api_client::datadog::configuration::{APIKey, Configuration}; use lazy_static::lazy_static; use minijinja::{Environment, State}; use regex::Regex; @@ -102,7 +102,7 @@ pub async fn before_scenario( let mut frozen_time = chrono::Utc::now().signed_duration_since(DateTime::UNIX_EPOCH); let vcr_client_builder = ClientBuilder::new(reqwest::Client::new()); - world.config.client = match env::var("RECORD").unwrap_or("false".to_string()).as_str() { + let client = match env::var("RECORD").unwrap_or("false".to_string()).as_str() { "none" => { prefix.push_str("-Rust"); vcr_client_builder.build() @@ -156,8 +156,21 @@ pub async fn before_scenario( vcr_client_builder.with(middleware).build() } }; - world.config.api_key_auth = Some("00000000000000000000000000000000".to_string()); - world.config.app_key_auth = Some("0000000000000000000000000000000000000000".to_string()); + world.config.client(client); + world.config.set_auth_key( + "apiKeyAuth", + APIKey { + key: "00000000000000000000000000000000".to_string(), + prefix: "".to_owned(), + }, + ); + world.config.set_auth_key( + "appKeyAuth", + APIKey { + key: "0000000000000000000000000000000000000000".to_string(), + prefix: "".to_owned(), + }, + ); let escaped_name = NON_ALNUM_RE .replace_all(scenario.name.as_str(), "_") @@ -213,13 +226,31 @@ pub async fn after_scenario( } #[given(expr = "a valid \"apiKeyAuth\" key in the system")] -fn valid_apikey_auth(world: &mut DatadogWorld) { - world.config.api_key_auth = env::var("DD_TEST_CLIENT_API_KEY").ok(); +fn valid_apikey(world: &mut DatadogWorld) { + world.config.set_auth_key( + "apiKeyAuth", + APIKey { + key: env::var("DD_TEST_CLIENT_API_KEY").unwrap_or_default(), + prefix: "".to_owned(), + }, + ); + if let Some(api) = world.api_name.as_ref() { + initialize_api_instance(world, api.to_string()); + } } #[given(expr = "a valid \"appKeyAuth\" key in the system")] -fn valid_appkey_auth(world: &mut DatadogWorld) { - world.config.app_key_auth = env::var("DD_TEST_CLIENT_APP_KEY").ok(); +fn valid_appkey(world: &mut DatadogWorld) { + world.config.set_auth_key( + "appKeyAuth", + APIKey { + key: env::var("DD_TEST_CLIENT_APP_KEY").unwrap_or_default(), + prefix: "".to_owned(), + }, + ); + if let Some(api) = world.api_name.as_ref() { + initialize_api_instance(world, api.to_string()); + } } #[given(expr = "an instance of {string} API")] diff --git a/tests/scenarios/function_mappings.rs b/tests/scenarios/function_mappings.rs index 5b19c5483..4b9f940a0 100644 --- a/tests/scenarios/function_mappings.rs +++ b/tests/scenarios/function_mappings.rs @@ -2397,7 +2397,7 @@ fn test_v1_get_ip_ranges(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2421,7 +2421,7 @@ fn test_v1_list_api_keys(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2446,7 +2446,7 @@ fn test_v1_create_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2471,7 +2471,7 @@ fn test_v1_delete_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2496,7 +2496,7 @@ fn test_v1_get_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2522,7 +2522,7 @@ fn test_v1_update_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2546,7 +2546,7 @@ fn test_v1_list_application_keys(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2571,7 +2571,7 @@ fn test_v1_create_application_key(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2596,7 +2596,7 @@ fn test_v1_delete_application_key(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2621,7 +2621,7 @@ fn test_v1_get_application_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2647,7 +2647,7 @@ fn test_v1_update_application_key(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2672,7 +2672,7 @@ fn test_v1_submit_service_check(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2717,7 +2717,7 @@ fn test_v1_get_daily_custom_reports( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2746,7 +2746,7 @@ fn test_v1_get_specified_daily_custom_reports( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2791,7 +2791,7 @@ fn test_v1_get_monthly_custom_reports( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2820,7 +2820,7 @@ fn test_v1_get_specified_monthly_custom_reports( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2851,7 +2851,7 @@ fn test_v1_get_usage_analyzed_logs(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2905,7 +2905,7 @@ fn test_v1_get_usage_attribution(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2935,7 +2935,7 @@ fn test_v1_get_usage_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2965,7 +2965,7 @@ fn test_v1_get_usage_lambda(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2998,7 +2998,7 @@ fn test_v1_get_usage_billable_summary( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3028,7 +3028,7 @@ fn test_v1_get_usage_ci_app(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3063,7 +3063,7 @@ fn test_v1_get_usage_cloud_security_posture_management( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3093,7 +3093,7 @@ fn test_v1_get_usage_cws(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3123,7 +3123,7 @@ fn test_v1_get_usage_dbm(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3153,7 +3153,7 @@ fn test_v1_get_usage_fargate(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3183,7 +3183,7 @@ fn test_v1_get_usage_hosts(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3233,7 +3233,7 @@ fn test_v1_get_hourly_usage_attribution( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3264,7 +3264,7 @@ fn test_v1_get_incident_management(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3295,7 +3295,7 @@ fn test_v1_get_usage_indexed_spans(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3325,7 +3325,7 @@ fn test_v1_get_ingested_spans(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3360,7 +3360,7 @@ fn test_v1_get_usage_internet_of_things( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3390,7 +3390,7 @@ fn test_v1_get_usage_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3425,7 +3425,7 @@ fn test_v1_get_usage_logs_by_retention( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3460,7 +3460,7 @@ fn test_v1_get_usage_logs_by_index(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3520,7 +3520,7 @@ fn test_v1_get_monthly_usage_attribution( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3551,7 +3551,7 @@ fn test_v1_get_usage_network_flows(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3582,7 +3582,7 @@ fn test_v1_get_usage_network_hosts(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3616,7 +3616,7 @@ fn test_v1_get_usage_online_archive( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3646,7 +3646,7 @@ fn test_v1_get_usage_profiling(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3676,7 +3676,7 @@ fn test_v1_get_usage_rum_units(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3711,7 +3711,7 @@ fn test_v1_get_usage_rum_sessions(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3741,7 +3741,7 @@ fn test_v1_get_usage_sds(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3771,7 +3771,7 @@ fn test_v1_get_usage_snmp(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3806,7 +3806,7 @@ fn test_v1_get_usage_summary(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3837,7 +3837,7 @@ fn test_v1_get_usage_synthetics(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3871,7 +3871,7 @@ fn test_v1_get_usage_synthetics_api( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3906,7 +3906,7 @@ fn test_v1_get_usage_synthetics_browser( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3937,7 +3937,7 @@ fn test_v1_get_usage_timeseries(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3986,7 +3986,7 @@ fn test_v1_get_usage_top_avg_metrics( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4011,7 +4011,7 @@ fn test_v1_delete_dashboards(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4052,7 +4052,7 @@ fn test_v1_list_dashboards(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4077,7 +4077,7 @@ fn test_v1_restore_dashboards(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4102,7 +4102,7 @@ fn test_v1_create_dashboard(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4127,7 +4127,7 @@ fn test_v1_create_public_dashboard(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4152,7 +4152,7 @@ fn test_v1_delete_public_dashboard(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4177,7 +4177,7 @@ fn test_v1_get_public_dashboard(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4203,7 +4203,7 @@ fn test_v1_update_public_dashboard(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4233,7 +4233,7 @@ fn test_v1_delete_public_dashboard_invitation( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4272,7 +4272,7 @@ fn test_v1_get_public_dashboard_invitations( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4302,7 +4302,7 @@ fn test_v1_send_public_dashboard_invitation( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4328,7 +4328,7 @@ fn test_v1_delete_dashboard(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4354,7 +4354,7 @@ fn test_v1_get_dashboard(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4381,7 +4381,7 @@ fn test_v1_update_dashboard(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4405,7 +4405,7 @@ fn test_v1_list_dashboard_lists(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4430,7 +4430,7 @@ fn test_v1_create_dashboard_list(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4455,7 +4455,7 @@ fn test_v1_delete_dashboard_list(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4480,7 +4480,7 @@ fn test_v1_get_dashboard_list(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4506,7 +4506,7 @@ fn test_v1_update_dashboard_list(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4539,7 +4539,7 @@ fn test_v1_submit_distribution_points( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4573,7 +4573,7 @@ fn test_v1_list_active_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4599,7 +4599,7 @@ fn test_v1_get_metric_metadata(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4626,7 +4626,7 @@ fn test_v1_update_metric_metadata(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4653,7 +4653,7 @@ fn test_v1_query_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4678,7 +4678,7 @@ fn test_v1_list_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4708,7 +4708,7 @@ fn test_v1_submit_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4741,7 +4741,7 @@ fn test_v1_list_downtimes(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4766,7 +4766,7 @@ fn test_v1_create_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4794,7 +4794,7 @@ fn test_v1_cancel_downtimes_by_scope( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4820,7 +4820,7 @@ fn test_v1_cancel_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4846,7 +4846,7 @@ fn test_v1_get_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4873,7 +4873,7 @@ fn test_v1_update_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4899,7 +4899,7 @@ fn test_v1_list_monitor_downtimes(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4950,7 +4950,7 @@ fn test_v1_list_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4975,7 +4975,7 @@ fn test_v1_create_event(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5000,7 +5000,7 @@ fn test_v1_get_event(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5051,7 +5051,7 @@ fn test_v1_get_graph_snapshot(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5077,7 +5077,7 @@ fn test_v1_mute_host(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5102,7 +5102,7 @@ fn test_v1_unmute_host(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5159,7 +5159,7 @@ fn test_v1_list_hosts(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5188,7 +5188,7 @@ fn test_v1_get_host_totals(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5213,7 +5213,7 @@ fn test_v1_delete_aws_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5250,7 +5250,7 @@ fn test_v1_list_aws_accounts(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5275,7 +5275,7 @@ fn test_v1_create_aws_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5313,7 +5313,7 @@ fn test_v1_update_aws_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5340,7 +5340,7 @@ fn test_v1_list_available_aws_namespaces( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5368,7 +5368,7 @@ fn test_v1_delete_aws_event_bridge_source( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5395,7 +5395,7 @@ fn test_v1_list_aws_event_bridge_sources( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5423,7 +5423,7 @@ fn test_v1_create_aws_event_bridge_source( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5448,7 +5448,7 @@ fn test_v1_delete_aws_tag_filter(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5474,7 +5474,7 @@ fn test_v1_list_aws_tag_filters(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5499,7 +5499,7 @@ fn test_v1_create_aws_tag_filter(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5527,7 +5527,7 @@ fn test_v1_create_new_aws_external_id( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5552,7 +5552,7 @@ fn test_v1_delete_aws_lambda_arn(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5579,7 +5579,7 @@ fn test_v1_list_aws_logs_integrations( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5604,7 +5604,7 @@ fn test_v1_create_aws_lambda_arn(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5632,7 +5632,7 @@ fn test_v1_check_aws_logs_lambda_async( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5656,7 +5656,7 @@ fn test_v1_list_aws_logs_services(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5681,7 +5681,7 @@ fn test_v1_enable_aws_log_services(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5709,7 +5709,7 @@ fn test_v1_check_aws_logs_services_async( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5737,7 +5737,7 @@ fn test_v1_delete_azure_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5761,7 +5761,7 @@ fn test_v1_list_azure_integration(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5789,7 +5789,7 @@ fn test_v1_create_azure_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5817,7 +5817,7 @@ fn test_v1_update_azure_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5845,7 +5845,7 @@ fn test_v1_update_azure_host_filters( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5870,7 +5870,7 @@ fn test_v1_delete_gcp_integration(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5894,7 +5894,7 @@ fn test_v1_list_gcp_integration(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5919,7 +5919,7 @@ fn test_v1_create_gcp_integration(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5944,7 +5944,7 @@ fn test_v1_update_gcp_integration(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5972,7 +5972,7 @@ fn test_v1_create_pager_duty_integration_service( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6002,7 +6002,7 @@ fn test_v1_delete_pager_duty_integration_service( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6032,7 +6032,7 @@ fn test_v1_get_pager_duty_integration_service( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6064,7 +6064,7 @@ fn test_v1_update_pager_duty_integration_service( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6093,7 +6093,7 @@ fn test_v1_get_slack_integration_channels( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6124,7 +6124,7 @@ fn test_v1_create_slack_integration_channel( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6157,7 +6157,7 @@ fn test_v1_remove_slack_integration_channel( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6190,7 +6190,7 @@ fn test_v1_get_slack_integration_channel( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6226,7 +6226,7 @@ fn test_v1_update_slack_integration_channel( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6255,7 +6255,7 @@ fn test_v1_create_webhooks_integration_custom_variable( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6286,7 +6286,7 @@ fn test_v1_delete_webhooks_integration_custom_variable( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6317,7 +6317,7 @@ fn test_v1_get_webhooks_integration_custom_variable( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6349,7 +6349,7 @@ fn test_v1_update_webhooks_integration_custom_variable( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6377,7 +6377,7 @@ fn test_v1_create_webhooks_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6406,7 +6406,7 @@ fn test_v1_delete_webhooks_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6435,7 +6435,7 @@ fn test_v1_get_webhooks_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6466,7 +6466,7 @@ fn test_v1_update_webhooks_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6491,7 +6491,7 @@ fn test_v1_list_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6525,7 +6525,7 @@ fn test_v1_submit_log(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6549,7 +6549,7 @@ fn test_v1_get_logs_index_order(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6574,7 +6574,7 @@ fn test_v1_update_logs_index_order(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6598,7 +6598,7 @@ fn test_v1_list_log_indexes(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6623,7 +6623,7 @@ fn test_v1_create_logs_index(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6648,7 +6648,7 @@ fn test_v1_get_logs_index(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6674,7 +6674,7 @@ fn test_v1_update_logs_index(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6698,7 +6698,7 @@ fn test_v1_get_logs_pipeline_order(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6726,7 +6726,7 @@ fn test_v1_update_logs_pipeline_order( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6750,7 +6750,7 @@ fn test_v1_list_logs_pipelines(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6775,7 +6775,7 @@ fn test_v1_create_logs_pipeline(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6801,7 +6801,7 @@ fn test_v1_delete_logs_pipeline(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6827,7 +6827,7 @@ fn test_v1_get_logs_pipeline(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6854,7 +6854,7 @@ fn test_v1_update_logs_pipeline(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6911,7 +6911,7 @@ fn test_v1_list_monitors(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6936,7 +6936,7 @@ fn test_v1_create_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6965,7 +6965,7 @@ fn test_v1_check_can_delete_monitor( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7006,7 +7006,7 @@ fn test_v1_search_monitor_groups(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7047,7 +7047,7 @@ fn test_v1_search_monitors(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7072,7 +7072,7 @@ fn test_v1_validate_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7103,7 +7103,7 @@ fn test_v1_delete_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7138,7 +7138,7 @@ fn test_v1_get_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7165,7 +7165,7 @@ fn test_v1_update_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7195,7 +7195,7 @@ fn test_v1_validate_existing_monitor( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7260,7 +7260,7 @@ fn test_v1_list_notebooks(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7285,7 +7285,7 @@ fn test_v1_create_notebook(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7311,7 +7311,7 @@ fn test_v1_delete_notebook(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7337,7 +7337,7 @@ fn test_v1_get_notebook(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7364,7 +7364,7 @@ fn test_v1_update_notebook(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7388,7 +7388,7 @@ fn test_v1_list_orgs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7413,7 +7413,7 @@ fn test_v1_create_child_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7438,7 +7438,7 @@ fn test_v1_get_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7464,7 +7464,7 @@ fn test_v1_update_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7489,7 +7489,7 @@ fn test_v1_downgrade_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7521,7 +7521,7 @@ fn test_v1_upload_idp_for_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7552,7 +7552,7 @@ fn test_v1_add_security_monitoring_signal_to_incident( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7583,7 +7583,7 @@ fn test_v1_edit_security_monitoring_signal_assignee( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7613,7 +7613,7 @@ fn test_v1_edit_security_monitoring_signal_state( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7663,7 +7663,7 @@ fn test_v1_list_slos(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7688,7 +7688,7 @@ fn test_v1_create_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7716,7 +7716,7 @@ fn test_v1_delete_slo_timeframe_in_bulk( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7741,7 +7741,7 @@ fn test_v1_check_can_delete_slo(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7783,7 +7783,7 @@ fn test_v1_search_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7814,7 +7814,7 @@ fn test_v1_delete_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7844,7 +7844,7 @@ fn test_v1_get_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7870,7 +7870,7 @@ fn test_v1_update_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7895,7 +7895,7 @@ fn test_v1_get_slo_corrections(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7933,7 +7933,7 @@ fn test_v1_get_slo_history(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7966,7 +7966,7 @@ fn test_v1_list_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7991,7 +7991,7 @@ fn test_v1_create_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8017,7 +8017,7 @@ fn test_v1_delete_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8043,7 +8043,7 @@ fn test_v1_get_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8071,7 +8071,7 @@ fn test_v1_update_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8096,7 +8096,7 @@ fn test_v1_get_synthetics_ci_batch(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8120,7 +8120,7 @@ fn test_v1_list_locations(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8145,7 +8145,7 @@ fn test_v1_create_private_location(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8171,7 +8171,7 @@ fn test_v1_delete_private_location(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8197,7 +8197,7 @@ fn test_v1_get_private_location(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8224,7 +8224,7 @@ fn test_v1_update_private_location(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8251,7 +8251,7 @@ fn test_v1_get_synthetics_default_locations( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8284,7 +8284,7 @@ fn test_v1_list_tests(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8312,7 +8312,7 @@ fn test_v1_create_synthetics_api_test( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8337,7 +8337,7 @@ fn test_v1_get_api_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8363,7 +8363,7 @@ fn test_v1_update_api_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8391,7 +8391,7 @@ fn test_v1_create_synthetics_browser_test( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8416,7 +8416,7 @@ fn test_v1_get_browser_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8442,7 +8442,7 @@ fn test_v1_update_browser_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8485,7 +8485,7 @@ fn test_v1_get_browser_test_latest_results( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8512,7 +8512,7 @@ fn test_v1_get_browser_test_result(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8537,7 +8537,7 @@ fn test_v1_delete_tests(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8562,7 +8562,7 @@ fn test_v1_trigger_tests(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8587,7 +8587,7 @@ fn test_v1_trigger_ci_tests(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8612,7 +8612,7 @@ fn test_v1_get_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8638,7 +8638,7 @@ fn test_v1_patch_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8681,7 +8681,7 @@ fn test_v1_get_api_test_latest_results( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8707,7 +8707,7 @@ fn test_v1_get_api_test_result(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8736,7 +8736,7 @@ fn test_v1_update_test_pause_status( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8760,7 +8760,7 @@ fn test_v1_list_global_variables(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8785,7 +8785,7 @@ fn test_v1_create_global_variable(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8811,7 +8811,7 @@ fn test_v1_delete_global_variable(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8837,7 +8837,7 @@ fn test_v1_get_global_variable(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8864,7 +8864,7 @@ fn test_v1_edit_global_variable(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8893,7 +8893,7 @@ fn test_v1_list_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8923,7 +8923,7 @@ fn test_v1_delete_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8953,7 +8953,7 @@ fn test_v1_get_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8984,7 +8984,7 @@ fn test_v1_create_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9015,7 +9015,7 @@ fn test_v1_update_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9039,7 +9039,7 @@ fn test_v1_list_users(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9064,7 +9064,7 @@ fn test_v1_create_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9090,7 +9090,7 @@ fn test_v1_disable_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9116,7 +9116,7 @@ fn test_v1_get_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9143,7 +9143,7 @@ fn test_v1_update_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9167,7 +9167,7 @@ fn test_v1_validate(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9236,7 +9236,7 @@ fn test_v2_list_api_keys(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9261,7 +9261,7 @@ fn test_v2_create_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9287,7 +9287,7 @@ fn test_v2_delete_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9318,7 +9318,7 @@ fn test_v2_get_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9345,7 +9345,7 @@ fn test_v2_update_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9399,7 +9399,7 @@ fn test_v2_list_application_keys(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9425,7 +9425,7 @@ fn test_v2_delete_application_key(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9456,7 +9456,7 @@ fn test_v2_get_application_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9483,7 +9483,7 @@ fn test_v2_update_application_key(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9540,7 +9540,7 @@ fn test_v2_list_current_user_application_keys( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9568,7 +9568,7 @@ fn test_v2_create_current_user_application_key( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9598,7 +9598,7 @@ fn test_v2_delete_current_user_application_key( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9627,7 +9627,7 @@ fn test_v2_get_current_user_application_key( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9658,7 +9658,7 @@ fn test_v2_update_current_user_application_key( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9682,7 +9682,7 @@ fn test_v2_list_spans_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9707,7 +9707,7 @@ fn test_v2_create_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9732,7 +9732,7 @@ fn test_v2_delete_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9757,7 +9757,7 @@ fn test_v2_get_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9783,7 +9783,7 @@ fn test_v2_update_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9810,7 +9810,7 @@ fn test_v2_list_apm_retention_filters( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9838,7 +9838,7 @@ fn test_v2_create_apm_retention_filter( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9866,7 +9866,7 @@ fn test_v2_reorder_apm_retention_filters( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9894,7 +9894,7 @@ fn test_v2_delete_apm_retention_filter( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9922,7 +9922,7 @@ fn test_v2_get_apm_retention_filter( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9951,7 +9951,7 @@ fn test_v2_update_apm_retention_filter( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10000,7 +10000,7 @@ fn test_v2_list_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10029,7 +10029,7 @@ fn test_v2_search_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10070,7 +10070,7 @@ fn test_v2_list_authn_mappings(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10095,7 +10095,7 @@ fn test_v2_create_authn_mapping(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10121,7 +10121,7 @@ fn test_v2_delete_authn_mapping(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10147,7 +10147,7 @@ fn test_v2_get_authn_mapping(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10174,7 +10174,7 @@ fn test_v2_update_authn_mapping(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10202,7 +10202,7 @@ fn test_v2_create_ci_app_pipeline_event( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10230,7 +10230,7 @@ fn test_v2_aggregate_ci_app_pipeline_events( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10284,7 +10284,7 @@ fn test_v2_list_ci_app_pipeline_events( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10316,7 +10316,7 @@ fn test_v2_search_ci_app_pipeline_events( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10344,7 +10344,7 @@ fn test_v2_aggregate_ci_app_test_events( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10394,7 +10394,7 @@ fn test_v2_list_ci_app_test_events(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10427,7 +10427,7 @@ fn test_v2_search_ci_app_test_events( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10473,7 +10473,7 @@ fn test_v2_list_container_images(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10518,7 +10518,7 @@ fn test_v2_list_containers(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10545,7 +10545,7 @@ fn test_v2_list_cost_awscur_configs( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10573,7 +10573,7 @@ fn test_v2_create_cost_awscur_config( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10602,7 +10602,7 @@ fn test_v2_delete_cost_awscur_config( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10633,7 +10633,7 @@ fn test_v2_update_cost_awscur_config( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10669,7 +10669,7 @@ fn test_v2_list_aws_related_accounts( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10696,7 +10696,7 @@ fn test_v2_list_cost_azure_uc_configs( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10724,7 +10724,7 @@ fn test_v2_create_cost_azure_uc_configs( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10754,7 +10754,7 @@ fn test_v2_delete_cost_azure_uc_config( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10785,7 +10785,7 @@ fn test_v2_update_cost_azure_uc_configs( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10809,7 +10809,7 @@ fn test_v2_get_cloud_cost_activity(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10836,7 +10836,7 @@ fn test_v2_get_active_billing_dimensions( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10894,7 +10894,7 @@ fn test_v2_get_monthly_cost_attribution( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10929,7 +10929,7 @@ fn test_v2_get_usage_application_security_monitoring( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10960,7 +10960,7 @@ fn test_v2_get_cost_by_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11009,7 +11009,7 @@ fn test_v2_get_estimated_cost_by_org( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11049,7 +11049,7 @@ fn test_v2_get_historical_cost_by_org( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11108,7 +11108,7 @@ fn test_v2_get_hourly_usage(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11144,7 +11144,7 @@ fn test_v2_get_usage_lambda_traced_invocations( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11179,7 +11179,7 @@ fn test_v2_get_usage_observability_pipelines( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11208,7 +11208,7 @@ fn test_v2_get_projected_cost(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11239,7 +11239,7 @@ fn test_v2_delete_dashboard_list_items( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11268,7 +11268,7 @@ fn test_v2_get_dashboard_list_items( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11299,7 +11299,7 @@ fn test_v2_create_dashboard_list_items( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11330,7 +11330,7 @@ fn test_v2_update_dashboard_list_items( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11355,7 +11355,7 @@ fn test_v2_create_dora_deployment(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11380,7 +11380,7 @@ fn test_v2_create_dora_incident(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11421,7 +11421,7 @@ fn test_v2_list_downtimes(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11446,7 +11446,7 @@ fn test_v2_create_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11472,7 +11472,7 @@ fn test_v2_cancel_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11503,7 +11503,7 @@ fn test_v2_get_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11530,7 +11530,7 @@ fn test_v2_update_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11565,7 +11565,7 @@ fn test_v2_list_monitor_downtimes(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11614,7 +11614,7 @@ fn test_v2_list_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11643,7 +11643,7 @@ fn test_v2_search_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11680,7 +11680,7 @@ fn test_v2_list_incidents(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11705,7 +11705,7 @@ fn test_v2_create_incident(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11747,7 +11747,7 @@ fn test_v2_search_incidents(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11773,7 +11773,7 @@ fn test_v2_delete_incident(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11804,7 +11804,7 @@ fn test_v2_get_incident(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11836,7 +11836,7 @@ fn test_v2_update_incident(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11876,7 +11876,7 @@ fn test_v2_list_incident_attachments( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11913,7 +11913,7 @@ fn test_v2_update_incident_attachments( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11942,7 +11942,7 @@ fn test_v2_list_incident_integrations( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11973,7 +11973,7 @@ fn test_v2_create_incident_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12007,7 +12007,7 @@ fn test_v2_delete_incident_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12041,7 +12041,7 @@ fn test_v2_get_incident_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12078,7 +12078,7 @@ fn test_v2_update_incident_integration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12104,7 +12104,7 @@ fn test_v2_list_incident_todos(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12131,7 +12131,7 @@ fn test_v2_create_incident_todo(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12158,7 +12158,7 @@ fn test_v2_delete_incident_todo(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12185,7 +12185,7 @@ fn test_v2_get_incident_todo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12214,7 +12214,7 @@ fn test_v2_update_incident_todo(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12238,7 +12238,7 @@ fn test_v2_list_gcpsts_accounts(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12263,7 +12263,7 @@ fn test_v2_create_gcpsts_account(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12289,7 +12289,7 @@ fn test_v2_delete_gcpsts_account(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12316,7 +12316,7 @@ fn test_v2_update_gcpsts_account(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12340,7 +12340,7 @@ fn test_v2_get_gcpsts_delegate(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12370,7 +12370,7 @@ fn test_v2_make_gcpsts_delegate(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12394,7 +12394,7 @@ fn test_v2_list_opsgenie_services(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12419,7 +12419,7 @@ fn test_v2_create_opsgenie_service(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12446,7 +12446,7 @@ fn test_v2_delete_opsgenie_service(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12472,7 +12472,7 @@ fn test_v2_get_opsgenie_service(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12500,7 +12500,7 @@ fn test_v2_update_opsgenie_service(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12527,7 +12527,7 @@ fn test_v2_list_cloudflare_accounts( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12555,7 +12555,7 @@ fn test_v2_create_cloudflare_account( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12584,7 +12584,7 @@ fn test_v2_delete_cloudflare_account( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12610,7 +12610,7 @@ fn test_v2_get_cloudflare_account(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12640,7 +12640,7 @@ fn test_v2_update_cloudflare_account( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12664,7 +12664,7 @@ fn test_v2_list_confluent_account(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12692,7 +12692,7 @@ fn test_v2_create_confluent_account( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12721,7 +12721,7 @@ fn test_v2_delete_confluent_account( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12747,7 +12747,7 @@ fn test_v2_get_confluent_account(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12777,7 +12777,7 @@ fn test_v2_update_confluent_account( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12803,7 +12803,7 @@ fn test_v2_list_confluent_resource(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12833,7 +12833,7 @@ fn test_v2_create_confluent_resource( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12865,7 +12865,7 @@ fn test_v2_delete_confluent_resource( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12894,7 +12894,7 @@ fn test_v2_get_confluent_resource(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12928,7 +12928,7 @@ fn test_v2_update_confluent_resource( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12952,7 +12952,7 @@ fn test_v2_list_fastly_accounts(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12977,7 +12977,7 @@ fn test_v2_create_fastly_account(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13003,7 +13003,7 @@ fn test_v2_delete_fastly_account(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13029,7 +13029,7 @@ fn test_v2_get_fastly_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13056,7 +13056,7 @@ fn test_v2_update_fastly_account(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13082,7 +13082,7 @@ fn test_v2_list_fastly_services(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13109,7 +13109,7 @@ fn test_v2_create_fastly_service(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13138,7 +13138,7 @@ fn test_v2_delete_fastly_service(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13166,7 +13166,7 @@ fn test_v2_get_fastly_service(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13196,7 +13196,7 @@ fn test_v2_update_fastly_service(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13220,7 +13220,7 @@ fn test_v2_list_okta_accounts(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13245,7 +13245,7 @@ fn test_v2_create_okta_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13271,7 +13271,7 @@ fn test_v2_delete_okta_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13297,7 +13297,7 @@ fn test_v2_get_okta_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13324,7 +13324,7 @@ fn test_v2_update_okta_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13348,7 +13348,7 @@ fn test_v2_get_ip_allowlist(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13373,7 +13373,7 @@ fn test_v2_update_ip_allowlist(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13407,7 +13407,7 @@ fn test_v2_submit_log(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13432,7 +13432,7 @@ fn test_v2_aggregate_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13489,7 +13489,7 @@ fn test_v2_list_logs_get(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13518,7 +13518,7 @@ fn test_v2_list_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13542,7 +13542,7 @@ fn test_v2_get_logs_archive_order(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13570,7 +13570,7 @@ fn test_v2_update_logs_archive_order( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13594,7 +13594,7 @@ fn test_v2_list_logs_archives(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13619,7 +13619,7 @@ fn test_v2_create_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13645,7 +13645,7 @@ fn test_v2_delete_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13671,7 +13671,7 @@ fn test_v2_get_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13698,7 +13698,7 @@ fn test_v2_update_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13728,7 +13728,7 @@ fn test_v2_remove_role_from_archive( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13754,7 +13754,7 @@ fn test_v2_list_archive_read_roles(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13784,7 +13784,7 @@ fn test_v2_add_read_role_to_archive( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13808,7 +13808,7 @@ fn test_v2_list_logs_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13833,7 +13833,7 @@ fn test_v2_create_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13858,7 +13858,7 @@ fn test_v2_delete_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13883,7 +13883,7 @@ fn test_v2_get_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13909,7 +13909,7 @@ fn test_v2_update_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13962,7 +13962,7 @@ fn test_v2_list_tag_configurations(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13990,7 +13990,7 @@ fn test_v2_delete_bulk_tags_metrics_configuration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14018,7 +14018,7 @@ fn test_v2_create_bulk_tags_metrics_configuration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14054,7 +14054,7 @@ fn test_v2_list_active_metric_configurations( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14083,7 +14083,7 @@ fn test_v2_list_tags_by_metric_name( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14135,7 +14135,7 @@ fn test_v2_estimate_metrics_output_series( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14164,7 +14164,7 @@ fn test_v2_delete_tag_configuration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14193,7 +14193,7 @@ fn test_v2_list_tag_configuration_by_name( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14223,7 +14223,7 @@ fn test_v2_update_tag_configuration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14253,7 +14253,7 @@ fn test_v2_create_tag_configuration( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14282,7 +14282,7 @@ fn test_v2_list_volumes_by_metric_name( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14307,7 +14307,7 @@ fn test_v2_query_scalar_data(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14332,7 +14332,7 @@ fn test_v2_query_timeseries_data(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14362,7 +14362,7 @@ fn test_v2_submit_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14389,7 +14389,7 @@ fn test_v2_list_monitor_config_policies( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14417,7 +14417,7 @@ fn test_v2_create_monitor_config_policy( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14445,7 +14445,7 @@ fn test_v2_delete_monitor_config_policy( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14473,7 +14473,7 @@ fn test_v2_get_monitor_config_policy( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14503,7 +14503,7 @@ fn test_v2_update_monitor_config_policy( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14527,7 +14527,7 @@ fn test_v2_list_permissions(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14572,7 +14572,7 @@ fn test_v2_list_roles(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14597,7 +14597,7 @@ fn test_v2_create_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14622,7 +14622,7 @@ fn test_v2_delete_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14647,7 +14647,7 @@ fn test_v2_get_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14673,7 +14673,7 @@ fn test_v2_update_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14699,7 +14699,7 @@ fn test_v2_clone_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14728,7 +14728,7 @@ fn test_v2_remove_permission_from_role( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14753,7 +14753,7 @@ fn test_v2_list_role_permissions(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14779,7 +14779,7 @@ fn test_v2_add_permission_to_role(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14805,7 +14805,7 @@ fn test_v2_remove_user_from_role(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14847,7 +14847,7 @@ fn test_v2_list_role_users(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14873,7 +14873,7 @@ fn test_v2_add_user_to_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14946,7 +14946,7 @@ fn test_v2_list_findings(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14971,7 +14971,7 @@ fn test_v2_mute_findings(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15002,7 +15002,7 @@ fn test_v2_get_finding(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15026,7 +15026,7 @@ fn test_v2_list_security_filters(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15051,7 +15051,7 @@ fn test_v2_create_security_filter(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15077,7 +15077,7 @@ fn test_v2_delete_security_filter(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15103,7 +15103,7 @@ fn test_v2_get_security_filter(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15131,7 +15131,7 @@ fn test_v2_update_security_filter(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15169,7 +15169,7 @@ fn test_v2_list_security_monitoring_rules( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15197,7 +15197,7 @@ fn test_v2_create_security_monitoring_rule( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15225,7 +15225,7 @@ fn test_v2_delete_security_monitoring_rule( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15253,7 +15253,7 @@ fn test_v2_get_security_monitoring_rule( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15283,7 +15283,7 @@ fn test_v2_update_security_monitoring_rule( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15335,7 +15335,7 @@ fn test_v2_list_security_monitoring_signals( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15367,7 +15367,7 @@ fn test_v2_search_security_monitoring_signals( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15395,7 +15395,7 @@ fn test_v2_get_security_monitoring_signal( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15426,7 +15426,7 @@ fn test_v2_edit_security_monitoring_signal_assignee( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15457,7 +15457,7 @@ fn test_v2_edit_security_monitoring_signal_incidents( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15487,7 +15487,7 @@ fn test_v2_edit_security_monitoring_signal_state( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15520,7 +15520,7 @@ fn test_v2_list_powerpacks(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15545,7 +15545,7 @@ fn test_v2_create_powerpack(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15571,7 +15571,7 @@ fn test_v2_delete_powerpack(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15597,7 +15597,7 @@ fn test_v2_get_powerpack(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15624,7 +15624,7 @@ fn test_v2_update_powerpack(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15673,7 +15673,7 @@ fn test_v2_list_processes(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15702,7 +15702,7 @@ fn test_v2_delete_restriction_policy( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15728,7 +15728,7 @@ fn test_v2_get_restriction_policy(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15758,7 +15758,7 @@ fn test_v2_update_restriction_policy( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15783,7 +15783,7 @@ fn test_v2_aggregate_rum_events(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15807,7 +15807,7 @@ fn test_v2_get_rum_applications(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15832,7 +15832,7 @@ fn test_v2_create_rum_application(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15857,7 +15857,7 @@ fn test_v2_delete_rum_application(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15882,7 +15882,7 @@ fn test_v2_get_rum_application(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15908,7 +15908,7 @@ fn test_v2_update_rum_application(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15957,7 +15957,7 @@ fn test_v2_list_rum_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15982,7 +15982,7 @@ fn test_v2_search_rum_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16011,7 +16011,7 @@ fn test_v2_upload_idp_metadata(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16077,7 +16077,7 @@ fn test_v2_list_scorecard_outcomes(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16105,7 +16105,7 @@ fn test_v2_create_scorecard_outcomes_batch( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16171,7 +16171,7 @@ fn test_v2_list_scorecard_rules(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16196,7 +16196,7 @@ fn test_v2_create_scorecard_rule(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16221,7 +16221,7 @@ fn test_v2_delete_scorecard_rule(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16248,7 +16248,7 @@ fn test_v2_download_cloud_workload_policy_file( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16275,7 +16275,7 @@ fn test_v2_list_cloud_workload_security_agent_rules( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16304,7 +16304,7 @@ fn test_v2_create_cloud_workload_security_agent_rule( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16335,7 +16335,7 @@ fn test_v2_delete_cloud_workload_security_agent_rule( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16365,7 +16365,7 @@ fn test_v2_get_cloud_workload_security_agent_rule( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16397,7 +16397,7 @@ fn test_v2_update_cloud_workload_security_agent_rule( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16421,7 +16421,7 @@ fn test_v2_list_scanning_groups(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16446,7 +16446,7 @@ fn test_v2_reorder_scanning_groups(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16471,7 +16471,7 @@ fn test_v2_create_scanning_group(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16497,7 +16497,7 @@ fn test_v2_delete_scanning_group(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16523,7 +16523,7 @@ fn test_v2_update_scanning_group(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16548,7 +16548,7 @@ fn test_v2_create_scanning_rule(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16574,7 +16574,7 @@ fn test_v2_delete_scanning_rule(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16600,7 +16600,7 @@ fn test_v2_update_scanning_rule(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16624,7 +16624,7 @@ fn test_v2_list_standard_patterns(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16649,7 +16649,7 @@ fn test_v2_create_service_account(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16705,7 +16705,7 @@ fn test_v2_list_service_account_application_keys( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16737,7 +16737,7 @@ fn test_v2_create_service_account_application_key( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16770,7 +16770,7 @@ fn test_v2_delete_service_account_application_key( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16803,7 +16803,7 @@ fn test_v2_get_service_account_application_key( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16839,7 +16839,7 @@ fn test_v2_update_service_account_application_key( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16881,7 +16881,7 @@ fn test_v2_list_incident_services(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16906,7 +16906,7 @@ fn test_v2_create_incident_service(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16932,7 +16932,7 @@ fn test_v2_delete_incident_service(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16964,7 +16964,7 @@ fn test_v2_get_incident_service(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16991,7 +16991,7 @@ fn test_v2_update_incident_service(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17032,7 +17032,7 @@ fn test_v2_list_service_definitions( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17060,7 +17060,7 @@ fn test_v2_create_or_update_service_definitions( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17089,7 +17089,7 @@ fn test_v2_delete_service_definition( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17121,7 +17121,7 @@ fn test_v2_get_service_definition(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17146,7 +17146,7 @@ fn test_v2_aggregate_spans(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17195,7 +17195,7 @@ fn test_v2_list_spans_get(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17220,7 +17220,7 @@ fn test_v2_list_spans(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17247,7 +17247,7 @@ fn test_v2_get_on_demand_concurrency_cap( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17275,7 +17275,7 @@ fn test_v2_set_on_demand_concurrency_cap( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17328,7 +17328,7 @@ fn test_v2_list_teams(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17353,7 +17353,7 @@ fn test_v2_create_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17378,7 +17378,7 @@ fn test_v2_delete_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17403,7 +17403,7 @@ fn test_v2_get_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17429,7 +17429,7 @@ fn test_v2_update_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17454,7 +17454,7 @@ fn test_v2_get_team_links(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17480,7 +17480,7 @@ fn test_v2_create_team_link(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17506,7 +17506,7 @@ fn test_v2_delete_team_link(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17532,7 +17532,7 @@ fn test_v2_get_team_link(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17559,7 +17559,7 @@ fn test_v2_update_team_link(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17601,7 +17601,7 @@ fn test_v2_get_team_memberships(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17627,7 +17627,7 @@ fn test_v2_create_team_membership(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17653,7 +17653,7 @@ fn test_v2_delete_team_membership(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17681,7 +17681,7 @@ fn test_v2_update_team_membership(world: &mut DatadogWorld, _parameters: &HashMa world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17709,7 +17709,7 @@ fn test_v2_get_team_permission_settings( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17740,7 +17740,7 @@ fn test_v2_update_team_permission_setting( world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17765,7 +17765,7 @@ fn test_v2_get_user_memberships(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17806,7 +17806,7 @@ fn test_v2_list_incident_teams(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17831,7 +17831,7 @@ fn test_v2_create_incident_team(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17856,7 +17856,7 @@ fn test_v2_delete_incident_team(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17886,7 +17886,7 @@ fn test_v2_get_incident_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17912,7 +17912,7 @@ fn test_v2_update_incident_team(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17937,7 +17937,7 @@ fn test_v2_send_invitations(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17963,7 +17963,7 @@ fn test_v2_get_invitation(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18012,7 +18012,7 @@ fn test_v2_list_users(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18037,7 +18037,7 @@ fn test_v2_create_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18062,7 +18062,7 @@ fn test_v2_disable_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18087,7 +18087,7 @@ fn test_v2_get_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18113,7 +18113,7 @@ fn test_v2_update_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18138,7 +18138,7 @@ fn test_v2_list_user_organizations(world: &mut DatadogWorld, _parameters: &HashM world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18163,7 +18163,7 @@ fn test_v2_list_user_permissions(world: &mut DatadogWorld, _parameters: &HashMap world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } };