From a68124da8bff5ae8343f01546657ba24371e2b57 Mon Sep 17 00:00:00 2001 From: Kevin Zou Date: Thu, 15 Feb 2024 10:38:23 -0500 Subject: [PATCH] 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());