From 88180c779f86ceb57f4d27f277d7d6769b4b2d93 Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Tue, 13 Feb 2024 15:09:14 -0500 Subject: [PATCH 1/7] reinit api instance on config change --- tests/main.rs | 5 +++++ tests/scenarios/fixtures.rs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/tests/main.rs b/tests/main.rs index 343b797e5..35cd1205e 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 => 16, + 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| { diff --git a/tests/scenarios/fixtures.rs b/tests/scenarios/fixtures.rs index bba275e09..c9dcff96e 100644 --- a/tests/scenarios/fixtures.rs +++ b/tests/scenarios/fixtures.rs @@ -215,11 +215,17 @@ 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(); + 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(); + if let Some(api) = world.api_name.as_ref() { + initialize_api_instance(world, api.to_string()); + } } #[given(expr = "an instance of {string} API")] From a68124da8bff5ae8343f01546657ba24371e2b57 Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Thu, 15 Feb 2024 10:38:23 -0500 Subject: [PATCH 2/7] implement servers both globally and per-operation --- .generator/src/generator/templates/api.j2 | 11 +- .../src/generator/templates/configuration.j2 | 163 ++++++- Cargo.toml | 2 +- src/datadog/configuration.rs | 414 ++++++++++++++++- src/datadogV1/api/api_authentication.rs | 13 +- src/datadogV1/api/api_aws_integration.rs | 132 +++--- src/datadogV1/api/api_aws_logs_integration.rs | 70 +-- src/datadogV1/api/api_azure_integration.rs | 62 ++- src/datadogV1/api/api_dashboard_lists.rs | 50 +- src/datadogV1/api/api_dashboards.rs | 155 ++++--- src/datadogV1/api/api_downtimes.rs | 76 +-- src/datadogV1/api/api_events.rs | 36 +- src/datadogV1/api/api_gcp_integration.rs | 52 ++- src/datadogV1/api/api_hosts.rs | 46 +- src/datadogV1/api/api_ip_ranges.rs | 13 +- src/datadogV1/api/api_key_management.rs | 112 +++-- src/datadogV1/api/api_logs.rs | 26 +- src/datadogV1/api/api_logs_indexes.rs | 60 +-- src/datadogV1/api/api_logs_pipelines.rs | 70 +-- src/datadogV1/api/api_metrics.rs | 82 ++-- src/datadogV1/api/api_monitors.rs | 112 +++-- src/datadogV1/api/api_notebooks.rs | 56 ++- src/datadogV1/api/api_organizations.rs | 66 +-- .../api/api_pager_duty_integration.rs | 40 +- src/datadogV1/api/api_security_monitoring.rs | 30 +- src/datadogV1/api/api_service_checks.rs | 13 +- ...api_service_level_objective_corrections.rs | 56 ++- .../api/api_service_level_objectives.rs | 115 +++-- src/datadogV1/api/api_slack_integration.rs | 50 +- src/datadogV1/api/api_snapshots.rs | 13 +- src/datadogV1/api/api_synthetics.rs | 293 ++++++------ src/datadogV1/api/api_tags.rs | 53 ++- src/datadogV1/api/api_usage_metering.rs | 435 ++++++++++-------- src/datadogV1/api/api_users.rs | 56 ++- src/datadogV1/api/api_webhooks_integration.rs | 83 ++-- .../api/api_apm_retention_filters.rs | 60 +-- src/datadogV2/api/api_audit.rs | 23 +- src/datadogV2/api/api_auth_n_mappings.rs | 56 ++- .../api/api_ci_visibility_pipelines.rs | 43 +- src/datadogV2/api/api_ci_visibility_tests.rs | 33 +- .../api/api_cloud_cost_management.rs | 103 +++-- .../api/api_cloud_workload_security.rs | 60 +-- .../api/api_cloudflare_integration.rs | 50 +- src/datadogV2/api/api_confluent_cloud.rs | 100 ++-- src/datadogV2/api/api_container_images.rs | 13 +- src/datadogV2/api/api_containers.rs | 13 +- src/datadogV2/api/api_dashboard_lists.rs | 40 +- src/datadogV2/api/api_dora_metrics.rs | 36 +- src/datadogV2/api/api_downtimes.rs | 66 +-- src/datadogV2/api/api_events.rs | 26 +- src/datadogV2/api/api_fastly_integration.rs | 100 ++-- src/datadogV2/api/api_gcp_integration.rs | 60 +-- src/datadogV2/api/api_incident_services.rs | 81 ++-- src/datadogV2/api/api_incident_teams.rs | 81 ++-- src/datadogV2/api/api_incidents.rs | 279 ++++++----- src/datadogV2/api/api_ip_allowlist.rs | 26 +- src/datadogV2/api/api_key_management.rs | 149 +++--- src/datadogV2/api/api_logs.rs | 46 +- src/datadogV2/api/api_logs_archives.rs | 100 ++-- src/datadogV2/api/api_logs_metrics.rs | 50 +- src/datadogV2/api/api_metrics.rs | 162 ++++--- src/datadogV2/api/api_monitors.rs | 56 ++- src/datadogV2/api/api_okta_integration.rs | 50 +- src/datadogV2/api/api_opsgenie_integration.rs | 50 +- src/datadogV2/api/api_organizations.rs | 10 +- src/datadogV2/api/api_powerpack.rs | 56 ++- src/datadogV2/api/api_processes.rs | 13 +- src/datadogV2/api/api_restriction_policies.rs | 30 +- src/datadogV2/api/api_roles.rs | 139 +++--- src/datadogV2/api/api_rum.rs | 92 ++-- src/datadogV2/api/api_security_monitoring.rs | 205 ++++----- .../api/api_sensitive_data_scanner.rs | 90 ++-- src/datadogV2/api/api_service_accounts.rs | 63 +-- src/datadogV2/api/api_service_definition.rs | 40 +- src/datadogV2/api/api_service_scorecards.rs | 81 ++-- src/datadogV2/api/api_spans.rs | 33 +- src/datadogV2/api/api_spans_metrics.rs | 50 +- src/datadogV2/api/api_synthetics.rs | 20 +- src/datadogV2/api/api_teams.rs | 176 +++---- src/datadogV2/api/api_usage_metering.rs | 113 ++--- src/datadogV2/api/api_users.rs | 99 ++-- tests/main.rs | 2 +- tests/scenarios/fixtures.rs | 8 +- 83 files changed, 3641 insertions(+), 2807 deletions(-) diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index 7d0e744fc..2e38e669c 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -109,9 +109,10 @@ 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; {%- if "x-unstable" in operation %} let operation_id = "{{ version }}.{{ operation.operationId | snake_case }}".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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 @@ -134,7 +133,7 @@ impl {{ structName }} { let local_uri_str = format!( "{}{{path}}", - local_configuration.base_path + local_configuration.get_operation_host("{{ version }}.{{ operation.operationId | snake_case }}") {%- 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 %} diff --git a/.generator/src/generator/templates/configuration.j2 b/.generator/src/generator/templates/configuration.j2 index d12ecbf05..f24a2255e 100644 --- a/.generator/src/generator/templates/configuration.j2 +++ b/.generator/src/generator/templates/configuration.j2 @@ -1,13 +1,46 @@ {% include "partial_header.j2" %} +use lazy_static::lazy_static; use std::env; use std::collections::HashMap; use log::warn; +#[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 {} for variable {} is not in the enum values", + value, name + ); + } + url = url.replace(&format!("{{ '{{{}}}' }}", name), &value); + } + url + } +} + +#[non_exhaustive] #[derive(Debug, Clone)] pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest_middleware::ClientWithMiddleware, + pub(crate) user_agent: String, + pub(crate) client: reqwest_middleware::ClientWithMiddleware, + pub unstable_operations: HashMap, {%- set authMethods = openapi.security %} {%- if authMethods %} {%- for authMethod in authMethods %} @@ -19,7 +52,11 @@ pub struct Configuration { {%- endfor %} {%- endfor %} {%- endif %} - unstable_operations: HashMap, + pub server_index: usize, + pub server_variables: HashMap, + pub server_operation_index: HashMap, + pub server_operation_variables: HashMap>, + } impl Configuration { @@ -27,17 +64,41 @@ impl Configuration { Configuration::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 { if self.unstable_operations.contains_key(operation) { self.unstable_operations.insert(operation.to_string(), enabled); 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 +107,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 } @@ -66,6 +123,13 @@ impl Configuration { 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() %} @@ -79,15 +143,9 @@ impl Default for Configuration { ]); 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, - )), + user_agent, client: http_client.build(), + unstable_operations, {%- set authMethods = openapi.security %} {%- if authMethods %} {%- for authMethod in authMethods %} @@ -99,7 +157,66 @@ impl Default for Configuration { {%- endfor %} {%- endfor %} {%- endif %} - unstable_operations, + 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/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..6055e6aff 100644 --- a/src/datadog/configuration.rs +++ b/src/datadog/configuration.rs @@ -1,18 +1,54 @@ // 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 {} for variable {} is not in the enum values", + value, name + ); + } + url = url.replace(&format!("{{{}}}", name), &value); + } + url + } +} + +#[non_exhaustive] #[derive(Debug, Clone)] pub struct Configuration { - pub base_path: String, - pub user_agent: Option, - pub client: reqwest_middleware::ClientWithMiddleware, + pub(crate) user_agent: String, + pub(crate) client: reqwest_middleware::ClientWithMiddleware, + pub unstable_operations: HashMap, pub api_key_auth: Option, pub app_key_auth: Option, - unstable_operations: HashMap, + pub server_index: usize, + pub server_variables: HashMap, + pub server_operation_index: HashMap, + pub server_operation_variables: HashMap>, } impl Configuration { @@ -20,6 +56,34 @@ impl Configuration { Configuration::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 { if self.unstable_operations.contains_key(operation) { self.unstable_operations @@ -27,11 +91,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 +100,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 } @@ -60,6 +116,13 @@ impl Configuration { 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), @@ -106,18 +169,323 @@ impl Default for Configuration { ]); 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, - )), + user_agent, client: http_client.build(), + unstable_operations, api_key_auth: env::var("DD_API_KEY").ok(), app_key_auth: env::var("DD_APP_KEY").ok(), - unstable_operations, + 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..31750bd6c 100644 --- a/src/datadogV1/api/api_authentication.rs +++ b/src/datadogV1/api/api_authentication.rs @@ -59,15 +59,18 @@ impl AuthenticationAPI { 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("v1.validate") + ); 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 { diff --git a/src/datadogV1/api/api_aws_integration.rs b/src/datadogV1/api/api_aws_integration.rs index 482b0ed75..dfbe27796 100644 --- a/src/datadogV1/api/api_aws_integration.rs +++ b/src/datadogV1/api/api_aws_integration.rs @@ -244,15 +244,18 @@ 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("v1.create_aws_account") + ); 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 { @@ -326,16 +329,16 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/event_bridge", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_aws_event_bridge_source") ); 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 { @@ -406,16 +409,16 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/filtering", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_aws_tag_filter") ); 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 { @@ -486,16 +489,16 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/generate_new_external_id", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_new_aws_external_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 { @@ -564,15 +567,18 @@ 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("v1.delete_aws_account") + ); 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 { @@ -646,16 +652,16 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/event_bridge", - local_configuration.base_path + local_configuration.get_operation_host("v1.delete_aws_event_bridge_source") ); 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 { @@ -726,16 +732,16 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/filtering", - local_configuration.base_path + local_configuration.get_operation_host("v1.delete_aws_tag_filter") ); 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 { @@ -807,7 +813,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("v1.list_aws_accounts") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -825,10 +834,10 @@ 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 { @@ -890,16 +899,16 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/event_bridge", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_aws_event_bridge_sources") ); 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 { @@ -963,7 +972,7 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/filtering", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_aws_tag_filters") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -971,10 +980,10 @@ 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 { @@ -1030,16 +1039,16 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/available_namespace_rules", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_available_aws_namespaces") ); 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 { @@ -1107,7 +1116,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("v1.update_aws_account") + ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1125,10 +1137,10 @@ 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 { diff --git a/src/datadogV1/api/api_aws_logs_integration.rs b/src/datadogV1/api/api_aws_logs_integration.rs index 31c31610f..ce8165855 100644 --- a/src/datadogV1/api/api_aws_logs_integration.rs +++ b/src/datadogV1/api/api_aws_logs_integration.rs @@ -137,16 +137,16 @@ impl AWSLogsIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/logs/check_async", - local_configuration.base_path + local_configuration.get_operation_host("v1.check_aws_logs_lambda_async") ); 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 { @@ -238,16 +238,16 @@ impl AWSLogsIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/logs/services_async", - local_configuration.base_path + local_configuration.get_operation_host("v1.check_aws_logs_services_async") ); 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 { @@ -318,16 +318,16 @@ impl AWSLogsIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/logs", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_aws_lambda_arn") ); 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 { @@ -398,16 +398,16 @@ impl AWSLogsIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/logs", - local_configuration.base_path + local_configuration.get_operation_host("v1.delete_aws_lambda_arn") ); 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 { @@ -478,16 +478,16 @@ impl AWSLogsIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/logs/services", - local_configuration.base_path + local_configuration.get_operation_host("v1.enable_aws_log_services") ); 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 { @@ -556,16 +556,16 @@ impl AWSLogsIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/logs", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_aws_logs_integrations") ); 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 { @@ -627,16 +627,16 @@ impl AWSLogsIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws/logs/services", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_aws_logs_services") ); 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 { diff --git a/src/datadogV1/api/api_azure_integration.rs b/src/datadogV1/api/api_azure_integration.rs index 5eeb5b1df..336330ed6 100644 --- a/src/datadogV1/api/api_azure_integration.rs +++ b/src/datadogV1/api/api_azure_integration.rs @@ -114,15 +114,18 @@ impl AzureIntegrationAPI { 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("v1.create_azure_integration") + ); 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 { @@ -191,15 +194,18 @@ impl AzureIntegrationAPI { 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("v1.delete_azure_integration") + ); 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 { @@ -264,15 +270,18 @@ impl AzureIntegrationAPI { 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("v1.list_azure_integration") + ); 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 { @@ -336,16 +345,16 @@ impl AzureIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/azure/host_filters", - local_configuration.base_path + local_configuration.get_operation_host("v1.update_azure_host_filters") ); 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 { @@ -418,15 +427,18 @@ impl AzureIntegrationAPI { 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("v1.update_azure_integration") + ); 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 { diff --git a/src/datadogV1/api/api_dashboard_lists.rs b/src/datadogV1/api/api_dashboard_lists.rs index e0c21aee3..183e24411 100644 --- a/src/datadogV1/api/api_dashboard_lists.rs +++ b/src/datadogV1/api/api_dashboard_lists.rs @@ -102,16 +102,16 @@ impl DashboardListsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_dashboard_list") ); 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 { @@ -182,17 +182,17 @@ impl DashboardListsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual/{list_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_dashboard_list"), 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 { @@ -251,17 +251,17 @@ impl DashboardListsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual/{list_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_dashboard_list"), 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 { @@ -323,16 +323,16 @@ impl DashboardListsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_dashboard_lists") ); 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 { @@ -399,17 +399,17 @@ impl DashboardListsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/lists/manual/{list_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_dashboard_list"), 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 { diff --git a/src/datadogV1/api/api_dashboards.rs b/src/datadogV1/api/api_dashboards.rs index 6fa87b1b9..0ef120206 100644 --- a/src/datadogV1/api/api_dashboards.rs +++ b/src/datadogV1/api/api_dashboards.rs @@ -258,15 +258,18 @@ 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("v1.create_dashboard") + ); 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 { @@ -333,15 +336,18 @@ impl DashboardsAPI { 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("v1.create_public_dashboard") + ); 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 { @@ -410,17 +416,17 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/{dashboard_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_dashboard"), 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 { @@ -476,15 +482,18 @@ 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("v1.delete_dashboards") + ); 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 { @@ -553,17 +562,17 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_public_dashboard"), 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 { @@ -626,17 +635,17 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_public_dashboard_invitation"), 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 { @@ -699,17 +708,17 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/{dashboard_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_dashboard"), 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 { @@ -770,17 +779,17 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_public_dashboard"), 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 { @@ -853,7 +862,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_public_dashboard_invitations"), token = urlencode(token) ); let mut local_req_builder = @@ -869,10 +878,10 @@ 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 { @@ -943,7 +952,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("v1.list_dashboards") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -965,10 +977,10 @@ 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 { @@ -1024,15 +1036,18 @@ 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("v1.restore_dashboards") + ); 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 { @@ -1106,17 +1121,17 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", - local_configuration.base_path, + local_configuration.get_operation_host("v1.send_public_dashboard_invitation"), 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 { @@ -1187,17 +1202,17 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/{dashboard_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_dashboard"), 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 { @@ -1271,17 +1286,17 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_public_dashboard"), 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 { diff --git a/src/datadogV1/api/api_downtimes.rs b/src/datadogV1/api/api_downtimes.rs index 844c495ff..82ca652e6 100644 --- a/src/datadogV1/api/api_downtimes.rs +++ b/src/datadogV1/api/api_downtimes.rs @@ -142,17 +142,17 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v1/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.cancel_downtime"), 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 { @@ -214,16 +214,16 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v1/downtime/cancel/by_scope", - local_configuration.base_path + local_configuration.get_operation_host("v1.cancel_downtimes_by_scope") ); 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 { @@ -287,15 +287,18 @@ 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("v1.create_downtime") + ); 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 { @@ -360,17 +363,17 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v1/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_downtime"), 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 { @@ -430,7 +433,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("v1.list_downtimes") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -444,10 +450,10 @@ 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 { @@ -509,17 +515,17 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}/downtimes", - local_configuration.base_path, + local_configuration.get_operation_host("v1.list_monitor_downtimes"), 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 { @@ -580,17 +586,17 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v1/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_downtime"), 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 { diff --git a/src/datadogV1/api/api_events.rs b/src/datadogV1/api/api_events.rs index a00030952..953372939 100644 --- a/src/datadogV1/api/api_events.rs +++ b/src/datadogV1/api/api_events.rs @@ -139,15 +139,18 @@ 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("v1.create_event") + ); 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 { @@ -214,17 +217,17 @@ impl EventsAPI { let local_uri_str = format!( "{}/api/v1/events/{event_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_event"), 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 { @@ -308,7 +311,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("v1.list_events") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -340,10 +346,10 @@ 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 { diff --git a/src/datadogV1/api/api_gcp_integration.rs b/src/datadogV1/api/api_gcp_integration.rs index cd5863009..e31b1adf0 100644 --- a/src/datadogV1/api/api_gcp_integration.rs +++ b/src/datadogV1/api/api_gcp_integration.rs @@ -92,15 +92,18 @@ impl GCPIntegrationAPI { 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("v1.create_gcp_integration") + ); 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 { @@ -169,15 +172,18 @@ impl GCPIntegrationAPI { 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("v1.delete_gcp_integration") + ); 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 { @@ -242,15 +248,18 @@ impl GCPIntegrationAPI { 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("v1.list_gcp_integration") + ); 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 { @@ -318,15 +327,18 @@ impl GCPIntegrationAPI { 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("v1.update_gcp_integration") + ); 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 { diff --git a/src/datadogV1/api/api_hosts.rs b/src/datadogV1/api/api_hosts.rs index fc08f4015..04077120d 100644 --- a/src/datadogV1/api/api_hosts.rs +++ b/src/datadogV1/api/api_hosts.rs @@ -173,7 +173,10 @@ impl HostsAPI { 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("v1.get_host_totals") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -183,10 +186,10 @@ 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 { @@ -259,7 +262,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("v1.list_hosts") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -297,10 +303,10 @@ 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 { @@ -360,17 +366,17 @@ impl HostsAPI { let local_uri_str = format!( "{}/api/v1/host/{host_name}/mute", - local_configuration.base_path, + local_configuration.get_operation_host("v1.mute_host"), 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 { @@ -435,17 +441,17 @@ impl HostsAPI { let local_uri_str = format!( "{}/api/v1/host/{host_name}/unmute", - local_configuration.base_path, + local_configuration.get_operation_host("v1.unmute_host"), 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 { diff --git a/src/datadogV1/api/api_ip_ranges.rs b/src/datadogV1/api/api_ip_ranges.rs index d3817a912..fcbe2e2c9 100644 --- a/src/datadogV1/api/api_ip_ranges.rs +++ b/src/datadogV1/api/api_ip_ranges.rs @@ -52,15 +52,18 @@ impl IPRangesAPI { 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("v1.get_ip_ranges") + ); 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..30a1cc6b8 100644 --- a/src/datadogV1/api/api_key_management.rs +++ b/src/datadogV1/api/api_key_management.rs @@ -150,15 +150,18 @@ impl KeyManagementAPI { 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("v1.create_api_key") + ); 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 { @@ -226,15 +229,18 @@ impl KeyManagementAPI { 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("v1.create_application_key") + ); 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 { @@ -300,17 +306,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/api_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_api_key"), 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 { @@ -373,17 +379,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/application_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_application_key"), 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 { @@ -442,17 +448,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/api_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_api_key"), 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 { @@ -515,17 +521,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/application_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_application_key"), 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 { @@ -580,15 +586,18 @@ impl KeyManagementAPI { 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("v1.list_api_keys") + ); 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 { @@ -647,15 +656,18 @@ impl KeyManagementAPI { 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("v1.list_application_keys") + ); 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 { @@ -716,17 +728,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/api_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_api_key"), 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 { @@ -798,17 +810,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v1/application_key/{key}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_application_key"), 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 { diff --git a/src/datadogV1/api/api_logs.rs b/src/datadogV1/api/api_logs.rs index 7460e097e..c8feae8c8 100644 --- a/src/datadogV1/api/api_logs.rs +++ b/src/datadogV1/api/api_logs.rs @@ -108,15 +108,18 @@ impl LogsAPI { 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("v1.list_logs") + ); 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 { @@ -224,7 +227,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("v1.submit_log") + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -238,10 +244,10 @@ 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 { diff --git a/src/datadogV1/api/api_logs_indexes.rs b/src/datadogV1/api/api_logs_indexes.rs index 829577013..337cc47ce 100644 --- a/src/datadogV1/api/api_logs_indexes.rs +++ b/src/datadogV1/api/api_logs_indexes.rs @@ -107,16 +107,16 @@ impl LogsIndexesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/indexes", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_logs_index") ); 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 { @@ -181,17 +181,17 @@ impl LogsIndexesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/indexes/{name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_logs_index"), 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 { @@ -250,16 +250,16 @@ impl LogsIndexesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/index-order", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_logs_index_order") ); 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 { @@ -321,16 +321,16 @@ impl LogsIndexesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/indexes", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_log_indexes") ); 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 { @@ -399,17 +399,17 @@ impl LogsIndexesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/indexes/{name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_logs_index"), 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 { @@ -480,16 +480,16 @@ impl LogsIndexesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/index-order", - local_configuration.base_path + local_configuration.get_operation_host("v1.update_logs_index_order") ); 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 { diff --git a/src/datadogV1/api/api_logs_pipelines.rs b/src/datadogV1/api/api_logs_pipelines.rs index 9408c0b6c..d58811fe0 100644 --- a/src/datadogV1/api/api_logs_pipelines.rs +++ b/src/datadogV1/api/api_logs_pipelines.rs @@ -120,16 +120,16 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipelines", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_logs_pipeline") ); 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 { @@ -196,17 +196,17 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipelines/{pipeline_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_logs_pipeline"), 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 { @@ -265,17 +265,17 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipelines/{pipeline_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_logs_pipeline"), 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 { @@ -337,16 +337,16 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipeline-order", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_logs_pipeline_order") ); 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 { @@ -408,16 +408,16 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipelines", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_logs_pipelines") ); 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 { @@ -489,17 +489,17 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipelines/{pipeline_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_logs_pipeline"), 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 { @@ -578,16 +578,16 @@ impl LogsPipelinesAPI { let local_uri_str = format!( "{}/api/v1/logs/config/pipeline-order", - local_configuration.base_path + local_configuration.get_operation_host("v1.update_logs_pipeline_order") ); 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 { diff --git a/src/datadogV1/api/api_metrics.rs b/src/datadogV1/api/api_metrics.rs index dd3ed8d5f..310838646 100644 --- a/src/datadogV1/api/api_metrics.rs +++ b/src/datadogV1/api/api_metrics.rs @@ -192,17 +192,17 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v1/metrics/{metric_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_metric_metadata"), 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 { @@ -268,7 +268,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("v1.list_active_metrics") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -283,10 +286,10 @@ 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 { @@ -346,17 +349,20 @@ impl MetricsAPI { 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("v1.list_metrics") + ); 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 { @@ -419,7 +425,10 @@ impl MetricsAPI { 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("v1.query_metrics") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -428,10 +437,10 @@ 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 { @@ -502,7 +511,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v1/distribution_points", - local_configuration.base_path + local_configuration.get_operation_host("v1.submit_distribution_points") ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -512,10 +521,10 @@ 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 { @@ -604,7 +613,10 @@ impl MetricsAPI { 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("v1.submit_metrics") + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -613,10 +625,10 @@ 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 { @@ -687,17 +699,17 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v1/metrics/{metric_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_metric_metadata"), 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 { diff --git a/src/datadogV1/api/api_monitors.rs b/src/datadogV1/api/api_monitors.rs index f4487b883..ae413c740 100644 --- a/src/datadogV1/api/api_monitors.rs +++ b/src/datadogV1/api/api_monitors.rs @@ -391,7 +391,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/can_delete", - local_configuration.base_path + local_configuration.get_operation_host("v1.check_can_delete_monitor") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -407,10 +407,10 @@ 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 { @@ -828,15 +828,18 @@ 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("v1.create_monitor") + ); 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 { @@ -907,7 +910,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_monitor"), monitor_id = monitor_id ); let mut local_req_builder = @@ -919,10 +922,10 @@ 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 { @@ -986,7 +989,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_monitor"), monitor_id = monitor_id ); let mut local_req_builder = @@ -1002,10 +1005,10 @@ 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 { @@ -1071,7 +1074,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("v1.list_monitors") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1109,10 +1115,10 @@ 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 { @@ -1181,7 +1187,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/groups/search", - local_configuration.base_path + local_configuration.get_operation_host("v1.search_monitor_groups") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1204,10 +1210,10 @@ 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 { @@ -1273,7 +1279,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("v1.search_monitors") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1295,10 +1304,10 @@ 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 { @@ -1358,17 +1367,17 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_monitor"), 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 { @@ -1444,17 +1453,17 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}/validate", - local_configuration.base_path, + local_configuration.get_operation_host("v1.validate_existing_monitor"), 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 { @@ -1527,15 +1536,18 @@ impl MonitorsAPI { 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("v1.validate_monitor") + ); 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 { diff --git a/src/datadogV1/api/api_notebooks.rs b/src/datadogV1/api/api_notebooks.rs index 479dafc90..ff9559bca 100644 --- a/src/datadogV1/api/api_notebooks.rs +++ b/src/datadogV1/api/api_notebooks.rs @@ -182,15 +182,18 @@ 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("v1.create_notebook") + ); 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 { @@ -255,17 +258,17 @@ impl NotebooksAPI { let local_uri_str = format!( "{}/api/v1/notebooks/{notebook_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_notebook"), 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 { @@ -322,17 +325,17 @@ impl NotebooksAPI { let local_uri_str = format!( "{}/api/v1/notebooks/{notebook_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_notebook"), 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 { @@ -404,7 +407,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("v1.list_notebooks") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -450,10 +456,10 @@ 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 { @@ -516,17 +522,17 @@ impl NotebooksAPI { let local_uri_str = format!( "{}/api/v1/notebooks/{notebook_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_notebook"), 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 { diff --git a/src/datadogV1/api/api_organizations.rs b/src/datadogV1/api/api_organizations.rs index 629723dfa..d5970b045 100644 --- a/src/datadogV1/api/api_organizations.rs +++ b/src/datadogV1/api/api_organizations.rs @@ -130,15 +130,18 @@ impl OrganizationsAPI { 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("v1.create_child_org") + ); 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 { @@ -207,17 +210,17 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v1/org/{public_id}/downgrade", - local_configuration.base_path, + local_configuration.get_operation_host("v1.downgrade_org"), 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 { @@ -275,17 +278,17 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v1/org/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_org"), 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 { @@ -342,15 +345,18 @@ impl OrganizationsAPI { 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("v1.list_orgs") + ); 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 { @@ -410,17 +416,17 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v1/org/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_org"), 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 { @@ -500,17 +506,17 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v1/org/{public_id}/idp_metadata", - local_configuration.base_path, + local_configuration.get_operation_host("v1.upload_id_p_for_org"), 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 { diff --git a/src/datadogV1/api/api_pager_duty_integration.rs b/src/datadogV1/api/api_pager_duty_integration.rs index 02402dc84..06c564c2f 100644 --- a/src/datadogV1/api/api_pager_duty_integration.rs +++ b/src/datadogV1/api/api_pager_duty_integration.rs @@ -98,16 +98,16 @@ impl PagerDutyIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_pager_duty_integration_service") ); 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 { @@ -175,17 +175,17 @@ impl PagerDutyIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_pager_duty_integration_service"), 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 { @@ -250,17 +250,17 @@ impl PagerDutyIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_pager_duty_integration_service"), 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 { @@ -323,17 +323,17 @@ impl PagerDutyIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/pagerduty/configuration/services/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_pager_duty_integration_service"), 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 { diff --git a/src/datadogV1/api/api_security_monitoring.rs b/src/datadogV1/api/api_security_monitoring.rs index 1700cdddd..c73ce1c1c 100644 --- a/src/datadogV1/api/api_security_monitoring.rs +++ b/src/datadogV1/api/api_security_monitoring.rs @@ -92,17 +92,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v1/security_analytics/signals/{signal_id}/add_to_incident", - local_configuration.base_path, + local_configuration.get_operation_host("v1.add_security_monitoring_signal_to_incident"), 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 { @@ -178,17 +178,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v1/security_analytics/signals/{signal_id}/assignee", - local_configuration.base_path, + local_configuration.get_operation_host("v1.edit_security_monitoring_signal_assignee"), 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 { @@ -264,17 +264,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v1/security_analytics/signals/{signal_id}/state", - local_configuration.base_path, + local_configuration.get_operation_host("v1.edit_security_monitoring_signal_state"), 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 { diff --git a/src/datadogV1/api/api_service_checks.rs b/src/datadogV1/api/api_service_checks.rs index 0de99830d..3a9bb0acc 100644 --- a/src/datadogV1/api/api_service_checks.rs +++ b/src/datadogV1/api/api_service_checks.rs @@ -72,15 +72,18 @@ impl ServiceChecksAPI { 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("v1.submit_service_check") + ); 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 { diff --git a/src/datadogV1/api/api_service_level_objective_corrections.rs b/src/datadogV1/api/api_service_level_objective_corrections.rs index 089902063..da7b1b8aa 100644 --- a/src/datadogV1/api/api_service_level_objective_corrections.rs +++ b/src/datadogV1/api/api_service_level_objective_corrections.rs @@ -126,15 +126,18 @@ 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("v1.create_slo_correction") + ); 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 { @@ -202,17 +205,17 @@ impl ServiceLevelObjectiveCorrectionsAPI { let local_uri_str = format!( "{}/api/v1/slo/correction/{slo_correction_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_slo_correction"), 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 { @@ -275,17 +278,17 @@ impl ServiceLevelObjectiveCorrectionsAPI { let local_uri_str = format!( "{}/api/v1/slo/correction/{slo_correction_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_slo_correction"), 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 { @@ -351,7 +354,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("v1.list_slo_correction") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -365,10 +371,10 @@ 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 { @@ -437,17 +443,17 @@ impl ServiceLevelObjectiveCorrectionsAPI { let local_uri_str = format!( "{}/api/v1/slo/correction/{slo_correction_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_slo_correction"), 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 { diff --git a/src/datadogV1/api/api_service_level_objectives.rs b/src/datadogV1/api/api_service_level_objectives.rs index 47c5f5330..79bdec5bb 100644 --- a/src/datadogV1/api/api_service_level_objectives.rs +++ b/src/datadogV1/api/api_service_level_objectives.rs @@ -309,17 +309,20 @@ impl ServiceLevelObjectivesAPI { 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("v1.check_can_delete_slo") + ); 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 { @@ -376,15 +379,18 @@ 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("v1.create_slo") + ); 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 { @@ -460,7 +466,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_slo"), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -472,10 +478,10 @@ 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 { @@ -544,15 +550,18 @@ impl ServiceLevelObjectivesAPI { 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("v1.delete_slo_timeframe_in_bulk") + ); 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 { @@ -622,7 +631,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_slo"), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -634,10 +643,10 @@ 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 { @@ -700,17 +709,17 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}/corrections", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_slo_corrections"), 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 { @@ -799,7 +808,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}/history", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_slo_history"), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -817,10 +826,10 @@ 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 { @@ -885,7 +894,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("v1.list_sl_os") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -914,10 +926,10 @@ 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 { @@ -979,7 +991,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("v1.search_slo") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1001,10 +1016,10 @@ 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 { @@ -1064,17 +1079,17 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_slo"), 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 { diff --git a/src/datadogV1/api/api_slack_integration.rs b/src/datadogV1/api/api_slack_integration.rs index 986cfbbb7..575fc563a 100644 --- a/src/datadogV1/api/api_slack_integration.rs +++ b/src/datadogV1/api/api_slack_integration.rs @@ -114,17 +114,17 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels", - local_configuration.base_path, + local_configuration.get_operation_host("v1.create_slack_integration_channel"), 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 { @@ -200,7 +200,7 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", - local_configuration.base_path, account_name= + local_configuration.get_operation_host("v1.get_slack_integration_channel"), account_name= urlencode(account_name) , channel_name= urlencode(channel_name) @@ -209,10 +209,10 @@ 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 { @@ -279,17 +279,17 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_slack_integration_channels"), 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 { @@ -352,7 +352,7 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", - local_configuration.base_path, account_name= + local_configuration.get_operation_host("v1.remove_slack_integration_channel"), account_name= urlencode(account_name) , channel_name= urlencode(channel_name) @@ -361,10 +361,10 @@ 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 { @@ -433,7 +433,7 @@ impl SlackIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_name}", - local_configuration.base_path, account_name= + local_configuration.get_operation_host("v1.update_slack_integration_channel"), account_name= urlencode(account_name) , channel_name= urlencode(channel_name) @@ -442,10 +442,10 @@ 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 { diff --git a/src/datadogV1/api/api_snapshots.rs b/src/datadogV1/api/api_snapshots.rs index 2bd08dc16..a270beef9 100644 --- a/src/datadogV1/api/api_snapshots.rs +++ b/src/datadogV1/api/api_snapshots.rs @@ -129,7 +129,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("v1.get_graph_snapshot") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -161,10 +164,10 @@ 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 { diff --git a/src/datadogV1/api/api_synthetics.rs b/src/datadogV1/api/api_synthetics.rs index 97f536f88..09b9a3da8 100644 --- a/src/datadogV1/api/api_synthetics.rs +++ b/src/datadogV1/api/api_synthetics.rs @@ -424,16 +424,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/variables", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_global_variable") ); 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 { @@ -504,16 +504,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/private-locations", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_private_location") ); 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 { @@ -585,16 +585,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/api", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_synthetics_api_test") ); 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 { @@ -668,16 +668,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_synthetics_browser_test") ); 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 { @@ -745,17 +745,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/variables/{variable_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_global_variable"), 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 { @@ -814,17 +814,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/private-locations/{location_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_private_location"), 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 { @@ -886,16 +886,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/delete", - local_configuration.base_path + local_configuration.get_operation_host("v1.delete_tests") ); 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 { @@ -970,17 +970,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/variables/{variable_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.edit_global_variable"), 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 { @@ -1048,17 +1048,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/api/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_api_test"), 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 { @@ -1131,7 +1131,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}/results", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_api_test_latest_results"), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -1158,10 +1158,10 @@ 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 { @@ -1231,7 +1231,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}/results/{result_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_api_test_result"), public_id = urlencode(public_id), result_id = urlencode(result_id) ); @@ -1239,10 +1239,10 @@ 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 { @@ -1306,17 +1306,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_browser_test"), 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 { @@ -1390,7 +1390,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("v1.get_browser_test_latest_results"), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -1417,10 +1417,10 @@ 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 { @@ -1490,7 +1490,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_browser_test_result"), public_id = urlencode(public_id), result_id = urlencode(result_id) ); @@ -1498,10 +1498,10 @@ 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 { @@ -1565,17 +1565,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/variables/{variable_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_global_variable"), 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 { @@ -1639,17 +1639,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/private-locations/{location_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_private_location"), 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 { @@ -1713,17 +1713,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/ci/batch/{batch_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_synthetics_ci_batch"), 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 { @@ -1779,16 +1779,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/settings/default_locations", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_synthetics_default_locations") ); 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 { @@ -1846,17 +1846,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_test"), 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 { @@ -1917,16 +1917,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/variables", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_global_variables") ); 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 { @@ -1989,16 +1989,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/locations", - local_configuration.base_path + local_configuration.get_operation_host("v1.list_locations") ); 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 { @@ -2062,7 +2062,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("v1.list_tests") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2076,10 +2079,10 @@ 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 { @@ -2141,17 +2144,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.patch_test"), 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 { @@ -2221,16 +2224,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/trigger/ci", - local_configuration.base_path + local_configuration.get_operation_host("v1.trigger_ci_tests") ); 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 { @@ -2301,16 +2304,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/trigger", - local_configuration.base_path + local_configuration.get_operation_host("v1.trigger_tests") ); 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 { @@ -2379,17 +2382,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/api/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_api_test"), 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 { @@ -2463,17 +2466,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/browser/{public_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_browser_test"), 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 { @@ -2549,17 +2552,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/private-locations/{location_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_private_location"), 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 { @@ -2629,17 +2632,17 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests/{public_id}/status", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_test_pause_status"), 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 { diff --git a/src/datadogV1/api/api_tags.rs b/src/datadogV1/api/api_tags.rs index 43edc3831..4eebe70df 100644 --- a/src/datadogV1/api/api_tags.rs +++ b/src/datadogV1/api/api_tags.rs @@ -197,7 +197,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.create_host_tags"), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -209,10 +209,10 @@ 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 { @@ -287,7 +287,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_host_tags"), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -299,10 +299,10 @@ 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 { @@ -363,7 +363,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_host_tags"), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -375,10 +375,10 @@ 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 { @@ -437,7 +437,10 @@ impl TagsAPI { 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("v1.list_host_tags") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -447,10 +450,10 @@ 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 { @@ -520,7 +523,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_host_tags"), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -532,10 +535,10 @@ 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 { diff --git a/src/datadogV1/api/api_usage_metering.rs b/src/datadogV1/api/api_usage_metering.rs index 7e4d2ac4d..e75f06b51 100644 --- a/src/datadogV1/api/api_usage_metering.rs +++ b/src/datadogV1/api/api_usage_metering.rs @@ -1247,7 +1247,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/daily_custom_reports", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_daily_custom_reports") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1270,10 +1270,10 @@ 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 { @@ -1378,7 +1378,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/hourly-attribution", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_hourly_usage_attribution") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1403,10 +1403,10 @@ 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 { @@ -1480,7 +1480,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/incident-management", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_incident_management") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1492,10 +1492,10 @@ 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 { @@ -1569,7 +1569,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/ingested-spans", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_ingested_spans") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1581,10 +1581,10 @@ 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 { @@ -1658,7 +1658,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/monthly_custom_reports", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_monthly_custom_reports") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1681,10 +1681,10 @@ 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 { @@ -1791,7 +1791,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/monthly-attribution", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_monthly_usage_attribution") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1824,10 +1824,10 @@ 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 { @@ -1898,17 +1898,17 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/daily_custom_reports/{report_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_specified_daily_custom_reports"), 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 { @@ -1979,17 +1979,17 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/monthly_custom_reports/{report_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_specified_monthly_custom_reports"), 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 { @@ -2063,7 +2063,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/analyzed_logs", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_analyzed_logs") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2075,10 +2075,10 @@ 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 { @@ -2159,7 +2159,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("v1.get_usage_attribution") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2191,10 +2194,10 @@ 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 { @@ -2266,7 +2269,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_audit_logs") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2277,10 +2283,10 @@ 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 { @@ -2347,7 +2353,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/billable-summary", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_billable_summary") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2358,10 +2364,10 @@ 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 { @@ -2428,7 +2434,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_ci_app") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2439,10 +2448,10 @@ 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 { @@ -2506,7 +2515,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_cws") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2517,10 +2529,10 @@ 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 { @@ -2591,7 +2603,11 @@ impl UsageMeteringAPI { 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("v1.get_usage_cloud_security_posture_management") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2602,10 +2618,10 @@ 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 { @@ -2670,7 +2686,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_dbm") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2681,10 +2700,10 @@ 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 { @@ -2753,7 +2772,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_fargate") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2764,10 +2786,10 @@ 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 { @@ -2834,7 +2856,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_hosts") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2845,10 +2870,10 @@ 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 { @@ -2922,7 +2947,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/indexed-spans", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_indexed_spans") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2934,10 +2959,10 @@ 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 { @@ -3009,7 +3034,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_internet_of_things") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3020,10 +3048,10 @@ 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 { @@ -3090,7 +3118,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_lambda") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3101,10 +3132,10 @@ 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 { @@ -3168,7 +3199,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_logs") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3179,10 +3213,10 @@ 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 { @@ -3254,7 +3288,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/logs_by_index", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_logs_by_index") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3277,10 +3311,10 @@ 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 { @@ -3354,7 +3388,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/logs-by-retention", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_logs_by_retention") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3366,10 +3400,10 @@ 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 { @@ -3443,7 +3477,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/network_flows", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_network_flows") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3455,10 +3489,10 @@ 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 { @@ -3532,7 +3566,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/network_hosts", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_network_hosts") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3544,10 +3578,10 @@ 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 { @@ -3621,7 +3655,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/online-archive", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_online_archive") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3633,10 +3667,10 @@ 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 { @@ -3708,7 +3742,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_profiling") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3719,10 +3756,10 @@ 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 { @@ -3797,7 +3834,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/rum_sessions", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_rum_sessions") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3813,10 +3850,10 @@ 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 { @@ -3886,7 +3923,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_rum_units") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3897,10 +3937,10 @@ 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 { @@ -3964,7 +4004,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_sds") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3975,10 +4018,10 @@ 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 { @@ -4041,7 +4084,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_snmp") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4052,10 +4098,10 @@ 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 { @@ -4123,7 +4169,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("v1.get_usage_summary") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4138,10 +4187,10 @@ 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 { @@ -4213,7 +4262,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_synthetics") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4224,10 +4276,10 @@ 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 { @@ -4301,7 +4353,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/synthetics_api", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_synthetics_api") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4313,10 +4365,10 @@ 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 { @@ -4390,7 +4442,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/synthetics_browser", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_synthetics_browser") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4402,10 +4454,10 @@ 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 { @@ -4477,7 +4529,10 @@ impl UsageMeteringAPI { 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("v1.get_usage_timeseries") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4488,10 +4543,10 @@ 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 { @@ -4562,7 +4617,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/top_avg_metrics", - local_configuration.base_path + local_configuration.get_operation_host("v1.get_usage_top_avg_metrics") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4595,10 +4650,10 @@ 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 { diff --git a/src/datadogV1/api/api_users.rs b/src/datadogV1/api/api_users.rs index 335234736..4dbe4fa14 100644 --- a/src/datadogV1/api/api_users.rs +++ b/src/datadogV1/api/api_users.rs @@ -105,15 +105,18 @@ impl UsersAPI { 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("v1.create_user") + ); 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 { @@ -186,17 +189,17 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v1/user/{user_handle}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.disable_user"), 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 { @@ -253,17 +256,17 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v1/user/{user_handle}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_user"), 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 { @@ -317,15 +320,18 @@ impl UsersAPI { 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("v1.list_users") + ); 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 { @@ -389,17 +395,17 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v1/user/{user_handle}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_user"), 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 { diff --git a/src/datadogV1/api/api_webhooks_integration.rs b/src/datadogV1/api/api_webhooks_integration.rs index 084d75408..58c721cb3 100644 --- a/src/datadogV1/api/api_webhooks_integration.rs +++ b/src/datadogV1/api/api_webhooks_integration.rs @@ -138,16 +138,16 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks", - local_configuration.base_path + local_configuration.get_operation_host("v1.create_webhooks_integration") ); 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 { @@ -221,16 +221,17 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables", - local_configuration.base_path + local_configuration + .get_operation_host("v1.create_webhooks_integration_custom_variable") ); 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 { @@ -299,17 +300,17 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.delete_webhooks_integration"), 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 { @@ -368,17 +369,18 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}", - local_configuration.base_path, + local_configuration + .get_operation_host("v1.delete_webhooks_integration_custom_variable"), 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 { @@ -443,17 +445,17 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_webhooks_integration"), 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 { @@ -526,17 +528,17 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.get_webhooks_integration_custom_variable"), 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 { @@ -606,17 +608,17 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/webhooks/{webhook_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v1.update_webhooks_integration"), 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 { @@ -692,17 +694,18 @@ impl WebhooksIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/webhooks/configuration/custom-variables/{custom_variable_name}", - local_configuration.base_path, + local_configuration + .get_operation_host("v1.update_webhooks_integration_custom_variable"), 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 { diff --git a/src/datadogV2/api/api_apm_retention_filters.rs b/src/datadogV2/api/api_apm_retention_filters.rs index 5cec2d781..5273db118 100644 --- a/src/datadogV2/api/api_apm_retention_filters.rs +++ b/src/datadogV2/api/api_apm_retention_filters.rs @@ -117,16 +117,16 @@ impl APMRetentionFiltersAPI { let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_apm_retention_filter") ); 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 { @@ -194,17 +194,17 @@ impl APMRetentionFiltersAPI { let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters/{filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_apm_retention_filter"), 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 { @@ -269,17 +269,17 @@ impl APMRetentionFiltersAPI { let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters/{filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_apm_retention_filter"), 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 { @@ -341,16 +341,16 @@ impl APMRetentionFiltersAPI { let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_apm_retention_filters") ); 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 { @@ -411,16 +411,16 @@ impl APMRetentionFiltersAPI { let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters-execution-order", - local_configuration.base_path + local_configuration.get_operation_host("v2.reorder_apm_retention_filters") ); 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 { @@ -494,17 +494,17 @@ impl APMRetentionFiltersAPI { let local_uri_str = format!( "{}/api/v2/apm/config/retention-filters/{filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_apm_retention_filter"), 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 { diff --git a/src/datadogV2/api/api_audit.rs b/src/datadogV2/api/api_audit.rs index 853def6ad..f2efc9c00 100644 --- a/src/datadogV2/api/api_audit.rs +++ b/src/datadogV2/api/api_audit.rs @@ -156,7 +156,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("v2.list_audit_logs") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -186,10 +189,10 @@ 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 { @@ -264,16 +267,16 @@ impl AuditAPI { let local_uri_str = format!( "{}/api/v2/audit/events/search", - local_configuration.base_path + local_configuration.get_operation_host("v2.search_audit_logs") ); 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 { diff --git a/src/datadogV2/api/api_auth_n_mappings.rs b/src/datadogV2/api/api_auth_n_mappings.rs index 7004a033b..07c7eb7f2 100644 --- a/src/datadogV2/api/api_auth_n_mappings.rs +++ b/src/datadogV2/api/api_auth_n_mappings.rs @@ -140,15 +140,18 @@ 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("v2.create_auth_n_mapping") + ); 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 { @@ -216,17 +219,17 @@ impl AuthNMappingsAPI { let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_auth_n_mapping"), 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 { @@ -289,17 +292,17 @@ impl AuthNMappingsAPI { let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_auth_n_mapping"), 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 { @@ -365,7 +368,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("v2.list_auth_n_mappings") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -387,10 +393,10 @@ 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 { @@ -457,17 +463,17 @@ impl AuthNMappingsAPI { let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_auth_n_mapping"), 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 { diff --git a/src/datadogV2/api/api_ci_visibility_pipelines.rs b/src/datadogV2/api/api_ci_visibility_pipelines.rs index eac29cc6b..5fde3d7e6 100644 --- a/src/datadogV2/api/api_ci_visibility_pipelines.rs +++ b/src/datadogV2/api/api_ci_visibility_pipelines.rs @@ -170,16 +170,16 @@ impl CIVisibilityPipelinesAPI { let local_uri_str = format!( "{}/api/v2/ci/pipelines/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host("v2.aggregate_ci_app_pipeline_events") ); 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 { @@ -253,15 +253,18 @@ impl CIVisibilityPipelinesAPI { 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("v2.create_ci_app_pipeline_event") + ); 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 { @@ -346,7 +349,7 @@ impl CIVisibilityPipelinesAPI { let local_uri_str = format!( "{}/api/v2/ci/pipelines/events", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_ci_app_pipeline_events") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -377,10 +380,10 @@ 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 { @@ -456,16 +459,16 @@ impl CIVisibilityPipelinesAPI { let local_uri_str = format!( "{}/api/v2/ci/pipelines/events/search", - local_configuration.base_path + local_configuration.get_operation_host("v2.search_ci_app_pipeline_events") ); 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 { diff --git a/src/datadogV2/api/api_ci_visibility_tests.rs b/src/datadogV2/api/api_ci_visibility_tests.rs index b3fea3689..4e6f43211 100644 --- a/src/datadogV2/api/api_ci_visibility_tests.rs +++ b/src/datadogV2/api/api_ci_visibility_tests.rs @@ -149,16 +149,16 @@ impl CIVisibilityTestsAPI { let local_uri_str = format!( "{}/api/v2/ci/tests/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host("v2.aggregate_ci_app_test_events") ); 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 { @@ -242,7 +242,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("v2.list_ci_app_test_events") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -272,10 +275,10 @@ 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 { @@ -348,16 +351,16 @@ impl CIVisibilityTestsAPI { let local_uri_str = format!( "{}/api/v2/ci/tests/events/search", - local_configuration.base_path + local_configuration.get_operation_host("v2.search_ci_app_test_events") ); 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 { diff --git a/src/datadogV2/api/api_cloud_cost_management.rs b/src/datadogV2/api/api_cloud_cost_management.rs index 2e417058f..2a70b4ec4 100644 --- a/src/datadogV2/api/api_cloud_cost_management.rs +++ b/src/datadogV2/api/api_cloud_cost_management.rs @@ -150,16 +150,16 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_cost_awscur_config") ); 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 { @@ -230,16 +230,16 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_cost_azure_uc_configs") ); 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 { @@ -307,17 +307,17 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config/{cloud_account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_cost_awscur_config"), 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 { @@ -376,17 +376,17 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config/{cloud_account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_cost_azure_uc_config"), 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 { @@ -444,15 +444,18 @@ impl CloudCostManagementAPI { 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("v2.get_cloud_cost_activity") + ); 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 { @@ -519,7 +522,7 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/aws_related_accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_aws_related_accounts") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -530,10 +533,10 @@ 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 { @@ -595,16 +598,16 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_cost_awscur_configs") ); 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 { @@ -666,16 +669,16 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_cost_azure_uc_configs") ); 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 { @@ -744,17 +747,17 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/aws_cur_config/{cloud_account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_cost_awscur_config"), 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 { @@ -830,17 +833,17 @@ impl CloudCostManagementAPI { let local_uri_str = format!( "{}/api/v2/cost/azure_uc_config/{cloud_account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_cost_azure_uc_configs"), 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 { diff --git a/src/datadogV2/api/api_cloud_workload_security.rs b/src/datadogV2/api/api_cloud_workload_security.rs index 1d8f95eb8..dad1dc111 100644 --- a/src/datadogV2/api/api_cloud_workload_security.rs +++ b/src/datadogV2/api/api_cloud_workload_security.rs @@ -118,16 +118,16 @@ impl CloudWorkloadSecurityAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_cloud_workload_security_agent_rule") ); 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 { @@ -196,17 +196,17 @@ impl CloudWorkloadSecurityAPI { 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("v2.delete_cloud_workload_security_agent_rule"), 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 { @@ -267,16 +267,16 @@ impl CloudWorkloadSecurityAPI { let local_uri_str = format!( "{}/api/v2/security/cloud_workload/policy/download", - local_configuration.base_path + local_configuration.get_operation_host("v2.download_cloud_workload_policy_file") ); 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 { @@ -342,17 +342,17 @@ impl CloudWorkloadSecurityAPI { 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("v2.get_cloud_workload_security_agent_rule"), 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 { @@ -418,16 +418,16 @@ impl CloudWorkloadSecurityAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/cloud_workload_security/agent_rules", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_cloud_workload_security_agent_rules") ); 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 { @@ -499,17 +499,17 @@ impl CloudWorkloadSecurityAPI { 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("v2.update_cloud_workload_security_agent_rule"), 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 { diff --git a/src/datadogV2/api/api_cloudflare_integration.rs b/src/datadogV2/api/api_cloudflare_integration.rs index 33d5d3083..ec3436e4e 100644 --- a/src/datadogV2/api/api_cloudflare_integration.rs +++ b/src/datadogV2/api/api_cloudflare_integration.rs @@ -109,16 +109,16 @@ impl CloudflareIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_cloudflare_account") ); 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 { @@ -186,17 +186,17 @@ impl CloudflareIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_cloudflare_account"), 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 { @@ -258,17 +258,17 @@ impl CloudflareIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_cloudflare_account"), 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 { @@ -330,16 +330,16 @@ impl CloudflareIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_cloudflare_accounts") ); 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 { @@ -408,17 +408,17 @@ impl CloudflareIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/cloudflare/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_cloudflare_account"), 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 { diff --git a/src/datadogV2/api/api_confluent_cloud.rs b/src/datadogV2/api/api_confluent_cloud.rs index 50d23b225..eefe138a8 100644 --- a/src/datadogV2/api/api_confluent_cloud.rs +++ b/src/datadogV2/api/api_confluent_cloud.rs @@ -164,16 +164,16 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_confluent_account") ); 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 { @@ -249,17 +249,17 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources", - local_configuration.base_path, + local_configuration.get_operation_host("v2.create_confluent_resource"), 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 { @@ -327,17 +327,17 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_confluent_account"), 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 { @@ -398,7 +398,7 @@ impl ConfluentCloudAPI { 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("v2.delete_confluent_resource"), account_id = urlencode(account_id), resource_id = urlencode(resource_id) ); @@ -406,10 +406,10 @@ 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 { @@ -471,17 +471,17 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_confluent_account"), 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 { @@ -550,7 +550,7 @@ impl ConfluentCloudAPI { 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("v2.get_confluent_resource"), account_id = urlencode(account_id), resource_id = urlencode(resource_id) ); @@ -558,10 +558,10 @@ 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 { @@ -623,16 +623,16 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_confluent_account") ); 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 { @@ -699,17 +699,17 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_confluent_resource"), 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 { @@ -778,17 +778,17 @@ impl ConfluentCloudAPI { let local_uri_str = format!( "{}/api/v2/integrations/confluent-cloud/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_confluent_account"), 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 { @@ -866,7 +866,7 @@ impl ConfluentCloudAPI { 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("v2.update_confluent_resource"), account_id = urlencode(account_id), resource_id = urlencode(resource_id) ); @@ -874,10 +874,10 @@ 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 { diff --git a/src/datadogV2/api/api_container_images.rs b/src/datadogV2/api/api_container_images.rs index 8dee6dea9..f07aab373 100644 --- a/src/datadogV2/api/api_container_images.rs +++ b/src/datadogV2/api/api_container_images.rs @@ -115,7 +115,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("v2.list_container_images") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -141,10 +144,10 @@ 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 { diff --git a/src/datadogV2/api/api_containers.rs b/src/datadogV2/api/api_containers.rs index 9473a58be..142eac73a 100644 --- a/src/datadogV2/api/api_containers.rs +++ b/src/datadogV2/api/api_containers.rs @@ -113,7 +113,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("v2.list_containers") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -139,10 +142,10 @@ 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 { diff --git a/src/datadogV2/api/api_dashboard_lists.rs b/src/datadogV2/api/api_dashboard_lists.rs index 60f344f79..08857319a 100644 --- a/src/datadogV2/api/api_dashboard_lists.rs +++ b/src/datadogV2/api/api_dashboard_lists.rs @@ -102,17 +102,17 @@ impl DashboardListsAPI { let local_uri_str = format!( "{}/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards", - local_configuration.base_path, + local_configuration.get_operation_host("v2.create_dashboard_list_items"), 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 { @@ -188,17 +188,17 @@ impl DashboardListsAPI { let local_uri_str = format!( "{}/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_dashboard_list_items"), 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 { @@ -272,17 +272,17 @@ impl DashboardListsAPI { let local_uri_str = format!( "{}/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_dashboard_list_items"), 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 { @@ -351,17 +351,17 @@ impl DashboardListsAPI { let local_uri_str = format!( "{}/api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_dashboard_list_items"), 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 { diff --git a/src/datadogV2/api/api_dora_metrics.rs b/src/datadogV2/api/api_dora_metrics.rs index 5555b23e9..76cfb6810 100644 --- a/src/datadogV2/api/api_dora_metrics.rs +++ b/src/datadogV2/api/api_dora_metrics.rs @@ -79,8 +79,9 @@ impl DORAMetricsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.create_dora_deployment".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -89,19 +90,20 @@ 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("v2.create_dora_deployment") + ); 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 { @@ -169,8 +171,9 @@ impl DORAMetricsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.create_dora_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -179,19 +182,20 @@ 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("v2.create_dora_incident") + ); 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 { diff --git a/src/datadogV2/api/api_downtimes.rs b/src/datadogV2/api/api_downtimes.rs index 7cd290e0a..1541482d0 100644 --- a/src/datadogV2/api/api_downtimes.rs +++ b/src/datadogV2/api/api_downtimes.rs @@ -188,17 +188,17 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.cancel_downtime"), 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 { @@ -255,15 +255,18 @@ 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("v2.create_downtime") + ); 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 { @@ -334,7 +337,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_downtime"), downtime_id = urlencode(downtime_id) ); let mut local_req_builder = @@ -346,10 +349,10 @@ 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 { @@ -414,7 +417,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("v2.list_downtimes") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -436,10 +442,10 @@ 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 { @@ -512,7 +518,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/monitor/{monitor_id}/downtime_matches", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_monitor_downtimes"), monitor_id = monitor_id ); let mut local_req_builder = @@ -528,10 +534,10 @@ 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 { @@ -594,17 +600,17 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_downtime"), 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 { diff --git a/src/datadogV2/api/api_events.rs b/src/datadogV2/api/api_events.rs index c816b18b0..ce8f64b2c 100644 --- a/src/datadogV2/api/api_events.rs +++ b/src/datadogV2/api/api_events.rs @@ -146,7 +146,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("v2.list_events") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -176,10 +179,10 @@ 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 { @@ -246,15 +249,18 @@ impl EventsAPI { 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("v2.search_events") + ); 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 { diff --git a/src/datadogV2/api/api_fastly_integration.rs b/src/datadogV2/api/api_fastly_integration.rs index e61dce249..734d3b4cf 100644 --- a/src/datadogV2/api/api_fastly_integration.rs +++ b/src/datadogV2/api/api_fastly_integration.rs @@ -164,16 +164,16 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_fastly_account") ); 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 { @@ -249,17 +249,17 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services", - local_configuration.base_path, + local_configuration.get_operation_host("v2.create_fastly_service"), 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 { @@ -324,17 +324,17 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_fastly_account"), 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 { @@ -395,7 +395,7 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_fastly_service"), account_id = urlencode(account_id), service_id = urlencode(service_id) ); @@ -403,10 +403,10 @@ 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 { @@ -466,17 +466,17 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_fastly_account"), 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 { @@ -543,7 +543,7 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_fastly_service"), account_id = urlencode(account_id), service_id = urlencode(service_id) ); @@ -551,10 +551,10 @@ 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 { @@ -616,16 +616,16 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_fastly_accounts") ); 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 { @@ -689,17 +689,17 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_fastly_services"), 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 { @@ -768,17 +768,17 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_fastly_account"), 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 { @@ -856,7 +856,7 @@ impl FastlyIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_fastly_service"), account_id = urlencode(account_id), service_id = urlencode(service_id) ); @@ -864,10 +864,10 @@ 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 { diff --git a/src/datadogV2/api/api_gcp_integration.rs b/src/datadogV2/api/api_gcp_integration.rs index 2affaf730..a83c9b93e 100644 --- a/src/datadogV2/api/api_gcp_integration.rs +++ b/src/datadogV2/api/api_gcp_integration.rs @@ -135,16 +135,16 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_gcpsts_account") ); 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 { @@ -209,17 +209,17 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_gcpsts_account"), 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 { @@ -279,16 +279,16 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/sts_delegate", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_gcpsts_delegate") ); 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 { @@ -350,16 +350,16 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_gcpsts_accounts") ); 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 { @@ -426,16 +426,16 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/sts_delegate", - local_configuration.base_path + local_configuration.get_operation_host("v2.make_gcpsts_delegate") ); 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 { @@ -511,17 +511,17 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_gcpsts_account"), 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 { diff --git a/src/datadogV2/api/api_incident_services.rs b/src/datadogV2/api/api_incident_services.rs index 3698735ec..c9c872189 100644 --- a/src/datadogV2/api/api_incident_services.rs +++ b/src/datadogV2/api/api_incident_services.rs @@ -162,8 +162,9 @@ impl IncidentServicesAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.create_incident_service".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -172,19 +173,20 @@ 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("v2.create_incident_service") + ); 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 { @@ -246,8 +248,9 @@ impl IncidentServicesAPI { &self, service_id: String, ) -> Result, Error> { + let local_configuration = &self.config; let operation_id = "v2.delete_incident_service".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -256,23 +259,21 @@ 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("v2.delete_incident_service"), 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 { @@ -335,8 +336,9 @@ impl IncidentServicesAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.get_incident_service".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.get_incident_service"), service_id = urlencode(service_id) ); let mut local_req_builder = @@ -366,10 +366,10 @@ 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 { @@ -427,8 +427,9 @@ impl IncidentServicesAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.list_incident_services".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.list_incident_services") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -469,10 +471,10 @@ 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 { @@ -535,8 +537,9 @@ impl IncidentServicesAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.update_incident_service".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -545,23 +548,21 @@ 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("v2.update_incident_service"), 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 { diff --git a/src/datadogV2/api/api_incident_teams.rs b/src/datadogV2/api/api_incident_teams.rs index 6e2de016a..3c121507c 100644 --- a/src/datadogV2/api/api_incident_teams.rs +++ b/src/datadogV2/api/api_incident_teams.rs @@ -160,8 +160,9 @@ impl IncidentTeamsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.create_incident_team".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -170,19 +171,20 @@ 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("v2.create_incident_team") + ); 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 { @@ -241,8 +243,9 @@ impl IncidentTeamsAPI { &self, team_id: String, ) -> Result, Error> { + let local_configuration = &self.config; let operation_id = "v2.delete_incident_team".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -251,23 +254,21 @@ 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("v2.delete_incident_team"), 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 { @@ -325,8 +326,9 @@ impl IncidentTeamsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.get_incident_team".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.get_incident_team"), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -356,10 +356,10 @@ 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 { @@ -415,8 +415,9 @@ impl IncidentTeamsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.list_incident_teams".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.list_incident_teams") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -457,10 +459,10 @@ 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 { @@ -521,8 +523,9 @@ impl IncidentTeamsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.update_incident_team".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -531,23 +534,21 @@ 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("v2.update_incident_team"), 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 { diff --git a/src/datadogV2/api/api_incidents.rs b/src/datadogV2/api/api_incidents.rs index a8ec61469..3f7ebe94f 100644 --- a/src/datadogV2/api/api_incidents.rs +++ b/src/datadogV2/api/api_incidents.rs @@ -419,8 +419,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.create_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -429,19 +430,20 @@ 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("v2.create_incident") + ); 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 { @@ -511,8 +513,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.create_incident_integration".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -521,23 +524,21 @@ 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("v2.create_incident_integration"), 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 { @@ -605,8 +606,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.create_incident_todo".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -615,23 +617,21 @@ 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("v2.create_incident_todo"), 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 { @@ -690,8 +690,9 @@ impl IncidentsAPI { &self, incident_id: String, ) -> Result, Error> { + let local_configuration = &self.config; let operation_id = "v2.delete_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -700,23 +701,21 @@ 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("v2.delete_incident"), 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 { @@ -771,8 +770,9 @@ impl IncidentsAPI { incident_id: String, integration_metadata_id: String, ) -> Result, Error> { + let local_configuration = &self.config; let operation_id = "v2.delete_incident_integration".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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= + local_configuration.get_operation_host("v2.delete_incident_integration"), incident_id= urlencode(incident_id) , integration_metadata_id= urlencode(integration_metadata_id) @@ -796,10 +794,10 @@ 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 { @@ -854,8 +852,9 @@ impl IncidentsAPI { incident_id: String, todo_id: String, ) -> Result, Error> { + let local_configuration = &self.config; let operation_id = "v2.delete_incident_todo".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.delete_incident_todo"), incident_id = urlencode(incident_id), todo_id = urlencode(todo_id) ); @@ -878,10 +875,10 @@ 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 { @@ -934,8 +931,9 @@ impl IncidentsAPI { params: GetIncidentOptionalParams, ) -> Result, Error> { + let local_configuration = &self.config; let operation_id = "v2.get_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.get_incident"), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -972,10 +968,10 @@ 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 { @@ -1037,8 +1033,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.get_incident_integration".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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= + local_configuration.get_operation_host("v2.get_incident_integration"), incident_id= urlencode(incident_id) , integration_metadata_id= urlencode(integration_metadata_id) @@ -1062,10 +1057,10 @@ 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 { @@ -1126,8 +1121,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.get_incident_todo".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.get_incident_todo"), incident_id = urlencode(incident_id), todo_id = urlencode(todo_id) ); @@ -1150,10 +1144,10 @@ 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 { @@ -1216,8 +1210,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.list_incident_attachments".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.list_incident_attachments"), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1266,10 +1259,10 @@ 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 { @@ -1330,8 +1323,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.list_incident_integrations".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -1340,23 +1334,21 @@ 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("v2.list_incident_integrations"), 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 { @@ -1415,8 +1407,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.list_incident_todos".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -1425,23 +1418,21 @@ 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("v2.list_incident_todos"), 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 { @@ -1496,8 +1487,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.list_incidents".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.list_incidents") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1540,10 +1533,10 @@ 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 { @@ -1601,8 +1594,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.search_incidents".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.search_incidents") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1644,10 +1639,10 @@ 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 { @@ -1709,8 +1704,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.update_incident".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.update_incident"), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1747,10 +1741,10 @@ 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 { @@ -1822,8 +1816,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.update_incident_attachments".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.update_incident_attachments"), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1860,10 +1853,10 @@ 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 { @@ -1935,8 +1928,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.update_incident_integration".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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= + local_configuration.get_operation_host("v2.update_incident_integration"), incident_id= urlencode(incident_id) , integration_metadata_id= urlencode(integration_metadata_id) @@ -1960,10 +1952,10 @@ 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 { @@ -2033,8 +2025,9 @@ impl IncidentsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.update_incident_todo".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.update_incident_todo"), incident_id = urlencode(incident_id), todo_id = urlencode(todo_id) ); @@ -2057,10 +2048,10 @@ 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 { diff --git a/src/datadogV2/api/api_ip_allowlist.rs b/src/datadogV2/api/api_ip_allowlist.rs index 84308c8c0..707b552f4 100644 --- a/src/datadogV2/api/api_ip_allowlist.rs +++ b/src/datadogV2/api/api_ip_allowlist.rs @@ -69,15 +69,18 @@ impl IPAllowlistAPI { 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("v2.get_ip_allowlist") + ); 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 { @@ -137,15 +140,18 @@ impl IPAllowlistAPI { 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("v2.update_ip_allowlist") + ); 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 { diff --git a/src/datadogV2/api/api_key_management.rs b/src/datadogV2/api/api_key_management.rs index cda4f0809..4c61cdcd9 100644 --- a/src/datadogV2/api/api_key_management.rs +++ b/src/datadogV2/api/api_key_management.rs @@ -439,15 +439,18 @@ 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("v2.create_api_key") + ); 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 { @@ -520,16 +523,16 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_current_user_application_key") ); 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 { @@ -594,17 +597,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_api_key"), 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 { @@ -659,17 +662,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_application_key"), 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 { @@ -728,17 +731,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_current_user_application_key"), 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 { @@ -800,7 +803,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_api_key"), api_key_id = urlencode(api_key_id) ); let mut local_req_builder = @@ -812,10 +815,10 @@ 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 { @@ -886,7 +889,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_application_key"), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = @@ -898,10 +901,10 @@ 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 { @@ -968,17 +971,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_current_user_application_key"), 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 { @@ -1048,7 +1051,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("v2.list_api_keys") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1100,10 +1106,10 @@ 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 { @@ -1173,7 +1179,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("v2.list_application_keys") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1207,10 +1216,10 @@ 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 { @@ -1286,7 +1295,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_current_user_application_keys") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1321,10 +1330,10 @@ 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 { @@ -1385,17 +1394,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_api_key"), 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 { @@ -1470,17 +1479,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_application_key"), 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 { @@ -1556,17 +1565,17 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys/{app_key_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_current_user_application_key"), 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 { diff --git a/src/datadogV2/api/api_logs.rs b/src/datadogV2/api/api_logs.rs index d8a00398e..6c8467d61 100644 --- a/src/datadogV2/api/api_logs.rs +++ b/src/datadogV2/api/api_logs.rs @@ -207,16 +207,16 @@ impl LogsAPI { let local_uri_str = format!( "{}/api/v2/logs/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host("v2.aggregate_logs") ); 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 { @@ -305,16 +305,16 @@ impl LogsAPI { let local_uri_str = format!( "{}/api/v2/logs/events/search", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_logs") ); 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 { @@ -407,7 +407,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("v2.list_logs_get") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -452,10 +455,10 @@ 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 { @@ -566,7 +569,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("v2.submit_log") + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -580,10 +586,10 @@ 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 { diff --git a/src/datadogV2/api/api_logs_archives.rs b/src/datadogV2/api/api_logs_archives.rs index 1b4a75b65..11f8a88f7 100644 --- a/src/datadogV2/api/api_logs_archives.rs +++ b/src/datadogV2/api/api_logs_archives.rs @@ -158,17 +158,17 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}/readers", - local_configuration.base_path, + local_configuration.get_operation_host("v2.add_read_role_to_archive"), 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 { @@ -232,16 +232,16 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_logs_archive") ); 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 { @@ -306,17 +306,17 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_logs_archive"), 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 { @@ -373,17 +373,17 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_logs_archive"), 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 { @@ -445,16 +445,16 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archive-order", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_logs_archive_order") ); 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 { @@ -519,17 +519,17 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}/readers", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_archive_read_roles"), 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 { @@ -586,16 +586,16 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_logs_archives") ); 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 { @@ -658,17 +658,17 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}/readers", - local_configuration.base_path, + local_configuration.get_operation_host("v2.remove_role_from_archive"), 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 { @@ -743,17 +743,17 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archives/{archive_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_logs_archive"), 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 { @@ -830,16 +830,16 @@ impl LogsArchivesAPI { let local_uri_str = format!( "{}/api/v2/logs/config/archive-order", - local_configuration.base_path + local_configuration.get_operation_host("v2.update_logs_archive_order") ); 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 { diff --git a/src/datadogV2/api/api_logs_metrics.rs b/src/datadogV2/api/api_logs_metrics.rs index 848339f59..a670f1f8d 100644 --- a/src/datadogV2/api/api_logs_metrics.rs +++ b/src/datadogV2/api/api_logs_metrics.rs @@ -105,16 +105,16 @@ impl LogsMetricsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/metrics", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_logs_metric") ); 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 { @@ -179,17 +179,17 @@ impl LogsMetricsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_logs_metric"), 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 { @@ -249,17 +249,17 @@ impl LogsMetricsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_logs_metric"), 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 { @@ -319,16 +319,16 @@ impl LogsMetricsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/metrics", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_logs_metrics") ); 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 { @@ -397,17 +397,17 @@ impl LogsMetricsAPI { let local_uri_str = format!( "{}/api/v2/logs/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_logs_metric"), 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 { diff --git a/src/datadogV2/api/api_metrics.rs b/src/datadogV2/api/api_metrics.rs index 84d983478..795f79c4b 100644 --- a/src/datadogV2/api/api_metrics.rs +++ b/src/datadogV2/api/api_metrics.rs @@ -372,16 +372,16 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/config/bulk-tags", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_bulk_tags_metrics_configuration") ); 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 { @@ -465,17 +465,17 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", - local_configuration.base_path, + local_configuration.get_operation_host("v2.create_tag_configuration"), 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 { @@ -555,16 +555,16 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/config/bulk-tags", - local_configuration.base_path + local_configuration.get_operation_host("v2.delete_bulk_tags_metrics_configuration") ); 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 { @@ -634,17 +634,17 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_tag_configuration"), 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 { @@ -718,7 +718,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/estimate", - local_configuration.base_path, + local_configuration.get_operation_host("v2.estimate_metrics_output_series"), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -746,10 +746,10 @@ 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 { @@ -821,7 +821,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/active-configurations", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_active_metric_configurations"), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -833,10 +833,10 @@ 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 { @@ -904,17 +904,17 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_tag_configuration_by_name"), 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 { @@ -985,7 +985,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("v2.list_tag_configurations") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1021,10 +1024,10 @@ 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 { @@ -1092,17 +1095,17 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/all-tags", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_tags_by_metric_name"), 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 { @@ -1173,17 +1176,17 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/volumes", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_volumes_by_metric_name"), 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 { @@ -1245,8 +1248,9 @@ impl MetricsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.query_scalar_data".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -1255,19 +1259,20 @@ 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("v2.query_scalar_data") + ); 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 { @@ -1334,8 +1339,9 @@ impl MetricsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.query_timeseries_data".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -1344,19 +1350,20 @@ 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("v2.query_timeseries_data") + ); 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 { @@ -1450,7 +1457,10 @@ impl MetricsAPI { 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("v2.submit_metrics") + ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1459,10 +1469,10 @@ 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 { @@ -1543,17 +1553,17 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics/{metric_name}/tags", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_tag_configuration"), 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 { diff --git a/src/datadogV2/api/api_monitors.rs b/src/datadogV2/api/api_monitors.rs index c9ee5736b..33313af63 100644 --- a/src/datadogV2/api/api_monitors.rs +++ b/src/datadogV2/api/api_monitors.rs @@ -103,15 +103,18 @@ impl MonitorsAPI { 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("v2.create_monitor_config_policy") + ); 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 { @@ -179,17 +182,17 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v2/monitor/policy/{policy_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_monitor_config_policy"), 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 { @@ -254,17 +257,17 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v2/monitor/policy/{policy_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_monitor_config_policy"), 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 { @@ -324,15 +327,18 @@ impl MonitorsAPI { 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("v2.list_monitor_config_policies") + ); 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 { @@ -401,17 +407,17 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v2/monitor/policy/{policy_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_monitor_config_policy"), 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 { diff --git a/src/datadogV2/api/api_okta_integration.rs b/src/datadogV2/api/api_okta_integration.rs index c089d88c6..52bf24d4d 100644 --- a/src/datadogV2/api/api_okta_integration.rs +++ b/src/datadogV2/api/api_okta_integration.rs @@ -107,16 +107,16 @@ impl OktaIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_okta_account") ); 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 { @@ -181,17 +181,17 @@ impl OktaIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_okta_account"), 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 { @@ -251,17 +251,17 @@ impl OktaIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_okta_account"), 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 { @@ -321,16 +321,16 @@ impl OktaIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_okta_accounts") ); 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 { @@ -397,17 +397,17 @@ impl OktaIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integrations/okta/accounts/{account_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_okta_account"), 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 { diff --git a/src/datadogV2/api/api_opsgenie_integration.rs b/src/datadogV2/api/api_opsgenie_integration.rs index 419a6e506..5def1a42e 100644 --- a/src/datadogV2/api/api_opsgenie_integration.rs +++ b/src/datadogV2/api/api_opsgenie_integration.rs @@ -109,16 +109,16 @@ impl OpsgenieIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_opsgenie_service") ); 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 { @@ -186,17 +186,17 @@ impl OpsgenieIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services/{integration_service_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_opsgenie_service"), 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 { @@ -261,17 +261,17 @@ impl OpsgenieIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services/{integration_service_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_opsgenie_service"), 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 { @@ -333,16 +333,16 @@ impl OpsgenieIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_opsgenie_services") ); 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 { @@ -411,17 +411,17 @@ impl OpsgenieIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/opsgenie/services/{integration_service_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_opsgenie_service"), 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 { diff --git a/src/datadogV2/api/api_organizations.rs b/src/datadogV2/api/api_organizations.rs index a372d5141..005284fce 100644 --- a/src/datadogV2/api/api_organizations.rs +++ b/src/datadogV2/api/api_organizations.rs @@ -81,16 +81,16 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v2/saml_configurations/idp_metadata", - local_configuration.base_path + local_configuration.get_operation_host("v2.upload_id_p_metadata") ); 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 { diff --git a/src/datadogV2/api/api_powerpack.rs b/src/datadogV2/api/api_powerpack.rs index 3906c647f..dcdae12a1 100644 --- a/src/datadogV2/api/api_powerpack.rs +++ b/src/datadogV2/api/api_powerpack.rs @@ -118,15 +118,18 @@ 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("v2.create_powerpack") + ); 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 { @@ -191,17 +194,17 @@ impl PowerpackAPI { let local_uri_str = format!( "{}/api/v2/powerpacks/{powerpack_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_powerpack"), 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 { @@ -258,17 +261,17 @@ impl PowerpackAPI { let local_uri_str = format!( "{}/api/v2/powerpacks/{powerpack_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_powerpack"), 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 { @@ -331,7 +334,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("v2.list_powerpacks") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -345,10 +351,10 @@ 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 { @@ -415,17 +421,17 @@ impl PowerpackAPI { let local_uri_str = format!( "{}/api/v2/powerpacks/{powerpack_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_powerpack"), 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 { diff --git a/src/datadogV2/api/api_processes.rs b/src/datadogV2/api/api_processes.rs index 41cb9bf28..392445b4b 100644 --- a/src/datadogV2/api/api_processes.rs +++ b/src/datadogV2/api/api_processes.rs @@ -129,7 +129,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("v2.list_processes") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -158,10 +161,10 @@ 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 { diff --git a/src/datadogV2/api/api_restriction_policies.rs b/src/datadogV2/api/api_restriction_policies.rs index 4354e8f2c..ee53832ca 100644 --- a/src/datadogV2/api/api_restriction_policies.rs +++ b/src/datadogV2/api/api_restriction_policies.rs @@ -81,17 +81,17 @@ impl RestrictionPoliciesAPI { let local_uri_str = format!( "{}/api/v2/restriction_policy/{resource_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_restriction_policy"), 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 { @@ -156,17 +156,17 @@ impl RestrictionPoliciesAPI { let local_uri_str = format!( "{}/api/v2/restriction_policy/{resource_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_restriction_policy"), 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 { @@ -269,17 +269,17 @@ impl RestrictionPoliciesAPI { let local_uri_str = format!( "{}/api/v2/restriction_policy/{resource_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_restriction_policy"), 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 { diff --git a/src/datadogV2/api/api_roles.rs b/src/datadogV2/api/api_roles.rs index 2212c3d41..d5a38159b 100644 --- a/src/datadogV2/api/api_roles.rs +++ b/src/datadogV2/api/api_roles.rs @@ -283,17 +283,17 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/permissions", - local_configuration.base_path, + local_configuration.get_operation_host("v2.add_permission_to_role"), 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 { @@ -361,17 +361,17 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", - local_configuration.base_path, + local_configuration.get_operation_host("v2.add_user_to_role"), 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 { @@ -438,17 +438,17 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/clone", - local_configuration.base_path, + local_configuration.get_operation_host("v2.clone_role"), 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 { @@ -511,15 +511,18 @@ 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("v2.create_role") + ); 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 { @@ -580,17 +583,17 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_role"), 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 { @@ -645,17 +648,17 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_role"), 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 { @@ -712,15 +715,18 @@ impl RolesAPI { 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("v2.list_permissions") + ); 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 { @@ -782,17 +788,17 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/permissions", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_role_permissions"), 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 { @@ -859,7 +865,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_role_users"), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -883,10 +889,10 @@ 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 { @@ -950,7 +956,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("v2.list_roles") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -976,10 +985,10 @@ 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 { @@ -1047,17 +1056,17 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/permissions", - local_configuration.base_path, + local_configuration.get_operation_host("v2.remove_permission_from_role"), 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 { @@ -1131,17 +1140,17 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", - local_configuration.base_path, + local_configuration.get_operation_host("v2.remove_user_from_role"), 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 { @@ -1209,17 +1218,17 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_role"), 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 { diff --git a/src/datadogV2/api/api_rum.rs b/src/datadogV2/api/api_rum.rs index 73d7b4685..5d3b1a99a 100644 --- a/src/datadogV2/api/api_rum.rs +++ b/src/datadogV2/api/api_rum.rs @@ -182,16 +182,16 @@ impl RUMAPI { let local_uri_str = format!( "{}/api/v2/rum/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host("v2.aggregate_rum_events") ); 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 { @@ -260,15 +260,18 @@ impl RUMAPI { 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("v2.create_rum_application") + ); 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 { @@ -333,17 +336,17 @@ impl RUMAPI { let local_uri_str = format!( "{}/api/v2/rum/applications/{id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_rum_application"), 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 { @@ -405,17 +408,17 @@ impl RUMAPI { let local_uri_str = format!( "{}/api/v2/rum/applications/{id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_rum_application"), 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 { @@ -475,15 +478,18 @@ impl RUMAPI { 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("v2.get_rum_applications") + ); 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 { @@ -560,7 +566,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("v2.list_rum_events") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -590,10 +599,10 @@ 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 { @@ -663,15 +672,18 @@ impl RUMAPI { 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("v2.search_rum_events") + ); 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 { @@ -744,17 +756,17 @@ impl RUMAPI { let local_uri_str = format!( "{}/api/v2/rum/applications/{id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_rum_application"), 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 { diff --git a/src/datadogV2/api/api_security_monitoring.rs b/src/datadogV2/api/api_security_monitoring.rs index 3ac491b34..b9528a09f 100644 --- a/src/datadogV2/api/api_security_monitoring.rs +++ b/src/datadogV2/api/api_security_monitoring.rs @@ -465,16 +465,16 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_security_filter") ); 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 { @@ -548,16 +548,16 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_security_monitoring_rule") ); 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 { @@ -625,17 +625,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_security_filter"), 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 { @@ -694,17 +694,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_security_monitoring_rule"), 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 { @@ -771,17 +771,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}/assignee", - local_configuration.base_path, + local_configuration.get_operation_host("v2.edit_security_monitoring_signal_assignee"), 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 { @@ -858,17 +858,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}/incidents", - local_configuration.base_path, + local_configuration.get_operation_host("v2.edit_security_monitoring_signal_incidents"), 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 { @@ -945,17 +945,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}/state", - local_configuration.base_path, + local_configuration.get_operation_host("v2.edit_security_monitoring_signal_state"), 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 { @@ -1018,8 +1018,9 @@ impl SecurityMonitoringAPI { params: GetFindingOptionalParams, ) -> Result, Error> { + let local_configuration = &self.config; let operation_id = "v2.get_finding".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -1028,8 +1029,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 +1036,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/posture_management/findings/{finding_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_finding"), finding_id = urlencode(finding_id) ); let mut local_req_builder = @@ -1049,10 +1048,10 @@ 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 { @@ -1124,17 +1123,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_security_filter"), 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 { @@ -1201,17 +1200,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_security_monitoring_rule"), 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 { @@ -1278,17 +1277,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/{signal_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_security_monitoring_signal"), 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 { @@ -1404,8 +1403,9 @@ impl SecurityMonitoringAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.list_findings".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -1414,8 +1414,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 +1432,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/posture_management/findings", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_findings") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1493,10 +1491,10 @@ 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 { @@ -1557,16 +1555,16 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_security_filters") ); 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 { @@ -1637,7 +1635,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_security_monitoring_rules") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1652,10 +1650,10 @@ 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 { @@ -1734,7 +1732,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_security_monitoring_signals") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1765,10 +1763,10 @@ 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 { @@ -1825,8 +1823,9 @@ impl SecurityMonitoringAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.mute_findings".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -1835,22 +1834,20 @@ 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("v2.mute_findings") ); 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 { @@ -1930,16 +1927,16 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/search", - local_configuration.base_path + local_configuration.get_operation_host("v2.search_security_monitoring_signals") ); 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 { @@ -2018,17 +2015,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_security_filter"), 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 { @@ -2108,17 +2105,17 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_security_monitoring_rule"), 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 { diff --git a/src/datadogV2/api/api_sensitive_data_scanner.rs b/src/datadogV2/api/api_sensitive_data_scanner.rs index 5dc41c08c..ada66c28c 100644 --- a/src/datadogV2/api/api_sensitive_data_scanner.rs +++ b/src/datadogV2/api/api_sensitive_data_scanner.rs @@ -156,16 +156,16 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/groups", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_scanning_group") ); 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 { @@ -245,16 +245,16 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/rules", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_scanning_rule") ); 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 { @@ -331,17 +331,17 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/groups/{group_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_scanning_group"), 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 { @@ -418,17 +418,17 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_scanning_rule"), 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 { @@ -498,16 +498,16 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_scanning_groups") ); 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 { @@ -570,16 +570,16 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/standard-patterns", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_standard_patterns") ); 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 { @@ -644,16 +644,16 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config", - local_configuration.base_path + local_configuration.get_operation_host("v2.reorder_scanning_groups") ); 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 { @@ -736,17 +736,17 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/groups/{group_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_scanning_group"), 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 { @@ -829,17 +829,17 @@ impl SensitiveDataScannerAPI { let local_uri_str = format!( "{}/api/v2/sensitive-data-scanner/config/rules/{rule_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_scanning_rule"), 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 { diff --git a/src/datadogV2/api/api_service_accounts.rs b/src/datadogV2/api/api_service_accounts.rs index 05693cdc8..1c7882f14 100644 --- a/src/datadogV2/api/api_service_accounts.rs +++ b/src/datadogV2/api/api_service_accounts.rs @@ -167,15 +167,18 @@ impl ServiceAccountsAPI { 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("v2.create_service_account") + ); 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 { @@ -251,17 +254,17 @@ 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("v2.create_service_account_application_key"), 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 { @@ -331,7 +334,7 @@ impl ServiceAccountsAPI { 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("v2.delete_service_account_application_key"), service_account_id = urlencode(service_account_id), app_key_id = urlencode(app_key_id) ); @@ -339,10 +342,10 @@ 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 { @@ -409,7 +412,7 @@ impl ServiceAccountsAPI { 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("v2.get_service_account_application_key"), service_account_id = urlencode(service_account_id), app_key_id = urlencode(app_key_id) ); @@ -417,10 +420,10 @@ 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 { @@ -497,7 +500,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("v2.list_service_account_application_keys"), service_account_id = urlencode(service_account_id) ); let mut local_req_builder = @@ -529,10 +532,10 @@ 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 { @@ -607,7 +610,7 @@ impl ServiceAccountsAPI { 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("v2.update_service_account_application_key"), service_account_id = urlencode(service_account_id), app_key_id = urlencode(app_key_id) ); @@ -615,10 +618,10 @@ 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 { diff --git a/src/datadogV2/api/api_service_definition.rs b/src/datadogV2/api/api_service_definition.rs index 4b2d88ca7..c802dc240 100644 --- a/src/datadogV2/api/api_service_definition.rs +++ b/src/datadogV2/api/api_service_definition.rs @@ -152,16 +152,16 @@ impl ServiceDefinitionAPI { let local_uri_str = format!( "{}/api/v2/services/definitions", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_or_update_service_definitions") ); 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 { @@ -229,17 +229,17 @@ impl ServiceDefinitionAPI { let local_uri_str = format!( "{}/api/v2/services/definitions/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_service_definition"), 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 { @@ -309,7 +309,7 @@ impl ServiceDefinitionAPI { let local_uri_str = format!( "{}/api/v2/services/definitions/{service_name}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_service_definition"), service_name = urlencode(service_name) ); let mut local_req_builder = @@ -321,10 +321,10 @@ 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 { @@ -393,7 +393,7 @@ impl ServiceDefinitionAPI { let local_uri_str = format!( "{}/api/v2/services/definitions", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_service_definitions") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -412,10 +412,10 @@ 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 { diff --git a/src/datadogV2/api/api_service_scorecards.rs b/src/datadogV2/api/api_service_scorecards.rs index 6c08367f2..88d61a474 100644 --- a/src/datadogV2/api/api_service_scorecards.rs +++ b/src/datadogV2/api/api_service_scorecards.rs @@ -261,8 +261,9 @@ impl ServiceScorecardsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.create_scorecard_outcomes_batch".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -271,22 +272,20 @@ 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("v2.create_scorecard_outcomes_batch") ); 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 { @@ -349,8 +348,9 @@ impl ServiceScorecardsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.create_scorecard_rule".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -359,19 +359,20 @@ 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("v2.create_scorecard_rule") + ); 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 { @@ -430,8 +431,9 @@ impl ServiceScorecardsAPI { &self, rule_id: String, ) -> Result, Error> { + let local_configuration = &self.config; let operation_id = "v2.delete_scorecard_rule".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -440,23 +442,21 @@ 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("v2.delete_scorecard_rule"), 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 { @@ -510,8 +510,9 @@ impl ServiceScorecardsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.list_scorecard_outcomes".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.list_scorecard_outcomes") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -587,10 +586,10 @@ 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 { @@ -646,8 +645,9 @@ impl ServiceScorecardsAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.list_scorecard_rules".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -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("v2.list_scorecard_rules") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -718,10 +719,10 @@ 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 { diff --git a/src/datadogV2/api/api_spans.rs b/src/datadogV2/api/api_spans.rs index 824f3fea9..29ce123e7 100644 --- a/src/datadogV2/api/api_spans.rs +++ b/src/datadogV2/api/api_spans.rs @@ -137,16 +137,16 @@ impl SpansAPI { let local_uri_str = format!( "{}/api/v2/spans/analytics/aggregate", - local_configuration.base_path + local_configuration.get_operation_host("v2.aggregate_spans") ); 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 { @@ -224,16 +224,16 @@ impl SpansAPI { let local_uri_str = format!( "{}/api/v2/spans/events/search", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_spans") ); 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 { @@ -316,7 +316,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("v2.list_spans_get") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -346,10 +349,10 @@ 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 { diff --git a/src/datadogV2/api/api_spans_metrics.rs b/src/datadogV2/api/api_spans_metrics.rs index eb4f8b4ba..441e9f12b 100644 --- a/src/datadogV2/api/api_spans_metrics.rs +++ b/src/datadogV2/api/api_spans_metrics.rs @@ -105,16 +105,16 @@ impl SpansMetricsAPI { let local_uri_str = format!( "{}/api/v2/apm/config/metrics", - local_configuration.base_path + local_configuration.get_operation_host("v2.create_spans_metric") ); 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 { @@ -179,17 +179,17 @@ impl SpansMetricsAPI { let local_uri_str = format!( "{}/api/v2/apm/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_spans_metric"), 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 { @@ -249,17 +249,17 @@ impl SpansMetricsAPI { let local_uri_str = format!( "{}/api/v2/apm/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_spans_metric"), 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 { @@ -319,16 +319,16 @@ impl SpansMetricsAPI { let local_uri_str = format!( "{}/api/v2/apm/config/metrics", - local_configuration.base_path + local_configuration.get_operation_host("v2.list_spans_metrics") ); 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 { @@ -397,17 +397,17 @@ impl SpansMetricsAPI { let local_uri_str = format!( "{}/api/v2/apm/config/metrics/{metric_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_spans_metric"), 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 { diff --git a/src/datadogV2/api/api_synthetics.rs b/src/datadogV2/api/api_synthetics.rs index 82613bedc..df2b78c2b 100644 --- a/src/datadogV2/api/api_synthetics.rs +++ b/src/datadogV2/api/api_synthetics.rs @@ -68,16 +68,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v2/synthetics/settings/on_demand_concurrency_cap", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_on_demand_concurrency_cap") ); 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 { @@ -144,16 +144,16 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v2/synthetics/settings/on_demand_concurrency_cap", - local_configuration.base_path + local_configuration.get_operation_host("v2.set_on_demand_concurrency_cap") ); 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 { diff --git a/src/datadogV2/api/api_teams.rs b/src/datadogV2/api/api_teams.rs index 5f4a72644..eeed60e4e 100644 --- a/src/datadogV2/api/api_teams.rs +++ b/src/datadogV2/api/api_teams.rs @@ -316,15 +316,18 @@ 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("v2.create_team") + ); 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 { @@ -393,17 +396,17 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links", - local_configuration.base_path, + local_configuration.get_operation_host("v2.create_team_link"), 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 { @@ -477,17 +480,17 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships", - local_configuration.base_path, + local_configuration.get_operation_host("v2.create_team_membership"), 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 { @@ -549,17 +552,17 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_team"), 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 { @@ -616,7 +619,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links/{link_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_team_link"), team_id = urlencode(team_id), link_id = urlencode(link_id) ); @@ -624,10 +627,10 @@ 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 { @@ -688,7 +691,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.delete_team_membership"), team_id = urlencode(team_id), user_id = urlencode(user_id) ); @@ -696,10 +699,10 @@ 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 { @@ -755,17 +758,17 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_team"), 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 { @@ -825,7 +828,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links/{link_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_team_link"), team_id = urlencode(team_id), link_id = urlencode(link_id) ); @@ -833,10 +836,10 @@ 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 { @@ -894,17 +897,17 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_team_links"), 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 { @@ -976,7 +979,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_team_memberships"), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -1000,10 +1003,10 @@ 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 { @@ -1070,17 +1073,17 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/permission-settings", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_team_permission_settings"), 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 { @@ -1142,17 +1145,17 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/users/{user_uuid}/memberships", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_user_memberships"), 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 { @@ -1220,7 +1223,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("v2.list_teams") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1268,10 +1274,10 @@ 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 { @@ -1333,17 +1339,17 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_team"), 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 { @@ -1417,7 +1423,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/links/{link_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_team_link"), team_id = urlencode(team_id), link_id = urlencode(link_id) ); @@ -1425,10 +1431,10 @@ 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 { @@ -1504,7 +1510,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_team_membership"), team_id = urlencode(team_id), user_id = urlencode(user_id) ); @@ -1512,10 +1518,10 @@ 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 { @@ -1593,7 +1599,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/permission-settings/{action}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_team_permission_setting"), team_id = urlencode(team_id), action = urlencode(action) ); @@ -1601,10 +1607,10 @@ 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 { diff --git a/src/datadogV2/api/api_usage_metering.rs b/src/datadogV2/api/api_usage_metering.rs index c50a93623..34c00f865 100644 --- a/src/datadogV2/api/api_usage_metering.rs +++ b/src/datadogV2/api/api_usage_metering.rs @@ -401,8 +401,9 @@ impl UsageMeteringAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.get_active_billing_dimensions".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -411,22 +412,20 @@ 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("v2.get_active_billing_dimensions") ); 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 { @@ -499,7 +498,10 @@ impl UsageMeteringAPI { 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("v2.get_cost_by_org") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -510,10 +512,10 @@ 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 { @@ -587,7 +589,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/estimated_cost", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_estimated_cost_by_org") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -614,10 +616,10 @@ 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 { @@ -692,7 +694,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/historical_cost", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_historical_cost_by_org") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -708,10 +710,10 @@ 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 { @@ -792,7 +794,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/hourly_usage", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_hourly_usage") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -833,10 +835,10 @@ 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 { @@ -929,8 +931,9 @@ impl UsageMeteringAPI { ResponseContent, Error, > { + let local_configuration = &self.config; let operation_id = "v2.get_monthly_cost_attribution".to_string(); - if self.config.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(&operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -939,8 +942,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 +953,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("v2.get_monthly_cost_attribution") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -982,10 +983,10 @@ 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 { @@ -1054,7 +1055,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/projected_cost", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_projected_cost") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1065,10 +1066,10 @@ 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 { @@ -1142,7 +1143,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/application_security", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_usage_application_security_monitoring") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1154,10 +1155,10 @@ 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 { @@ -1232,7 +1233,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/lambda_traced_invocations", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_usage_lambda_traced_invocations") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1244,10 +1245,10 @@ 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 { @@ -1322,7 +1323,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/observability_pipelines", - local_configuration.base_path + local_configuration.get_operation_host("v2.get_usage_observability_pipelines") ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1334,10 +1335,10 @@ 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 { diff --git a/src/datadogV2/api/api_users.rs b/src/datadogV2/api/api_users.rs index 4b2391e7a..0e7340fe5 100644 --- a/src/datadogV2/api/api_users.rs +++ b/src/datadogV2/api/api_users.rs @@ -200,15 +200,18 @@ 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("v2.create_user") + ); 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 { @@ -274,17 +277,17 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.disable_user"), 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 { @@ -346,17 +349,17 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/user_invitations/{user_invitation_uuid}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_invitation"), 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 { @@ -414,17 +417,17 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.get_user"), 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 { @@ -487,17 +490,17 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}/orgs", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_user_organizations"), 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 { @@ -561,17 +564,17 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}/permissions", - local_configuration.base_path, + local_configuration.get_operation_host("v2.list_user_permissions"), 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 { @@ -638,7 +641,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("v2.list_users") + ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -668,10 +674,10 @@ 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 { @@ -730,15 +736,18 @@ impl UsersAPI { 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("v2.send_invitations") + ); 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 { @@ -808,17 +817,17 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users/{user_id}", - local_configuration.base_path, + local_configuration.get_operation_host("v2.update_user"), 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 { diff --git a/tests/main.rs b/tests/main.rs index 35cd1205e..3298bba7a 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -57,7 +57,7 @@ async fn main() { .to_lowercase(); let is_replay = !record_mode.eq("true") && !record_mode.eq("none"); let concurrent_scenarios = match is_replay { - true => 16, + true => 64, false => 1, }; let parsed_cli: cli::Opts = diff --git a/tests/scenarios/fixtures.rs b/tests/scenarios/fixtures.rs index c9dcff96e..4ffd6f702 100644 --- a/tests/scenarios/fixtures.rs +++ b/tests/scenarios/fixtures.rs @@ -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,6 +156,12 @@ pub async fn before_scenario( vcr_client_builder.with(middleware).build() } }; + world.config.client(client); + world + .config + .server_variables + .insert("site".into(), "datadoghq.com".into()); + world.config.api_key_auth = Some("00000000000000000000000000000000".to_string()); world.config.app_key_auth = Some("0000000000000000000000000000000000000000".to_string()); From dc4042152522e85ff4ed4cff6957ec78eb0479fc Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Thu, 15 Feb 2024 16:05:55 -0500 Subject: [PATCH 3/7] refactor config object constructor and naming --- .generator/src/generator/templates/api.j2 | 10 +- .../src/generator/templates/configuration.j2 | 105 +++-- src/datadog/configuration.rs | 144 +++--- src/datadogV1/api/api_authentication.rs | 7 +- src/datadogV1/api/api_aws_integration.rs | 132 +++--- src/datadogV1/api/api_aws_logs_integration.rs | 77 ++-- src/datadogV1/api/api_azure_integration.rs | 55 +-- src/datadogV1/api/api_dashboard_lists.rs | 55 +-- src/datadogV1/api/api_dashboards.rs | 154 ++++--- src/datadogV1/api/api_downtimes.rs | 77 ++-- src/datadogV1/api/api_events.rs | 29 +- src/datadogV1/api/api_gcp_integration.rs | 44 +- src/datadogV1/api/api_hosts.rs | 44 +- src/datadogV1/api/api_ip_ranges.rs | 6 +- src/datadogV1/api/api_key_management.rs | 110 ++--- src/datadogV1/api/api_logs.rs | 18 +- src/datadogV1/api/api_logs_indexes.rs | 66 +-- src/datadogV1/api/api_logs_pipelines.rs | 77 ++-- src/datadogV1/api/api_metrics.rs | 69 +-- src/datadogV1/api/api_monitors.rs | 110 ++--- src/datadogV1/api/api_notebooks.rs | 55 +-- src/datadogV1/api/api_organizations.rs | 66 +-- .../api/api_pager_duty_integration.rs | 44 +- src/datadogV1/api/api_security_monitoring.rs | 33 +- src/datadogV1/api/api_service_checks.rs | 7 +- ...api_service_level_objective_corrections.rs | 55 +-- .../api/api_service_level_objectives.rs | 110 ++--- src/datadogV1/api/api_slack_integration.rs | 55 +-- src/datadogV1/api/api_snapshots.rs | 11 +- src/datadogV1/api/api_synthetics.rs | 319 +++++++------ src/datadogV1/api/api_tags.rs | 55 +-- src/datadogV1/api/api_usage_metering.rs | 419 ++++++++++-------- src/datadogV1/api/api_users.rs | 55 +-- src/datadogV1/api/api_webhooks_integration.rs | 91 ++-- .../api/api_apm_retention_filters.rs | 66 +-- src/datadogV2/api/api_audit.rs | 22 +- src/datadogV2/api/api_auth_n_mappings.rs | 55 +-- .../api/api_ci_visibility_pipelines.rs | 40 +- src/datadogV2/api/api_ci_visibility_tests.rs | 33 +- .../api/api_cloud_cost_management.rs | 110 ++--- .../api/api_cloud_workload_security.rs | 66 +-- .../api/api_cloudflare_integration.rs | 55 +-- src/datadogV2/api/api_confluent_cloud.rs | 110 ++--- src/datadogV2/api/api_container_images.rs | 11 +- src/datadogV2/api/api_containers.rs | 11 +- src/datadogV2/api/api_dashboard_lists.rs | 44 +- src/datadogV2/api/api_dora_metrics.rs | 20 +- src/datadogV2/api/api_downtimes.rs | 66 +-- src/datadogV2/api/api_events.rs | 22 +- src/datadogV2/api/api_fastly_integration.rs | 110 ++--- src/datadogV2/api/api_gcp_integration.rs | 66 +-- src/datadogV2/api/api_incident_services.rs | 70 +-- src/datadogV2/api/api_incident_teams.rs | 70 +-- src/datadogV2/api/api_incidents.rs | 252 +++++------ src/datadogV2/api/api_ip_allowlist.rs | 22 +- src/datadogV2/api/api_key_management.rs | 154 ++++--- src/datadogV2/api/api_logs.rs | 40 +- src/datadogV2/api/api_logs_archives.rs | 110 ++--- src/datadogV2/api/api_logs_metrics.rs | 55 +-- src/datadogV2/api/api_metrics.rs | 156 ++++--- src/datadogV2/api/api_monitors.rs | 55 +-- src/datadogV2/api/api_okta_integration.rs | 55 +-- src/datadogV2/api/api_opsgenie_integration.rs | 55 +-- src/datadogV2/api/api_organizations.rs | 11 +- src/datadogV2/api/api_powerpack.rs | 55 +-- src/datadogV2/api/api_processes.rs | 11 +- src/datadogV2/api/api_restriction_policies.rs | 33 +- src/datadogV2/api/api_roles.rs | 143 +++--- src/datadogV2/api/api_rum.rs | 88 ++-- src/datadogV2/api/api_security_monitoring.rs | 218 ++++----- .../api/api_sensitive_data_scanner.rs | 99 +++-- src/datadogV2/api/api_service_accounts.rs | 66 +-- src/datadogV2/api/api_service_definition.rs | 44 +- src/datadogV2/api/api_service_scorecards.rs | 70 +-- src/datadogV2/api/api_spans.rs | 33 +- src/datadogV2/api/api_spans_metrics.rs | 55 +-- src/datadogV2/api/api_synthetics.rs | 22 +- src/datadogV2/api/api_teams.rs | 187 ++++---- src/datadogV2/api/api_usage_metering.rs | 116 ++--- src/datadogV2/api/api_users.rs | 99 +++-- tests/scenarios/fixtures.rs | 12 +- 81 files changed, 3316 insertions(+), 2811 deletions(-) diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index 2e38e669c..f2a2085b3 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -110,9 +110,9 @@ impl {{ structName }} { {%- 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 local_configuration.is_unstable_operation_enabled(&operation_id) { + if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {}", operation_id); } else { let local_error = UnstableOperationDisabledError { @@ -133,7 +133,7 @@ impl {{ structName }} { let local_uri_str = format!( "{}{{path}}", - local_configuration.get_operation_host("{{ version }}.{{ operation.operationId | snake_case }}") + 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 %}) @@ -180,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(ref local_key) = local_configuration.{{name|variable_name|replace("_auth", "")}} { + local_req_builder = local_req_builder.header("{{schema.name}}", local_key); }; {%- endif %} {%- endfor %} diff --git a/.generator/src/generator/templates/configuration.j2 b/.generator/src/generator/templates/configuration.j2 index f24a2255e..ffebd6f00 100644 --- a/.generator/src/generator/templates/configuration.j2 +++ b/.generator/src/generator/templates/configuration.j2 @@ -47,7 +47,7 @@ pub struct Configuration { {%- for name in authMethod %} {%- set schema = openapi.components.securitySchemes[name] %} {%- if schema.type == "apiKey" and schema.in != "cookie" %} - pub {{name|variable_name}}: Option, + pub {{name|variable_name|replace("_auth", "")}}: Option, {%- endif %} {%- endfor %} {%- endfor %} @@ -60,14 +60,71 @@ pub struct Configuration { } impl Configuration { - pub fn new() -> Configuration { - Configuration::default() + pub fn new() -> Self { + Self::default() + } + + pub fn with_keys({% if openapi.security %}{% for authMethod in openapi.security %}{% for name in authMethod %}{% set schema = openapi.components.securitySchemes[name] %}{% if schema.type == "apiKey" and schema.in != "cookie" %}{{name|variable_name|replace("_auth", "")}}: Option{% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% endfor %}{% endif %}) -> 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() %} + {%- for _, _, operation in operations|sort(attribute="2.operationId") %} + {%- if "x-unstable" in operation %} + ("{{ version }}.{{ operation.operationId | snake_case }}".to_owned(), false), + {%- endif %} + {%- endfor %} + {%- endfor %} + {%- endfor %} + ]); + + Self { + user_agent, + client: http_client.build(), + unstable_operations, + {%- 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|replace("_auth", "")}}, + {%- endif %} + {%- endfor %} + {%- endfor %} + {%- endif %} + server_index: 0, + server_variables: HashMap::new(), + server_operation_index: HashMap::new(), + server_operation_variables: HashMap::new(), + } + } pub fn client(&mut self, client: reqwest_middleware::ClientWithMiddleware) { self.client = client; } + {%- if openapi.security %} + {%- for authMethod in openapi.security %} + {%- for name in authMethod %} + {%- set schema = openapi.components.securitySchemes[name] %} + {% if schema.type == "apiKey" and schema.in != "cookie" %} + pub fn {{name|variable_name|replace("_auth", "")}}(&mut self, key: String) { + self.{{name|variable_name|replace("_auth", "")}} = Some(key); + } + {%- endif %} + {%- endfor %} + {%- endfor %} + {%- endif %} + pub fn get_operation_host(&self, operation_str: &str) -> String { let operation = operation_str.to_string(); if let Some(servers) = OPERATION_SERVERS.get(&operation) { @@ -122,46 +179,7 @@ impl Configuration { 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() %} - {%- for _, _, operation in operations|sort(attribute="2.operationId") %} - {%- if "x-unstable" in operation %} - ("{{ version }}.{{ operation.operationId | snake_case }}".to_owned(), false), - {%- endif %} - {%- endfor %} - {%- endfor %} - {%- endfor %} - ]); - - Configuration { - user_agent, - client: http_client.build(), - unstable_operations, - {%- 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 %} - server_index: 0, - server_variables: HashMap::new(), - server_operation_index: HashMap::new(), - server_operation_variables: HashMap::new(), - } + Self::with_keys({% if openapi.security %}{% for authMethod in openapi.security %}{% for name in authMethod %}{% set schema = openapi.components.securitySchemes[name] %}{% if schema.type == "apiKey" and schema.in != "cookie" %}env::var("{{ schema.get("x-env-name") }}").ok(){% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% endfor %}{% endif %}) } } @@ -188,7 +206,6 @@ ServerConfiguration { }, {%- endmacro %} - lazy_static! { static ref SERVERS: Vec = { vec![ diff --git a/src/datadog/configuration.rs b/src/datadog/configuration.rs index 6055e6aff..66b86febb 100644 --- a/src/datadog/configuration.rs +++ b/src/datadog/configuration.rs @@ -43,8 +43,8 @@ pub struct Configuration { pub(crate) user_agent: String, pub(crate) client: reqwest_middleware::ClientWithMiddleware, pub unstable_operations: HashMap, - pub api_key_auth: Option, - pub app_key_auth: Option, + pub api_key: Option, + pub app_key: Option, pub server_index: usize, pub server_variables: HashMap, pub server_operation_index: HashMap, @@ -52,69 +52,11 @@ pub struct Configuration { } 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 { - if self.unstable_operations.contains_key(operation) { - self.unstable_operations - .insert(operation.to_string(), enabled); - return true; - } - - warn!("Operation {operation} is not an unstable operation, can't enable/disable"); - false - } - - pub fn is_unstable_operation_enabled(&self, operation: &str) -> bool { - if self.unstable_operations.contains_key(operation) { - return self.unstable_operations.get(operation).unwrap().clone(); - } - - warn!("Operation {operation} is not an unstable operation, is always enabled"); - false - } - - pub fn is_unstable_operation(&self, operation: &str) -> bool { - if self.unstable_operations.contains_key(operation) { - return true; - } - - false - } -} - -impl Default for Configuration { - fn default() -> Self { + pub fn with_keys(api_key: Option, app_key: Option) -> Self { let http_client = reqwest_middleware::ClientBuilder::new(reqwest::Client::new()); let user_agent = format!( "datadog-api-client-rust/{} (rust {}; os {}; arch {})", @@ -168,18 +110,88 @@ impl Default for Configuration { ("v2.update_incident_team".to_owned(), false), ]); - Configuration { + Self { user_agent, client: http_client.build(), unstable_operations, - api_key_auth: env::var("DD_API_KEY").ok(), - app_key_auth: env::var("DD_APP_KEY").ok(), + api_key, + app_key, server_index: 0, server_variables: HashMap::new(), server_operation_index: HashMap::new(), server_operation_variables: HashMap::new(), } } + + pub fn client(&mut self, client: reqwest_middleware::ClientWithMiddleware) { + self.client = client; + } + + pub fn api_key(&mut self, key: String) { + self.api_key = Some(key); + } + + pub fn app_key(&mut self, key: String) { + self.app_key = Some(key); + } + + 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 { + if self.unstable_operations.contains_key(operation) { + self.unstable_operations + .insert(operation.to_string(), enabled); + return true; + } + + warn!("Operation {operation} is not an unstable operation, can't enable/disable"); + false + } + + pub fn is_unstable_operation_enabled(&self, operation: &str) -> bool { + if self.unstable_operations.contains_key(operation) { + return self.unstable_operations.get(operation).unwrap().clone(); + } + + warn!("Operation {operation} is not an unstable operation, is always enabled"); + false + } + + pub fn is_unstable_operation(&self, operation: &str) -> bool { + if self.unstable_operations.contains_key(operation) { + return true; + } + + false + } +} + +impl Default for Configuration { + fn default() -> Self { + Self::with_keys(env::var("DD_API_KEY").ok(), env::var("DD_APP_KEY").ok()) + } } lazy_static! { diff --git a/src/datadogV1/api/api_authentication.rs b/src/datadogV1/api/api_authentication.rs index 31750bd6c..ceb41cdda 100644 --- a/src/datadogV1/api/api_authentication.rs +++ b/src/datadogV1/api/api_authentication.rs @@ -56,12 +56,13 @@ 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.get_operation_host("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()); @@ -73,8 +74,8 @@ impl AuthenticationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_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 dfbe27796..788742abe 100644 --- a/src/datadogV1/api/api_aws_integration.rs +++ b/src/datadogV1/api/api_aws_integration.rs @@ -241,12 +241,13 @@ 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.get_operation_host("v1.create_aws_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -258,11 +259,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -324,12 +325,13 @@ 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.get_operation_host("v1.create_aws_event_bridge_source") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -341,11 +343,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -404,12 +406,13 @@ 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.get_operation_host("v1.create_aws_tag_filter") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -421,11 +424,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -484,12 +487,13 @@ 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.get_operation_host("v1.create_new_aws_external_id") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -501,11 +505,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -564,12 +568,13 @@ 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.get_operation_host("v1.delete_aws_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -581,11 +586,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -647,12 +652,13 @@ 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.get_operation_host("v1.delete_aws_event_bridge_source") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -664,11 +670,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -727,12 +733,13 @@ 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.get_operation_host("v1.delete_aws_tag_filter") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -744,11 +751,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -805,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; @@ -815,7 +823,7 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws", - local_configuration.get_operation_host("v1.list_aws_accounts") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -840,11 +848,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -894,12 +902,13 @@ 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.get_operation_host("v1.list_aws_event_bridge_sources") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -911,11 +920,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -967,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.get_operation_host("v1.list_aws_tag_filters") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -986,11 +996,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1034,12 +1044,13 @@ 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.get_operation_host("v1.list_available_aws_namespaces") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1051,11 +1062,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1108,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; @@ -1118,7 +1130,7 @@ impl AWSIntegrationAPI { let local_uri_str = format!( "{}/api/v1/integration/aws", - local_configuration.get_operation_host("v1.update_aws_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -1143,11 +1155,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 ce8165855..f8956a4a4 100644 --- a/src/datadogV1/api/api_aws_logs_integration.rs +++ b/src/datadogV1/api/api_aws_logs_integration.rs @@ -132,12 +132,13 @@ 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.get_operation_host("v1.check_aws_logs_lambda_async") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -149,11 +150,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -233,12 +234,13 @@ 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.get_operation_host("v1.check_aws_logs_services_async") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -250,11 +252,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -313,12 +315,13 @@ 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.get_operation_host("v1.create_aws_lambda_arn") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -330,11 +333,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -393,12 +396,13 @@ 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.get_operation_host("v1.delete_aws_lambda_arn") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -410,11 +414,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -473,12 +477,13 @@ 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.get_operation_host("v1.enable_aws_log_services") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -490,11 +495,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -551,12 +556,13 @@ 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.get_operation_host("v1.list_aws_logs_integrations") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -568,11 +574,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -622,12 +628,13 @@ 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.get_operation_host("v1.list_aws_logs_services") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -639,11 +646,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 336330ed6..cbbbf0485 100644 --- a/src/datadogV1/api/api_azure_integration.rs +++ b/src/datadogV1/api/api_azure_integration.rs @@ -111,12 +111,13 @@ 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.get_operation_host("v1.create_azure_integration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -128,11 +129,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -191,12 +192,13 @@ 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.get_operation_host("v1.delete_azure_integration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -208,11 +210,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -267,12 +269,13 @@ 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.get_operation_host("v1.list_azure_integration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -284,11 +287,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -340,12 +343,13 @@ 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.get_operation_host("v1.update_azure_host_filters") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -357,11 +361,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -424,12 +428,13 @@ 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.get_operation_host("v1.update_azure_integration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -441,11 +446,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_dashboard_lists.rs b/src/datadogV1/api/api_dashboard_lists.rs index 183e24411..bf2d30c27 100644 --- a/src/datadogV1/api/api_dashboard_lists.rs +++ b/src/datadogV1/api/api_dashboard_lists.rs @@ -97,12 +97,13 @@ 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.get_operation_host("v1.create_dashboard_list") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -114,11 +115,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -177,12 +178,13 @@ 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.get_operation_host("v1.delete_dashboard_list"), + local_configuration.get_operation_host(operation_id), list_id = list_id ); let mut local_req_builder = @@ -195,11 +197,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -246,12 +248,13 @@ 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.get_operation_host("v1.get_dashboard_list"), + local_configuration.get_operation_host(operation_id), list_id = list_id ); let mut local_req_builder = @@ -264,11 +267,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -318,12 +321,13 @@ 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.get_operation_host("v1.list_dashboard_lists") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -335,11 +339,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -394,12 +398,13 @@ 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.get_operation_host("v1.update_dashboard_list"), + local_configuration.get_operation_host(operation_id), list_id = list_id ); let mut local_req_builder = @@ -412,11 +417,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_dashboards.rs b/src/datadogV1/api/api_dashboards.rs index 0ef120206..699140905 100644 --- a/src/datadogV1/api/api_dashboards.rs +++ b/src/datadogV1/api/api_dashboards.rs @@ -255,12 +255,13 @@ 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.get_operation_host("v1.create_dashboard") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -272,11 +273,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -333,12 +334,13 @@ 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.get_operation_host("v1.create_public_dashboard") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -350,11 +352,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -411,12 +413,13 @@ 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.get_operation_host("v1.delete_dashboard"), + local_configuration.get_operation_host(operation_id), dashboard_id = urlencode(dashboard_id) ); let mut local_req_builder = @@ -429,11 +432,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -479,12 +482,13 @@ 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.get_operation_host("v1.delete_dashboards") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -496,11 +500,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -557,12 +561,13 @@ 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.get_operation_host("v1.delete_public_dashboard"), + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = @@ -575,11 +580,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -630,12 +635,13 @@ 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.get_operation_host("v1.delete_public_dashboard_invitation"), + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = @@ -648,11 +654,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -703,12 +709,13 @@ 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.get_operation_host("v1.get_dashboard"), + local_configuration.get_operation_host(operation_id), dashboard_id = urlencode(dashboard_id) ); let mut local_req_builder = @@ -721,11 +728,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -774,12 +781,13 @@ 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.get_operation_host("v1.get_public_dashboard"), + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = @@ -792,11 +800,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -853,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; @@ -862,7 +871,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard/public/{token}/invitation", - local_configuration.get_operation_host("v1.get_public_dashboard_invitations"), + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = @@ -884,11 +893,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -943,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; @@ -954,7 +964,7 @@ impl DashboardsAPI { let local_uri_str = format!( "{}/api/v1/dashboard", - local_configuration.get_operation_host("v1.list_dashboards") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -983,11 +993,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1033,12 +1043,13 @@ 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.get_operation_host("v1.restore_dashboards") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1050,11 +1061,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1116,12 +1127,13 @@ 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.get_operation_host("v1.send_public_dashboard_invitation"), + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = @@ -1134,11 +1146,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1197,12 +1209,13 @@ 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.get_operation_host("v1.update_dashboard"), + local_configuration.get_operation_host(operation_id), dashboard_id = urlencode(dashboard_id) ); let mut local_req_builder = @@ -1215,11 +1228,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1281,12 +1294,13 @@ 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.get_operation_host("v1.update_public_dashboard"), + local_configuration.get_operation_host(operation_id), token = urlencode(token) ); let mut local_req_builder = @@ -1299,11 +1313,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_downtimes.rs b/src/datadogV1/api/api_downtimes.rs index 82ca652e6..b72430b28 100644 --- a/src/datadogV1/api/api_downtimes.rs +++ b/src/datadogV1/api/api_downtimes.rs @@ -137,12 +137,13 @@ 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.get_operation_host("v1.cancel_downtime"), + local_configuration.get_operation_host(operation_id), downtime_id = downtime_id ); let mut local_req_builder = @@ -155,11 +156,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -209,12 +210,13 @@ 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.get_operation_host("v1.cancel_downtimes_by_scope") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -226,11 +228,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -284,12 +286,13 @@ 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.get_operation_host("v1.create_downtime") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -301,11 +304,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -358,12 +361,13 @@ 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.get_operation_host("v1.get_downtime"), + local_configuration.get_operation_host(operation_id), downtime_id = downtime_id ); let mut local_req_builder = @@ -376,11 +380,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -426,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; @@ -435,7 +440,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v1/downtime", - local_configuration.get_operation_host("v1.list_downtimes") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -456,11 +461,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -510,12 +515,13 @@ 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.get_operation_host("v1.list_monitor_downtimes"), + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = @@ -528,11 +534,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -581,12 +587,13 @@ 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.get_operation_host("v1.update_downtime"), + local_configuration.get_operation_host(operation_id), downtime_id = downtime_id ); let mut local_req_builder = @@ -599,11 +606,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_events.rs b/src/datadogV1/api/api_events.rs index 953372939..4d9bb4079 100644 --- a/src/datadogV1/api/api_events.rs +++ b/src/datadogV1/api/api_events.rs @@ -136,12 +136,13 @@ 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.get_operation_host("v1.create_event") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -153,8 +154,8 @@ impl EventsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; // build body parameters @@ -212,12 +213,13 @@ 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.get_operation_host("v1.get_event"), + local_configuration.get_operation_host(operation_id), event_id = event_id ); let mut local_req_builder = @@ -230,11 +232,11 @@ impl EventsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -300,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; @@ -313,7 +316,7 @@ impl EventsAPI { let local_uri_str = format!( "{}/api/v1/events", - local_configuration.get_operation_host("v1.list_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -352,11 +355,11 @@ impl EventsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 e31b1adf0..eac96ab04 100644 --- a/src/datadogV1/api/api_gcp_integration.rs +++ b/src/datadogV1/api/api_gcp_integration.rs @@ -89,12 +89,13 @@ 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.get_operation_host("v1.create_gcp_integration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -106,11 +107,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -169,12 +170,13 @@ 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.get_operation_host("v1.delete_gcp_integration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -186,11 +188,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -245,12 +247,13 @@ 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.get_operation_host("v1.list_gcp_integration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -262,11 +265,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -324,12 +327,13 @@ 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.get_operation_host("v1.update_gcp_integration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -341,11 +345,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_hosts.rs b/src/datadogV1/api/api_hosts.rs index 04077120d..6a07f26ba 100644 --- a/src/datadogV1/api/api_hosts.rs +++ b/src/datadogV1/api/api_hosts.rs @@ -167,6 +167,7 @@ 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; @@ -175,7 +176,7 @@ impl HostsAPI { let local_uri_str = format!( "{}/api/v1/hosts/totals", - local_configuration.get_operation_host("v1.get_host_totals") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -192,11 +193,11 @@ impl HostsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -249,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; @@ -264,7 +266,7 @@ impl HostsAPI { let local_uri_str = format!( "{}/api/v1/hosts", - local_configuration.get_operation_host("v1.list_hosts") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -309,11 +311,11 @@ impl HostsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -361,12 +363,13 @@ 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.get_operation_host("v1.mute_host"), + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -379,11 +382,11 @@ impl HostsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -436,12 +439,13 @@ 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.get_operation_host("v1.unmute_host"), + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -454,11 +458,11 @@ impl HostsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 fcbe2e2c9..aa40a0a13 100644 --- a/src/datadogV1/api/api_ip_ranges.rs +++ b/src/datadogV1/api/api_ip_ranges.rs @@ -49,13 +49,11 @@ 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.get_operation_host("v1.get_ip_ranges") - ); + 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()); diff --git a/src/datadogV1/api/api_key_management.rs b/src/datadogV1/api/api_key_management.rs index 30a1cc6b8..6215daf22 100644 --- a/src/datadogV1/api/api_key_management.rs +++ b/src/datadogV1/api/api_key_management.rs @@ -147,12 +147,13 @@ 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.get_operation_host("v1.create_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()); @@ -164,11 +165,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -226,12 +227,13 @@ 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.get_operation_host("v1.create_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()); @@ -243,11 +245,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -301,12 +303,13 @@ 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.get_operation_host("v1.delete_api_key"), + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = @@ -319,11 +322,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -374,12 +377,13 @@ 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.get_operation_host("v1.delete_application_key"), + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = @@ -392,11 +396,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -443,12 +447,13 @@ 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.get_operation_host("v1.get_api_key"), + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = @@ -461,11 +466,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -516,12 +521,13 @@ 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.get_operation_host("v1.get_application_key"), + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = @@ -534,11 +540,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -583,12 +589,13 @@ 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.get_operation_host("v1.list_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()); @@ -600,11 +607,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -653,12 +660,13 @@ 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.get_operation_host("v1.list_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()); @@ -670,11 +678,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -723,12 +731,13 @@ 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.get_operation_host("v1.update_api_key"), + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = @@ -741,11 +750,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -805,12 +814,13 @@ 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.get_operation_host("v1.update_application_key"), + local_configuration.get_operation_host(operation_id), key = urlencode(key) ); let mut local_req_builder = @@ -823,11 +833,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_logs.rs b/src/datadogV1/api/api_logs.rs index c8feae8c8..5a8c9f31b 100644 --- a/src/datadogV1/api/api_logs.rs +++ b/src/datadogV1/api/api_logs.rs @@ -105,12 +105,13 @@ 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.get_operation_host("v1.list_logs") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -122,11 +123,11 @@ impl LogsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -220,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; @@ -229,7 +231,7 @@ impl LogsAPI { let local_uri_str = format!( "{}/v1/input", - local_configuration.get_operation_host("v1.submit_log") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -250,8 +252,8 @@ impl LogsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_logs_indexes.rs b/src/datadogV1/api/api_logs_indexes.rs index 337cc47ce..618f35540 100644 --- a/src/datadogV1/api/api_logs_indexes.rs +++ b/src/datadogV1/api/api_logs_indexes.rs @@ -102,12 +102,13 @@ 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.get_operation_host("v1.create_logs_index") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -119,11 +120,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -176,12 +177,13 @@ 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.get_operation_host("v1.get_logs_index"), + local_configuration.get_operation_host(operation_id), name = urlencode(name) ); let mut local_req_builder = @@ -194,11 +196,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -245,12 +247,13 @@ 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.get_operation_host("v1.get_logs_index_order") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -262,11 +265,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -316,12 +319,13 @@ 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.get_operation_host("v1.list_log_indexes") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -333,11 +337,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -394,12 +398,13 @@ 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.get_operation_host("v1.update_logs_index"), + local_configuration.get_operation_host(operation_id), name = urlencode(name) ); let mut local_req_builder = @@ -412,11 +417,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -475,12 +480,13 @@ 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.get_operation_host("v1.update_logs_index_order") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -492,11 +498,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_logs_pipelines.rs b/src/datadogV1/api/api_logs_pipelines.rs index d58811fe0..342abdb51 100644 --- a/src/datadogV1/api/api_logs_pipelines.rs +++ b/src/datadogV1/api/api_logs_pipelines.rs @@ -115,12 +115,13 @@ 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.get_operation_host("v1.create_logs_pipeline") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -132,11 +133,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -191,12 +192,13 @@ 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.get_operation_host("v1.delete_logs_pipeline"), + local_configuration.get_operation_host(operation_id), pipeline_id = urlencode(pipeline_id) ); let mut local_req_builder = @@ -209,11 +211,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -260,12 +262,13 @@ 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.get_operation_host("v1.get_logs_pipeline"), + local_configuration.get_operation_host(operation_id), pipeline_id = urlencode(pipeline_id) ); let mut local_req_builder = @@ -278,11 +281,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -332,12 +335,13 @@ 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.get_operation_host("v1.get_logs_pipeline_order") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -349,11 +353,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -403,12 +407,13 @@ 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.get_operation_host("v1.list_logs_pipelines") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -420,11 +425,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -484,12 +489,13 @@ 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.get_operation_host("v1.update_logs_pipeline"), + local_configuration.get_operation_host(operation_id), pipeline_id = urlencode(pipeline_id) ); let mut local_req_builder = @@ -502,11 +508,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -573,12 +579,13 @@ 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.get_operation_host("v1.update_logs_pipeline_order") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -590,11 +597,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_metrics.rs b/src/datadogV1/api/api_metrics.rs index 310838646..0041a8e93 100644 --- a/src/datadogV1/api/api_metrics.rs +++ b/src/datadogV1/api/api_metrics.rs @@ -187,12 +187,13 @@ 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.get_operation_host("v1.get_metric_metadata"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -205,11 +206,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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; @@ -270,7 +272,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v1/metrics", - local_configuration.get_operation_host("v1.list_active_metrics") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -292,11 +294,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -346,12 +348,13 @@ 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.get_operation_host("v1.list_metrics") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -365,11 +368,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -422,12 +425,13 @@ 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.get_operation_host("v1.query_metrics") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -443,11 +447,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -503,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; @@ -511,7 +516,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v1/distribution_points", - local_configuration.get_operation_host("v1.submit_distribution_points") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -527,8 +532,8 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; // build body parameters @@ -607,6 +612,7 @@ 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; @@ -615,7 +621,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v1/series", - local_configuration.get_operation_host("v1.submit_metrics") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -631,8 +637,8 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; // build body parameters @@ -694,12 +700,13 @@ 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.get_operation_host("v1.update_metric_metadata"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -712,11 +719,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_monitors.rs b/src/datadogV1/api/api_monitors.rs index ae413c740..64a4f599e 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.get_operation_host("v1.check_can_delete_monitor") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -413,11 +414,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -825,12 +826,13 @@ 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.get_operation_host("v1.create_monitor") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -842,11 +844,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -902,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; @@ -910,7 +913,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}", - local_configuration.get_operation_host("v1.delete_monitor"), + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = @@ -928,11 +931,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -980,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; @@ -989,7 +993,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/{monitor_id}", - local_configuration.get_operation_host("v1.get_monitor"), + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = @@ -1011,11 +1015,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1061,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; @@ -1076,7 +1081,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor", - local_configuration.get_operation_host("v1.list_monitors") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1121,11 +1126,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1176,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; @@ -1187,7 +1193,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/groups/search", - local_configuration.get_operation_host("v1.search_monitor_groups") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1216,11 +1222,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1270,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; @@ -1281,7 +1288,7 @@ impl MonitorsAPI { let local_uri_str = format!( "{}/api/v1/monitor/search", - local_configuration.get_operation_host("v1.search_monitors") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1310,11 +1317,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1362,12 +1369,13 @@ 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.get_operation_host("v1.update_monitor"), + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = @@ -1380,11 +1388,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1448,12 +1456,13 @@ 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.get_operation_host("v1.validate_existing_monitor"), + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = @@ -1466,11 +1475,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1533,12 +1542,13 @@ 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.get_operation_host("v1.validate_monitor") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1550,11 +1560,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_notebooks.rs b/src/datadogV1/api/api_notebooks.rs index ff9559bca..0cae446a6 100644 --- a/src/datadogV1/api/api_notebooks.rs +++ b/src/datadogV1/api/api_notebooks.rs @@ -179,12 +179,13 @@ 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.get_operation_host("v1.create_notebook") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -196,11 +197,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -253,12 +254,13 @@ 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.get_operation_host("v1.delete_notebook"), + local_configuration.get_operation_host(operation_id), notebook_id = notebook_id ); let mut local_req_builder = @@ -271,11 +273,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -320,12 +322,13 @@ 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.get_operation_host("v1.get_notebook"), + local_configuration.get_operation_host(operation_id), notebook_id = notebook_id ); let mut local_req_builder = @@ -338,11 +341,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -392,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; @@ -409,7 +413,7 @@ impl NotebooksAPI { let local_uri_str = format!( "{}/api/v1/notebooks", - local_configuration.get_operation_host("v1.list_notebooks") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -462,11 +466,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -517,12 +521,13 @@ 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.get_operation_host("v1.update_notebook"), + local_configuration.get_operation_host(operation_id), notebook_id = notebook_id ); let mut local_req_builder = @@ -535,11 +540,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_organizations.rs b/src/datadogV1/api/api_organizations.rs index d5970b045..0f3c39d47 100644 --- a/src/datadogV1/api/api_organizations.rs +++ b/src/datadogV1/api/api_organizations.rs @@ -127,12 +127,13 @@ 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.get_operation_host("v1.create_child_org") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -144,11 +145,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -205,12 +206,13 @@ 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.get_operation_host("v1.downgrade_org"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -223,11 +225,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -273,12 +275,13 @@ 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.get_operation_host("v1.get_org"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -291,11 +294,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -342,12 +345,13 @@ 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.get_operation_host("v1.list_orgs") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -359,11 +363,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -411,12 +415,13 @@ 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.get_operation_host("v1.update_org"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -429,11 +434,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -501,12 +506,13 @@ impl OrganizationsAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.upload_id_p_for_org"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v1/org/{public_id}/idp_metadata", - local_configuration.get_operation_host("v1.upload_id_p_for_org"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -519,11 +525,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 06c564c2f..5dbd93553 100644 --- a/src/datadogV1/api/api_pager_duty_integration.rs +++ b/src/datadogV1/api/api_pager_duty_integration.rs @@ -93,12 +93,13 @@ 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.get_operation_host("v1.create_pager_duty_integration_service") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -110,11 +111,11 @@ impl PagerDutyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -170,12 +171,13 @@ 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.get_operation_host("v1.delete_pager_duty_integration_service"), + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = @@ -188,11 +190,11 @@ impl PagerDutyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -245,12 +247,13 @@ 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.get_operation_host("v1.get_pager_duty_integration_service"), + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = @@ -263,11 +266,11 @@ impl PagerDutyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -318,12 +321,13 @@ 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.get_operation_host("v1.update_pager_duty_integration_service"), + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = @@ -336,11 +340,11 @@ impl PagerDutyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_security_monitoring.rs b/src/datadogV1/api/api_security_monitoring.rs index c73ce1c1c..2ac86cfb4 100644 --- a/src/datadogV1/api/api_security_monitoring.rs +++ b/src/datadogV1/api/api_security_monitoring.rs @@ -87,12 +87,13 @@ 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.get_operation_host("v1.add_security_monitoring_signal_to_incident"), + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = @@ -105,11 +106,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -173,12 +174,13 @@ 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.get_operation_host("v1.edit_security_monitoring_signal_assignee"), + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = @@ -191,11 +193,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -259,12 +261,13 @@ 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.get_operation_host("v1.edit_security_monitoring_signal_state"), + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = @@ -277,11 +280,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_service_checks.rs b/src/datadogV1/api/api_service_checks.rs index 3a9bb0acc..133c2c63d 100644 --- a/src/datadogV1/api/api_service_checks.rs +++ b/src/datadogV1/api/api_service_checks.rs @@ -69,12 +69,13 @@ 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.get_operation_host("v1.submit_service_check") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -86,8 +87,8 @@ impl ServiceChecksAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_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 da7b1b8aa..581c75cf2 100644 --- a/src/datadogV1/api/api_service_level_objective_corrections.rs +++ b/src/datadogV1/api/api_service_level_objective_corrections.rs @@ -123,12 +123,13 @@ 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.get_operation_host("v1.create_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()); @@ -140,11 +141,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -200,12 +201,13 @@ 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.get_operation_host("v1.delete_slo_correction"), + local_configuration.get_operation_host(operation_id), slo_correction_id = urlencode(slo_correction_id) ); let mut local_req_builder = @@ -218,11 +220,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -273,12 +275,13 @@ 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.get_operation_host("v1.get_slo_correction"), + local_configuration.get_operation_host(operation_id), slo_correction_id = urlencode(slo_correction_id) ); let mut local_req_builder = @@ -291,11 +294,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -347,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; @@ -356,7 +360,7 @@ impl ServiceLevelObjectiveCorrectionsAPI { let local_uri_str = format!( "{}/api/v1/slo/correction", - local_configuration.get_operation_host("v1.list_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()); @@ -377,11 +381,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -438,12 +442,13 @@ 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.get_operation_host("v1.update_slo_correction"), + local_configuration.get_operation_host(operation_id), slo_correction_id = urlencode(slo_correction_id) ); let mut local_req_builder = @@ -456,11 +461,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 79bdec5bb..1fed570c2 100644 --- a/src/datadogV1/api/api_service_level_objectives.rs +++ b/src/datadogV1/api/api_service_level_objectives.rs @@ -306,12 +306,13 @@ 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.get_operation_host("v1.check_can_delete_slo") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -325,11 +326,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -376,12 +377,13 @@ 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.get_operation_host("v1.create_slo") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -393,11 +395,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -458,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; @@ -466,7 +469,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", - local_configuration.get_operation_host("v1.delete_slo"), + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -484,11 +487,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -547,12 +550,13 @@ 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.get_operation_host("v1.delete_slo_timeframe_in_bulk") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -564,11 +568,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -623,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; @@ -631,7 +636,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}", - local_configuration.get_operation_host("v1.get_slo"), + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -649,11 +654,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -704,12 +709,13 @@ 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.get_operation_host("v1.get_slo_corrections"), + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -722,11 +728,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -799,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; @@ -808,7 +815,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/{slo_id}/history", - local_configuration.get_operation_host("v1.get_slo_history"), + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -832,11 +839,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -883,6 +890,7 @@ impl ServiceLevelObjectivesAPI { ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v1.list_sl_os"; // unbox and build optional parameters let ids = params.ids; @@ -896,7 +904,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo", - local_configuration.get_operation_host("v1.list_sl_os") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -932,11 +940,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -982,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; @@ -993,7 +1002,7 @@ impl ServiceLevelObjectivesAPI { let local_uri_str = format!( "{}/api/v1/slo/search", - local_configuration.get_operation_host("v1.search_slo") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1022,11 +1031,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1074,12 +1083,13 @@ 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.get_operation_host("v1.update_slo"), + local_configuration.get_operation_host(operation_id), slo_id = urlencode(slo_id) ); let mut local_req_builder = @@ -1092,11 +1102,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_slack_integration.rs b/src/datadogV1/api/api_slack_integration.rs index 575fc563a..cdfbb1c5e 100644 --- a/src/datadogV1/api/api_slack_integration.rs +++ b/src/datadogV1/api/api_slack_integration.rs @@ -109,12 +109,13 @@ 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.get_operation_host("v1.create_slack_integration_channel"), + local_configuration.get_operation_host(operation_id), account_name = urlencode(account_name) ); let mut local_req_builder = @@ -127,11 +128,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_slack_integration_channel"), account_name= + local_configuration.get_operation_host(operation_id), account_name= urlencode(account_name) , channel_name= urlencode(channel_name) @@ -215,11 +217,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -274,12 +276,13 @@ 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.get_operation_host("v1.get_slack_integration_channels"), + local_configuration.get_operation_host(operation_id), account_name = urlencode(account_name) ); let mut local_req_builder = @@ -292,11 +295,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.remove_slack_integration_channel"), account_name= + local_configuration.get_operation_host(operation_id), account_name= urlencode(account_name) , channel_name= urlencode(channel_name) @@ -367,11 +371,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.update_slack_integration_channel"), account_name= + local_configuration.get_operation_host(operation_id), account_name= urlencode(account_name) , channel_name= urlencode(channel_name) @@ -448,11 +453,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_snapshots.rs b/src/datadogV1/api/api_snapshots.rs index a270beef9..ff99f6c5d 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; @@ -131,7 +132,7 @@ impl SnapshotsAPI { let local_uri_str = format!( "{}/api/v1/graph/snapshot", - local_configuration.get_operation_host("v1.get_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()); @@ -170,11 +171,11 @@ impl SnapshotsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 09b9a3da8..df1836665 100644 --- a/src/datadogV1/api/api_synthetics.rs +++ b/src/datadogV1/api/api_synthetics.rs @@ -419,12 +419,13 @@ 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.get_operation_host("v1.create_global_variable") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -436,11 +437,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -499,12 +500,13 @@ 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.get_operation_host("v1.create_private_location") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -516,11 +518,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -580,12 +582,13 @@ 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.get_operation_host("v1.create_synthetics_api_test") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -597,11 +600,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -663,12 +666,13 @@ 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.get_operation_host("v1.create_synthetics_browser_test") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -680,11 +684,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -740,12 +744,13 @@ 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.get_operation_host("v1.delete_global_variable"), + local_configuration.get_operation_host(operation_id), variable_id = urlencode(variable_id) ); let mut local_req_builder = @@ -758,11 +763,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -809,12 +814,13 @@ 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.get_operation_host("v1.delete_private_location"), + local_configuration.get_operation_host(operation_id), location_id = urlencode(location_id) ); let mut local_req_builder = @@ -827,11 +833,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -881,12 +887,13 @@ 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.get_operation_host("v1.delete_tests") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -898,11 +905,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -965,12 +972,13 @@ 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.get_operation_host("v1.edit_global_variable"), + local_configuration.get_operation_host(operation_id), variable_id = urlencode(variable_id) ); let mut local_req_builder = @@ -983,11 +991,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1043,12 +1051,13 @@ 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.get_operation_host("v1.get_api_test"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -1061,11 +1070,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_api_test_latest_results"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -1164,11 +1174,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_api_test_result"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id), result_id = urlencode(result_id) ); @@ -1245,11 +1256,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1301,12 +1312,13 @@ 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.get_operation_host("v1.get_browser_test"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -1319,11 +1331,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_browser_test_latest_results"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -1423,11 +1436,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_browser_test_result"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id), result_id = urlencode(result_id) ); @@ -1504,11 +1518,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1560,12 +1574,13 @@ 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.get_operation_host("v1.get_global_variable"), + local_configuration.get_operation_host(operation_id), variable_id = urlencode(variable_id) ); let mut local_req_builder = @@ -1578,11 +1593,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1634,12 +1649,13 @@ 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.get_operation_host("v1.get_private_location"), + local_configuration.get_operation_host(operation_id), location_id = urlencode(location_id) ); let mut local_req_builder = @@ -1652,11 +1668,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1708,12 +1724,13 @@ 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.get_operation_host("v1.get_synthetics_ci_batch"), + local_configuration.get_operation_host(operation_id), batch_id = urlencode(batch_id) ); let mut local_req_builder = @@ -1726,11 +1743,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1774,12 +1791,13 @@ 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.get_operation_host("v1.get_synthetics_default_locations") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1791,11 +1809,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1841,12 +1859,13 @@ 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.get_operation_host("v1.get_test"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -1859,11 +1878,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1912,12 +1931,13 @@ 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.get_operation_host("v1.list_global_variables") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1929,11 +1949,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1984,12 +2004,13 @@ 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.get_operation_host("v1.list_locations") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2001,11 +2022,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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; @@ -2064,7 +2086,7 @@ impl SyntheticsAPI { let local_uri_str = format!( "{}/api/v1/synthetics/tests", - local_configuration.get_operation_host("v1.list_tests") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2085,11 +2107,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2139,12 +2161,13 @@ 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.get_operation_host("v1.patch_test"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -2157,11 +2180,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -2219,12 +2242,13 @@ 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.get_operation_host("v1.trigger_ci_tests") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -2236,11 +2260,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -2299,12 +2323,13 @@ 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.get_operation_host("v1.trigger_tests") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -2316,11 +2341,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -2377,12 +2402,13 @@ 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.get_operation_host("v1.update_api_test"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -2395,11 +2421,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -2461,12 +2487,13 @@ 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.get_operation_host("v1.update_browser_test"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -2479,11 +2506,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -2547,12 +2574,13 @@ 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.get_operation_host("v1.update_private_location"), + local_configuration.get_operation_host(operation_id), location_id = urlencode(location_id) ); let mut local_req_builder = @@ -2565,11 +2593,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -2627,12 +2655,13 @@ 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.get_operation_host("v1.update_test_pause_status"), + local_configuration.get_operation_host(operation_id), public_id = urlencode(public_id) ); let mut local_req_builder = @@ -2645,11 +2674,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_tags.rs b/src/datadogV1/api/api_tags.rs index 4eebe70df..bbb4f716e 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.get_operation_host("v1.create_host_tags"), + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -215,11 +216,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.delete_host_tags"), + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -305,11 +307,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_host_tags"), + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -381,11 +384,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -431,6 +434,7 @@ 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; @@ -439,7 +443,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts", - local_configuration.get_operation_host("v1.list_host_tags") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -456,11 +460,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -515,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; @@ -523,7 +528,7 @@ impl TagsAPI { let local_uri_str = format!( "{}/api/v1/tags/hosts/{host_name}", - local_configuration.get_operation_host("v1.update_host_tags"), + local_configuration.get_operation_host(operation_id), host_name = urlencode(host_name) ); let mut local_req_builder = @@ -541,11 +546,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_usage_metering.rs b/src/datadogV1/api/api_usage_metering.rs index e75f06b51..d9a3bb61e 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.get_operation_host("v1.get_daily_custom_reports") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1276,11 +1277,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_hourly_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()); @@ -1409,11 +1411,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_incident_management") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1498,11 +1501,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_ingested_spans") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1587,11 +1591,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_monthly_custom_reports") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1687,11 +1692,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_monthly_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()); @@ -1830,11 +1836,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1893,12 +1899,13 @@ 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.get_operation_host("v1.get_specified_daily_custom_reports"), + local_configuration.get_operation_host(operation_id), report_id = urlencode(report_id) ); let mut local_req_builder = @@ -1911,11 +1918,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1974,12 +1981,13 @@ 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.get_operation_host("v1.get_specified_monthly_custom_reports"), + local_configuration.get_operation_host(operation_id), report_id = urlencode(report_id) ); let mut local_req_builder = @@ -1992,11 +2000,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v1.get_usage_analyzed_logs") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2081,11 +2090,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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; @@ -2161,7 +2171,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/attribution", - local_configuration.get_operation_host("v1.get_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()); @@ -2200,11 +2210,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2263,6 +2273,7 @@ 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; @@ -2271,7 +2282,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/audit_logs", - local_configuration.get_operation_host("v1.get_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()); @@ -2289,11 +2300,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2345,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; @@ -2353,7 +2365,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/billable-summary", - local_configuration.get_operation_host("v1.get_usage_billable_summary") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2370,11 +2382,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2428,6 +2440,7 @@ 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; @@ -2436,7 +2449,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/ci-app", - local_configuration.get_operation_host("v1.get_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()); @@ -2454,11 +2467,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2509,6 +2522,7 @@ 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; @@ -2517,7 +2531,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/cws", - local_configuration.get_operation_host("v1.get_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()); @@ -2535,11 +2549,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2597,6 +2611,7 @@ 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; @@ -2605,8 +2620,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/cspm", - local_configuration - .get_operation_host("v1.get_usage_cloud_security_posture_management") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2624,11 +2638,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2680,6 +2694,7 @@ 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; @@ -2688,7 +2703,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/dbm", - local_configuration.get_operation_host("v1.get_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()); @@ -2706,11 +2721,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2766,6 +2781,7 @@ 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; @@ -2774,7 +2790,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/fargate", - local_configuration.get_operation_host("v1.get_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()); @@ -2792,11 +2808,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2850,6 +2866,7 @@ 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; @@ -2858,7 +2875,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/hosts", - local_configuration.get_operation_host("v1.get_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()); @@ -2876,11 +2893,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -2939,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; @@ -2947,7 +2965,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/indexed-spans", - local_configuration.get_operation_host("v1.get_usage_indexed_spans") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -2965,11 +2983,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3028,6 +3046,7 @@ 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; @@ -3036,7 +3055,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/iot", - local_configuration.get_operation_host("v1.get_usage_internet_of_things") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3054,11 +3073,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3112,6 +3131,7 @@ 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; @@ -3120,7 +3140,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/aws_lambda", - local_configuration.get_operation_host("v1.get_usage_lambda") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3138,11 +3158,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3193,6 +3213,7 @@ 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; @@ -3201,7 +3222,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/logs", - local_configuration.get_operation_host("v1.get_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()); @@ -3219,11 +3240,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3279,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; @@ -3288,7 +3310,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/logs_by_index", - local_configuration.get_operation_host("v1.get_usage_logs_by_index") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3317,11 +3339,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3380,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; @@ -3388,7 +3411,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/logs-by-retention", - local_configuration.get_operation_host("v1.get_usage_logs_by_retention") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3406,11 +3429,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3469,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; @@ -3477,7 +3501,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/network_flows", - local_configuration.get_operation_host("v1.get_usage_network_flows") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3495,11 +3519,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3558,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; @@ -3566,7 +3591,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/network_hosts", - local_configuration.get_operation_host("v1.get_usage_network_hosts") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3584,11 +3609,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3647,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; @@ -3655,7 +3681,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/online-archive", - local_configuration.get_operation_host("v1.get_usage_online_archive") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3673,11 +3699,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3736,6 +3762,7 @@ 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; @@ -3744,7 +3771,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/profiling", - local_configuration.get_operation_host("v1.get_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()); @@ -3762,11 +3789,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3825,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; @@ -3834,7 +3862,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/rum_sessions", - local_configuration.get_operation_host("v1.get_usage_rum_sessions") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3856,11 +3884,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3917,6 +3945,7 @@ 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; @@ -3925,7 +3954,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/rum", - local_configuration.get_operation_host("v1.get_usage_rum_units") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -3943,11 +3972,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -3998,6 +4027,7 @@ 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; @@ -4006,7 +4036,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/sds", - local_configuration.get_operation_host("v1.get_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()); @@ -4024,11 +4054,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -4078,6 +4108,7 @@ 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; @@ -4086,7 +4117,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/snmp", - local_configuration.get_operation_host("v1.get_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()); @@ -4104,11 +4135,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -4162,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; @@ -4171,7 +4203,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/summary", - local_configuration.get_operation_host("v1.get_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()); @@ -4193,11 +4225,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -4256,6 +4288,7 @@ 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; @@ -4264,7 +4297,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/synthetics", - local_configuration.get_operation_host("v1.get_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()); @@ -4282,11 +4315,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -4345,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; @@ -4353,7 +4387,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/synthetics_api", - local_configuration.get_operation_host("v1.get_usage_synthetics_api") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4371,11 +4405,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -4434,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; @@ -4442,7 +4477,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/synthetics_browser", - local_configuration.get_operation_host("v1.get_usage_synthetics_browser") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4460,11 +4495,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -4523,6 +4558,7 @@ 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; @@ -4531,7 +4567,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/timeseries", - local_configuration.get_operation_host("v1.get_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()); @@ -4549,11 +4585,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -4605,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; @@ -4617,7 +4654,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v1/usage/top_avg_metrics", - local_configuration.get_operation_host("v1.get_usage_top_avg_metrics") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -4656,11 +4693,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 4dbe4fa14..5bbfa29cb 100644 --- a/src/datadogV1/api/api_users.rs +++ b/src/datadogV1/api/api_users.rs @@ -102,12 +102,13 @@ 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.get_operation_host("v1.create_user") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -119,11 +120,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -184,12 +185,13 @@ 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.get_operation_host("v1.disable_user"), + local_configuration.get_operation_host(operation_id), user_handle = urlencode(user_handle) ); let mut local_req_builder = @@ -202,11 +204,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -251,12 +253,13 @@ 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.get_operation_host("v1.get_user"), + local_configuration.get_operation_host(operation_id), user_handle = urlencode(user_handle) ); let mut local_req_builder = @@ -269,11 +272,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -317,12 +320,13 @@ 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.get_operation_host("v1.list_users") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -334,11 +338,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -390,12 +394,13 @@ 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.get_operation_host("v1.update_user"), + local_configuration.get_operation_host(operation_id), user_handle = urlencode(user_handle) ); let mut local_req_builder = @@ -408,11 +413,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV1/api/api_webhooks_integration.rs b/src/datadogV1/api/api_webhooks_integration.rs index 58c721cb3..49475181c 100644 --- a/src/datadogV1/api/api_webhooks_integration.rs +++ b/src/datadogV1/api/api_webhooks_integration.rs @@ -133,12 +133,13 @@ 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.get_operation_host("v1.create_webhooks_integration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -150,11 +151,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -216,13 +217,13 @@ 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 - .get_operation_host("v1.create_webhooks_integration_custom_variable") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -234,11 +235,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -295,12 +296,13 @@ 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.get_operation_host("v1.delete_webhooks_integration"), + local_configuration.get_operation_host(operation_id), webhook_name = urlencode(webhook_name) ); let mut local_req_builder = @@ -313,11 +315,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -364,13 +366,13 @@ 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 - .get_operation_host("v1.delete_webhooks_integration_custom_variable"), + local_configuration.get_operation_host(operation_id), custom_variable_name = urlencode(custom_variable_name) ); let mut local_req_builder = @@ -383,11 +385,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -440,12 +442,13 @@ 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.get_operation_host("v1.get_webhooks_integration"), + local_configuration.get_operation_host(operation_id), webhook_name = urlencode(webhook_name) ); let mut local_req_builder = @@ -458,11 +461,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -523,12 +526,13 @@ 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.get_operation_host("v1.get_webhooks_integration_custom_variable"), + local_configuration.get_operation_host(operation_id), custom_variable_name = urlencode(custom_variable_name) ); let mut local_req_builder = @@ -541,11 +545,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -603,12 +607,13 @@ 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.get_operation_host("v1.update_webhooks_integration"), + local_configuration.get_operation_host(operation_id), webhook_name = urlencode(webhook_name) ); let mut local_req_builder = @@ -621,11 +626,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -689,13 +694,13 @@ 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 - .get_operation_host("v1.update_webhooks_integration_custom_variable"), + local_configuration.get_operation_host(operation_id), custom_variable_name = urlencode(custom_variable_name) ); let mut local_req_builder = @@ -708,11 +713,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 5273db118..31dd8a4c5 100644 --- a/src/datadogV2/api/api_apm_retention_filters.rs +++ b/src/datadogV2/api/api_apm_retention_filters.rs @@ -112,12 +112,13 @@ 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.get_operation_host("v2.create_apm_retention_filter") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -129,11 +130,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -189,12 +190,13 @@ 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.get_operation_host("v2.delete_apm_retention_filter"), + local_configuration.get_operation_host(operation_id), filter_id = urlencode(filter_id) ); let mut local_req_builder = @@ -207,11 +209,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -264,12 +266,13 @@ 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.get_operation_host("v2.get_apm_retention_filter"), + local_configuration.get_operation_host(operation_id), filter_id = urlencode(filter_id) ); let mut local_req_builder = @@ -282,11 +285,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -336,12 +339,13 @@ 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.get_operation_host("v2.list_apm_retention_filters") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -353,11 +357,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -406,12 +410,13 @@ 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.get_operation_host("v2.reorder_apm_retention_filters") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -423,11 +428,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -489,12 +494,13 @@ 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.get_operation_host("v2.update_apm_retention_filter"), + local_configuration.get_operation_host(operation_id), filter_id = urlencode(filter_id) ); let mut local_req_builder = @@ -507,11 +513,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_audit.rs b/src/datadogV2/api/api_audit.rs index f2efc9c00..7f6874b02 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; @@ -158,7 +159,7 @@ impl AuditAPI { let local_uri_str = format!( "{}/api/v2/audit/events", - local_configuration.get_operation_host("v2.list_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()); @@ -195,11 +196,11 @@ impl AuditAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -259,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; @@ -267,7 +269,7 @@ impl AuditAPI { let local_uri_str = format!( "{}/api/v2/audit/events/search", - local_configuration.get_operation_host("v2.search_audit_logs") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -279,11 +281,11 @@ impl AuditAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_auth_n_mappings.rs b/src/datadogV2/api/api_auth_n_mappings.rs index 07c7eb7f2..199ad9280 100644 --- a/src/datadogV2/api/api_auth_n_mappings.rs +++ b/src/datadogV2/api/api_auth_n_mappings.rs @@ -137,12 +137,13 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.create_auth_n_mapping"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/authn_mappings", - local_configuration.get_operation_host("v2.create_auth_n_mapping") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -154,11 +155,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -214,12 +215,13 @@ impl AuthNMappingsAPI { authn_mapping_id: String, ) -> Result, Error> { let local_configuration = &self.config; + let operation_id = "v2.delete_auth_n_mapping"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", - local_configuration.get_operation_host("v2.delete_auth_n_mapping"), + local_configuration.get_operation_host(operation_id), authn_mapping_id = urlencode(authn_mapping_id) ); let mut local_req_builder = @@ -232,11 +234,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -287,12 +289,13 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.get_auth_n_mapping"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", - local_configuration.get_operation_host("v2.get_auth_n_mapping"), + local_configuration.get_operation_host(operation_id), authn_mapping_id = urlencode(authn_mapping_id) ); let mut local_req_builder = @@ -305,11 +308,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -359,6 +362,7 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.list_auth_n_mappings"; // unbox and build optional parameters let page_size = params.page_size; @@ -370,7 +374,7 @@ impl AuthNMappingsAPI { let local_uri_str = format!( "{}/api/v2/authn_mappings", - local_configuration.get_operation_host("v2.list_auth_n_mappings") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -399,11 +403,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -458,12 +462,13 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.update_auth_n_mapping"; let local_client = &local_configuration.client; let local_uri_str = format!( "{}/api/v2/authn_mappings/{authn_mapping_id}", - local_configuration.get_operation_host("v2.update_auth_n_mapping"), + local_configuration.get_operation_host(operation_id), authn_mapping_id = urlencode(authn_mapping_id) ); let mut local_req_builder = @@ -476,11 +481,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 5fde3d7e6..67cba21b7 100644 --- a/src/datadogV2/api/api_ci_visibility_pipelines.rs +++ b/src/datadogV2/api/api_ci_visibility_pipelines.rs @@ -165,12 +165,13 @@ 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.get_operation_host("v2.aggregate_ci_app_pipeline_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -182,11 +183,11 @@ impl CIVisibilityPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -250,12 +251,13 @@ 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.get_operation_host("v2.create_ci_app_pipeline_event") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -267,8 +269,8 @@ impl CIVisibilityPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; // build body parameters @@ -336,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; @@ -349,7 +352,7 @@ impl CIVisibilityPipelinesAPI { let local_uri_str = format!( "{}/api/v2/ci/pipelines/events", - local_configuration.get_operation_host("v2.list_ci_app_pipeline_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -386,11 +389,11 @@ impl CIVisibilityPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -451,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; @@ -459,7 +463,7 @@ impl CIVisibilityPipelinesAPI { let local_uri_str = format!( "{}/api/v2/ci/pipelines/events/search", - local_configuration.get_operation_host("v2.search_ci_app_pipeline_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -471,11 +475,11 @@ impl CIVisibilityPipelinesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 4e6f43211..74c3e0b38 100644 --- a/src/datadogV2/api/api_ci_visibility_tests.rs +++ b/src/datadogV2/api/api_ci_visibility_tests.rs @@ -144,12 +144,13 @@ 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.get_operation_host("v2.aggregate_ci_app_test_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -161,11 +162,11 @@ impl CIVisibilityTestsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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; @@ -244,7 +246,7 @@ impl CIVisibilityTestsAPI { let local_uri_str = format!( "{}/api/v2/ci/tests/events", - local_configuration.get_operation_host("v2.list_ci_app_test_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -281,11 +283,11 @@ impl CIVisibilityTestsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -343,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; @@ -351,7 +354,7 @@ impl CIVisibilityTestsAPI { let local_uri_str = format!( "{}/api/v2/ci/tests/events/search", - local_configuration.get_operation_host("v2.search_ci_app_test_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -363,11 +366,11 @@ impl CIVisibilityTestsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 2a70b4ec4..9ce779a63 100644 --- a/src/datadogV2/api/api_cloud_cost_management.rs +++ b/src/datadogV2/api/api_cloud_cost_management.rs @@ -145,12 +145,13 @@ 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.get_operation_host("v2.create_cost_awscur_config") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -162,11 +163,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -225,12 +226,13 @@ 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.get_operation_host("v2.create_cost_azure_uc_configs") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -242,11 +244,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -302,12 +304,13 @@ 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.get_operation_host("v2.delete_cost_awscur_config"), + local_configuration.get_operation_host(operation_id), cloud_account_id = urlencode(cloud_account_id) ); let mut local_req_builder = @@ -320,11 +323,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -371,12 +374,13 @@ 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.get_operation_host("v2.delete_cost_azure_uc_config"), + local_configuration.get_operation_host(operation_id), cloud_account_id = urlencode(cloud_account_id) ); let mut local_req_builder = @@ -389,11 +393,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -441,12 +445,13 @@ 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.get_operation_host("v2.get_cloud_cost_activity") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -458,11 +463,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -517,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.get_operation_host("v2.list_aws_related_accounts") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -539,11 +545,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -593,12 +599,13 @@ 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.get_operation_host("v2.list_cost_awscur_configs") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -610,11 +617,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -664,12 +671,13 @@ 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.get_operation_host("v2.list_cost_azure_uc_configs") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -681,11 +689,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -742,12 +750,13 @@ 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.get_operation_host("v2.update_cost_awscur_config"), + local_configuration.get_operation_host(operation_id), cloud_account_id = urlencode(cloud_account_id) ); let mut local_req_builder = @@ -760,11 +769,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -828,12 +837,13 @@ 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.get_operation_host("v2.update_cost_azure_uc_configs"), + local_configuration.get_operation_host(operation_id), cloud_account_id = urlencode(cloud_account_id) ); let mut local_req_builder = @@ -846,11 +856,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 dad1dc111..09f4254d1 100644 --- a/src/datadogV2/api/api_cloud_workload_security.rs +++ b/src/datadogV2/api/api_cloud_workload_security.rs @@ -113,12 +113,13 @@ 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.get_operation_host("v2.create_cloud_workload_security_agent_rule") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -130,11 +131,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -191,12 +192,13 @@ 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.get_operation_host("v2.delete_cloud_workload_security_agent_rule"), + local_configuration.get_operation_host(operation_id), agent_rule_id = urlencode(agent_rule_id) ); let mut local_req_builder = @@ -209,11 +211,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -262,12 +264,13 @@ 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.get_operation_host("v2.download_cloud_workload_policy_file") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -279,11 +282,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -337,12 +340,13 @@ 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.get_operation_host("v2.get_cloud_workload_security_agent_rule"), + local_configuration.get_operation_host(operation_id), agent_rule_id = urlencode(agent_rule_id) ); let mut local_req_builder = @@ -355,11 +359,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -413,12 +417,13 @@ 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.get_operation_host("v2.list_cloud_workload_security_agent_rules") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -430,11 +435,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -494,12 +499,13 @@ 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.get_operation_host("v2.update_cloud_workload_security_agent_rule"), + local_configuration.get_operation_host(operation_id), agent_rule_id = urlencode(agent_rule_id) ); let mut local_req_builder = @@ -512,11 +518,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_cloudflare_integration.rs b/src/datadogV2/api/api_cloudflare_integration.rs index ec3436e4e..441f59c0f 100644 --- a/src/datadogV2/api/api_cloudflare_integration.rs +++ b/src/datadogV2/api/api_cloudflare_integration.rs @@ -104,12 +104,13 @@ 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.get_operation_host("v2.create_cloudflare_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -121,11 +122,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -181,12 +182,13 @@ 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.get_operation_host("v2.delete_cloudflare_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -199,11 +201,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -253,12 +255,13 @@ 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.get_operation_host("v2.get_cloudflare_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -271,11 +274,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -325,12 +328,13 @@ 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.get_operation_host("v2.list_cloudflare_accounts") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -342,11 +346,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -403,12 +407,13 @@ 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.get_operation_host("v2.update_cloudflare_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -421,11 +426,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_confluent_cloud.rs b/src/datadogV2/api/api_confluent_cloud.rs index eefe138a8..4f02ee050 100644 --- a/src/datadogV2/api/api_confluent_cloud.rs +++ b/src/datadogV2/api/api_confluent_cloud.rs @@ -159,12 +159,13 @@ 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.get_operation_host("v2.create_confluent_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -176,11 +177,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -244,12 +245,13 @@ 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.get_operation_host("v2.create_confluent_resource"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -262,11 +264,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -322,12 +324,13 @@ 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.get_operation_host("v2.delete_confluent_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -340,11 +343,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.delete_confluent_resource"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), resource_id = urlencode(resource_id) ); @@ -412,11 +416,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -466,12 +470,13 @@ 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.get_operation_host("v2.get_confluent_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -484,11 +489,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.get_confluent_resource"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), resource_id = urlencode(resource_id) ); @@ -564,11 +570,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -618,12 +624,13 @@ 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.get_operation_host("v2.list_confluent_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -635,11 +642,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -694,12 +701,13 @@ 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.get_operation_host("v2.list_confluent_resource"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -712,11 +720,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -773,12 +781,13 @@ 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.get_operation_host("v2.update_confluent_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -791,11 +800,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.update_confluent_resource"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), resource_id = urlencode(resource_id) ); @@ -880,11 +890,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_container_images.rs b/src/datadogV2/api/api_container_images.rs index f07aab373..fe544e722 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; @@ -117,7 +118,7 @@ impl ContainerImagesAPI { let local_uri_str = format!( "{}/api/v2/container_images", - local_configuration.get_operation_host("v2.list_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()); @@ -150,11 +151,11 @@ impl ContainerImagesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 142eac73a..c1f486ede 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; @@ -115,7 +116,7 @@ impl ContainersAPI { let local_uri_str = format!( "{}/api/v2/containers", - local_configuration.get_operation_host("v2.list_containers") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -148,11 +149,11 @@ impl ContainersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 08857319a..350b158bc 100644 --- a/src/datadogV2/api/api_dashboard_lists.rs +++ b/src/datadogV2/api/api_dashboard_lists.rs @@ -97,12 +97,13 @@ 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.get_operation_host("v2.create_dashboard_list_items"), + local_configuration.get_operation_host(operation_id), dashboard_list_id = dashboard_list_id ); let mut local_req_builder = @@ -115,11 +116,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -183,12 +184,13 @@ 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.get_operation_host("v2.delete_dashboard_list_items"), + local_configuration.get_operation_host(operation_id), dashboard_list_id = dashboard_list_id ); let mut local_req_builder = @@ -201,11 +203,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -267,12 +269,13 @@ 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.get_operation_host("v2.get_dashboard_list_items"), + local_configuration.get_operation_host(operation_id), dashboard_list_id = dashboard_list_id ); let mut local_req_builder = @@ -285,11 +288,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -346,12 +349,13 @@ 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.get_operation_host("v2.update_dashboard_list_items"), + local_configuration.get_operation_host(operation_id), dashboard_list_id = dashboard_list_id ); let mut local_req_builder = @@ -364,11 +368,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_dora_metrics.rs b/src/datadogV2/api/api_dora_metrics.rs index 76cfb6810..9f0537f8f 100644 --- a/src/datadogV2/api/api_dora_metrics.rs +++ b/src/datadogV2/api/api_dora_metrics.rs @@ -80,8 +80,8 @@ impl DORAMetricsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_dora_deployment".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -94,7 +94,7 @@ impl DORAMetricsAPI { let local_uri_str = format!( "{}/api/v2/dora/deployment", - local_configuration.get_operation_host("v2.create_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()); @@ -106,8 +106,8 @@ impl DORAMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; // build body parameters @@ -172,8 +172,8 @@ impl DORAMetricsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_dora_incident".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -186,7 +186,7 @@ impl DORAMetricsAPI { let local_uri_str = format!( "{}/api/v2/dora/incident", - local_configuration.get_operation_host("v2.create_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()); @@ -198,8 +198,8 @@ impl DORAMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_downtimes.rs b/src/datadogV2/api/api_downtimes.rs index 1541482d0..3e66e2a75 100644 --- a/src/datadogV2/api/api_downtimes.rs +++ b/src/datadogV2/api/api_downtimes.rs @@ -183,12 +183,13 @@ 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.get_operation_host("v2.cancel_downtime"), + local_configuration.get_operation_host(operation_id), downtime_id = urlencode(downtime_id) ); let mut local_req_builder = @@ -201,11 +202,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -252,12 +253,13 @@ 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.get_operation_host("v2.create_downtime") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -269,11 +271,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -329,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; @@ -337,7 +340,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/downtime/{downtime_id}", - local_configuration.get_operation_host("v2.get_downtime"), + local_configuration.get_operation_host(operation_id), downtime_id = urlencode(downtime_id) ); let mut local_req_builder = @@ -355,11 +358,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -408,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; @@ -419,7 +423,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/downtime", - local_configuration.get_operation_host("v2.list_downtimes") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -448,11 +452,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -509,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; @@ -518,7 +523,7 @@ impl DowntimesAPI { let local_uri_str = format!( "{}/api/v2/monitor/{monitor_id}/downtime_matches", - local_configuration.get_operation_host("v2.list_monitor_downtimes"), + local_configuration.get_operation_host(operation_id), monitor_id = monitor_id ); let mut local_req_builder = @@ -540,11 +545,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -595,12 +600,13 @@ 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.get_operation_host("v2.update_downtime"), + local_configuration.get_operation_host(operation_id), downtime_id = urlencode(downtime_id) ); let mut local_req_builder = @@ -613,11 +619,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_events.rs b/src/datadogV2/api/api_events.rs index ce8f64b2c..06d012c53 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; @@ -148,7 +149,7 @@ impl EventsAPI { let local_uri_str = format!( "{}/api/v2/events", - local_configuration.get_operation_host("v2.list_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -185,11 +186,11 @@ impl EventsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -243,6 +244,7 @@ impl EventsAPI { Error, > { let local_configuration = &self.config; + let operation_id = "v2.search_events"; // unbox and build optional parameters let body = params.body; @@ -251,7 +253,7 @@ impl EventsAPI { let local_uri_str = format!( "{}/api/v2/events/search", - local_configuration.get_operation_host("v2.search_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -263,11 +265,11 @@ impl EventsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_fastly_integration.rs b/src/datadogV2/api/api_fastly_integration.rs index 734d3b4cf..02fcff1d2 100644 --- a/src/datadogV2/api/api_fastly_integration.rs +++ b/src/datadogV2/api/api_fastly_integration.rs @@ -159,12 +159,13 @@ 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.get_operation_host("v2.create_fastly_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -176,11 +177,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -244,12 +245,13 @@ 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.get_operation_host("v2.create_fastly_service"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -262,11 +264,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -319,12 +321,13 @@ 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.get_operation_host("v2.delete_fastly_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -337,11 +340,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.delete_fastly_service"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), service_id = urlencode(service_id) ); @@ -409,11 +413,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -461,12 +465,13 @@ 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.get_operation_host("v2.get_fastly_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -479,11 +484,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.get_fastly_service"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), service_id = urlencode(service_id) ); @@ -557,11 +563,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -611,12 +617,13 @@ 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.get_operation_host("v2.list_fastly_accounts") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -628,11 +635,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -684,12 +691,13 @@ 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.get_operation_host("v2.list_fastly_services"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -702,11 +710,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -763,12 +771,13 @@ 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.get_operation_host("v2.update_fastly_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -781,11 +790,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.update_fastly_service"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id), service_id = urlencode(service_id) ); @@ -870,11 +880,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_gcp_integration.rs b/src/datadogV2/api/api_gcp_integration.rs index a83c9b93e..df12e6406 100644 --- a/src/datadogV2/api/api_gcp_integration.rs +++ b/src/datadogV2/api/api_gcp_integration.rs @@ -130,12 +130,13 @@ 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.get_operation_host("v2.create_gcpsts_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -147,11 +148,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -204,12 +205,13 @@ 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.get_operation_host("v2.delete_gcpsts_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -222,11 +224,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -274,12 +276,13 @@ 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.get_operation_host("v2.get_gcpsts_delegate") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -291,11 +294,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -345,12 +348,13 @@ 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.get_operation_host("v2.list_gcpsts_accounts") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -362,11 +366,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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,7 +431,7 @@ impl GCPIntegrationAPI { let local_uri_str = format!( "{}/api/v2/integration/gcp/sts_delegate", - local_configuration.get_operation_host("v2.make_gcpsts_delegate") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -438,11 +443,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -506,12 +511,13 @@ 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.get_operation_host("v2.update_gcpsts_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -524,11 +530,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_incident_services.rs b/src/datadogV2/api/api_incident_services.rs index c9c872189..25cd7234c 100644 --- a/src/datadogV2/api/api_incident_services.rs +++ b/src/datadogV2/api/api_incident_services.rs @@ -163,8 +163,8 @@ impl IncidentServicesAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_incident_service".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -177,7 +177,7 @@ impl IncidentServicesAPI { let local_uri_str = format!( "{}/api/v2/services", - local_configuration.get_operation_host("v2.create_incident_service") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -189,11 +189,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -249,8 +249,8 @@ impl IncidentServicesAPI { service_id: String, ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.delete_incident_service".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -263,7 +263,7 @@ impl IncidentServicesAPI { let local_uri_str = format!( "{}/api/v2/services/{service_id}", - local_configuration.get_operation_host("v2.delete_incident_service"), + local_configuration.get_operation_host(operation_id), service_id = urlencode(service_id) ); let mut local_req_builder = @@ -276,11 +276,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -337,8 +337,8 @@ impl IncidentServicesAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.get_incident_service".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -354,7 +354,7 @@ impl IncidentServicesAPI { let local_uri_str = format!( "{}/api/v2/services/{service_id}", - local_configuration.get_operation_host("v2.get_incident_service"), + local_configuration.get_operation_host(operation_id), service_id = urlencode(service_id) ); let mut local_req_builder = @@ -372,11 +372,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -428,8 +428,8 @@ impl IncidentServicesAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_incident_services".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -448,7 +448,7 @@ impl IncidentServicesAPI { let local_uri_str = format!( "{}/api/v2/services", - local_configuration.get_operation_host("v2.list_incident_services") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -477,11 +477,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -538,8 +538,8 @@ impl IncidentServicesAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.update_incident_service".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -552,7 +552,7 @@ impl IncidentServicesAPI { let local_uri_str = format!( "{}/api/v2/services/{service_id}", - local_configuration.get_operation_host("v2.update_incident_service"), + local_configuration.get_operation_host(operation_id), service_id = urlencode(service_id) ); let mut local_req_builder = @@ -565,11 +565,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_incident_teams.rs b/src/datadogV2/api/api_incident_teams.rs index 3c121507c..cb19fd316 100644 --- a/src/datadogV2/api/api_incident_teams.rs +++ b/src/datadogV2/api/api_incident_teams.rs @@ -161,8 +161,8 @@ impl IncidentTeamsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_incident_team".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -175,7 +175,7 @@ impl IncidentTeamsAPI { let local_uri_str = format!( "{}/api/v2/teams", - local_configuration.get_operation_host("v2.create_incident_team") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -187,11 +187,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -244,8 +244,8 @@ impl IncidentTeamsAPI { team_id: String, ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.delete_incident_team".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -258,7 +258,7 @@ impl IncidentTeamsAPI { let local_uri_str = format!( "{}/api/v2/teams/{team_id}", - local_configuration.get_operation_host("v2.delete_incident_team"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -271,11 +271,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -327,8 +327,8 @@ impl IncidentTeamsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.get_incident_team".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -344,7 +344,7 @@ impl IncidentTeamsAPI { let local_uri_str = format!( "{}/api/v2/teams/{team_id}", - local_configuration.get_operation_host("v2.get_incident_team"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -362,11 +362,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -416,8 +416,8 @@ impl IncidentTeamsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_incident_teams".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -436,7 +436,7 @@ impl IncidentTeamsAPI { let local_uri_str = format!( "{}/api/v2/teams", - local_configuration.get_operation_host("v2.list_incident_teams") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -465,11 +465,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -524,8 +524,8 @@ impl IncidentTeamsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.update_incident_team".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -538,7 +538,7 @@ impl IncidentTeamsAPI { let local_uri_str = format!( "{}/api/v2/teams/{team_id}", - local_configuration.get_operation_host("v2.update_incident_team"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -551,11 +551,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_incidents.rs b/src/datadogV2/api/api_incidents.rs index 3f7ebe94f..fd7833f56 100644 --- a/src/datadogV2/api/api_incidents.rs +++ b/src/datadogV2/api/api_incidents.rs @@ -420,8 +420,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_incident".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -434,7 +434,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents", - local_configuration.get_operation_host("v2.create_incident") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -446,11 +446,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -514,8 +514,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_incident_integration".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -528,7 +528,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations", - local_configuration.get_operation_host("v2.create_incident_integration"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -541,11 +541,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -607,8 +607,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_incident_todo".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -621,7 +621,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos", - local_configuration.get_operation_host("v2.create_incident_todo"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -634,11 +634,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -691,8 +691,8 @@ impl IncidentsAPI { incident_id: String, ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.delete_incident".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -705,7 +705,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}", - local_configuration.get_operation_host("v2.delete_incident"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -718,11 +718,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -771,8 +771,8 @@ impl IncidentsAPI { integration_metadata_id: String, ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.delete_incident_integration".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -785,7 +785,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", - local_configuration.get_operation_host("v2.delete_incident_integration"), incident_id= + local_configuration.get_operation_host(operation_id), incident_id= urlencode(incident_id) , integration_metadata_id= urlencode(integration_metadata_id) @@ -800,11 +800,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -853,8 +853,8 @@ impl IncidentsAPI { todo_id: String, ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.delete_incident_todo".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -867,7 +867,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}", - local_configuration.get_operation_host("v2.delete_incident_todo"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id), todo_id = urlencode(todo_id) ); @@ -881,11 +881,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -932,8 +932,8 @@ impl IncidentsAPI { ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.get_incident".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -949,7 +949,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}", - local_configuration.get_operation_host("v2.get_incident"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -974,11 +974,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1034,8 +1034,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.get_incident_integration".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1048,7 +1048,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", - local_configuration.get_operation_host("v2.get_incident_integration"), incident_id= + local_configuration.get_operation_host(operation_id), incident_id= urlencode(incident_id) , integration_metadata_id= urlencode(integration_metadata_id) @@ -1063,11 +1063,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1122,8 +1122,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.get_incident_todo".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1136,7 +1136,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}", - local_configuration.get_operation_host("v2.get_incident_todo"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id), todo_id = urlencode(todo_id) ); @@ -1150,11 +1150,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1211,8 +1211,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_incident_attachments".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1229,7 +1229,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/attachments", - local_configuration.get_operation_host("v2.list_incident_attachments"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1265,11 +1265,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1324,8 +1324,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_incident_integrations".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1338,7 +1338,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations", - local_configuration.get_operation_host("v2.list_incident_integrations"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1351,11 +1351,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1408,8 +1408,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_incident_todos".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1422,7 +1422,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos", - local_configuration.get_operation_host("v2.list_incident_todos"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1435,11 +1435,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1488,8 +1488,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_incidents".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1507,7 +1507,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents", - local_configuration.get_operation_host("v2.list_incidents") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1539,11 +1539,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1595,8 +1595,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.search_incidents".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1615,7 +1615,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/search", - local_configuration.get_operation_host("v2.search_incidents") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1645,11 +1645,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1705,8 +1705,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.update_incident".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1722,7 +1722,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}", - local_configuration.get_operation_host("v2.update_incident"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1747,11 +1747,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1817,8 +1817,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.update_incident_attachments".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1834,7 +1834,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/attachments", - local_configuration.get_operation_host("v2.update_incident_attachments"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id) ); let mut local_req_builder = @@ -1859,11 +1859,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1929,8 +1929,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.update_incident_integration".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1943,7 +1943,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}", - local_configuration.get_operation_host("v2.update_incident_integration"), incident_id= + local_configuration.get_operation_host(operation_id), incident_id= urlencode(incident_id) , integration_metadata_id= urlencode(integration_metadata_id) @@ -1958,11 +1958,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -2026,8 +2026,8 @@ impl IncidentsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.update_incident_todo".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -2040,7 +2040,7 @@ impl IncidentsAPI { let local_uri_str = format!( "{}/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}", - local_configuration.get_operation_host("v2.update_incident_todo"), + local_configuration.get_operation_host(operation_id), incident_id = urlencode(incident_id), todo_id = urlencode(todo_id) ); @@ -2054,11 +2054,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_ip_allowlist.rs b/src/datadogV2/api/api_ip_allowlist.rs index 707b552f4..4e55a0884 100644 --- a/src/datadogV2/api/api_ip_allowlist.rs +++ b/src/datadogV2/api/api_ip_allowlist.rs @@ -66,12 +66,13 @@ 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.get_operation_host("v2.get_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()); @@ -83,11 +84,11 @@ impl IPAllowlistAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -137,12 +138,13 @@ 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.get_operation_host("v2.update_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()); @@ -154,11 +156,11 @@ impl IPAllowlistAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_key_management.rs b/src/datadogV2/api/api_key_management.rs index 4c61cdcd9..49da3cdee 100644 --- a/src/datadogV2/api/api_key_management.rs +++ b/src/datadogV2/api/api_key_management.rs @@ -436,12 +436,13 @@ 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.get_operation_host("v2.create_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()); @@ -453,11 +454,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -518,12 +519,13 @@ 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.get_operation_host("v2.create_current_user_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()); @@ -535,11 +537,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -592,12 +594,13 @@ 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.get_operation_host("v2.delete_api_key"), + local_configuration.get_operation_host(operation_id), api_key_id = urlencode(api_key_id) ); let mut local_req_builder = @@ -610,11 +613,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -657,12 +660,13 @@ 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.get_operation_host("v2.delete_application_key"), + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = @@ -675,11 +679,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -726,12 +730,13 @@ 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.get_operation_host("v2.delete_current_user_application_key"), + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = @@ -744,11 +749,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -795,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; @@ -803,7 +809,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/api_keys/{api_key_id}", - local_configuration.get_operation_host("v2.get_api_key"), + local_configuration.get_operation_host(operation_id), api_key_id = urlencode(api_key_id) ); let mut local_req_builder = @@ -821,11 +827,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -881,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; @@ -889,7 +896,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/application_keys/{app_key_id}", - local_configuration.get_operation_host("v2.get_application_key"), + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = @@ -907,11 +914,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -966,12 +973,13 @@ 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.get_operation_host("v2.get_current_user_application_key"), + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = @@ -984,11 +992,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1035,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; @@ -1053,7 +1062,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/api_keys", - local_configuration.get_operation_host("v2.list_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()); @@ -1112,11 +1121,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1167,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; @@ -1181,7 +1191,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/application_keys", - local_configuration.get_operation_host("v2.list_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()); @@ -1222,11 +1232,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1281,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; @@ -1295,7 +1306,7 @@ impl KeyManagementAPI { let local_uri_str = format!( "{}/api/v2/current_user/application_keys", - local_configuration.get_operation_host("v2.list_current_user_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()); @@ -1336,11 +1347,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1389,12 +1400,13 @@ 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.get_operation_host("v2.update_api_key"), + local_configuration.get_operation_host(operation_id), api_key_id = urlencode(api_key_id) ); let mut local_req_builder = @@ -1407,11 +1419,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1474,12 +1486,13 @@ 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.get_operation_host("v2.update_application_key"), + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = @@ -1492,11 +1505,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1560,12 +1573,13 @@ 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.get_operation_host("v2.update_current_user_application_key"), + local_configuration.get_operation_host(operation_id), app_key_id = urlencode(app_key_id) ); let mut local_req_builder = @@ -1578,11 +1592,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_logs.rs b/src/datadogV2/api/api_logs.rs index 6c8467d61..a5880f857 100644 --- a/src/datadogV2/api/api_logs.rs +++ b/src/datadogV2/api/api_logs.rs @@ -202,12 +202,13 @@ 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.get_operation_host("v2.aggregate_logs") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -219,11 +220,11 @@ impl LogsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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,7 +307,7 @@ impl LogsAPI { let local_uri_str = format!( "{}/api/v2/logs/events/search", - local_configuration.get_operation_host("v2.list_logs") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -317,11 +319,11 @@ impl LogsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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; @@ -409,7 +412,7 @@ impl LogsAPI { let local_uri_str = format!( "{}/api/v2/logs/events", - local_configuration.get_operation_host("v2.list_logs_get") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -461,11 +464,11 @@ impl LogsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -562,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; @@ -571,7 +575,7 @@ impl LogsAPI { let local_uri_str = format!( "{}/api/v2/logs", - local_configuration.get_operation_host("v2.submit_log") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -592,8 +596,8 @@ impl LogsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_logs_archives.rs b/src/datadogV2/api/api_logs_archives.rs index 11f8a88f7..54fa6c936 100644 --- a/src/datadogV2/api/api_logs_archives.rs +++ b/src/datadogV2/api/api_logs_archives.rs @@ -153,12 +153,13 @@ 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.get_operation_host("v2.add_read_role_to_archive"), + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = @@ -171,11 +172,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -227,12 +228,13 @@ 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.get_operation_host("v2.create_logs_archive") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -244,11 +246,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -301,12 +303,13 @@ 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.get_operation_host("v2.delete_logs_archive"), + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = @@ -319,11 +322,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -368,12 +371,13 @@ 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.get_operation_host("v2.get_logs_archive"), + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = @@ -386,11 +390,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -440,12 +444,13 @@ 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.get_operation_host("v2.get_logs_archive_order") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -457,11 +462,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -514,12 +519,13 @@ 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.get_operation_host("v2.list_archive_read_roles"), + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = @@ -532,11 +538,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -581,12 +587,13 @@ 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.get_operation_host("v2.list_logs_archives") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -598,11 +605,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -653,12 +660,13 @@ 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.get_operation_host("v2.remove_role_from_archive"), + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = @@ -671,11 +679,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -738,12 +746,13 @@ 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.get_operation_host("v2.update_logs_archive"), + local_configuration.get_operation_host(operation_id), archive_id = urlencode(archive_id) ); let mut local_req_builder = @@ -756,11 +765,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -825,12 +834,13 @@ 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.get_operation_host("v2.update_logs_archive_order") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); @@ -842,11 +852,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_logs_metrics.rs b/src/datadogV2/api/api_logs_metrics.rs index a670f1f8d..8da4a5146 100644 --- a/src/datadogV2/api/api_logs_metrics.rs +++ b/src/datadogV2/api/api_logs_metrics.rs @@ -100,12 +100,13 @@ 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.get_operation_host("v2.create_logs_metric") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -117,11 +118,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -174,12 +175,13 @@ 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.get_operation_host("v2.delete_logs_metric"), + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = @@ -192,11 +194,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -244,12 +246,13 @@ 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.get_operation_host("v2.get_logs_metric"), + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = @@ -262,11 +265,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -314,12 +317,13 @@ 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.get_operation_host("v2.list_logs_metrics") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -331,11 +335,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -392,12 +396,13 @@ 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.get_operation_host("v2.update_logs_metric"), + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = @@ -410,11 +415,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_metrics.rs b/src/datadogV2/api/api_metrics.rs index 795f79c4b..ffc5d39e3 100644 --- a/src/datadogV2/api/api_metrics.rs +++ b/src/datadogV2/api/api_metrics.rs @@ -367,12 +367,13 @@ 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.get_operation_host("v2.create_bulk_tags_metrics_configuration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -384,11 +385,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -460,12 +461,13 @@ 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.get_operation_host("v2.create_tag_configuration"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -478,11 +480,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -550,12 +552,13 @@ 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.get_operation_host("v2.delete_bulk_tags_metrics_configuration") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -567,11 +570,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -629,12 +632,13 @@ 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.get_operation_host("v2.delete_tag_configuration"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -647,11 +651,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.estimate_metrics_output_series"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -752,11 +757,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.list_active_metric_configurations"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -839,11 +845,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -899,12 +905,13 @@ 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.get_operation_host("v2.list_tag_configuration_by_name"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -917,11 +924,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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; @@ -987,7 +995,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/metrics", - local_configuration.get_operation_host("v2.list_tag_configurations") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1030,11 +1038,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1090,12 +1098,13 @@ 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.get_operation_host("v2.list_tags_by_metric_name"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -1108,11 +1117,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1171,12 +1180,13 @@ 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.get_operation_host("v2.list_volumes_by_metric_name"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -1189,11 +1199,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1249,8 +1259,8 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.query_scalar_data".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1263,7 +1273,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/query/scalar", - local_configuration.get_operation_host("v2.query_scalar_data") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1275,11 +1285,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1340,8 +1350,8 @@ impl MetricsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.query_timeseries_data".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1354,7 +1364,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/query/timeseries", - local_configuration.get_operation_host("v2.query_timeseries_data") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1366,11 +1376,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1451,6 +1461,7 @@ 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; @@ -1459,7 +1470,7 @@ impl MetricsAPI { let local_uri_str = format!( "{}/api/v2/series", - local_configuration.get_operation_host("v2.submit_metrics") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1475,8 +1486,8 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; // build body parameters @@ -1548,12 +1559,13 @@ 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.get_operation_host("v2.update_tag_configuration"), + local_configuration.get_operation_host(operation_id), metric_name = urlencode(metric_name) ); let mut local_req_builder = @@ -1566,11 +1578,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_monitors.rs b/src/datadogV2/api/api_monitors.rs index 33313af63..0215c9b24 100644 --- a/src/datadogV2/api/api_monitors.rs +++ b/src/datadogV2/api/api_monitors.rs @@ -100,12 +100,13 @@ 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.get_operation_host("v2.create_monitor_config_policy") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -117,11 +118,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -177,12 +178,13 @@ 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.get_operation_host("v2.delete_monitor_config_policy"), + local_configuration.get_operation_host(operation_id), policy_id = urlencode(policy_id) ); let mut local_req_builder = @@ -195,11 +197,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -252,12 +254,13 @@ 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.get_operation_host("v2.get_monitor_config_policy"), + local_configuration.get_operation_host(operation_id), policy_id = urlencode(policy_id) ); let mut local_req_builder = @@ -270,11 +273,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -324,12 +327,13 @@ 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.get_operation_host("v2.list_monitor_config_policies") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -341,11 +345,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -402,12 +406,13 @@ 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.get_operation_host("v2.update_monitor_config_policy"), + local_configuration.get_operation_host(operation_id), policy_id = urlencode(policy_id) ); let mut local_req_builder = @@ -420,11 +425,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_okta_integration.rs b/src/datadogV2/api/api_okta_integration.rs index 52bf24d4d..d6e717d4f 100644 --- a/src/datadogV2/api/api_okta_integration.rs +++ b/src/datadogV2/api/api_okta_integration.rs @@ -102,12 +102,13 @@ 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.get_operation_host("v2.create_okta_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -119,11 +120,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -176,12 +177,13 @@ 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.get_operation_host("v2.delete_okta_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -194,11 +196,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -246,12 +248,13 @@ 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.get_operation_host("v2.get_okta_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -264,11 +267,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -316,12 +319,13 @@ 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.get_operation_host("v2.list_okta_accounts") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -333,11 +337,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -392,12 +396,13 @@ 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.get_operation_host("v2.update_okta_account"), + local_configuration.get_operation_host(operation_id), account_id = urlencode(account_id) ); let mut local_req_builder = @@ -410,11 +415,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_opsgenie_integration.rs b/src/datadogV2/api/api_opsgenie_integration.rs index 5def1a42e..c437357d5 100644 --- a/src/datadogV2/api/api_opsgenie_integration.rs +++ b/src/datadogV2/api/api_opsgenie_integration.rs @@ -104,12 +104,13 @@ 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.get_operation_host("v2.create_opsgenie_service") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -121,11 +122,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -181,12 +182,13 @@ 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.get_operation_host("v2.delete_opsgenie_service"), + local_configuration.get_operation_host(operation_id), integration_service_id = urlencode(integration_service_id) ); let mut local_req_builder = @@ -199,11 +201,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -256,12 +258,13 @@ 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.get_operation_host("v2.get_opsgenie_service"), + local_configuration.get_operation_host(operation_id), integration_service_id = urlencode(integration_service_id) ); let mut local_req_builder = @@ -274,11 +277,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -328,12 +331,13 @@ 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.get_operation_host("v2.list_opsgenie_services") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -345,11 +349,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -406,12 +410,13 @@ 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.get_operation_host("v2.update_opsgenie_service"), + local_configuration.get_operation_host(operation_id), integration_service_id = urlencode(integration_service_id) ); let mut local_req_builder = @@ -424,11 +429,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_organizations.rs b/src/datadogV2/api/api_organizations.rs index 005284fce..81a44b3fa 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_id_p_metadata"; // unbox and build optional parameters let idp_file = params.idp_file; @@ -81,7 +82,7 @@ impl OrganizationsAPI { let local_uri_str = format!( "{}/api/v2/saml_configurations/idp_metadata", - local_configuration.get_operation_host("v2.upload_id_p_metadata") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -93,11 +94,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build form parameters diff --git a/src/datadogV2/api/api_powerpack.rs b/src/datadogV2/api/api_powerpack.rs index dcdae12a1..ae6d8645e 100644 --- a/src/datadogV2/api/api_powerpack.rs +++ b/src/datadogV2/api/api_powerpack.rs @@ -115,12 +115,13 @@ 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.get_operation_host("v2.create_powerpack") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -132,11 +133,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -189,12 +190,13 @@ 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.get_operation_host("v2.delete_powerpack"), + local_configuration.get_operation_host(operation_id), powerpack_id = urlencode(powerpack_id) ); let mut local_req_builder = @@ -207,11 +209,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -256,12 +258,13 @@ 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.get_operation_host("v2.get_powerpack"), + local_configuration.get_operation_host(operation_id), powerpack_id = urlencode(powerpack_id) ); let mut local_req_builder = @@ -274,11 +277,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -327,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; @@ -336,7 +340,7 @@ impl PowerpackAPI { let local_uri_str = format!( "{}/api/v2/powerpacks", - local_configuration.get_operation_host("v2.list_powerpacks") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -357,11 +361,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -416,12 +420,13 @@ 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.get_operation_host("v2.update_powerpack"), + local_configuration.get_operation_host(operation_id), powerpack_id = urlencode(powerpack_id) ); let mut local_req_builder = @@ -434,11 +439,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_processes.rs b/src/datadogV2/api/api_processes.rs index 392445b4b..616d2c3ae 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; @@ -131,7 +132,7 @@ impl ProcessesAPI { let local_uri_str = format!( "{}/api/v2/processes", - local_configuration.get_operation_host("v2.list_processes") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -167,11 +168,11 @@ impl ProcessesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 ee53832ca..4b9d13dca 100644 --- a/src/datadogV2/api/api_restriction_policies.rs +++ b/src/datadogV2/api/api_restriction_policies.rs @@ -76,12 +76,13 @@ 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.get_operation_host("v2.delete_restriction_policy"), + local_configuration.get_operation_host(operation_id), resource_id = urlencode(resource_id) ); let mut local_req_builder = @@ -94,11 +95,11 @@ impl RestrictionPoliciesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -151,12 +152,13 @@ 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.get_operation_host("v2.get_restriction_policy"), + local_configuration.get_operation_host(operation_id), resource_id = urlencode(resource_id) ); let mut local_req_builder = @@ -169,11 +171,11 @@ impl RestrictionPoliciesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -264,12 +266,13 @@ 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.get_operation_host("v2.update_restriction_policy"), + local_configuration.get_operation_host(operation_id), resource_id = urlencode(resource_id) ); let mut local_req_builder = @@ -282,11 +285,11 @@ impl RestrictionPoliciesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_roles.rs b/src/datadogV2/api/api_roles.rs index d5a38159b..0c391808d 100644 --- a/src/datadogV2/api/api_roles.rs +++ b/src/datadogV2/api/api_roles.rs @@ -278,12 +278,13 @@ 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.get_operation_host("v2.add_permission_to_role"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -296,11 +297,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -356,12 +357,13 @@ 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.get_operation_host("v2.add_user_to_role"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -374,11 +376,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -433,12 +435,13 @@ 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.get_operation_host("v2.clone_role"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -451,11 +454,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -508,12 +511,13 @@ 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.get_operation_host("v2.create_role") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -525,11 +529,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -578,12 +582,13 @@ 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.get_operation_host("v2.delete_role"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -596,11 +601,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -643,12 +648,13 @@ 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.get_operation_host("v2.get_role"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -661,11 +667,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -712,12 +718,13 @@ 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.get_operation_host("v2.list_permissions") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -729,11 +736,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -783,12 +790,13 @@ 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.get_operation_host("v2.list_role_permissions"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -801,11 +809,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -854,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; @@ -865,7 +874,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles/{role_id}/users", - local_configuration.get_operation_host("v2.list_role_users"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -895,11 +904,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -946,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; @@ -958,7 +968,7 @@ impl RolesAPI { let local_uri_str = format!( "{}/api/v2/roles", - local_configuration.get_operation_host("v2.list_roles") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -991,11 +1001,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1051,12 +1061,13 @@ 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.get_operation_host("v2.remove_permission_from_role"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -1069,11 +1080,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1135,12 +1146,13 @@ 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.get_operation_host("v2.remove_user_from_role"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -1153,11 +1165,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1213,12 +1225,13 @@ 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.get_operation_host("v2.update_role"), + local_configuration.get_operation_host(operation_id), role_id = urlencode(role_id) ); let mut local_req_builder = @@ -1231,11 +1244,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_rum.rs b/src/datadogV2/api/api_rum.rs index 5d3b1a99a..394906f52 100644 --- a/src/datadogV2/api/api_rum.rs +++ b/src/datadogV2/api/api_rum.rs @@ -177,12 +177,13 @@ 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.get_operation_host("v2.aggregate_rum_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -194,11 +195,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -257,12 +258,13 @@ 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.get_operation_host("v2.create_rum_application") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -274,11 +276,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -331,12 +333,13 @@ 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.get_operation_host("v2.delete_rum_application"), + local_configuration.get_operation_host(operation_id), id = urlencode(id) ); let mut local_req_builder = @@ -349,11 +352,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -403,12 +406,13 @@ 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.get_operation_host("v2.get_rum_application"), + local_configuration.get_operation_host(operation_id), id = urlencode(id) ); let mut local_req_builder = @@ -421,11 +425,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -475,12 +479,13 @@ 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.get_operation_host("v2.get_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()); @@ -492,11 +497,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -555,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; @@ -568,7 +574,7 @@ impl RUMAPI { let local_uri_str = format!( "{}/api/v2/rum/events", - local_configuration.get_operation_host("v2.list_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()); @@ -605,11 +611,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -669,12 +675,13 @@ 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.get_operation_host("v2.search_rum_events") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -686,11 +693,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -751,12 +758,13 @@ 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.get_operation_host("v2.update_rum_application"), + local_configuration.get_operation_host(operation_id), id = urlencode(id) ); let mut local_req_builder = @@ -769,11 +777,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_security_monitoring.rs b/src/datadogV2/api/api_security_monitoring.rs index b9528a09f..02f268956 100644 --- a/src/datadogV2/api/api_security_monitoring.rs +++ b/src/datadogV2/api/api_security_monitoring.rs @@ -460,12 +460,13 @@ 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.get_operation_host("v2.create_security_filter") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -477,11 +478,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -543,12 +544,13 @@ 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.get_operation_host("v2.create_security_monitoring_rule") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -560,11 +562,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -620,12 +622,13 @@ 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.get_operation_host("v2.delete_security_filter"), + local_configuration.get_operation_host(operation_id), security_filter_id = urlencode(security_filter_id) ); let mut local_req_builder = @@ -638,11 +641,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -689,12 +692,13 @@ 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.get_operation_host("v2.delete_security_monitoring_rule"), + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = @@ -707,11 +711,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -766,12 +770,13 @@ 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.get_operation_host("v2.edit_security_monitoring_signal_assignee"), + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = @@ -784,11 +789,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -853,12 +858,13 @@ 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.get_operation_host("v2.edit_security_monitoring_signal_incidents"), + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = @@ -871,11 +877,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -940,12 +946,13 @@ 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.get_operation_host("v2.edit_security_monitoring_signal_state"), + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = @@ -958,11 +965,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1019,8 +1026,8 @@ impl SecurityMonitoringAPI { ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.get_finding".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1036,7 +1043,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/posture_management/findings/{finding_id}", - local_configuration.get_operation_host("v2.get_finding"), + local_configuration.get_operation_host(operation_id), finding_id = urlencode(finding_id) ); let mut local_req_builder = @@ -1054,11 +1061,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1118,12 +1125,13 @@ 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.get_operation_host("v2.get_security_filter"), + local_configuration.get_operation_host(operation_id), security_filter_id = urlencode(security_filter_id) ); let mut local_req_builder = @@ -1136,11 +1144,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1195,12 +1203,13 @@ 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.get_operation_host("v2.get_security_monitoring_rule"), + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = @@ -1213,11 +1222,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1272,12 +1281,13 @@ 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.get_operation_host("v2.get_security_monitoring_signal"), + local_configuration.get_operation_host(operation_id), signal_id = urlencode(signal_id) ); let mut local_req_builder = @@ -1290,11 +1300,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1404,8 +1414,8 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_findings".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1432,7 +1442,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/posture_management/findings", - local_configuration.get_operation_host("v2.list_findings") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1497,11 +1507,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1550,12 +1560,13 @@ 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.get_operation_host("v2.list_security_filters") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1567,11 +1578,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1626,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; @@ -1635,7 +1647,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/rules", - local_configuration.get_operation_host("v2.list_security_monitoring_rules") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1656,11 +1668,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1719,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; @@ -1732,7 +1745,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals", - local_configuration.get_operation_host("v2.list_security_monitoring_signals") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1769,11 +1782,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1824,8 +1837,8 @@ impl SecurityMonitoringAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.mute_findings".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -1838,7 +1851,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/posture_management/findings", - local_configuration.get_operation_host("v2.mute_findings") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -1850,11 +1863,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1919,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; @@ -1927,7 +1941,7 @@ impl SecurityMonitoringAPI { let local_uri_str = format!( "{}/api/v2/security_monitoring/signals/search", - local_configuration.get_operation_host("v2.search_security_monitoring_signals") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -1939,11 +1953,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -2010,12 +2024,13 @@ 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.get_operation_host("v2.update_security_filter"), + local_configuration.get_operation_host(operation_id), security_filter_id = urlencode(security_filter_id) ); let mut local_req_builder = @@ -2028,11 +2043,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -2100,12 +2115,13 @@ 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.get_operation_host("v2.update_security_monitoring_rule"), + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = @@ -2118,11 +2134,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 ada66c28c..d5d99ccc1 100644 --- a/src/datadogV2/api/api_sensitive_data_scanner.rs +++ b/src/datadogV2/api/api_sensitive_data_scanner.rs @@ -151,12 +151,13 @@ 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.get_operation_host("v2.create_scanning_group") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -168,11 +169,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -240,12 +241,13 @@ 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.get_operation_host("v2.create_scanning_rule") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -257,11 +259,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -326,12 +328,13 @@ 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.get_operation_host("v2.delete_scanning_group"), + local_configuration.get_operation_host(operation_id), group_id = urlencode(group_id) ); let mut local_req_builder = @@ -344,11 +347,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -413,12 +416,13 @@ 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.get_operation_host("v2.delete_scanning_rule"), + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = @@ -431,11 +435,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -493,12 +497,13 @@ 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.get_operation_host("v2.list_scanning_groups") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -510,11 +515,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -565,12 +570,13 @@ 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.get_operation_host("v2.list_standard_patterns") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -582,11 +588,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -639,12 +645,13 @@ 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.get_operation_host("v2.reorder_scanning_groups") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -656,11 +663,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -731,12 +738,13 @@ 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.get_operation_host("v2.update_scanning_group"), + local_configuration.get_operation_host(operation_id), group_id = urlencode(group_id) ); let mut local_req_builder = @@ -749,11 +757,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -824,12 +832,13 @@ 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.get_operation_host("v2.update_scanning_rule"), + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = @@ -842,11 +851,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_service_accounts.rs b/src/datadogV2/api/api_service_accounts.rs index 1c7882f14..dd0fdb97b 100644 --- a/src/datadogV2/api/api_service_accounts.rs +++ b/src/datadogV2/api/api_service_accounts.rs @@ -164,12 +164,13 @@ 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.get_operation_host("v2.create_service_account") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -181,11 +182,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -249,12 +250,13 @@ 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.get_operation_host("v2.create_service_account_application_key"), + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id) ); let mut local_req_builder = @@ -267,11 +269,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -329,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.get_operation_host("v2.delete_service_account_application_key"), + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id), app_key_id = urlencode(app_key_id) ); @@ -348,11 +351,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -407,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.get_operation_host("v2.get_service_account_application_key"), + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id), app_key_id = urlencode(app_key_id) ); @@ -426,11 +430,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -487,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; @@ -500,7 +505,7 @@ impl ServiceAccountsAPI { let local_uri_str = format!( "{}/api/v2/service_accounts/{service_account_id}/application_keys", - local_configuration.get_operation_host("v2.list_service_account_application_keys"), + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id) ); let mut local_req_builder = @@ -538,11 +543,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -605,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.get_operation_host("v2.update_service_account_application_key"), + local_configuration.get_operation_host(operation_id), service_account_id = urlencode(service_account_id), app_key_id = urlencode(app_key_id) ); @@ -624,11 +630,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_service_definition.rs b/src/datadogV2/api/api_service_definition.rs index c802dc240..ab8c6c0be 100644 --- a/src/datadogV2/api/api_service_definition.rs +++ b/src/datadogV2/api/api_service_definition.rs @@ -147,12 +147,13 @@ 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.get_operation_host("v2.create_or_update_service_definitions") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -164,11 +165,11 @@ impl ServiceDefinitionAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -224,12 +225,13 @@ 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.get_operation_host("v2.delete_service_definition"), + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = @@ -242,11 +244,11 @@ impl ServiceDefinitionAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.get_service_definition"), + local_configuration.get_operation_host(operation_id), service_name = urlencode(service_name) ); let mut local_req_builder = @@ -327,11 +330,11 @@ impl ServiceDefinitionAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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.get_operation_host("v2.list_service_definitions") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -418,11 +422,11 @@ impl ServiceDefinitionAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 88d61a474..ea00c8aaf 100644 --- a/src/datadogV2/api/api_service_scorecards.rs +++ b/src/datadogV2/api/api_service_scorecards.rs @@ -262,8 +262,8 @@ impl ServiceScorecardsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_scorecard_outcomes_batch".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -276,7 +276,7 @@ impl ServiceScorecardsAPI { let local_uri_str = format!( "{}/api/v2/scorecard/outcomes/batch", - local_configuration.get_operation_host("v2.create_scorecard_outcomes_batch") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -288,11 +288,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -349,8 +349,8 @@ impl ServiceScorecardsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_scorecard_rule".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -363,7 +363,7 @@ impl ServiceScorecardsAPI { let local_uri_str = format!( "{}/api/v2/scorecard/rules", - local_configuration.get_operation_host("v2.create_scorecard_rule") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -375,11 +375,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -432,8 +432,8 @@ impl ServiceScorecardsAPI { rule_id: String, ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.delete_scorecard_rule".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -446,7 +446,7 @@ impl ServiceScorecardsAPI { let local_uri_str = format!( "{}/api/v2/scorecard/rules/{rule_id}", - local_configuration.get_operation_host("v2.delete_scorecard_rule"), + local_configuration.get_operation_host(operation_id), rule_id = urlencode(rule_id) ); let mut local_req_builder = @@ -459,11 +459,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -511,8 +511,8 @@ impl ServiceScorecardsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_scorecard_outcomes".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -537,7 +537,7 @@ impl ServiceScorecardsAPI { let local_uri_str = format!( "{}/api/v2/scorecard/outcomes", - local_configuration.get_operation_host("v2.list_scorecard_outcomes") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -592,11 +592,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -646,8 +646,8 @@ impl ServiceScorecardsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_scorecard_rules".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -672,7 +672,7 @@ impl ServiceScorecardsAPI { let local_uri_str = format!( "{}/api/v2/scorecard/rules", - local_configuration.get_operation_host("v2.list_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()); @@ -725,11 +725,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 29ce123e7..d85884817 100644 --- a/src/datadogV2/api/api_spans.rs +++ b/src/datadogV2/api/api_spans.rs @@ -132,12 +132,13 @@ 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.get_operation_host("v2.aggregate_spans") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -149,11 +150,11 @@ impl SpansAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -219,12 +220,13 @@ 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.get_operation_host("v2.list_spans") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -236,11 +238,11 @@ impl SpansAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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; @@ -318,7 +321,7 @@ impl SpansAPI { let local_uri_str = format!( "{}/api/v2/spans/events", - local_configuration.get_operation_host("v2.list_spans_get") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -355,11 +358,11 @@ impl SpansAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 441e9f12b..566016cd8 100644 --- a/src/datadogV2/api/api_spans_metrics.rs +++ b/src/datadogV2/api/api_spans_metrics.rs @@ -100,12 +100,13 @@ 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.get_operation_host("v2.create_spans_metric") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -117,11 +118,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -174,12 +175,13 @@ 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.get_operation_host("v2.delete_spans_metric"), + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = @@ -192,11 +194,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -244,12 +246,13 @@ 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.get_operation_host("v2.get_spans_metric"), + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = @@ -262,11 +265,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -314,12 +317,13 @@ 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.get_operation_host("v2.list_spans_metrics") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -331,11 +335,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -392,12 +396,13 @@ 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.get_operation_host("v2.update_spans_metric"), + local_configuration.get_operation_host(operation_id), metric_id = urlencode(metric_id) ); let mut local_req_builder = @@ -410,11 +415,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_synthetics.rs b/src/datadogV2/api/api_synthetics.rs index df2b78c2b..a842b99fb 100644 --- a/src/datadogV2/api/api_synthetics.rs +++ b/src/datadogV2/api/api_synthetics.rs @@ -63,12 +63,13 @@ 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.get_operation_host("v2.get_on_demand_concurrency_cap") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -80,11 +81,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -139,12 +140,13 @@ 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.get_operation_host("v2.set_on_demand_concurrency_cap") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -156,11 +158,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_teams.rs b/src/datadogV2/api/api_teams.rs index eeed60e4e..93873f143 100644 --- a/src/datadogV2/api/api_teams.rs +++ b/src/datadogV2/api/api_teams.rs @@ -313,12 +313,13 @@ 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.get_operation_host("v2.create_team") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -330,11 +331,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -391,12 +392,13 @@ 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.get_operation_host("v2.create_team_link"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -409,11 +411,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -475,12 +477,13 @@ 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.get_operation_host("v2.create_team_membership"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -493,11 +496,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -547,12 +550,13 @@ 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.get_operation_host("v2.delete_team"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -565,11 +569,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -614,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.get_operation_host("v2.delete_team_link"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), link_id = urlencode(link_id) ); @@ -633,11 +638,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -686,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.get_operation_host("v2.delete_team_membership"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), user_id = urlencode(user_id) ); @@ -705,11 +711,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -753,12 +759,13 @@ 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.get_operation_host("v2.get_team"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -771,11 +778,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -823,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.get_operation_host("v2.get_team_link"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), link_id = urlencode(link_id) ); @@ -842,11 +850,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -892,12 +900,13 @@ 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.get_operation_host("v2.get_team_links"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -910,11 +919,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -968,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; @@ -979,7 +989,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team/{team_id}/memberships", - local_configuration.get_operation_host("v2.get_team_memberships"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -1009,11 +1019,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1068,12 +1078,13 @@ 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.get_operation_host("v2.get_team_permission_settings"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -1086,11 +1097,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1140,12 +1151,13 @@ 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.get_operation_host("v2.get_user_memberships"), + local_configuration.get_operation_host(operation_id), user_uuid = urlencode(user_uuid) ); let mut local_req_builder = @@ -1158,11 +1170,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1211,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; @@ -1225,7 +1238,7 @@ impl TeamsAPI { let local_uri_str = format!( "{}/api/v2/team", - local_configuration.get_operation_host("v2.list_teams") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1280,11 +1293,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1334,12 +1347,13 @@ 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.get_operation_host("v2.update_team"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id) ); let mut local_req_builder = @@ -1352,11 +1366,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1418,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.get_operation_host("v2.update_team_link"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), link_id = urlencode(link_id) ); @@ -1437,11 +1452,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1505,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.get_operation_host("v2.update_team_membership"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), user_id = urlencode(user_id) ); @@ -1524,11 +1540,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -1594,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.get_operation_host("v2.update_team_permission_setting"), + local_configuration.get_operation_host(operation_id), team_id = urlencode(team_id), action = urlencode(action) ); @@ -1613,11 +1630,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/src/datadogV2/api/api_usage_metering.rs b/src/datadogV2/api/api_usage_metering.rs index 34c00f865..e867af7b1 100644 --- a/src/datadogV2/api/api_usage_metering.rs +++ b/src/datadogV2/api/api_usage_metering.rs @@ -402,8 +402,8 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.get_active_billing_dimensions".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -416,7 +416,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/cost_by_tag/active_billing_dimensions", - local_configuration.get_operation_host("v2.get_active_billing_dimensions") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -428,11 +428,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -492,6 +492,7 @@ 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; @@ -500,7 +501,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/cost_by_org", - local_configuration.get_operation_host("v2.get_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()); @@ -518,11 +519,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -577,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; @@ -589,7 +591,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/estimated_cost", - local_configuration.get_operation_host("v2.get_estimated_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()); @@ -622,11 +624,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -685,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; @@ -694,7 +697,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/historical_cost", - local_configuration.get_operation_host("v2.get_historical_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()); @@ -716,11 +719,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -781,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; @@ -794,7 +798,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/hourly_usage", - local_configuration.get_operation_host("v2.get_hourly_usage") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -841,11 +845,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -932,8 +936,8 @@ impl UsageMeteringAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.get_monthly_cost_attribution".to_string(); - if local_configuration.is_unstable_operation_enabled(&operation_id) { + 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 { @@ -953,7 +957,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/cost_by_tag/monthly_cost_attribution", - local_configuration.get_operation_host("v2.get_monthly_cost_attribution") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -989,11 +993,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1047,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; @@ -1055,7 +1060,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/projected_cost", - local_configuration.get_operation_host("v2.get_projected_cost") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1072,11 +1077,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1135,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; @@ -1143,7 +1149,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/application_security", - local_configuration.get_operation_host("v2.get_usage_application_security_monitoring") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1161,11 +1167,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1225,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; @@ -1233,7 +1240,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/lambda_traced_invocations", - local_configuration.get_operation_host("v2.get_usage_lambda_traced_invocations") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1251,11 +1258,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -1315,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; @@ -1323,7 +1331,7 @@ impl UsageMeteringAPI { let local_uri_str = format!( "{}/api/v2/usage/observability_pipelines", - local_configuration.get_operation_host("v2.get_usage_observability_pipelines") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -1341,11 +1349,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_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 0e7340fe5..fee98ed92 100644 --- a/src/datadogV2/api/api_users.rs +++ b/src/datadogV2/api/api_users.rs @@ -197,12 +197,13 @@ 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.get_operation_host("v2.create_user") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -214,11 +215,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -272,12 +273,13 @@ 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.get_operation_host("v2.disable_user"), + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = @@ -290,11 +292,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -344,12 +346,13 @@ 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.get_operation_host("v2.get_invitation"), + local_configuration.get_operation_host(operation_id), user_invitation_uuid = urlencode(user_invitation_uuid) ); let mut local_req_builder = @@ -362,11 +365,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -412,12 +415,13 @@ 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.get_operation_host("v2.get_user"), + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = @@ -430,11 +434,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -485,12 +489,13 @@ 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.get_operation_host("v2.list_user_organizations"), + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = @@ -503,11 +508,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -559,12 +564,13 @@ 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.get_operation_host("v2.list_user_permissions"), + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = @@ -577,11 +583,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -630,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; @@ -643,7 +650,7 @@ impl UsersAPI { let local_uri_str = format!( "{}/api/v2/users", - local_configuration.get_operation_host("v2.list_users") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -680,11 +687,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; let local_req = local_req_builder.build()?; @@ -733,12 +740,13 @@ 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.get_operation_host("v2.send_invitations") + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::POST, local_uri_str.as_str()); @@ -750,11 +758,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters @@ -812,12 +820,13 @@ 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.get_operation_host("v2.update_user"), + local_configuration.get_operation_host(operation_id), user_id = urlencode(user_id) ); let mut local_req_builder = @@ -830,11 +839,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_apikey) = local_configuration.api_key_auth { - local_req_builder = local_req_builder.header("DD-API-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.api_key { + local_req_builder = local_req_builder.header("DD-API-KEY", local_key); }; - if let Some(ref local_apikey) = local_configuration.app_key_auth { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_apikey); + if let Some(ref local_key) = local_configuration.app_key { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); }; // build body parameters diff --git a/tests/scenarios/fixtures.rs b/tests/scenarios/fixtures.rs index 4ffd6f702..7c435c841 100644 --- a/tests/scenarios/fixtures.rs +++ b/tests/scenarios/fixtures.rs @@ -162,8 +162,8 @@ pub async fn before_scenario( .server_variables .insert("site".into(), "datadoghq.com".into()); - world.config.api_key_auth = Some("00000000000000000000000000000000".to_string()); - world.config.app_key_auth = Some("0000000000000000000000000000000000000000".to_string()); + world.config.api_key = Some("00000000000000000000000000000000".to_string()); + world.config.app_key = Some("0000000000000000000000000000000000000000".to_string()); let escaped_name = NON_ALNUM_RE .replace_all(scenario.name.as_str(), "_") @@ -219,16 +219,16 @@ 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.api_key = env::var("DD_TEST_CLIENT_API_KEY").ok(); 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.app_key = env::var("DD_TEST_CLIENT_APP_KEY").ok(); if let Some(api) = world.api_name.as_ref() { initialize_api_instance(world, api.to_string()); } From 832bd88b2021f46781b8d1bc3948115e11dc52cf Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Thu, 15 Feb 2024 16:35:19 -0500 Subject: [PATCH 4/7] shorten format strings --- .generator/src/generator/templates/api.j2 | 4 +- .../src/generator/templates/configuration.j2 | 7 +- .../generator/templates/function_mappings.j2 | 2 +- src/datadog/configuration.rs | 7 +- src/datadogV1/api/api_slack_integration.rs | 6 +- src/datadogV2/api/api_dora_metrics.rs | 4 +- src/datadogV2/api/api_incident_services.rs | 10 +- src/datadogV2/api/api_incident_teams.rs | 10 +- src/datadogV2/api/api_incidents.rs | 42 +- src/datadogV2/api/api_metrics.rs | 4 +- src/datadogV2/api/api_security_monitoring.rs | 6 +- src/datadogV2/api/api_service_scorecards.rs | 10 +- src/datadogV2/api/api_usage_metering.rs | 4 +- tests/scenarios/function_mappings.rs | 1050 ++++++++--------- 14 files changed, 580 insertions(+), 586 deletions(-) diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index f2a2085b3..addae0422 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -113,7 +113,7 @@ impl {{ structName }} { let operation_id = "{{ version }}.{{ operation.operationId | snake_case }}"; {%- if "x-unstable" in operation %} if local_configuration.is_unstable_operation_enabled(operation_id) { - warn!("Using unstable operation {}", 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(), @@ -132,7 +132,7 @@ impl {{ structName }} { let local_client = &local_configuration.client; let local_uri_str = format!( - "{}{{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" %} diff --git a/.generator/src/generator/templates/configuration.j2 b/.generator/src/generator/templates/configuration.j2 index ffebd6f00..36645d7f2 100644 --- a/.generator/src/generator/templates/configuration.j2 +++ b/.generator/src/generator/templates/configuration.j2 @@ -24,12 +24,9 @@ impl ServerConfiguration { 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 {} for variable {} is not in the enum values", - value, name - ); + panic!("Value {value} for variable {name} is not in the enum values"); } - url = url.replace(&format!("{{ '{{{}}}' }}", name), &value); + url = url.replace(&format!("{{ '{{{name}}}' }}"), &value); } url } 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/src/datadog/configuration.rs b/src/datadog/configuration.rs index 66b86febb..bc4b59ea2 100644 --- a/src/datadog/configuration.rs +++ b/src/datadog/configuration.rs @@ -26,12 +26,9 @@ impl ServerConfiguration { 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 {} for variable {} is not in the enum values", - value, name - ); + panic!("Value {value} for variable {name} is not in the enum values"); } - url = url.replace(&format!("{{{}}}", name), &value); + url = url.replace(&format!("{{{name}}}"), &value); } url } diff --git a/src/datadogV1/api/api_slack_integration.rs b/src/datadogV1/api/api_slack_integration.rs index cdfbb1c5e..1e3e24d04 100644 --- a/src/datadogV1/api/api_slack_integration.rs +++ b/src/datadogV1/api/api_slack_integration.rs @@ -201,7 +201,7 @@ impl SlackIntegrationAPI { let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_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= @@ -355,7 +355,7 @@ impl SlackIntegrationAPI { let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_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= @@ -437,7 +437,7 @@ impl SlackIntegrationAPI { let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v1/integration/slack/configuration/accounts/{account_name}/channels/{channel_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= diff --git a/src/datadogV2/api/api_dora_metrics.rs b/src/datadogV2/api/api_dora_metrics.rs index 9f0537f8f..e3354d05a 100644 --- a/src/datadogV2/api/api_dora_metrics.rs +++ b/src/datadogV2/api/api_dora_metrics.rs @@ -82,7 +82,7 @@ impl DORAMetricsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_dora_deployment' is not enabled".to_string(), @@ -174,7 +174,7 @@ impl DORAMetricsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_dora_incident' is not enabled".to_string(), diff --git a/src/datadogV2/api/api_incident_services.rs b/src/datadogV2/api/api_incident_services.rs index 25cd7234c..54f9e63f2 100644 --- a/src/datadogV2/api/api_incident_services.rs +++ b/src/datadogV2/api/api_incident_services.rs @@ -165,7 +165,7 @@ impl IncidentServicesAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_service' is not enabled".to_string(), @@ -251,7 +251,7 @@ impl IncidentServicesAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_service' is not enabled".to_string(), @@ -339,7 +339,7 @@ impl IncidentServicesAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_service' is not enabled".to_string(), @@ -430,7 +430,7 @@ impl IncidentServicesAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_services' is not enabled".to_string(), @@ -540,7 +540,7 @@ impl IncidentServicesAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_service' is not enabled".to_string(), diff --git a/src/datadogV2/api/api_incident_teams.rs b/src/datadogV2/api/api_incident_teams.rs index cb19fd316..46a4201e0 100644 --- a/src/datadogV2/api/api_incident_teams.rs +++ b/src/datadogV2/api/api_incident_teams.rs @@ -163,7 +163,7 @@ impl IncidentTeamsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_team' is not enabled".to_string(), @@ -246,7 +246,7 @@ impl IncidentTeamsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_team' is not enabled".to_string(), @@ -329,7 +329,7 @@ impl IncidentTeamsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_team' is not enabled".to_string(), @@ -418,7 +418,7 @@ impl IncidentTeamsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_teams' is not enabled".to_string(), @@ -526,7 +526,7 @@ impl IncidentTeamsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_team' is not enabled".to_string(), diff --git a/src/datadogV2/api/api_incidents.rs b/src/datadogV2/api/api_incidents.rs index fd7833f56..20f46653d 100644 --- a/src/datadogV2/api/api_incidents.rs +++ b/src/datadogV2/api/api_incidents.rs @@ -422,7 +422,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident' is not enabled".to_string(), @@ -516,7 +516,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_integration' is not enabled".to_string(), @@ -609,7 +609,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_incident_todo' is not enabled".to_string(), @@ -693,7 +693,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident' is not enabled".to_string(), @@ -773,7 +773,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_integration' is not enabled".to_string(), @@ -784,7 +784,7 @@ impl IncidentsAPI { let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_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= @@ -855,7 +855,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_incident_todo' is not enabled".to_string(), @@ -934,7 +934,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident' is not enabled".to_string(), @@ -1036,7 +1036,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_integration' is not enabled".to_string(), @@ -1047,7 +1047,7 @@ impl IncidentsAPI { let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_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= @@ -1124,7 +1124,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_incident_todo' is not enabled".to_string(), @@ -1213,7 +1213,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_attachments' is not enabled".to_string(), @@ -1326,7 +1326,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_integrations' is not enabled".to_string(), @@ -1410,7 +1410,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incident_todos' is not enabled".to_string(), @@ -1490,7 +1490,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_incidents' is not enabled".to_string(), @@ -1597,7 +1597,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.search_incidents' is not enabled".to_string(), @@ -1707,7 +1707,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident' is not enabled".to_string(), @@ -1819,7 +1819,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_attachments' is not enabled".to_string(), @@ -1931,7 +1931,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_integration' is not enabled".to_string(), @@ -1942,7 +1942,7 @@ impl IncidentsAPI { let local_client = &local_configuration.client; let local_uri_str = format!( - "{}/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_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= @@ -2028,7 +2028,7 @@ impl IncidentsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.update_incident_todo' is not enabled".to_string(), diff --git a/src/datadogV2/api/api_metrics.rs b/src/datadogV2/api/api_metrics.rs index ffc5d39e3..70ad868c7 100644 --- a/src/datadogV2/api/api_metrics.rs +++ b/src/datadogV2/api/api_metrics.rs @@ -1261,7 +1261,7 @@ impl MetricsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.query_scalar_data' is not enabled".to_string(), @@ -1352,7 +1352,7 @@ impl MetricsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.query_timeseries_data' is not enabled".to_string(), diff --git a/src/datadogV2/api/api_security_monitoring.rs b/src/datadogV2/api/api_security_monitoring.rs index 02f268956..2e86935b6 100644 --- a/src/datadogV2/api/api_security_monitoring.rs +++ b/src/datadogV2/api/api_security_monitoring.rs @@ -1028,7 +1028,7 @@ impl SecurityMonitoringAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_finding' is not enabled".to_string(), @@ -1416,7 +1416,7 @@ impl SecurityMonitoringAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_findings' is not enabled".to_string(), @@ -1839,7 +1839,7 @@ impl SecurityMonitoringAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.mute_findings' is not enabled".to_string(), diff --git a/src/datadogV2/api/api_service_scorecards.rs b/src/datadogV2/api/api_service_scorecards.rs index ea00c8aaf..bd11f09ff 100644 --- a/src/datadogV2/api/api_service_scorecards.rs +++ b/src/datadogV2/api/api_service_scorecards.rs @@ -264,7 +264,7 @@ impl ServiceScorecardsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_scorecard_outcomes_batch' is not enabled".to_string(), @@ -351,7 +351,7 @@ impl ServiceScorecardsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.create_scorecard_rule' is not enabled".to_string(), @@ -434,7 +434,7 @@ impl ServiceScorecardsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.delete_scorecard_rule' is not enabled".to_string(), @@ -513,7 +513,7 @@ impl ServiceScorecardsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_scorecard_outcomes' is not enabled".to_string(), @@ -648,7 +648,7 @@ impl ServiceScorecardsAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.list_scorecard_rules' is not enabled".to_string(), diff --git a/src/datadogV2/api/api_usage_metering.rs b/src/datadogV2/api/api_usage_metering.rs index e867af7b1..84393f42b 100644 --- a/src/datadogV2/api/api_usage_metering.rs +++ b/src/datadogV2/api/api_usage_metering.rs @@ -404,7 +404,7 @@ impl UsageMeteringAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_active_billing_dimensions' is not enabled".to_string(), @@ -938,7 +938,7 @@ impl UsageMeteringAPI { 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); + warn!("Using unstable operation {operation_id}"); } else { let local_error = UnstableOperationDisabledError { msg: "Operation 'v2.get_monthly_cost_attribution' is not enabled".to_string(), diff --git a/tests/scenarios/function_mappings.rs b/tests/scenarios/function_mappings.rs index 0e8052f37..6e5f8bc4b 100644 --- a/tests/scenarios/function_mappings.rs +++ b/tests/scenarios/function_mappings.rs @@ -2400,7 +2400,7 @@ fn test_v1_get_ip_ranges(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2424,7 +2424,7 @@ fn test_v1_list_api_keys(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2449,7 +2449,7 @@ fn test_v1_create_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2474,7 +2474,7 @@ fn test_v1_delete_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2499,7 +2499,7 @@ fn test_v1_get_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2525,7 +2525,7 @@ fn test_v1_update_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2549,7 +2549,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}"), }; } }; @@ -2574,7 +2574,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}"), }; } }; @@ -2599,7 +2599,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}"), }; } }; @@ -2624,7 +2624,7 @@ fn test_v1_get_application_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -2650,7 +2650,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}"), }; } }; @@ -2675,7 +2675,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}"), }; } }; @@ -2720,7 +2720,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}"), }; } }; @@ -2749,7 +2749,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}"), }; } }; @@ -2794,7 +2794,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}"), }; } }; @@ -2823,7 +2823,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}"), }; } }; @@ -2854,7 +2854,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}"), }; } }; @@ -2908,7 +2908,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}"), }; } }; @@ -2938,7 +2938,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}"), }; } }; @@ -2968,7 +2968,7 @@ fn test_v1_get_usage_lambda(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3001,7 +3001,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}"), }; } }; @@ -3031,7 +3031,7 @@ fn test_v1_get_usage_ci_app(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3066,7 +3066,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}"), }; } }; @@ -3096,7 +3096,7 @@ fn test_v1_get_usage_cws(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3126,7 +3126,7 @@ fn test_v1_get_usage_dbm(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3156,7 +3156,7 @@ fn test_v1_get_usage_fargate(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3186,7 +3186,7 @@ fn test_v1_get_usage_hosts(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3236,7 +3236,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}"), }; } }; @@ -3267,7 +3267,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}"), }; } }; @@ -3298,7 +3298,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}"), }; } }; @@ -3328,7 +3328,7 @@ fn test_v1_get_ingested_spans(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3363,7 +3363,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}"), }; } }; @@ -3393,7 +3393,7 @@ fn test_v1_get_usage_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3428,7 +3428,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}"), }; } }; @@ -3463,7 +3463,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}"), }; } }; @@ -3523,7 +3523,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}"), }; } }; @@ -3554,7 +3554,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}"), }; } }; @@ -3585,7 +3585,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}"), }; } }; @@ -3619,7 +3619,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}"), }; } }; @@ -3649,7 +3649,7 @@ fn test_v1_get_usage_profiling(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3679,7 +3679,7 @@ fn test_v1_get_usage_rum_units(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3714,7 +3714,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}"), }; } }; @@ -3744,7 +3744,7 @@ fn test_v1_get_usage_sds(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3774,7 +3774,7 @@ fn test_v1_get_usage_snmp(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3809,7 +3809,7 @@ fn test_v1_get_usage_summary(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -3840,7 +3840,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}"), }; } }; @@ -3874,7 +3874,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}"), }; } }; @@ -3909,7 +3909,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}"), }; } }; @@ -3940,7 +3940,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}"), }; } }; @@ -3989,7 +3989,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}"), }; } }; @@ -4014,7 +4014,7 @@ fn test_v1_delete_dashboards(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4055,7 +4055,7 @@ fn test_v1_list_dashboards(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4080,7 +4080,7 @@ fn test_v1_restore_dashboards(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4105,7 +4105,7 @@ fn test_v1_create_dashboard(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4130,7 +4130,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}"), }; } }; @@ -4155,7 +4155,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}"), }; } }; @@ -4180,7 +4180,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}"), }; } }; @@ -4206,7 +4206,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}"), }; } }; @@ -4236,7 +4236,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}"), }; } }; @@ -4275,7 +4275,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}"), }; } }; @@ -4305,7 +4305,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}"), }; } }; @@ -4331,7 +4331,7 @@ fn test_v1_delete_dashboard(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4357,7 +4357,7 @@ fn test_v1_get_dashboard(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4384,7 +4384,7 @@ fn test_v1_update_dashboard(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4408,7 +4408,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}"), }; } }; @@ -4433,7 +4433,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}"), }; } }; @@ -4458,7 +4458,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}"), }; } }; @@ -4483,7 +4483,7 @@ fn test_v1_get_dashboard_list(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4509,7 +4509,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}"), }; } }; @@ -4542,7 +4542,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}"), }; } }; @@ -4576,7 +4576,7 @@ fn test_v1_list_active_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4602,7 +4602,7 @@ fn test_v1_get_metric_metadata(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4629,7 +4629,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}"), }; } }; @@ -4656,7 +4656,7 @@ fn test_v1_query_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4681,7 +4681,7 @@ fn test_v1_list_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4711,7 +4711,7 @@ fn test_v1_submit_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4744,7 +4744,7 @@ fn test_v1_list_downtimes(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4769,7 +4769,7 @@ fn test_v1_create_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4797,7 +4797,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}"), }; } }; @@ -4823,7 +4823,7 @@ fn test_v1_cancel_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4849,7 +4849,7 @@ fn test_v1_get_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4876,7 +4876,7 @@ fn test_v1_update_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4902,7 +4902,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}"), }; } }; @@ -4953,7 +4953,7 @@ fn test_v1_list_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -4978,7 +4978,7 @@ fn test_v1_create_event(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5003,7 +5003,7 @@ fn test_v1_get_event(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5054,7 +5054,7 @@ fn test_v1_get_graph_snapshot(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5080,7 +5080,7 @@ fn test_v1_mute_host(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5105,7 +5105,7 @@ fn test_v1_unmute_host(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5162,7 +5162,7 @@ fn test_v1_list_hosts(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5191,7 +5191,7 @@ fn test_v1_get_host_totals(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5216,7 +5216,7 @@ fn test_v1_delete_aws_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5253,7 +5253,7 @@ fn test_v1_list_aws_accounts(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5278,7 +5278,7 @@ fn test_v1_create_aws_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5316,7 +5316,7 @@ fn test_v1_update_aws_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -5343,7 +5343,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}"), }; } }; @@ -5371,7 +5371,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}"), }; } }; @@ -5398,7 +5398,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}"), }; } }; @@ -5426,7 +5426,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}"), }; } }; @@ -5451,7 +5451,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}"), }; } }; @@ -5477,7 +5477,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}"), }; } }; @@ -5502,7 +5502,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}"), }; } }; @@ -5530,7 +5530,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}"), }; } }; @@ -5555,7 +5555,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}"), }; } }; @@ -5582,7 +5582,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}"), }; } }; @@ -5607,7 +5607,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}"), }; } }; @@ -5635,7 +5635,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}"), }; } }; @@ -5659,7 +5659,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}"), }; } }; @@ -5684,7 +5684,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}"), }; } }; @@ -5712,7 +5712,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}"), }; } }; @@ -5740,7 +5740,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}"), }; } }; @@ -5764,7 +5764,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}"), }; } }; @@ -5792,7 +5792,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}"), }; } }; @@ -5820,7 +5820,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}"), }; } }; @@ -5848,7 +5848,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}"), }; } }; @@ -5873,7 +5873,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}"), }; } }; @@ -5897,7 +5897,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}"), }; } }; @@ -5922,7 +5922,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}"), }; } }; @@ -5947,7 +5947,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}"), }; } }; @@ -5975,7 +5975,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}"), }; } }; @@ -6005,7 +6005,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}"), }; } }; @@ -6035,7 +6035,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}"), }; } }; @@ -6067,7 +6067,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}"), }; } }; @@ -6096,7 +6096,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}"), }; } }; @@ -6127,7 +6127,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}"), }; } }; @@ -6160,7 +6160,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}"), }; } }; @@ -6193,7 +6193,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}"), }; } }; @@ -6229,7 +6229,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}"), }; } }; @@ -6258,7 +6258,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}"), }; } }; @@ -6289,7 +6289,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}"), }; } }; @@ -6320,7 +6320,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}"), }; } }; @@ -6352,7 +6352,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}"), }; } }; @@ -6380,7 +6380,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}"), }; } }; @@ -6409,7 +6409,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}"), }; } }; @@ -6438,7 +6438,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}"), }; } }; @@ -6469,7 +6469,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}"), }; } }; @@ -6494,7 +6494,7 @@ fn test_v1_list_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6528,7 +6528,7 @@ fn test_v1_submit_log(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6552,7 +6552,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}"), }; } }; @@ -6577,7 +6577,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}"), }; } }; @@ -6601,7 +6601,7 @@ fn test_v1_list_log_indexes(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6626,7 +6626,7 @@ fn test_v1_create_logs_index(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6651,7 +6651,7 @@ fn test_v1_get_logs_index(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6677,7 +6677,7 @@ fn test_v1_update_logs_index(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6701,7 +6701,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}"), }; } }; @@ -6729,7 +6729,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}"), }; } }; @@ -6753,7 +6753,7 @@ fn test_v1_list_logs_pipelines(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6778,7 +6778,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}"), }; } }; @@ -6804,7 +6804,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}"), }; } }; @@ -6830,7 +6830,7 @@ fn test_v1_get_logs_pipeline(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6857,7 +6857,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}"), }; } }; @@ -6914,7 +6914,7 @@ fn test_v1_list_monitors(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6939,7 +6939,7 @@ fn test_v1_create_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -6968,7 +6968,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}"), }; } }; @@ -7009,7 +7009,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}"), }; } }; @@ -7050,7 +7050,7 @@ fn test_v1_search_monitors(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7075,7 +7075,7 @@ fn test_v1_validate_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7106,7 +7106,7 @@ fn test_v1_delete_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7141,7 +7141,7 @@ fn test_v1_get_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7168,7 +7168,7 @@ fn test_v1_update_monitor(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7198,7 +7198,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}"), }; } }; @@ -7263,7 +7263,7 @@ fn test_v1_list_notebooks(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7288,7 +7288,7 @@ fn test_v1_create_notebook(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7314,7 +7314,7 @@ fn test_v1_delete_notebook(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7340,7 +7340,7 @@ fn test_v1_get_notebook(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7367,7 +7367,7 @@ fn test_v1_update_notebook(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7391,7 +7391,7 @@ fn test_v1_list_orgs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7416,7 +7416,7 @@ fn test_v1_create_child_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7441,7 +7441,7 @@ fn test_v1_get_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7467,7 +7467,7 @@ fn test_v1_update_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7492,7 +7492,7 @@ fn test_v1_downgrade_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7524,7 +7524,7 @@ fn test_v1_upload_id_p_for_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7555,7 +7555,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}"), }; } }; @@ -7586,7 +7586,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}"), }; } }; @@ -7616,7 +7616,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}"), }; } }; @@ -7666,7 +7666,7 @@ fn test_v1_list_sl_os(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7691,7 +7691,7 @@ fn test_v1_create_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7719,7 +7719,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}"), }; } }; @@ -7744,7 +7744,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}"), }; } }; @@ -7786,7 +7786,7 @@ fn test_v1_search_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7817,7 +7817,7 @@ fn test_v1_delete_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7847,7 +7847,7 @@ fn test_v1_get_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7873,7 +7873,7 @@ fn test_v1_update_slo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7898,7 +7898,7 @@ fn test_v1_get_slo_corrections(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7936,7 +7936,7 @@ fn test_v1_get_slo_history(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7969,7 +7969,7 @@ fn test_v1_list_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -7994,7 +7994,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}"), }; } }; @@ -8020,7 +8020,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}"), }; } }; @@ -8046,7 +8046,7 @@ fn test_v1_get_slo_correction(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8074,7 +8074,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}"), }; } }; @@ -8099,7 +8099,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}"), }; } }; @@ -8123,7 +8123,7 @@ fn test_v1_list_locations(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8148,7 +8148,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}"), }; } }; @@ -8174,7 +8174,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}"), }; } }; @@ -8200,7 +8200,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}"), }; } }; @@ -8227,7 +8227,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}"), }; } }; @@ -8254,7 +8254,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}"), }; } }; @@ -8287,7 +8287,7 @@ fn test_v1_list_tests(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8315,7 +8315,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}"), }; } }; @@ -8340,7 +8340,7 @@ fn test_v1_get_api_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8366,7 +8366,7 @@ fn test_v1_update_api_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8394,7 +8394,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}"), }; } }; @@ -8419,7 +8419,7 @@ fn test_v1_get_browser_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8445,7 +8445,7 @@ fn test_v1_update_browser_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8488,7 +8488,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}"), }; } }; @@ -8515,7 +8515,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}"), }; } }; @@ -8540,7 +8540,7 @@ fn test_v1_delete_tests(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8565,7 +8565,7 @@ fn test_v1_trigger_tests(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8590,7 +8590,7 @@ fn test_v1_trigger_ci_tests(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8615,7 +8615,7 @@ fn test_v1_get_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8641,7 +8641,7 @@ fn test_v1_patch_test(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8684,7 +8684,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}"), }; } }; @@ -8710,7 +8710,7 @@ fn test_v1_get_api_test_result(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8739,7 +8739,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}"), }; } }; @@ -8763,7 +8763,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}"), }; } }; @@ -8788,7 +8788,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}"), }; } }; @@ -8814,7 +8814,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}"), }; } }; @@ -8840,7 +8840,7 @@ fn test_v1_get_global_variable(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8867,7 +8867,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}"), }; } }; @@ -8896,7 +8896,7 @@ fn test_v1_list_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8926,7 +8926,7 @@ fn test_v1_delete_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8956,7 +8956,7 @@ fn test_v1_get_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -8987,7 +8987,7 @@ fn test_v1_create_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9018,7 +9018,7 @@ fn test_v1_update_host_tags(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9042,7 +9042,7 @@ fn test_v1_list_users(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9067,7 +9067,7 @@ fn test_v1_create_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9093,7 +9093,7 @@ fn test_v1_disable_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9119,7 +9119,7 @@ fn test_v1_get_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9146,7 +9146,7 @@ fn test_v1_update_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9170,7 +9170,7 @@ fn test_v1_validate(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9239,7 +9239,7 @@ fn test_v2_list_api_keys(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9264,7 +9264,7 @@ fn test_v2_create_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9290,7 +9290,7 @@ fn test_v2_delete_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9321,7 +9321,7 @@ fn test_v2_get_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9348,7 +9348,7 @@ fn test_v2_update_api_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9402,7 +9402,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}"), }; } }; @@ -9428,7 +9428,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}"), }; } }; @@ -9459,7 +9459,7 @@ fn test_v2_get_application_key(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9486,7 +9486,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}"), }; } }; @@ -9543,7 +9543,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}"), }; } }; @@ -9571,7 +9571,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}"), }; } }; @@ -9601,7 +9601,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}"), }; } }; @@ -9630,7 +9630,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}"), }; } }; @@ -9661,7 +9661,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}"), }; } }; @@ -9685,7 +9685,7 @@ fn test_v2_list_spans_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9710,7 +9710,7 @@ fn test_v2_create_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9735,7 +9735,7 @@ fn test_v2_delete_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9760,7 +9760,7 @@ fn test_v2_get_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9786,7 +9786,7 @@ fn test_v2_update_spans_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -9813,7 +9813,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}"), }; } }; @@ -9841,7 +9841,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}"), }; } }; @@ -9869,7 +9869,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}"), }; } }; @@ -9897,7 +9897,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}"), }; } }; @@ -9925,7 +9925,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}"), }; } }; @@ -9954,7 +9954,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}"), }; } }; @@ -10003,7 +10003,7 @@ fn test_v2_list_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10032,7 +10032,7 @@ fn test_v2_search_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10074,7 +10074,7 @@ fn test_v2_list_auth_n_mappings(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10099,7 +10099,7 @@ fn test_v2_create_auth_n_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}"), }; } }; @@ -10125,7 +10125,7 @@ fn test_v2_delete_auth_n_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}"), }; } }; @@ -10151,7 +10151,7 @@ fn test_v2_get_auth_n_mapping(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10179,7 +10179,7 @@ fn test_v2_update_auth_n_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}"), }; } }; @@ -10207,7 +10207,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}"), }; } }; @@ -10235,7 +10235,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}"), }; } }; @@ -10289,7 +10289,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}"), }; } }; @@ -10321,7 +10321,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}"), }; } }; @@ -10349,7 +10349,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}"), }; } }; @@ -10399,7 +10399,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}"), }; } }; @@ -10432,7 +10432,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}"), }; } }; @@ -10478,7 +10478,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}"), }; } }; @@ -10523,7 +10523,7 @@ fn test_v2_list_containers(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -10550,7 +10550,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}"), }; } }; @@ -10578,7 +10578,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}"), }; } }; @@ -10607,7 +10607,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}"), }; } }; @@ -10638,7 +10638,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}"), }; } }; @@ -10674,7 +10674,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}"), }; } }; @@ -10701,7 +10701,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}"), }; } }; @@ -10729,7 +10729,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}"), }; } }; @@ -10759,7 +10759,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}"), }; } }; @@ -10790,7 +10790,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}"), }; } }; @@ -10814,7 +10814,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}"), }; } }; @@ -10841,7 +10841,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}"), }; } }; @@ -10899,7 +10899,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}"), }; } }; @@ -10934,7 +10934,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}"), }; } }; @@ -10965,7 +10965,7 @@ fn test_v2_get_cost_by_org(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11014,7 +11014,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}"), }; } }; @@ -11054,7 +11054,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}"), }; } }; @@ -11113,7 +11113,7 @@ fn test_v2_get_hourly_usage(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11149,7 +11149,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}"), }; } }; @@ -11184,7 +11184,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}"), }; } }; @@ -11213,7 +11213,7 @@ fn test_v2_get_projected_cost(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11244,7 +11244,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}"), }; } }; @@ -11273,7 +11273,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}"), }; } }; @@ -11304,7 +11304,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}"), }; } }; @@ -11335,7 +11335,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}"), }; } }; @@ -11360,7 +11360,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}"), }; } }; @@ -11385,7 +11385,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}"), }; } }; @@ -11426,7 +11426,7 @@ fn test_v2_list_downtimes(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11451,7 +11451,7 @@ fn test_v2_create_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11477,7 +11477,7 @@ fn test_v2_cancel_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11508,7 +11508,7 @@ fn test_v2_get_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11535,7 +11535,7 @@ fn test_v2_update_downtime(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11570,7 +11570,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}"), }; } }; @@ -11619,7 +11619,7 @@ fn test_v2_list_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11648,7 +11648,7 @@ fn test_v2_search_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11685,7 +11685,7 @@ fn test_v2_list_incidents(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11710,7 +11710,7 @@ fn test_v2_create_incident(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11752,7 +11752,7 @@ fn test_v2_search_incidents(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11778,7 +11778,7 @@ fn test_v2_delete_incident(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11809,7 +11809,7 @@ fn test_v2_get_incident(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11841,7 +11841,7 @@ fn test_v2_update_incident(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -11881,7 +11881,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}"), }; } }; @@ -11918,7 +11918,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}"), }; } }; @@ -11947,7 +11947,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}"), }; } }; @@ -11978,7 +11978,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}"), }; } }; @@ -12012,7 +12012,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}"), }; } }; @@ -12046,7 +12046,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}"), }; } }; @@ -12083,7 +12083,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}"), }; } }; @@ -12109,7 +12109,7 @@ fn test_v2_list_incident_todos(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12136,7 +12136,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}"), }; } }; @@ -12163,7 +12163,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}"), }; } }; @@ -12190,7 +12190,7 @@ fn test_v2_get_incident_todo(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12219,7 +12219,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}"), }; } }; @@ -12243,7 +12243,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}"), }; } }; @@ -12268,7 +12268,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}"), }; } }; @@ -12294,7 +12294,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}"), }; } }; @@ -12321,7 +12321,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}"), }; } }; @@ -12345,7 +12345,7 @@ fn test_v2_get_gcpsts_delegate(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -12375,7 +12375,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}"), }; } }; @@ -12399,7 +12399,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}"), }; } }; @@ -12424,7 +12424,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}"), }; } }; @@ -12451,7 +12451,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}"), }; } }; @@ -12477,7 +12477,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}"), }; } }; @@ -12505,7 +12505,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}"), }; } }; @@ -12532,7 +12532,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}"), }; } }; @@ -12560,7 +12560,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}"), }; } }; @@ -12589,7 +12589,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}"), }; } }; @@ -12615,7 +12615,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}"), }; } }; @@ -12645,7 +12645,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}"), }; } }; @@ -12669,7 +12669,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}"), }; } }; @@ -12697,7 +12697,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}"), }; } }; @@ -12726,7 +12726,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}"), }; } }; @@ -12752,7 +12752,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}"), }; } }; @@ -12782,7 +12782,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}"), }; } }; @@ -12808,7 +12808,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}"), }; } }; @@ -12838,7 +12838,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}"), }; } }; @@ -12870,7 +12870,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}"), }; } }; @@ -12899,7 +12899,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}"), }; } }; @@ -12933,7 +12933,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}"), }; } }; @@ -12957,7 +12957,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}"), }; } }; @@ -12982,7 +12982,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}"), }; } }; @@ -13008,7 +13008,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}"), }; } }; @@ -13034,7 +13034,7 @@ fn test_v2_get_fastly_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13061,7 +13061,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}"), }; } }; @@ -13087,7 +13087,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}"), }; } }; @@ -13114,7 +13114,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}"), }; } }; @@ -13143,7 +13143,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}"), }; } }; @@ -13171,7 +13171,7 @@ fn test_v2_get_fastly_service(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13201,7 +13201,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}"), }; } }; @@ -13225,7 +13225,7 @@ fn test_v2_list_okta_accounts(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13250,7 +13250,7 @@ fn test_v2_create_okta_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13276,7 +13276,7 @@ fn test_v2_delete_okta_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13302,7 +13302,7 @@ fn test_v2_get_okta_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13329,7 +13329,7 @@ fn test_v2_update_okta_account(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13353,7 +13353,7 @@ fn test_v2_get_ip_allowlist(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13378,7 +13378,7 @@ fn test_v2_update_ip_allowlist(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13412,7 +13412,7 @@ fn test_v2_submit_log(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13437,7 +13437,7 @@ fn test_v2_aggregate_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13494,7 +13494,7 @@ fn test_v2_list_logs_get(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13523,7 +13523,7 @@ fn test_v2_list_logs(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13547,7 +13547,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}"), }; } }; @@ -13575,7 +13575,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}"), }; } }; @@ -13599,7 +13599,7 @@ fn test_v2_list_logs_archives(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13624,7 +13624,7 @@ fn test_v2_create_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13650,7 +13650,7 @@ fn test_v2_delete_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13676,7 +13676,7 @@ fn test_v2_get_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13703,7 +13703,7 @@ fn test_v2_update_logs_archive(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13733,7 +13733,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}"), }; } }; @@ -13759,7 +13759,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}"), }; } }; @@ -13789,7 +13789,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}"), }; } }; @@ -13813,7 +13813,7 @@ fn test_v2_list_logs_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13838,7 +13838,7 @@ fn test_v2_create_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13863,7 +13863,7 @@ fn test_v2_delete_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13888,7 +13888,7 @@ fn test_v2_get_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13914,7 +13914,7 @@ fn test_v2_update_logs_metric(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -13967,7 +13967,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}"), }; } }; @@ -13995,7 +13995,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}"), }; } }; @@ -14023,7 +14023,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}"), }; } }; @@ -14059,7 +14059,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}"), }; } }; @@ -14088,7 +14088,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}"), }; } }; @@ -14140,7 +14140,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}"), }; } }; @@ -14169,7 +14169,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}"), }; } }; @@ -14198,7 +14198,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}"), }; } }; @@ -14228,7 +14228,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}"), }; } }; @@ -14258,7 +14258,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}"), }; } }; @@ -14287,7 +14287,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}"), }; } }; @@ -14312,7 +14312,7 @@ fn test_v2_query_scalar_data(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14337,7 +14337,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}"), }; } }; @@ -14367,7 +14367,7 @@ fn test_v2_submit_metrics(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14394,7 +14394,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}"), }; } }; @@ -14422,7 +14422,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}"), }; } }; @@ -14450,7 +14450,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}"), }; } }; @@ -14478,7 +14478,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}"), }; } }; @@ -14508,7 +14508,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}"), }; } }; @@ -14532,7 +14532,7 @@ fn test_v2_list_permissions(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14577,7 +14577,7 @@ fn test_v2_list_roles(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14602,7 +14602,7 @@ fn test_v2_create_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14627,7 +14627,7 @@ fn test_v2_delete_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14652,7 +14652,7 @@ fn test_v2_get_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14678,7 +14678,7 @@ fn test_v2_update_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14704,7 +14704,7 @@ fn test_v2_clone_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14733,7 +14733,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}"), }; } }; @@ -14758,7 +14758,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}"), }; } }; @@ -14784,7 +14784,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}"), }; } }; @@ -14810,7 +14810,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}"), }; } }; @@ -14852,7 +14852,7 @@ fn test_v2_list_role_users(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14878,7 +14878,7 @@ fn test_v2_add_user_to_role(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14951,7 +14951,7 @@ fn test_v2_list_findings(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -14976,7 +14976,7 @@ fn test_v2_mute_findings(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15007,7 +15007,7 @@ fn test_v2_get_finding(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15031,7 +15031,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}"), }; } }; @@ -15056,7 +15056,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}"), }; } }; @@ -15082,7 +15082,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}"), }; } }; @@ -15108,7 +15108,7 @@ fn test_v2_get_security_filter(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15136,7 +15136,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}"), }; } }; @@ -15174,7 +15174,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}"), }; } }; @@ -15202,7 +15202,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}"), }; } }; @@ -15230,7 +15230,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}"), }; } }; @@ -15258,7 +15258,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}"), }; } }; @@ -15288,7 +15288,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}"), }; } }; @@ -15340,7 +15340,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}"), }; } }; @@ -15372,7 +15372,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}"), }; } }; @@ -15400,7 +15400,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}"), }; } }; @@ -15431,7 +15431,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}"), }; } }; @@ -15462,7 +15462,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}"), }; } }; @@ -15492,7 +15492,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}"), }; } }; @@ -15525,7 +15525,7 @@ fn test_v2_list_powerpacks(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15550,7 +15550,7 @@ fn test_v2_create_powerpack(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15576,7 +15576,7 @@ fn test_v2_delete_powerpack(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15602,7 +15602,7 @@ fn test_v2_get_powerpack(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15629,7 +15629,7 @@ fn test_v2_update_powerpack(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15678,7 +15678,7 @@ fn test_v2_list_processes(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15707,7 +15707,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}"), }; } }; @@ -15733,7 +15733,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}"), }; } }; @@ -15763,7 +15763,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}"), }; } }; @@ -15788,7 +15788,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}"), }; } }; @@ -15812,7 +15812,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}"), }; } }; @@ -15837,7 +15837,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}"), }; } }; @@ -15862,7 +15862,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}"), }; } }; @@ -15887,7 +15887,7 @@ fn test_v2_get_rum_application(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15913,7 +15913,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}"), }; } }; @@ -15962,7 +15962,7 @@ fn test_v2_list_rum_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -15987,7 +15987,7 @@ fn test_v2_search_rum_events(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16016,7 +16016,7 @@ fn test_v2_upload_id_p_metadata(world: &mut DatadogWorld, _parameters: &HashMap< world.response.object = serde_json::to_value(entity).unwrap(); } } - _ => panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -16082,7 +16082,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}"), }; } }; @@ -16110,7 +16110,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}"), }; } }; @@ -16176,7 +16176,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}"), }; } }; @@ -16201,7 +16201,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}"), }; } }; @@ -16226,7 +16226,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}"), }; } }; @@ -16253,7 +16253,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}"), }; } }; @@ -16280,7 +16280,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}"), }; } }; @@ -16309,7 +16309,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}"), }; } }; @@ -16340,7 +16340,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}"), }; } }; @@ -16370,7 +16370,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}"), }; } }; @@ -16402,7 +16402,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}"), }; } }; @@ -16426,7 +16426,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}"), }; } }; @@ -16451,7 +16451,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}"), }; } }; @@ -16476,7 +16476,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}"), }; } }; @@ -16502,7 +16502,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}"), }; } }; @@ -16528,7 +16528,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}"), }; } }; @@ -16553,7 +16553,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}"), }; } }; @@ -16579,7 +16579,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}"), }; } }; @@ -16605,7 +16605,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}"), }; } }; @@ -16629,7 +16629,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}"), }; } }; @@ -16654,7 +16654,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}"), }; } }; @@ -16710,7 +16710,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}"), }; } }; @@ -16742,7 +16742,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}"), }; } }; @@ -16775,7 +16775,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}"), }; } }; @@ -16808,7 +16808,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}"), }; } }; @@ -16844,7 +16844,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}"), }; } }; @@ -16886,7 +16886,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}"), }; } }; @@ -16911,7 +16911,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}"), }; } }; @@ -16937,7 +16937,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}"), }; } }; @@ -16969,7 +16969,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}"), }; } }; @@ -16996,7 +16996,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}"), }; } }; @@ -17037,7 +17037,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}"), }; } }; @@ -17065,7 +17065,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}"), }; } }; @@ -17094,7 +17094,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}"), }; } }; @@ -17126,7 +17126,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}"), }; } }; @@ -17151,7 +17151,7 @@ fn test_v2_aggregate_spans(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17200,7 +17200,7 @@ fn test_v2_list_spans_get(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17225,7 +17225,7 @@ fn test_v2_list_spans(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17252,7 +17252,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}"), }; } }; @@ -17280,7 +17280,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}"), }; } }; @@ -17333,7 +17333,7 @@ fn test_v2_list_teams(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17358,7 +17358,7 @@ fn test_v2_create_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17383,7 +17383,7 @@ fn test_v2_delete_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17408,7 +17408,7 @@ fn test_v2_get_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17434,7 +17434,7 @@ fn test_v2_update_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17459,7 +17459,7 @@ fn test_v2_get_team_links(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17485,7 +17485,7 @@ fn test_v2_create_team_link(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17511,7 +17511,7 @@ fn test_v2_delete_team_link(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17537,7 +17537,7 @@ fn test_v2_get_team_link(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17564,7 +17564,7 @@ fn test_v2_update_team_link(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17606,7 +17606,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}"), }; } }; @@ -17632,7 +17632,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}"), }; } }; @@ -17658,7 +17658,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}"), }; } }; @@ -17686,7 +17686,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}"), }; } }; @@ -17714,7 +17714,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}"), }; } }; @@ -17745,7 +17745,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}"), }; } }; @@ -17770,7 +17770,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}"), }; } }; @@ -17811,7 +17811,7 @@ fn test_v2_list_incident_teams(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17836,7 +17836,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}"), }; } }; @@ -17861,7 +17861,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}"), }; } }; @@ -17891,7 +17891,7 @@ fn test_v2_get_incident_team(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17917,7 +17917,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}"), }; } }; @@ -17942,7 +17942,7 @@ fn test_v2_send_invitations(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -17968,7 +17968,7 @@ fn test_v2_get_invitation(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18017,7 +18017,7 @@ fn test_v2_list_users(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18042,7 +18042,7 @@ fn test_v2_create_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18067,7 +18067,7 @@ fn test_v2_disable_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18092,7 +18092,7 @@ fn test_v2_get_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18118,7 +18118,7 @@ fn test_v2_update_user(world: &mut DatadogWorld, _parameters: &HashMap panic!("error parsing response: {}", error), + _ => panic!("error parsing response: {error}"), }; } }; @@ -18143,7 +18143,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}"), }; } }; @@ -18168,7 +18168,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}"), }; } }; From 1576bb359ccf9a0ef375db385e4765a2e6ccf0df Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Tue, 20 Feb 2024 15:14:14 -0500 Subject: [PATCH 5/7] remove redundant site var --- tests/scenarios/fixtures.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/scenarios/fixtures.rs b/tests/scenarios/fixtures.rs index 7c435c841..f88e5510a 100644 --- a/tests/scenarios/fixtures.rs +++ b/tests/scenarios/fixtures.rs @@ -157,11 +157,6 @@ pub async fn before_scenario( } }; world.config.client(client); - world - .config - .server_variables - .insert("site".into(), "datadoghq.com".into()); - world.config.api_key = Some("00000000000000000000000000000000".to_string()); world.config.app_key = Some("0000000000000000000000000000000000000000".to_string()); From 77ef707f69af7ab1db4e58d76c27c15b5d62d853 Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Fri, 23 Feb 2024 13:49:27 -0500 Subject: [PATCH 6/7] redesign auth key object setting --- .generator/src/generator/templates/api.j2 | 4 +- .../src/generator/templates/configuration.j2 | 133 ++++---- src/datadog/configuration.rs | 163 +++++----- src/datadogV1/api/api_authentication.rs | 4 +- src/datadogV1/api/api_aws_integration.rs | 96 +++--- src/datadogV1/api/api_aws_logs_integration.rs | 56 ++-- src/datadogV1/api/api_azure_integration.rs | 40 +-- src/datadogV1/api/api_dashboard_lists.rs | 40 +-- src/datadogV1/api/api_dashboards.rs | 112 +++---- src/datadogV1/api/api_downtimes.rs | 56 ++-- src/datadogV1/api/api_events.rs | 20 +- src/datadogV1/api/api_gcp_integration.rs | 32 +- src/datadogV1/api/api_hosts.rs | 32 +- src/datadogV1/api/api_key_management.rs | 80 ++--- src/datadogV1/api/api_logs.rs | 12 +- src/datadogV1/api/api_logs_indexes.rs | 48 +-- src/datadogV1/api/api_logs_pipelines.rs | 56 ++-- src/datadogV1/api/api_metrics.rs | 48 +-- src/datadogV1/api/api_monitors.rs | 80 ++--- src/datadogV1/api/api_notebooks.rs | 40 +-- src/datadogV1/api/api_organizations.rs | 48 +-- .../api/api_pager_duty_integration.rs | 32 +- src/datadogV1/api/api_security_monitoring.rs | 24 +- src/datadogV1/api/api_service_checks.rs | 4 +- ...api_service_level_objective_corrections.rs | 40 +-- .../api/api_service_level_objectives.rs | 80 ++--- src/datadogV1/api/api_slack_integration.rs | 40 +-- src/datadogV1/api/api_snapshots.rs | 8 +- src/datadogV1/api/api_synthetics.rs | 232 ++++++------- src/datadogV1/api/api_tags.rs | 40 +-- src/datadogV1/api/api_usage_metering.rs | 304 +++++++++--------- src/datadogV1/api/api_users.rs | 40 +-- src/datadogV1/api/api_webhooks_integration.rs | 64 ++-- .../api/api_apm_retention_filters.rs | 48 +-- src/datadogV2/api/api_audit.rs | 16 +- src/datadogV2/api/api_auth_n_mappings.rs | 40 +-- .../api/api_ci_visibility_pipelines.rs | 28 +- src/datadogV2/api/api_ci_visibility_tests.rs | 24 +- .../api/api_cloud_cost_management.rs | 80 ++--- .../api/api_cloud_workload_security.rs | 48 +-- .../api/api_cloudflare_integration.rs | 40 +-- src/datadogV2/api/api_confluent_cloud.rs | 80 ++--- src/datadogV2/api/api_container_images.rs | 8 +- src/datadogV2/api/api_containers.rs | 8 +- src/datadogV2/api/api_dashboard_lists.rs | 32 +- src/datadogV2/api/api_dora_metrics.rs | 8 +- src/datadogV2/api/api_downtimes.rs | 48 +-- src/datadogV2/api/api_events.rs | 16 +- src/datadogV2/api/api_fastly_integration.rs | 80 ++--- src/datadogV2/api/api_gcp_integration.rs | 48 +-- src/datadogV2/api/api_incident_services.rs | 40 +-- src/datadogV2/api/api_incident_teams.rs | 40 +-- src/datadogV2/api/api_incidents.rs | 144 ++++----- src/datadogV2/api/api_ip_allowlist.rs | 16 +- src/datadogV2/api/api_key_management.rs | 112 +++---- src/datadogV2/api/api_logs.rs | 28 +- src/datadogV2/api/api_logs_archives.rs | 80 ++--- src/datadogV2/api/api_logs_metrics.rs | 40 +-- src/datadogV2/api/api_metrics.rs | 108 +++---- src/datadogV2/api/api_monitors.rs | 40 +-- src/datadogV2/api/api_okta_integration.rs | 40 +-- src/datadogV2/api/api_opsgenie_integration.rs | 40 +-- src/datadogV2/api/api_organizations.rs | 8 +- src/datadogV2/api/api_powerpack.rs | 40 +-- src/datadogV2/api/api_processes.rs | 8 +- src/datadogV2/api/api_restriction_policies.rs | 24 +- src/datadogV2/api/api_roles.rs | 104 +++--- src/datadogV2/api/api_rum.rs | 64 ++-- src/datadogV2/api/api_security_monitoring.rs | 152 ++++----- .../api/api_sensitive_data_scanner.rs | 72 ++--- src/datadogV2/api/api_service_accounts.rs | 48 +-- src/datadogV2/api/api_service_definition.rs | 32 +- src/datadogV2/api/api_service_scorecards.rs | 40 +-- src/datadogV2/api/api_spans.rs | 24 +- src/datadogV2/api/api_spans_metrics.rs | 40 +-- src/datadogV2/api/api_synthetics.rs | 16 +- src/datadogV2/api/api_teams.rs | 136 ++++---- src/datadogV2/api/api_usage_metering.rs | 80 ++--- src/datadogV2/api/api_users.rs | 72 ++--- tests/main.rs | 23 +- tests/scenarios/fixtures.rs | 34 +- 81 files changed, 2261 insertions(+), 2244 deletions(-) diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index addae0422..012a76b02 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -180,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_key) = local_configuration.{{name|variable_name|replace("_auth", "")}} { - local_req_builder = local_req_builder.header("{{schema.name}}", local_key); + 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 36645d7f2..d21d20852 100644 --- a/.generator/src/generator/templates/configuration.j2 +++ b/.generator/src/generator/templates/configuration.j2 @@ -32,96 +32,34 @@ impl ServerConfiguration { } } +#[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 unstable_operations: HashMap, - {%- 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|replace("_auth", "")}}: Option, - {%- endif %} - {%- endfor %} - {%- endfor %} - {%- endif %} + 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() -> Self { Self::default() } - pub fn with_keys({% if openapi.security %}{% for authMethod in openapi.security %}{% for name in authMethod %}{% set schema = openapi.components.securitySchemes[name] %}{% if schema.type == "apiKey" and schema.in != "cookie" %}{{name|variable_name|replace("_auth", "")}}: Option{% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% endfor %}{% endif %}) -> 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() %} - {%- for _, _, operation in operations|sort(attribute="2.operationId") %} - {%- if "x-unstable" in operation %} - ("{{ version }}.{{ operation.operationId | snake_case }}".to_owned(), false), - {%- endif %} - {%- endfor %} - {%- endfor %} - {%- endfor %} - ]); - - Self { - user_agent, - client: http_client.build(), - unstable_operations, - {%- 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|replace("_auth", "")}}, - {%- endif %} - {%- endfor %} - {%- endfor %} - {%- endif %} - server_index: 0, - server_variables: HashMap::new(), - server_operation_index: HashMap::new(), - server_operation_variables: HashMap::new(), - } - - } - pub fn client(&mut self, client: reqwest_middleware::ClientWithMiddleware) { self.client = client; } - {%- if openapi.security %} - {%- for authMethod in openapi.security %} - {%- for name in authMethod %} - {%- set schema = openapi.components.securitySchemes[name] %} - {% if schema.type == "apiKey" and schema.in != "cookie" %} - pub fn {{name|variable_name|replace("_auth", "")}}(&mut self, key: String) { - self.{{name|variable_name|replace("_auth", "")}} = Some(key); - } - {%- endif %} - {%- endfor %} - {%- endfor %} - {%- endif %} - pub fn get_operation_host(&self, operation_str: &str) -> String { let operation = operation_str.to_string(); if let Some(servers) = OPERATION_SERVERS.get(&operation) { @@ -172,11 +110,62 @@ 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 { - Self::with_keys({% if openapi.security %}{% for authMethod in openapi.security %}{% for name in authMethod %}{% set schema = openapi.components.securitySchemes[name] %}{% if schema.type == "apiKey" and schema.in != "cookie" %}env::var("{{ schema.get("x-env-name") }}").ok(){% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% endfor %}{% endif %}) + 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() %} + {%- for _, _, operation in operations|sort(attribute="2.operationId") %} + {%- if "x-unstable" in operation %} + ("{{ version }}.{{ operation.operationId | snake_case }}".to_owned(), false), + {%- endif %} + {%- endfor %} + {%- 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 %} + + Self { + user_agent, + client: http_client.build(), + unstable_operations, + auth_keys, + server_index: 0, + server_variables: HashMap::new(), + server_operation_index: HashMap::new(), + server_operation_variables: HashMap::new(), + } } } diff --git a/src/datadog/configuration.rs b/src/datadog/configuration.rs index bc4b59ea2..a01e3c3c2 100644 --- a/src/datadog/configuration.rs +++ b/src/datadog/configuration.rs @@ -34,14 +34,19 @@ impl ServerConfiguration { } } +#[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 unstable_operations: HashMap, - pub api_key: Option, - pub app_key: Option, + pub(crate) unstable_operations: HashMap, + pub(crate) auth_keys: HashMap, pub server_index: usize, pub server_variables: HashMap, pub server_operation_index: HashMap, @@ -53,7 +58,69 @@ impl Configuration { Self::default() } - pub fn with_keys(api_key: Option, app_key: Option) -> Self { + 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 { + if self.unstable_operations.contains_key(operation) { + self.unstable_operations + .insert(operation.to_string(), enabled); + return true; + } + + warn!("Operation {operation} is not an unstable operation, can't enable/disable"); + false + } + + pub fn is_unstable_operation_enabled(&self, operation: &str) -> bool { + if self.unstable_operations.contains_key(operation) { + return self.unstable_operations.get(operation).unwrap().clone(); + } + + warn!("Operation {operation} is not an unstable operation, is always enabled"); + false + } + + pub fn is_unstable_operation(&self, operation: &str) -> bool { + if self.unstable_operations.contains_key(operation) { + return true; + } + + 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 {})", @@ -106,89 +173,33 @@ impl 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(), + }, + ); Self { user_agent, client: http_client.build(), unstable_operations, - api_key, - app_key, + auth_keys, server_index: 0, server_variables: HashMap::new(), server_operation_index: HashMap::new(), server_operation_variables: HashMap::new(), } } - - pub fn client(&mut self, client: reqwest_middleware::ClientWithMiddleware) { - self.client = client; - } - - pub fn api_key(&mut self, key: String) { - self.api_key = Some(key); - } - - pub fn app_key(&mut self, key: String) { - self.app_key = Some(key); - } - - 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 { - if self.unstable_operations.contains_key(operation) { - self.unstable_operations - .insert(operation.to_string(), enabled); - return true; - } - - warn!("Operation {operation} is not an unstable operation, can't enable/disable"); - false - } - - pub fn is_unstable_operation_enabled(&self, operation: &str) -> bool { - if self.unstable_operations.contains_key(operation) { - return self.unstable_operations.get(operation).unwrap().clone(); - } - - warn!("Operation {operation} is not an unstable operation, is always enabled"); - false - } - - pub fn is_unstable_operation(&self, operation: &str) -> bool { - if self.unstable_operations.contains_key(operation) { - return true; - } - - false - } -} - -impl Default for Configuration { - fn default() -> Self { - Self::with_keys(env::var("DD_API_KEY").ok(), env::var("DD_APP_KEY").ok()) - } } lazy_static! { diff --git a/src/datadogV1/api/api_authentication.rs b/src/datadogV1/api/api_authentication.rs index ceb41cdda..fd5277387 100644 --- a/src/datadogV1/api/api_authentication.rs +++ b/src/datadogV1/api/api_authentication.rs @@ -74,8 +74,8 @@ impl AuthenticationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 788742abe..d1d44fbd5 100644 --- a/src/datadogV1/api/api_aws_integration.rs +++ b/src/datadogV1/api/api_aws_integration.rs @@ -259,11 +259,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -343,11 +343,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -424,11 +424,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -505,11 +505,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -586,11 +586,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -670,11 +670,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -751,11 +751,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -848,11 +848,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -920,11 +920,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -996,11 +996,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1062,11 +1062,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1155,11 +1155,11 @@ impl AWSIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 f8956a4a4..a7075c60b 100644 --- a/src/datadogV1/api/api_aws_logs_integration.rs +++ b/src/datadogV1/api/api_aws_logs_integration.rs @@ -150,11 +150,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -252,11 +252,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -333,11 +333,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -414,11 +414,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +495,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -574,11 +574,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +646,11 @@ impl AWSLogsIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 cbbbf0485..f9f18326a 100644 --- a/src/datadogV1/api/api_azure_integration.rs +++ b/src/datadogV1/api/api_azure_integration.rs @@ -129,11 +129,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -210,11 +210,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -287,11 +287,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -361,11 +361,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -446,11 +446,11 @@ impl AzureIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 bf2d30c27..fe1f23b6a 100644 --- a/src/datadogV1/api/api_dashboard_lists.rs +++ b/src/datadogV1/api/api_dashboard_lists.rs @@ -115,11 +115,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +197,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -267,11 +267,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +339,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -417,11 +417,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 699140905..16c0f4d56 100644 --- a/src/datadogV1/api/api_dashboards.rs +++ b/src/datadogV1/api/api_dashboards.rs @@ -273,11 +273,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -352,11 +352,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -432,11 +432,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -500,11 +500,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +580,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +654,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -728,11 +728,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -800,11 +800,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -893,11 +893,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -993,11 +993,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1061,11 +1061,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1146,11 +1146,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1228,11 +1228,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1313,11 +1313,11 @@ impl DashboardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 b72430b28..9665a3c8a 100644 --- a/src/datadogV1/api/api_downtimes.rs +++ b/src/datadogV1/api/api_downtimes.rs @@ -156,11 +156,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -228,11 +228,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -304,11 +304,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -380,11 +380,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +461,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -534,11 +534,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -606,11 +606,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 4d9bb4079..97a581a2b 100644 --- a/src/datadogV1/api/api_events.rs +++ b/src/datadogV1/api/api_events.rs @@ -154,8 +154,8 @@ impl EventsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 @@ -232,11 +232,11 @@ impl EventsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +355,11 @@ impl EventsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 eac96ab04..2b0eff2c1 100644 --- a/src/datadogV1/api/api_gcp_integration.rs +++ b/src/datadogV1/api/api_gcp_integration.rs @@ -107,11 +107,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +188,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -265,11 +265,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +345,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 6a07f26ba..b3166c914 100644 --- a/src/datadogV1/api/api_hosts.rs +++ b/src/datadogV1/api/api_hosts.rs @@ -193,11 +193,11 @@ impl HostsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -311,11 +311,11 @@ impl HostsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -382,11 +382,11 @@ impl HostsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -458,11 +458,11 @@ impl HostsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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_key_management.rs b/src/datadogV1/api/api_key_management.rs index 6215daf22..5f3dcd8ab 100644 --- a/src/datadogV1/api/api_key_management.rs +++ b/src/datadogV1/api/api_key_management.rs @@ -165,11 +165,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -245,11 +245,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +322,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +396,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +466,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -540,11 +540,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -607,11 +607,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -678,11 +678,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +750,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -833,11 +833,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 5a8c9f31b..9d728e179 100644 --- a/src/datadogV1/api/api_logs.rs +++ b/src/datadogV1/api/api_logs.rs @@ -123,11 +123,11 @@ impl LogsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -252,8 +252,8 @@ impl LogsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 618f35540..c1c457e18 100644 --- a/src/datadogV1/api/api_logs_indexes.rs +++ b/src/datadogV1/api/api_logs_indexes.rs @@ -120,11 +120,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -196,11 +196,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -265,11 +265,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +337,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -417,11 +417,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -498,11 +498,11 @@ impl LogsIndexesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 342abdb51..3b7dffff5 100644 --- a/src/datadogV1/api/api_logs_pipelines.rs +++ b/src/datadogV1/api/api_logs_pipelines.rs @@ -133,11 +133,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +211,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -281,11 +281,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -353,11 +353,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -425,11 +425,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -508,11 +508,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -597,11 +597,11 @@ impl LogsPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 0041a8e93..a8f903df3 100644 --- a/src/datadogV1/api/api_metrics.rs +++ b/src/datadogV1/api/api_metrics.rs @@ -206,11 +206,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -294,11 +294,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +368,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -447,11 +447,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -532,8 +532,8 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 @@ -637,8 +637,8 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 @@ -719,11 +719,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 64a4f599e..bd02f7f8c 100644 --- a/src/datadogV1/api/api_monitors.rs +++ b/src/datadogV1/api/api_monitors.rs @@ -414,11 +414,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +844,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -931,11 +931,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1015,11 +1015,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +1126,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1222,11 +1222,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1317,11 +1317,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1388,11 +1388,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1475,11 +1475,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1560,11 +1560,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 0cae446a6..c1004046c 100644 --- a/src/datadogV1/api/api_notebooks.rs +++ b/src/datadogV1/api/api_notebooks.rs @@ -197,11 +197,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -273,11 +273,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +341,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +466,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -540,11 +540,11 @@ impl NotebooksAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 0f3c39d47..37e9fa50b 100644 --- a/src/datadogV1/api/api_organizations.rs +++ b/src/datadogV1/api/api_organizations.rs @@ -145,11 +145,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +225,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -294,11 +294,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +363,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -434,11 +434,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -525,11 +525,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 5dbd93553..a641fb774 100644 --- a/src/datadogV1/api/api_pager_duty_integration.rs +++ b/src/datadogV1/api/api_pager_duty_integration.rs @@ -111,11 +111,11 @@ impl PagerDutyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -190,11 +190,11 @@ impl PagerDutyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -266,11 +266,11 @@ impl PagerDutyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +340,11 @@ impl PagerDutyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 2ac86cfb4..377c1dc22 100644 --- a/src/datadogV1/api/api_security_monitoring.rs +++ b/src/datadogV1/api/api_security_monitoring.rs @@ -106,11 +106,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -193,11 +193,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -280,11 +280,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 133c2c63d..251524dc8 100644 --- a/src/datadogV1/api/api_service_checks.rs +++ b/src/datadogV1/api/api_service_checks.rs @@ -87,8 +87,8 @@ impl ServiceChecksAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 581c75cf2..e86a09b16 100644 --- a/src/datadogV1/api/api_service_level_objective_corrections.rs +++ b/src/datadogV1/api/api_service_level_objective_corrections.rs @@ -141,11 +141,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -220,11 +220,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -294,11 +294,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -381,11 +381,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +461,11 @@ impl ServiceLevelObjectiveCorrectionsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 1fed570c2..c07c7bf3c 100644 --- a/src/datadogV1/api/api_service_level_objectives.rs +++ b/src/datadogV1/api/api_service_level_objectives.rs @@ -326,11 +326,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -395,11 +395,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -487,11 +487,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -568,11 +568,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -654,11 +654,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -728,11 +728,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -839,11 +839,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +940,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1031,11 +1031,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1102,11 +1102,11 @@ impl ServiceLevelObjectivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 1e3e24d04..1fd0f04d8 100644 --- a/src/datadogV1/api/api_slack_integration.rs +++ b/src/datadogV1/api/api_slack_integration.rs @@ -128,11 +128,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +217,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -295,11 +295,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +371,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -453,11 +453,11 @@ impl SlackIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 ff99f6c5d..8d0c00203 100644 --- a/src/datadogV1/api/api_snapshots.rs +++ b/src/datadogV1/api/api_snapshots.rs @@ -171,11 +171,11 @@ impl SnapshotsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 df1836665..650f05d33 100644 --- a/src/datadogV1/api/api_synthetics.rs +++ b/src/datadogV1/api/api_synthetics.rs @@ -437,11 +437,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -518,11 +518,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -600,11 +600,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -684,11 +684,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -763,11 +763,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -833,11 +833,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -905,11 +905,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -991,11 +991,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1070,11 +1070,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1174,11 +1174,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1256,11 +1256,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1331,11 +1331,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1436,11 +1436,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1518,11 +1518,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1593,11 +1593,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1668,11 +1668,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1743,11 +1743,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1809,11 +1809,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1878,11 +1878,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1949,11 +1949,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2022,11 +2022,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2107,11 +2107,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2180,11 +2180,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -2260,11 +2260,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -2341,11 +2341,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -2421,11 +2421,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -2506,11 +2506,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -2593,11 +2593,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -2674,11 +2674,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 bbb4f716e..abe6156c8 100644 --- a/src/datadogV1/api/api_tags.rs +++ b/src/datadogV1/api/api_tags.rs @@ -216,11 +216,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -307,11 +307,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +384,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -460,11 +460,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -546,11 +546,11 @@ impl TagsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 d9a3bb61e..bad331637 100644 --- a/src/datadogV1/api/api_usage_metering.rs +++ b/src/datadogV1/api/api_usage_metering.rs @@ -1277,11 +1277,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1411,11 +1411,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1501,11 +1501,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1591,11 +1591,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1692,11 +1692,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1836,11 +1836,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1918,11 +1918,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2000,11 +2000,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2090,11 +2090,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2210,11 +2210,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2300,11 +2300,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2382,11 +2382,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2467,11 +2467,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2549,11 +2549,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2638,11 +2638,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2721,11 +2721,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2808,11 +2808,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2893,11 +2893,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -2983,11 +2983,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3073,11 +3073,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3158,11 +3158,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3240,11 +3240,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3339,11 +3339,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3429,11 +3429,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3519,11 +3519,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3609,11 +3609,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3699,11 +3699,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3789,11 +3789,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3884,11 +3884,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -3972,11 +3972,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4054,11 +4054,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4135,11 +4135,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4225,11 +4225,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4315,11 +4315,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4405,11 +4405,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4495,11 +4495,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4585,11 +4585,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -4693,11 +4693,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 5bbfa29cb..e02e9e3aa 100644 --- a/src/datadogV1/api/api_users.rs +++ b/src/datadogV1/api/api_users.rs @@ -120,11 +120,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +204,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -272,11 +272,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -338,11 +338,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +413,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 49475181c..dedb44934 100644 --- a/src/datadogV1/api/api_webhooks_integration.rs +++ b/src/datadogV1/api/api_webhooks_integration.rs @@ -151,11 +151,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -235,11 +235,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -315,11 +315,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -385,11 +385,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +461,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +545,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -626,11 +626,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -713,11 +713,11 @@ impl WebhooksIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 31dd8a4c5..1ac42987b 100644 --- a/src/datadogV2/api/api_apm_retention_filters.rs +++ b/src/datadogV2/api/api_apm_retention_filters.rs @@ -130,11 +130,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -209,11 +209,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -285,11 +285,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -357,11 +357,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +428,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -513,11 +513,11 @@ impl APMRetentionFiltersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 7f6874b02..218ccb3be 100644 --- a/src/datadogV2/api/api_audit.rs +++ b/src/datadogV2/api/api_audit.rs @@ -196,11 +196,11 @@ impl AuditAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -281,11 +281,11 @@ impl AuditAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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_auth_n_mappings.rs b/src/datadogV2/api/api_auth_n_mappings.rs index 199ad9280..7478c9a7c 100644 --- a/src/datadogV2/api/api_auth_n_mappings.rs +++ b/src/datadogV2/api/api_auth_n_mappings.rs @@ -155,11 +155,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -234,11 +234,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -308,11 +308,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +403,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -481,11 +481,11 @@ impl AuthNMappingsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 67cba21b7..09dc785d5 100644 --- a/src/datadogV2/api/api_ci_visibility_pipelines.rs +++ b/src/datadogV2/api/api_ci_visibility_pipelines.rs @@ -183,11 +183,11 @@ impl CIVisibilityPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,8 +269,8 @@ impl CIVisibilityPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 @@ -389,11 +389,11 @@ impl CIVisibilityPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -475,11 +475,11 @@ impl CIVisibilityPipelinesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 74c3e0b38..f8a05127a 100644 --- a/src/datadogV2/api/api_ci_visibility_tests.rs +++ b/src/datadogV2/api/api_ci_visibility_tests.rs @@ -162,11 +162,11 @@ impl CIVisibilityTestsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -283,11 +283,11 @@ impl CIVisibilityTestsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -366,11 +366,11 @@ impl CIVisibilityTestsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 9ce779a63..7aa86de8d 100644 --- a/src/datadogV2/api/api_cloud_cost_management.rs +++ b/src/datadogV2/api/api_cloud_cost_management.rs @@ -163,11 +163,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +244,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -323,11 +323,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +393,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -463,11 +463,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +545,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -617,11 +617,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +689,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -769,11 +769,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -856,11 +856,11 @@ impl CloudCostManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 09f4254d1..d811f5db8 100644 --- a/src/datadogV2/api/api_cloud_workload_security.rs +++ b/src/datadogV2/api/api_cloud_workload_security.rs @@ -131,11 +131,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +211,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -282,11 +282,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -359,11 +359,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -435,11 +435,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -518,11 +518,11 @@ impl CloudWorkloadSecurityAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 441f59c0f..dd6619a7a 100644 --- a/src/datadogV2/api/api_cloudflare_integration.rs +++ b/src/datadogV2/api/api_cloudflare_integration.rs @@ -122,11 +122,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -201,11 +201,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +274,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +346,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -426,11 +426,11 @@ impl CloudflareIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 4f02ee050..280d27328 100644 --- a/src/datadogV2/api/api_confluent_cloud.rs +++ b/src/datadogV2/api/api_confluent_cloud.rs @@ -177,11 +177,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -264,11 +264,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -343,11 +343,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +416,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -489,11 +489,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -570,11 +570,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -642,11 +642,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -720,11 +720,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -800,11 +800,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -890,11 +890,11 @@ impl ConfluentCloudAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 fe544e722..831b7c213 100644 --- a/src/datadogV2/api/api_container_images.rs +++ b/src/datadogV2/api/api_container_images.rs @@ -151,11 +151,11 @@ impl ContainerImagesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 c1f486ede..d2ebd47ec 100644 --- a/src/datadogV2/api/api_containers.rs +++ b/src/datadogV2/api/api_containers.rs @@ -149,11 +149,11 @@ impl ContainersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 350b158bc..90648b3ab 100644 --- a/src/datadogV2/api/api_dashboard_lists.rs +++ b/src/datadogV2/api/api_dashboard_lists.rs @@ -116,11 +116,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -203,11 +203,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -288,11 +288,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +368,11 @@ impl DashboardListsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 e3354d05a..ccf4a3621 100644 --- a/src/datadogV2/api/api_dora_metrics.rs +++ b/src/datadogV2/api/api_dora_metrics.rs @@ -106,8 +106,8 @@ impl DORAMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 @@ -198,8 +198,8 @@ impl DORAMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 3e66e2a75..de8e0f18e 100644 --- a/src/datadogV2/api/api_downtimes.rs +++ b/src/datadogV2/api/api_downtimes.rs @@ -202,11 +202,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -271,11 +271,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -358,11 +358,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +452,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +545,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -619,11 +619,11 @@ impl DowntimesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 06d012c53..eac5393c4 100644 --- a/src/datadogV2/api/api_events.rs +++ b/src/datadogV2/api/api_events.rs @@ -186,11 +186,11 @@ impl EventsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -265,11 +265,11 @@ impl EventsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 02fcff1d2..981765718 100644 --- a/src/datadogV2/api/api_fastly_integration.rs +++ b/src/datadogV2/api/api_fastly_integration.rs @@ -177,11 +177,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -264,11 +264,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -340,11 +340,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +413,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +484,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -563,11 +563,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -635,11 +635,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -710,11 +710,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +790,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -880,11 +880,11 @@ impl FastlyIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 df12e6406..48a47d49d 100644 --- a/src/datadogV2/api/api_gcp_integration.rs +++ b/src/datadogV2/api/api_gcp_integration.rs @@ -148,11 +148,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +224,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -294,11 +294,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -366,11 +366,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -443,11 +443,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -530,11 +530,11 @@ impl GCPIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 54f9e63f2..4f181abff 100644 --- a/src/datadogV2/api/api_incident_services.rs +++ b/src/datadogV2/api/api_incident_services.rs @@ -189,11 +189,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -276,11 +276,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -372,11 +372,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -477,11 +477,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +565,11 @@ impl IncidentServicesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 46a4201e0..3cae1c7dc 100644 --- a/src/datadogV2/api/api_incident_teams.rs +++ b/src/datadogV2/api/api_incident_teams.rs @@ -187,11 +187,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -271,11 +271,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -362,11 +362,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -465,11 +465,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -551,11 +551,11 @@ impl IncidentTeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 20f46653d..04ebbe713 100644 --- a/src/datadogV2/api/api_incidents.rs +++ b/src/datadogV2/api/api_incidents.rs @@ -446,11 +446,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -541,11 +541,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -634,11 +634,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -718,11 +718,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -800,11 +800,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +881,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -974,11 +974,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1063,11 +1063,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1150,11 +1150,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1265,11 +1265,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1351,11 +1351,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1435,11 +1435,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1539,11 +1539,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1645,11 +1645,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1747,11 +1747,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1859,11 +1859,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1958,11 +1958,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -2054,11 +2054,11 @@ impl IncidentsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 4e55a0884..f18c92a76 100644 --- a/src/datadogV2/api/api_ip_allowlist.rs +++ b/src/datadogV2/api/api_ip_allowlist.rs @@ -84,11 +84,11 @@ impl IPAllowlistAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -156,11 +156,11 @@ impl IPAllowlistAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 49da3cdee..0ea7d86c6 100644 --- a/src/datadogV2/api/api_key_management.rs +++ b/src/datadogV2/api/api_key_management.rs @@ -454,11 +454,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -537,11 +537,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -613,11 +613,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -679,11 +679,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -749,11 +749,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -827,11 +827,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -914,11 +914,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -992,11 +992,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +1121,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1232,11 +1232,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1347,11 +1347,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1419,11 +1419,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1505,11 +1505,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1592,11 +1592,11 @@ impl KeyManagementAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 a5880f857..5a9723bec 100644 --- a/src/datadogV2/api/api_logs.rs +++ b/src/datadogV2/api/api_logs.rs @@ -220,11 +220,11 @@ impl LogsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +319,11 @@ impl LogsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -464,11 +464,11 @@ impl LogsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -596,8 +596,8 @@ impl LogsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 54fa6c936..b7f03af63 100644 --- a/src/datadogV2/api/api_logs_archives.rs +++ b/src/datadogV2/api/api_logs_archives.rs @@ -172,11 +172,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +246,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +322,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +390,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -462,11 +462,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +538,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -605,11 +605,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -679,11 +679,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -765,11 +765,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -852,11 +852,11 @@ impl LogsArchivesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 8da4a5146..6cd86d89a 100644 --- a/src/datadogV2/api/api_logs_metrics.rs +++ b/src/datadogV2/api/api_logs_metrics.rs @@ -118,11 +118,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -194,11 +194,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -265,11 +265,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +335,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +415,11 @@ impl LogsMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 70ad868c7..9859cdbd8 100644 --- a/src/datadogV2/api/api_metrics.rs +++ b/src/datadogV2/api/api_metrics.rs @@ -385,11 +385,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -480,11 +480,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -570,11 +570,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -651,11 +651,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -757,11 +757,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -845,11 +845,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -924,11 +924,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1038,11 +1038,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1117,11 +1117,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1199,11 +1199,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1285,11 +1285,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1376,11 +1376,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1486,8 +1486,8 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + 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 @@ -1578,11 +1578,11 @@ impl MetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 0215c9b24..d9e54c00a 100644 --- a/src/datadogV2/api/api_monitors.rs +++ b/src/datadogV2/api/api_monitors.rs @@ -118,11 +118,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +197,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -273,11 +273,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +345,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -425,11 +425,11 @@ impl MonitorsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 d6e717d4f..5fd77759a 100644 --- a/src/datadogV2/api/api_okta_integration.rs +++ b/src/datadogV2/api/api_okta_integration.rs @@ -120,11 +120,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -196,11 +196,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -267,11 +267,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +337,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +415,11 @@ impl OktaIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 c437357d5..c72c619cc 100644 --- a/src/datadogV2/api/api_opsgenie_integration.rs +++ b/src/datadogV2/api/api_opsgenie_integration.rs @@ -122,11 +122,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -201,11 +201,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -277,11 +277,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -349,11 +349,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -429,11 +429,11 @@ impl OpsgenieIntegrationAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 81a44b3fa..58069b806 100644 --- a/src/datadogV2/api/api_organizations.rs +++ b/src/datadogV2/api/api_organizations.rs @@ -94,11 +94,11 @@ impl OrganizationsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 ae6d8645e..47b6b2087 100644 --- a/src/datadogV2/api/api_powerpack.rs +++ b/src/datadogV2/api/api_powerpack.rs @@ -133,11 +133,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -209,11 +209,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -277,11 +277,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -361,11 +361,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -439,11 +439,11 @@ impl PowerpackAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 616d2c3ae..b6618fbcc 100644 --- a/src/datadogV2/api/api_processes.rs +++ b/src/datadogV2/api/api_processes.rs @@ -168,11 +168,11 @@ impl ProcessesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 4b9d13dca..5ab18b5c2 100644 --- a/src/datadogV2/api/api_restriction_policies.rs +++ b/src/datadogV2/api/api_restriction_policies.rs @@ -95,11 +95,11 @@ impl RestrictionPoliciesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -171,11 +171,11 @@ impl RestrictionPoliciesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -285,11 +285,11 @@ impl RestrictionPoliciesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 0c391808d..dad692234 100644 --- a/src/datadogV2/api/api_roles.rs +++ b/src/datadogV2/api/api_roles.rs @@ -297,11 +297,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -376,11 +376,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -454,11 +454,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -529,11 +529,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -601,11 +601,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -667,11 +667,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -736,11 +736,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +809,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -904,11 +904,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1001,11 +1001,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1080,11 +1080,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1165,11 +1165,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1244,11 +1244,11 @@ impl RolesAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 394906f52..2bacf73af 100644 --- a/src/datadogV2/api/api_rum.rs +++ b/src/datadogV2/api/api_rum.rs @@ -195,11 +195,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -276,11 +276,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -352,11 +352,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -425,11 +425,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -497,11 +497,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +611,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -693,11 +693,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -777,11 +777,11 @@ impl RUMAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 2e86935b6..d07407c8d 100644 --- a/src/datadogV2/api/api_security_monitoring.rs +++ b/src/datadogV2/api/api_security_monitoring.rs @@ -478,11 +478,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -562,11 +562,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +641,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +711,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -789,11 +789,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -877,11 +877,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +965,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1061,11 +1061,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1144,11 +1144,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1222,11 +1222,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1300,11 +1300,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1507,11 +1507,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1578,11 +1578,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1668,11 +1668,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1782,11 +1782,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1863,11 +1863,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1953,11 +1953,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -2043,11 +2043,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -2134,11 +2134,11 @@ impl SecurityMonitoringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 d5d99ccc1..acae2e0b9 100644 --- a/src/datadogV2/api/api_sensitive_data_scanner.rs +++ b/src/datadogV2/api/api_sensitive_data_scanner.rs @@ -169,11 +169,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +259,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -347,11 +347,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -435,11 +435,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +515,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -588,11 +588,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -663,11 +663,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -757,11 +757,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +851,11 @@ impl SensitiveDataScannerAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 dd0fdb97b..4bbaf5bb0 100644 --- a/src/datadogV2/api/api_service_accounts.rs +++ b/src/datadogV2/api/api_service_accounts.rs @@ -182,11 +182,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +269,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -351,11 +351,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -430,11 +430,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -543,11 +543,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -630,11 +630,11 @@ impl ServiceAccountsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 ab8c6c0be..658e8d6cd 100644 --- a/src/datadogV2/api/api_service_definition.rs +++ b/src/datadogV2/api/api_service_definition.rs @@ -165,11 +165,11 @@ impl ServiceDefinitionAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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,11 +244,11 @@ impl ServiceDefinitionAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -330,11 +330,11 @@ impl ServiceDefinitionAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -422,11 +422,11 @@ impl ServiceDefinitionAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 bd11f09ff..a94fef4ed 100644 --- a/src/datadogV2/api/api_service_scorecards.rs +++ b/src/datadogV2/api/api_service_scorecards.rs @@ -288,11 +288,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -375,11 +375,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -459,11 +459,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -592,11 +592,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -725,11 +725,11 @@ impl ServiceScorecardsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 d85884817..c3330d75b 100644 --- a/src/datadogV2/api/api_spans.rs +++ b/src/datadogV2/api/api_spans.rs @@ -150,11 +150,11 @@ impl SpansAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -238,11 +238,11 @@ impl SpansAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -358,11 +358,11 @@ impl SpansAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 566016cd8..ea96eb28d 100644 --- a/src/datadogV2/api/api_spans_metrics.rs +++ b/src/datadogV2/api/api_spans_metrics.rs @@ -118,11 +118,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -194,11 +194,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -265,11 +265,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +335,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +415,11 @@ impl SpansMetricsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 a842b99fb..ee10b0836 100644 --- a/src/datadogV2/api/api_synthetics.rs +++ b/src/datadogV2/api/api_synthetics.rs @@ -81,11 +81,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -158,11 +158,11 @@ impl SyntheticsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 93873f143..69fc00eda 100644 --- a/src/datadogV2/api/api_teams.rs +++ b/src/datadogV2/api/api_teams.rs @@ -331,11 +331,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -411,11 +411,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -496,11 +496,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -569,11 +569,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -638,11 +638,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +711,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -778,11 +778,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -850,11 +850,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -919,11 +919,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1019,11 +1019,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1097,11 +1097,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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,11 +1170,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1293,11 +1293,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1366,11 +1366,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1452,11 +1452,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1540,11 +1540,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -1630,11 +1630,11 @@ impl TeamsAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 84393f42b..249756311 100644 --- a/src/datadogV2/api/api_usage_metering.rs +++ b/src/datadogV2/api/api_usage_metering.rs @@ -428,11 +428,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -519,11 +519,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -624,11 +624,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -719,11 +719,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -845,11 +845,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -993,11 +993,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1077,11 +1077,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1167,11 +1167,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1258,11 +1258,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -1349,11 +1349,11 @@ impl UsageMeteringAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.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 fee98ed92..acf344b73 100644 --- a/src/datadogV2/api/api_users.rs +++ b/src/datadogV2/api/api_users.rs @@ -215,11 +215,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -292,11 +292,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -365,11 +365,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -434,11 +434,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -508,11 +508,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -583,11 +583,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -687,11 +687,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); }; let local_req = local_req_builder.build()?; @@ -758,11 +758,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 @@ -839,11 +839,11 @@ impl UsersAPI { ); // build auth - if let Some(ref local_key) = local_configuration.api_key { - local_req_builder = local_req_builder.header("DD-API-KEY", local_key); + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); }; - if let Some(ref local_key) = local_configuration.app_key { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", local_key); + 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 3298bba7a..89c14f33e 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -95,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 f88e5510a..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; @@ -157,8 +157,20 @@ pub async fn before_scenario( } }; world.config.client(client); - world.config.api_key = Some("00000000000000000000000000000000".to_string()); - world.config.app_key = Some("0000000000000000000000000000000000000000".to_string()); + 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(), "_") @@ -215,7 +227,13 @@ pub async fn after_scenario( #[given(expr = "a valid \"apiKeyAuth\" key in the system")] fn valid_apikey(world: &mut DatadogWorld) { - world.config.api_key = env::var("DD_TEST_CLIENT_API_KEY").ok(); + 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()); } @@ -223,7 +241,13 @@ fn valid_apikey(world: &mut DatadogWorld) { #[given(expr = "a valid \"appKeyAuth\" key in the system")] fn valid_appkey(world: &mut DatadogWorld) { - world.config.app_key = env::var("DD_TEST_CLIENT_APP_KEY").ok(); + 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()); } From 41a223339bc1fe150d6f8314bdede42051199007 Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Fri, 23 Feb 2024 16:19:43 -0500 Subject: [PATCH 7/7] fix merge --- src/datadogV1/api/api_organizations.rs | 2 +- src/datadogV1/api/api_service_level_objectives.rs | 2 +- src/datadogV2/api/api_authn_mappings.rs | 10 +++++----- src/datadogV2/api/api_organizations.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/datadogV1/api/api_organizations.rs b/src/datadogV1/api/api_organizations.rs index 05e77bbdd..000f1a251 100644 --- a/src/datadogV1/api/api_organizations.rs +++ b/src/datadogV1/api/api_organizations.rs @@ -506,7 +506,7 @@ impl OrganizationsAPI { ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v1.upload_id_p_for_org"; + let operation_id = "v1.upload_idp_for_org"; let local_client = &local_configuration.client; diff --git a/src/datadogV1/api/api_service_level_objectives.rs b/src/datadogV1/api/api_service_level_objectives.rs index cc13cfcfe..875bf98c1 100644 --- a/src/datadogV1/api/api_service_level_objectives.rs +++ b/src/datadogV1/api/api_service_level_objectives.rs @@ -890,7 +890,7 @@ impl ServiceLevelObjectivesAPI { ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v1.list_sl_os"; + let operation_id = "v1.list_slos"; // unbox and build optional parameters let ids = params.ids; diff --git a/src/datadogV2/api/api_authn_mappings.rs b/src/datadogV2/api/api_authn_mappings.rs index 8d13ff5c5..1b147182e 100644 --- a/src/datadogV2/api/api_authn_mappings.rs +++ b/src/datadogV2/api/api_authn_mappings.rs @@ -137,7 +137,7 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_auth_n_mapping"; + let operation_id = "v2.create_authn_mapping"; let local_client = &local_configuration.client; @@ -215,7 +215,7 @@ impl AuthNMappingsAPI { authn_mapping_id: String, ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.delete_auth_n_mapping"; + let operation_id = "v2.delete_authn_mapping"; let local_client = &local_configuration.client; @@ -289,7 +289,7 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.get_auth_n_mapping"; + let operation_id = "v2.get_authn_mapping"; let local_client = &local_configuration.client; @@ -362,7 +362,7 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_auth_n_mappings"; + let operation_id = "v2.list_authn_mappings"; // unbox and build optional parameters let page_size = params.page_size; @@ -462,7 +462,7 @@ impl AuthNMappingsAPI { Error, > { let local_configuration = &self.config; - let operation_id = "v2.update_auth_n_mapping"; + let operation_id = "v2.update_authn_mapping"; let local_client = &local_configuration.client; diff --git a/src/datadogV2/api/api_organizations.rs b/src/datadogV2/api/api_organizations.rs index b941d4115..e741ff6c5 100644 --- a/src/datadogV2/api/api_organizations.rs +++ b/src/datadogV2/api/api_organizations.rs @@ -73,7 +73,7 @@ impl OrganizationsAPI { params: UploadIdPMetadataOptionalParams, ) -> Result, Error> { let local_configuration = &self.config; - let operation_id = "v2.upload_id_p_metadata"; + let operation_id = "v2.upload_idp_metadata"; // unbox and build optional parameters let idp_file = params.idp_file;