#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(unused_imports)]
#![allow(clippy::redundant_clone)]
pub mod models;
#[derive(Clone)]
pub struct Client {
endpoint: String,
credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
scopes: Vec<String>,
pipeline: azure_core::Pipeline,
}
#[derive(Clone)]
pub struct ClientBuilder {
credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
endpoint: Option<String>,
scopes: Option<Vec<String>>,
options: azure_core::ClientOptions,
}
pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD;
impl ClientBuilder {
#[doc = "Create a new instance of `ClientBuilder`."]
#[must_use]
pub fn new(credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>) -> Self {
Self {
credential,
endpoint: None,
scopes: None,
options: azure_core::ClientOptions::default(),
}
}
#[doc = "Set the endpoint."]
#[must_use]
pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self {
self.endpoint = Some(endpoint.into());
self
}
#[doc = "Set the scopes."]
#[must_use]
pub fn scopes(mut self, scopes: &[&str]) -> Self {
self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect());
self
}
#[doc = "Set the retry options."]
#[must_use]
pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self {
self.options = self.options.retry(retry);
self
}
#[doc = "Set the transport options."]
#[must_use]
pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self {
self.options = self.options.transport(transport);
self
}
#[doc = "Convert the builder into a `Client` instance."]
#[must_use]
pub fn build(self) -> Client {
let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned());
let scopes = self.scopes.unwrap_or_else(|| vec![format!("{}/", endpoint)]);
Client::new(endpoint, self.credential, scopes, self.options)
}
}
impl Client {
pub(crate) fn endpoint(&self) -> &str {
self.endpoint.as_str()
}
pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential {
self.credential.as_ref()
}
pub(crate) fn scopes(&self) -> Vec<&str> {
self.scopes.iter().map(String::as_str).collect()
}
pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result<azure_core::Response> {
let mut context = azure_core::Context::default();
self.pipeline.send(&mut context, request).await
}
#[doc = "Create a new `ClientBuilder`."]
#[must_use]
pub fn builder(credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>) -> ClientBuilder {
ClientBuilder::new(credential)
}
#[doc = "Create a new `Client`."]
#[must_use]
pub fn new(
endpoint: impl Into<String>,
credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
scopes: Vec<String>,
options: azure_core::ClientOptions,
) -> Self {
let endpoint = endpoint.into();
let pipeline = azure_core::Pipeline::new(
option_env!("CARGO_PKG_NAME"),
option_env!("CARGO_PKG_VERSION"),
options,
Vec::new(),
Vec::new(),
);
Self {
endpoint,
credential,
scopes,
pipeline,
}
}
pub fn application_gateway_private_endpoint_connections_client(&self) -> application_gateway_private_endpoint_connections::Client {
application_gateway_private_endpoint_connections::Client(self.clone())
}
pub fn application_gateway_private_link_resources_client(&self) -> application_gateway_private_link_resources::Client {
application_gateway_private_link_resources::Client(self.clone())
}
pub fn application_gateways_client(&self) -> application_gateways::Client {
application_gateways::Client(self.clone())
}
pub fn application_security_groups_client(&self) -> application_security_groups::Client {
application_security_groups::Client(self.clone())
}
pub fn available_delegations_client(&self) -> available_delegations::Client {
available_delegations::Client(self.clone())
}
pub fn available_endpoint_services_client(&self) -> available_endpoint_services::Client {
available_endpoint_services::Client(self.clone())
}
pub fn available_private_endpoint_types_client(&self) -> available_private_endpoint_types::Client {
available_private_endpoint_types::Client(self.clone())
}
pub fn available_resource_group_delegations_client(&self) -> available_resource_group_delegations::Client {
available_resource_group_delegations::Client(self.clone())
}
pub fn available_service_aliases_client(&self) -> available_service_aliases::Client {
available_service_aliases::Client(self.clone())
}
pub fn azure_firewall_fqdn_tags_client(&self) -> azure_firewall_fqdn_tags::Client {
azure_firewall_fqdn_tags::Client(self.clone())
}
pub fn azure_firewalls_client(&self) -> azure_firewalls::Client {
azure_firewalls::Client(self.clone())
}
pub fn bastion_hosts_client(&self) -> bastion_hosts::Client {
bastion_hosts::Client(self.clone())
}
pub fn bgp_service_communities_client(&self) -> bgp_service_communities::Client {
bgp_service_communities::Client(self.clone())
}
pub fn connection_monitors_client(&self) -> connection_monitors::Client {
connection_monitors::Client(self.clone())
}
pub fn custom_ip_prefixes_client(&self) -> custom_ip_prefixes::Client {
custom_ip_prefixes::Client(self.clone())
}
pub fn ddos_custom_policies_client(&self) -> ddos_custom_policies::Client {
ddos_custom_policies::Client(self.clone())
}
pub fn ddos_protection_plans_client(&self) -> ddos_protection_plans::Client {
ddos_protection_plans::Client(self.clone())
}
pub fn default_security_rules_client(&self) -> default_security_rules::Client {
default_security_rules::Client(self.clone())
}
pub fn dscp_configuration_client(&self) -> dscp_configuration::Client {
dscp_configuration::Client(self.clone())
}
pub fn express_route_circuit_authorizations_client(&self) -> express_route_circuit_authorizations::Client {
express_route_circuit_authorizations::Client(self.clone())
}
pub fn express_route_circuit_connections_client(&self) -> express_route_circuit_connections::Client {
express_route_circuit_connections::Client(self.clone())
}
pub fn express_route_circuit_peerings_client(&self) -> express_route_circuit_peerings::Client {
express_route_circuit_peerings::Client(self.clone())
}
pub fn express_route_circuits_client(&self) -> express_route_circuits::Client {
express_route_circuits::Client(self.clone())
}
pub fn express_route_connections_client(&self) -> express_route_connections::Client {
express_route_connections::Client(self.clone())
}
pub fn express_route_cross_connection_peerings_client(&self) -> express_route_cross_connection_peerings::Client {
express_route_cross_connection_peerings::Client(self.clone())
}
pub fn express_route_cross_connections_client(&self) -> express_route_cross_connections::Client {
express_route_cross_connections::Client(self.clone())
}
pub fn express_route_gateways_client(&self) -> express_route_gateways::Client {
express_route_gateways::Client(self.clone())
}
pub fn express_route_links_client(&self) -> express_route_links::Client {
express_route_links::Client(self.clone())
}
pub fn express_route_ports_client(&self) -> express_route_ports::Client {
express_route_ports::Client(self.clone())
}
pub fn express_route_ports_locations_client(&self) -> express_route_ports_locations::Client {
express_route_ports_locations::Client(self.clone())
}
pub fn express_route_service_providers_client(&self) -> express_route_service_providers::Client {
express_route_service_providers::Client(self.clone())
}
pub fn firewall_policies_client(&self) -> firewall_policies::Client {
firewall_policies::Client(self.clone())
}
pub fn firewall_policy_idps_signatures_client(&self) -> firewall_policy_idps_signatures::Client {
firewall_policy_idps_signatures::Client(self.clone())
}
pub fn firewall_policy_idps_signatures_filter_values_client(&self) -> firewall_policy_idps_signatures_filter_values::Client {
firewall_policy_idps_signatures_filter_values::Client(self.clone())
}
pub fn firewall_policy_idps_signatures_overrides_client(&self) -> firewall_policy_idps_signatures_overrides::Client {
firewall_policy_idps_signatures_overrides::Client(self.clone())
}
pub fn firewall_policy_rule_collection_groups_client(&self) -> firewall_policy_rule_collection_groups::Client {
firewall_policy_rule_collection_groups::Client(self.clone())
}
pub fn flow_logs_client(&self) -> flow_logs::Client {
flow_logs::Client(self.clone())
}
pub fn hub_route_tables_client(&self) -> hub_route_tables::Client {
hub_route_tables::Client(self.clone())
}
pub fn hub_virtual_network_connections_client(&self) -> hub_virtual_network_connections::Client {
hub_virtual_network_connections::Client(self.clone())
}
pub fn inbound_nat_rules_client(&self) -> inbound_nat_rules::Client {
inbound_nat_rules::Client(self.clone())
}
pub fn inbound_security_rule_client(&self) -> inbound_security_rule::Client {
inbound_security_rule::Client(self.clone())
}
pub fn ip_allocations_client(&self) -> ip_allocations::Client {
ip_allocations::Client(self.clone())
}
pub fn ip_groups_client(&self) -> ip_groups::Client {
ip_groups::Client(self.clone())
}
pub fn load_balancer_backend_address_pools_client(&self) -> load_balancer_backend_address_pools::Client {
load_balancer_backend_address_pools::Client(self.clone())
}
pub fn load_balancer_frontend_ip_configurations_client(&self) -> load_balancer_frontend_ip_configurations::Client {
load_balancer_frontend_ip_configurations::Client(self.clone())
}
pub fn load_balancer_load_balancing_rules_client(&self) -> load_balancer_load_balancing_rules::Client {
load_balancer_load_balancing_rules::Client(self.clone())
}
pub fn load_balancer_network_interfaces_client(&self) -> load_balancer_network_interfaces::Client {
load_balancer_network_interfaces::Client(self.clone())
}
pub fn load_balancer_outbound_rules_client(&self) -> load_balancer_outbound_rules::Client {
load_balancer_outbound_rules::Client(self.clone())
}
pub fn load_balancer_probes_client(&self) -> load_balancer_probes::Client {
load_balancer_probes::Client(self.clone())
}
pub fn load_balancers_client(&self) -> load_balancers::Client {
load_balancers::Client(self.clone())
}
pub fn local_network_gateways_client(&self) -> local_network_gateways::Client {
local_network_gateways::Client(self.clone())
}
pub fn nat_gateways_client(&self) -> nat_gateways::Client {
nat_gateways::Client(self.clone())
}
pub fn nat_rules_client(&self) -> nat_rules::Client {
nat_rules::Client(self.clone())
}
pub fn network_interface_ip_configurations_client(&self) -> network_interface_ip_configurations::Client {
network_interface_ip_configurations::Client(self.clone())
}
pub fn network_interface_load_balancers_client(&self) -> network_interface_load_balancers::Client {
network_interface_load_balancers::Client(self.clone())
}
pub fn network_interface_tap_configurations_client(&self) -> network_interface_tap_configurations::Client {
network_interface_tap_configurations::Client(self.clone())
}
pub fn network_interfaces_client(&self) -> network_interfaces::Client {
network_interfaces::Client(self.clone())
}
pub fn network_profiles_client(&self) -> network_profiles::Client {
network_profiles::Client(self.clone())
}
pub fn network_security_groups_client(&self) -> network_security_groups::Client {
network_security_groups::Client(self.clone())
}
pub fn network_virtual_appliances_client(&self) -> network_virtual_appliances::Client {
network_virtual_appliances::Client(self.clone())
}
pub fn network_watchers_client(&self) -> network_watchers::Client {
network_watchers::Client(self.clone())
}
pub fn operations_client(&self) -> operations::Client {
operations::Client(self.clone())
}
pub fn p2s_vpn_gateways_client(&self) -> p2s_vpn_gateways::Client {
p2s_vpn_gateways::Client(self.clone())
}
pub fn packet_captures_client(&self) -> packet_captures::Client {
packet_captures::Client(self.clone())
}
pub fn peer_express_route_circuit_connections_client(&self) -> peer_express_route_circuit_connections::Client {
peer_express_route_circuit_connections::Client(self.clone())
}
pub fn private_dns_zone_groups_client(&self) -> private_dns_zone_groups::Client {
private_dns_zone_groups::Client(self.clone())
}
pub fn private_endpoints_client(&self) -> private_endpoints::Client {
private_endpoints::Client(self.clone())
}
pub fn private_link_services_client(&self) -> private_link_services::Client {
private_link_services::Client(self.clone())
}
pub fn public_ip_addresses_client(&self) -> public_ip_addresses::Client {
public_ip_addresses::Client(self.clone())
}
pub fn public_ip_prefixes_client(&self) -> public_ip_prefixes::Client {
public_ip_prefixes::Client(self.clone())
}
pub fn resource_navigation_links_client(&self) -> resource_navigation_links::Client {
resource_navigation_links::Client(self.clone())
}
pub fn route_filter_rules_client(&self) -> route_filter_rules::Client {
route_filter_rules::Client(self.clone())
}
pub fn route_filters_client(&self) -> route_filters::Client {
route_filters::Client(self.clone())
}
pub fn route_tables_client(&self) -> route_tables::Client {
route_tables::Client(self.clone())
}
pub fn routes_client(&self) -> routes::Client {
routes::Client(self.clone())
}
pub fn routing_intent_client(&self) -> routing_intent::Client {
routing_intent::Client(self.clone())
}
pub fn security_partner_providers_client(&self) -> security_partner_providers::Client {
security_partner_providers::Client(self.clone())
}
pub fn security_rules_client(&self) -> security_rules::Client {
security_rules::Client(self.clone())
}
pub fn service_association_links_client(&self) -> service_association_links::Client {
service_association_links::Client(self.clone())
}
pub fn service_endpoint_policies_client(&self) -> service_endpoint_policies::Client {
service_endpoint_policies::Client(self.clone())
}
pub fn service_endpoint_policy_definitions_client(&self) -> service_endpoint_policy_definitions::Client {
service_endpoint_policy_definitions::Client(self.clone())
}
pub fn service_tag_information_client(&self) -> service_tag_information::Client {
service_tag_information::Client(self.clone())
}
pub fn service_tags_client(&self) -> service_tags::Client {
service_tags::Client(self.clone())
}
pub fn subnets_client(&self) -> subnets::Client {
subnets::Client(self.clone())
}
pub fn usages_client(&self) -> usages::Client {
usages::Client(self.clone())
}
pub fn virtual_appliance_sites_client(&self) -> virtual_appliance_sites::Client {
virtual_appliance_sites::Client(self.clone())
}
pub fn virtual_appliance_skus_client(&self) -> virtual_appliance_skus::Client {
virtual_appliance_skus::Client(self.clone())
}
pub fn virtual_hub_bgp_connection_client(&self) -> virtual_hub_bgp_connection::Client {
virtual_hub_bgp_connection::Client(self.clone())
}
pub fn virtual_hub_bgp_connections_client(&self) -> virtual_hub_bgp_connections::Client {
virtual_hub_bgp_connections::Client(self.clone())
}
pub fn virtual_hub_ip_configuration_client(&self) -> virtual_hub_ip_configuration::Client {
virtual_hub_ip_configuration::Client(self.clone())
}
pub fn virtual_hub_route_table_v2s_client(&self) -> virtual_hub_route_table_v2s::Client {
virtual_hub_route_table_v2s::Client(self.clone())
}
pub fn virtual_hubs_client(&self) -> virtual_hubs::Client {
virtual_hubs::Client(self.clone())
}
pub fn virtual_network_gateway_connections_client(&self) -> virtual_network_gateway_connections::Client {
virtual_network_gateway_connections::Client(self.clone())
}
pub fn virtual_network_gateway_nat_rules_client(&self) -> virtual_network_gateway_nat_rules::Client {
virtual_network_gateway_nat_rules::Client(self.clone())
}
pub fn virtual_network_gateways_client(&self) -> virtual_network_gateways::Client {
virtual_network_gateways::Client(self.clone())
}
pub fn virtual_network_peerings_client(&self) -> virtual_network_peerings::Client {
virtual_network_peerings::Client(self.clone())
}
pub fn virtual_network_taps_client(&self) -> virtual_network_taps::Client {
virtual_network_taps::Client(self.clone())
}
pub fn virtual_networks_client(&self) -> virtual_networks::Client {
virtual_networks::Client(self.clone())
}
pub fn virtual_router_peerings_client(&self) -> virtual_router_peerings::Client {
virtual_router_peerings::Client(self.clone())
}
pub fn virtual_routers_client(&self) -> virtual_routers::Client {
virtual_routers::Client(self.clone())
}
pub fn virtual_wans_client(&self) -> virtual_wans::Client {
virtual_wans::Client(self.clone())
}
pub fn vpn_connections_client(&self) -> vpn_connections::Client {
vpn_connections::Client(self.clone())
}
pub fn vpn_gateways_client(&self) -> vpn_gateways::Client {
vpn_gateways::Client(self.clone())
}
pub fn vpn_link_connections_client(&self) -> vpn_link_connections::Client {
vpn_link_connections::Client(self.clone())
}
pub fn vpn_server_configurations_client(&self) -> vpn_server_configurations::Client {
vpn_server_configurations::Client(self.clone())
}
pub fn vpn_server_configurations_associated_with_virtual_wan_client(
&self,
) -> vpn_server_configurations_associated_with_virtual_wan::Client {
vpn_server_configurations_associated_with_virtual_wan::Client(self.clone())
}
pub fn vpn_site_link_connections_client(&self) -> vpn_site_link_connections::Client {
vpn_site_link_connections::Client(self.clone())
}
pub fn vpn_site_links_client(&self) -> vpn_site_links::Client {
vpn_site_links::Client(self.clone())
}
pub fn vpn_sites_client(&self) -> vpn_sites::Client {
vpn_sites::Client(self.clone())
}
pub fn vpn_sites_configuration_client(&self) -> vpn_sites_configuration::Client {
vpn_sites_configuration::Client(self.clone())
}
pub fn web_application_firewall_policies_client(&self) -> web_application_firewall_policies::Client {
web_application_firewall_policies::Client(self.clone())
}
pub fn web_categories_client(&self) -> web_categories::Client {
web_categories::Client(self.clone())
}
}
pub mod application_gateways {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified application gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates the specified application gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `parameters`: Parameters supplied to the create or update application gateway operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
parameters: impl Into<models::ApplicationGateway>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates the specified application gateway tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `parameters`: Parameters supplied to update application gateway tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified application gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all application gateways in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the application gateways in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Starts the specified application gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn start(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> start::RequestBuilder {
start::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Stops the specified application gateway in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn stop(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> stop::RequestBuilder {
stop::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the backend health of the specified application gateway in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn backend_health(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> backend_health::RequestBuilder {
backend_health::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `probe_request`: Request body for on-demand test probe operation."]
pub fn backend_health_on_demand(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
probe_request: impl Into<models::ApplicationGatewayOnDemandProbe>,
) -> backend_health_on_demand::RequestBuilder {
backend_health_on_demand::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
subscription_id: subscription_id.into(),
probe_request: probe_request.into(),
expand: None,
}
}
#[doc = "Lists all available server variables."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_available_server_variables(
&self,
subscription_id: impl Into<String>,
) -> list_available_server_variables::RequestBuilder {
list_available_server_variables::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all available request headers."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_available_request_headers(&self, subscription_id: impl Into<String>) -> list_available_request_headers::RequestBuilder {
list_available_request_headers::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all available response headers."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_available_response_headers(
&self,
subscription_id: impl Into<String>,
) -> list_available_response_headers::RequestBuilder {
list_available_response_headers::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all available web application firewall rule sets."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_available_waf_rule_sets(&self, subscription_id: impl Into<String>) -> list_available_waf_rule_sets::RequestBuilder {
list_available_waf_rule_sets::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists available Ssl options for configuring Ssl policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_available_ssl_options(&self, subscription_id: impl Into<String>) -> list_available_ssl_options::RequestBuilder {
list_available_ssl_options::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all SSL predefined policies for configuring Ssl policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_available_ssl_predefined_policies(
&self,
subscription_id: impl Into<String>,
) -> list_available_ssl_predefined_policies::RequestBuilder {
list_available_ssl_predefined_policies::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets Ssl predefined policy with the specified policy name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `predefined_policy_name`: Name of Ssl predefined policy."]
pub fn get_ssl_predefined_policy(
&self,
subscription_id: impl Into<String>,
predefined_policy_name: impl Into<String>,
) -> get_ssl_predefined_policy::RequestBuilder {
get_ssl_predefined_policy::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
predefined_policy_name: predefined_policy_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) parameters: models::ApplicationGateway,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ApplicationGatewayListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ApplicationGatewayListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/applicationGateways",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod start {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}/start",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod stop {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}/stop",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod backend_health {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayBackendHealth> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayBackendHealth = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands BackendAddressPool and BackendHttpSettings referenced in backend health."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}/backendhealth",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewayBackendHealth>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod backend_health_on_demand {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayBackendHealthOnDemand> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayBackendHealthOnDemand = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) subscription_id: String,
pub(crate) probe_request: models::ApplicationGatewayOnDemandProbe,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands BackendAddressPool and BackendHttpSettings referenced in backend health."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}/getBackendHealthOnDemand" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . application_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.probe_request)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewayBackendHealthOnDemand>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_available_server_variables {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayAvailableServerVariablesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayAvailableServerVariablesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables",
this.client.endpoint(),
&this.subscription_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewayAvailableServerVariablesResult>>
{
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_available_request_headers {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayAvailableRequestHeadersResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayAvailableRequestHeadersResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders",
this.client.endpoint(),
&this.subscription_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewayAvailableRequestHeadersResult>>
{
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_available_response_headers {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayAvailableResponseHeadersResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayAvailableResponseHeadersResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders",
this.client.endpoint(),
&this.subscription_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewayAvailableResponseHeadersResult>>
{
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_available_waf_rule_sets {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayAvailableWafRuleSetsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayAvailableWafRuleSetsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets",
this.client.endpoint(),
&this.subscription_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewayAvailableWafRuleSetsResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_available_ssl_options {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayAvailableSslOptions> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayAvailableSslOptions = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default",
this.client.endpoint(),
&this.subscription_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewayAvailableSslOptions>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_available_ssl_predefined_policies {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayAvailableSslPredefinedPolicies> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayAvailableSslPredefinedPolicies = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(
self,
) -> azure_core::Pageable<models::ApplicationGatewayAvailableSslPredefinedPolicies, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies" , this . client . endpoint () , & this . subscription_id)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_ssl_predefined_policy {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewaySslPredefinedPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewaySslPredefinedPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) predefined_policy_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{}" , this . client . endpoint () , & this . subscription_id , & this . predefined_policy_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewaySslPredefinedPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod application_gateway_private_link_resources {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Lists all private link resources on an application gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayPrivateLinkResourceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayPrivateLinkResourceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(
self,
) -> azure_core::Pageable<models::ApplicationGatewayPrivateLinkResourceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}/privateLinkResources",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_gateway_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod application_gateway_private_endpoint_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified private endpoint connection on application gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `connection_name`: The name of the application gateway private endpoint connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates the specified private endpoint connection on application gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `connection_name`: The name of the application gateway private endpoint connection."]
#[doc = "* `parameters`: Parameters supplied to update application gateway private endpoint connection operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
connection_name: impl Into<String>,
parameters: impl Into<models::ApplicationGatewayPrivateEndpointConnection>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
connection_name: connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified private endpoint connection on application gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `connection_name`: The name of the application gateway private endpoint connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all private endpoint connections on an application gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_gateway_name`: The name of the application gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
application_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_gateway_name: application_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayPrivateEndpointConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayPrivateEndpointConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . application_gateway_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewayPrivateEndpointConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayPrivateEndpointConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayPrivateEndpointConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) connection_name: String,
pub(crate) parameters: models::ApplicationGatewayPrivateEndpointConnection,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . application_gateway_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationGatewayPrivateEndpointConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . application_gateway_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationGatewayPrivateEndpointConnectionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationGatewayPrivateEndpointConnectionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(
self,
) -> azure_core::Pageable<models::ApplicationGatewayPrivateEndpointConnectionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationGateways/{}/privateEndpointConnections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . application_gateway_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod network_interfaces {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets information about the specified network interface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a network interface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `parameters`: Parameters supplied to the create or update network interface operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
parameters: impl Into<models::NetworkInterface>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a network interface tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `parameters`: Parameters supplied to update network interface tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified network interface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network interfaces in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network interfaces in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all route tables applied to a network interface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_effective_route_table(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_effective_route_table::RequestBuilder {
get_effective_route_table::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network security groups applied to a network interface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_effective_network_security_groups(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_effective_network_security_groups::RequestBuilder {
list_effective_network_security_groups::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets information about all network interfaces in a role instance in a cloud service."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cloud_service_name`: The name of the cloud service."]
#[doc = "* `role_instance_name`: The name of role instance."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_cloud_service_role_instance_network_interfaces(
&self,
resource_group_name: impl Into<String>,
cloud_service_name: impl Into<String>,
role_instance_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_cloud_service_role_instance_network_interfaces::RequestBuilder {
list_cloud_service_role_instance_network_interfaces::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cloud_service_name: cloud_service_name.into(),
role_instance_name: role_instance_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network interfaces in a cloud service."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cloud_service_name`: The name of the cloud service."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_cloud_service_network_interfaces(
&self,
resource_group_name: impl Into<String>,
cloud_service_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_cloud_service_network_interfaces::RequestBuilder {
list_cloud_service_network_interfaces::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cloud_service_name: cloud_service_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Get the specified network interface in a cloud service."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cloud_service_name`: The name of the cloud service."]
#[doc = "* `role_instance_name`: The name of role instance."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_cloud_service_network_interface(
&self,
resource_group_name: impl Into<String>,
cloud_service_name: impl Into<String>,
role_instance_name: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_cloud_service_network_interface::RequestBuilder {
get_cloud_service_network_interface::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cloud_service_name: cloud_service_name.into(),
role_instance_name: role_instance_name.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Gets information about all network interfaces in a virtual machine in a virtual machine scale set."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_machine_scale_set_name`: The name of the virtual machine scale set."]
#[doc = "* `virtualmachine_index`: The virtual machine index."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_virtual_machine_scale_set_vm_network_interfaces(
&self,
resource_group_name: impl Into<String>,
virtual_machine_scale_set_name: impl Into<String>,
virtualmachine_index: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_virtual_machine_scale_set_vm_network_interfaces::RequestBuilder {
list_virtual_machine_scale_set_vm_network_interfaces::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_machine_scale_set_name: virtual_machine_scale_set_name.into(),
virtualmachine_index: virtualmachine_index.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network interfaces in a virtual machine scale set."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_machine_scale_set_name`: The name of the virtual machine scale set."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_virtual_machine_scale_set_network_interfaces(
&self,
resource_group_name: impl Into<String>,
virtual_machine_scale_set_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_virtual_machine_scale_set_network_interfaces::RequestBuilder {
list_virtual_machine_scale_set_network_interfaces::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_machine_scale_set_name: virtual_machine_scale_set_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Get the specified network interface in a virtual machine scale set."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_machine_scale_set_name`: The name of the virtual machine scale set."]
#[doc = "* `virtualmachine_index`: The virtual machine index."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_virtual_machine_scale_set_network_interface(
&self,
resource_group_name: impl Into<String>,
virtual_machine_scale_set_name: impl Into<String>,
virtualmachine_index: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_virtual_machine_scale_set_network_interface::RequestBuilder {
get_virtual_machine_scale_set_network_interface::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_machine_scale_set_name: virtual_machine_scale_set_name.into(),
virtualmachine_index: virtualmachine_index.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Get the specified network interface ip configuration in a virtual machine scale set."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_machine_scale_set_name`: The name of the virtual machine scale set."]
#[doc = "* `virtualmachine_index`: The virtual machine index."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_virtual_machine_scale_set_ip_configurations(
&self,
resource_group_name: impl Into<String>,
virtual_machine_scale_set_name: impl Into<String>,
virtualmachine_index: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_virtual_machine_scale_set_ip_configurations::RequestBuilder {
list_virtual_machine_scale_set_ip_configurations::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_machine_scale_set_name: virtual_machine_scale_set_name.into(),
virtualmachine_index: virtualmachine_index.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Get the specified network interface ip configuration in a virtual machine scale set."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_machine_scale_set_name`: The name of the virtual machine scale set."]
#[doc = "* `virtualmachine_index`: The virtual machine index."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `ip_configuration_name`: The name of the ip configuration."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_virtual_machine_scale_set_ip_configuration(
&self,
resource_group_name: impl Into<String>,
virtual_machine_scale_set_name: impl Into<String>,
virtualmachine_index: impl Into<String>,
network_interface_name: impl Into<String>,
ip_configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_virtual_machine_scale_set_ip_configuration::RequestBuilder {
get_virtual_machine_scale_set_ip_configuration::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_machine_scale_set_name: virtual_machine_scale_set_name.into(),
virtualmachine_index: virtualmachine_index.into(),
network_interface_name: network_interface_name.into(),
ip_configuration_name: ip_configuration_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterface> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterface = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkInterface>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterface> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterface = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) parameters: models::NetworkInterface,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkInterface>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterface> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterface = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkInterface>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/networkInterfaces",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_effective_route_table {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::EffectiveRouteListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::EffectiveRouteListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/effectiveRouteTable",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::EffectiveRouteListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_effective_network_security_groups {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::EffectiveNetworkSecurityGroupListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::EffectiveNetworkSecurityGroupListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/effectiveNetworkSecurityGroups" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_interface_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::EffectiveNetworkSecurityGroupListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_cloud_service_role_instance_network_interfaces {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cloud_service_name: String,
pub(crate) role_instance_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Compute/cloudServices/{}/roleInstances/{}/networkInterfaces" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cloud_service_name , & this . role_instance_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_cloud_service_network_interfaces {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cloud_service_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Compute/cloudServices/{}/networkInterfaces",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.cloud_service_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_cloud_service_network_interface {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterface> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterface = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cloud_service_name: String,
pub(crate) role_instance_name: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Compute/cloudServices/{}/roleInstances/{}/networkInterfaces/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cloud_service_name , & this . role_instance_name , & this . network_interface_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkInterface>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_virtual_machine_scale_set_vm_network_interfaces {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_machine_scale_set_name: String,
pub(crate) virtualmachine_index: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.Compute/virtualMachineScaleSets/{}/virtualMachines/{}/networkInterfaces" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_machine_scale_set_name , & this . virtualmachine_index)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_virtual_machine_scale_set_network_interfaces {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_machine_scale_set_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.Compute/virtualMachineScaleSets/{}/networkInterfaces" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_machine_scale_set_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_virtual_machine_scale_set_network_interface {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterface> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterface = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_machine_scale_set_name: String,
pub(crate) virtualmachine_index: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.Compute/virtualMachineScaleSets/{}/virtualMachines/{}/networkInterfaces/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_machine_scale_set_name , & this . virtualmachine_index , & this . network_interface_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkInterface>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_virtual_machine_scale_set_ip_configurations {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceIpConfigurationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceIpConfigurationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_machine_scale_set_name: String,
pub(crate) virtualmachine_index: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceIpConfigurationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.Compute/virtualMachineScaleSets/{}/virtualMachines/{}/networkInterfaces/{}/ipConfigurations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_machine_scale_set_name , & this . virtualmachine_index , & this . network_interface_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_virtual_machine_scale_set_ip_configuration {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceIpConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceIpConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_machine_scale_set_name: String,
pub(crate) virtualmachine_index: String,
pub(crate) network_interface_name: String,
pub(crate) ip_configuration_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.Compute/virtualMachineScaleSets/{}/virtualMachines/{}/networkInterfaces/{}/ipConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_machine_scale_set_name , & this . virtualmachine_index , & this . network_interface_name , & this . ip_configuration_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkInterfaceIpConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod network_interface_ip_configurations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get all ip configurations in a network interface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the specified network interface ip configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `ip_configuration_name`: The name of the ip configuration name."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
ip_configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
ip_configuration_name: ip_configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceIpConfigurationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceIpConfigurationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceIpConfigurationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/ipConfigurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceIpConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceIpConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) ip_configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/ipConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name,
&this.ip_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkInterfaceIpConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod network_interface_load_balancers {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "List all load balancers in a network interface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceLoadBalancerListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceLoadBalancerListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceLoadBalancerListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/loadBalancers",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod network_interface_tap_configurations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get the specified tap configuration on a network interface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `tap_configuration_name`: The name of the tap configuration."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
tap_configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
tap_configuration_name: tap_configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a Tap configuration in the specified NetworkInterface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `tap_configuration_name`: The name of the tap configuration."]
#[doc = "* `tap_configuration_parameters`: Parameters supplied to the create or update tap configuration operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
tap_configuration_name: impl Into<String>,
tap_configuration_parameters: impl Into<models::NetworkInterfaceTapConfiguration>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
tap_configuration_name: tap_configuration_name.into(),
tap_configuration_parameters: tap_configuration_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified tap configuration from the NetworkInterface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `tap_configuration_name`: The name of the tap configuration."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
tap_configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
tap_configuration_name: tap_configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Get all Tap configurations in a network interface."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
network_interface_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_interface_name: network_interface_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceTapConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceTapConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) tap_configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/tapConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name,
&this.tap_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkInterfaceTapConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceTapConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceTapConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) tap_configuration_name: String,
pub(crate) tap_configuration_parameters: models::NetworkInterfaceTapConfiguration,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/tapConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name,
&this.tap_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.tap_configuration_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkInterfaceTapConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) tap_configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/tapConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name,
&this.tap_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceTapConfigurationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceTapConfigurationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_interface_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceTapConfigurationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/tapConfigurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_interface_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod virtual_network_taps {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets information about the specified virtual network tap."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `tap_name`: The name of virtual network tap."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
tap_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
tap_name: tap_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a Virtual Network Tap."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `tap_name`: The name of the virtual network tap."]
#[doc = "* `parameters`: Parameters supplied to the create or update virtual network tap operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
tap_name: impl Into<String>,
parameters: impl Into<models::VirtualNetworkTap>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
tap_name: tap_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates an VirtualNetworkTap tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `tap_name`: The name of the tap."]
#[doc = "* `tap_parameters`: Parameters supplied to update VirtualNetworkTap tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
tap_name: impl Into<String>,
tap_parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
tap_name: tap_name.into(),
tap_parameters: tap_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified virtual network tap."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `tap_name`: The name of the virtual network tap."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
tap_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
tap_name: tap_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the VirtualNetworkTaps in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the VirtualNetworkTaps in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkTap> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkTap = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) tap_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.tap_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkTap>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkTap> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkTap = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) tap_name: String,
pub(crate) parameters: models::VirtualNetworkTap,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.tap_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkTap>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkTap> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkTap = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) tap_name: String,
pub(crate) tap_parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.tap_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.tap_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkTap>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) tap_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.tap_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkTapListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkTapListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualNetworkTapListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/virtualNetworkTaps",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkTapListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkTapListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualNetworkTapListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod load_balancers {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified load balancer."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a load balancer."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `parameters`: Parameters supplied to the create or update load balancer operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
parameters: impl Into<models::LoadBalancer>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a load balancer tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `parameters`: Parameters supplied to update load balancer tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified load balancer."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the load balancers in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the load balancers in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Swaps VIPs between two load balancers."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The region where load balancers are located at."]
#[doc = "* `parameters`: Parameters that define which VIPs should be swapped."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn swap_public_ip_addresses(
&self,
location: impl Into<String>,
parameters: impl Into<models::LoadBalancerVipSwapRequest>,
subscription_id: impl Into<String>,
) -> swap_public_ip_addresses::RequestBuilder {
swap_public_ip_addresses::RequestBuilder {
client: self.0.clone(),
location: location.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "List of inbound NAT rule port mappings."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `backend_pool_name`: The name of the load balancer backend address pool."]
#[doc = "* `parameters`: Query inbound NAT rule port mapping request."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_inbound_nat_rule_port_mappings(
&self,
group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
backend_pool_name: impl Into<String>,
parameters: impl Into<models::QueryInboundNatRulePortMappingRequest>,
subscription_id: impl Into<String>,
) -> list_inbound_nat_rule_port_mappings::RequestBuilder {
list_inbound_nat_rule_port_mappings::RequestBuilder {
client: self.0.clone(),
group_name: group_name.into(),
load_balancer_name: load_balancer_name.into(),
backend_pool_name: backend_pool_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancer> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancer = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::LoadBalancer>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancer> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancer = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) parameters: models::LoadBalancer,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::LoadBalancer>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancer> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancer = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::LoadBalancer>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancerListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancerListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::LoadBalancerListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/loadBalancers",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancerListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancerListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::LoadBalancerListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod swap_public_ip_addresses {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) parameters: models::LoadBalancerVipSwapRequest,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/setLoadBalancerFrontendPublicIpAddresses",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_inbound_nat_rule_port_mappings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BackendAddressInboundNatRulePortMappings> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackendAddressInboundNatRulePortMappings = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) backend_pool_name: String,
pub(crate) parameters: models::QueryInboundNatRulePortMappingRequest,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}/queryInboundNatRulePortMapping" , this . client . endpoint () , & this . subscription_id , & this . group_name , & this . load_balancer_name , & this . backend_pool_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::BackendAddressInboundNatRulePortMappings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod load_balancer_backend_address_pools {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the load balancer backed address pools."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets load balancer backend address pool."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `backend_address_pool_name`: The name of the backend address pool."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
backend_address_pool_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
backend_address_pool_name: backend_address_pool_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a load balancer backend address pool."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `backend_address_pool_name`: The name of the backend address pool."]
#[doc = "* `parameters`: Parameters supplied to the create or update load balancer backend address pool operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
backend_address_pool_name: impl Into<String>,
parameters: impl Into<models::BackendAddressPool>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
backend_address_pool_name: backend_address_pool_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified load balancer backend address pool."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `backend_address_pool_name`: The name of the backend address pool."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
backend_address_pool_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
backend_address_pool_name: backend_address_pool_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancerBackendAddressPoolListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancerBackendAddressPoolListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::LoadBalancerBackendAddressPoolListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BackendAddressPool> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackendAddressPool = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) backend_address_pool_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name,
&this.backend_address_pool_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::BackendAddressPool>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BackendAddressPool> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackendAddressPool = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) backend_address_pool_name: String,
pub(crate) parameters: models::BackendAddressPool,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name,
&this.backend_address_pool_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::BackendAddressPool>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) backend_address_pool_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name,
&this.backend_address_pool_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod load_balancer_frontend_ip_configurations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the load balancer frontend IP configurations."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets load balancer frontend IP configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `frontend_ip_configuration_name`: The name of the frontend IP configuration."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
frontend_ip_configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
frontend_ip_configuration_name: frontend_ip_configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancerFrontendIpConfigurationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancerFrontendIpConfigurationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(
self,
) -> azure_core::Pageable<models::LoadBalancerFrontendIpConfigurationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/frontendIPConfigurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FrontendIpConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::FrontendIpConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) frontend_ip_configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/frontendIPConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . load_balancer_name , & this . frontend_ip_configuration_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FrontendIpConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod inbound_nat_rules {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the inbound NAT rules in a load balancer."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the specified load balancer inbound NAT rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `inbound_nat_rule_name`: The name of the inbound NAT rule."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
inbound_nat_rule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
inbound_nat_rule_name: inbound_nat_rule_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a load balancer inbound NAT rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `inbound_nat_rule_name`: The name of the inbound NAT rule."]
#[doc = "* `inbound_nat_rule_parameters`: Parameters supplied to the create or update inbound NAT rule operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
inbound_nat_rule_name: impl Into<String>,
inbound_nat_rule_parameters: impl Into<models::InboundNatRule>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
inbound_nat_rule_name: inbound_nat_rule_name.into(),
inbound_nat_rule_parameters: inbound_nat_rule_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified load balancer inbound NAT rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `inbound_nat_rule_name`: The name of the inbound NAT rule."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
inbound_nat_rule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
inbound_nat_rule_name: inbound_nat_rule_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::InboundNatRuleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::InboundNatRuleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::InboundNatRuleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::InboundNatRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::InboundNatRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) inbound_nat_rule_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name,
&this.inbound_nat_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::InboundNatRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::InboundNatRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::InboundNatRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) inbound_nat_rule_name: String,
pub(crate) inbound_nat_rule_parameters: models::InboundNatRule,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name,
&this.inbound_nat_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.inbound_nat_rule_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::InboundNatRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) inbound_nat_rule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name,
&this.inbound_nat_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod load_balancer_load_balancing_rules {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the load balancing rules in a load balancer."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the specified load balancer load balancing rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `load_balancing_rule_name`: The name of the load balancing rule."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
load_balancing_rule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
load_balancing_rule_name: load_balancing_rule_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancerLoadBalancingRuleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancerLoadBalancingRuleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::LoadBalancerLoadBalancingRuleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/loadBalancingRules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancingRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancingRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) load_balancing_rule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/loadBalancingRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name,
&this.load_balancing_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::LoadBalancingRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod load_balancer_outbound_rules {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the outbound rules in a load balancer."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the specified load balancer outbound rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `outbound_rule_name`: The name of the outbound rule."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
outbound_rule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
outbound_rule_name: outbound_rule_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancerOutboundRuleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancerOutboundRuleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::LoadBalancerOutboundRuleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/outboundRules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::OutboundRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::OutboundRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) outbound_rule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/outboundRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name,
&this.outbound_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::OutboundRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod load_balancer_network_interfaces {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets associated load balancer network interfaces."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkInterfaceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkInterfaceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkInterfaceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/networkInterfaces",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod load_balancer_probes {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the load balancer probes."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets load balancer probe."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `load_balancer_name`: The name of the load balancer."]
#[doc = "* `probe_name`: The name of the probe."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
load_balancer_name: impl Into<String>,
probe_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
load_balancer_name: load_balancer_name.into(),
probe_name: probe_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LoadBalancerProbeListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::LoadBalancerProbeListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::LoadBalancerProbeListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/probes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Probe> {
let bytes = self.0.into_body().collect().await?;
let body: models::Probe = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) load_balancer_name: String,
pub(crate) probe_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/probes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.load_balancer_name,
&this.probe_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Probe>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod virtual_networks {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified virtual network by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a virtual network in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `parameters`: Parameters supplied to the create or update virtual network operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
parameters: impl Into<models::VirtualNetwork>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a virtual network tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `parameters`: Parameters supplied to update virtual network tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified virtual network."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all virtual networks in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all virtual networks in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Checks whether a private IP address is available for use."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `ip_address`: The private IP address to be verified."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn check_ip_address_availability(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
ip_address: impl Into<String>,
subscription_id: impl Into<String>,
) -> check_ip_address_availability::RequestBuilder {
check_ip_address_availability::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
ip_address: ip_address.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists usage stats."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_usage(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_usage::RequestBuilder {
list_usage::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetwork> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetwork = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetwork>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetwork> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetwork = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) parameters: models::VirtualNetwork,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetwork>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetwork> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetwork = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetwork>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualNetworkListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/virtualNetworks",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualNetworkListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod check_ip_address_availability {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpAddressAvailabilityResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpAddressAvailabilityResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) ip_address: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/CheckIPAddressAvailability" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let ip_address = &this.ip_address;
req.url_mut().query_pairs_mut().append_pair("ipAddress", ip_address);
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::IpAddressAvailabilityResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_usage {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkListUsageResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkListUsageResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualNetworkListUsageResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/usages",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod subnets {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified subnet by virtual network and resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subnet_name`: The name of the subnet."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subnet_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subnet_name: subnet_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a subnet in the specified virtual network."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subnet_name`: The name of the subnet."]
#[doc = "* `subnet_parameters`: Parameters supplied to the create or update subnet operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subnet_name: impl Into<String>,
subnet_parameters: impl Into<models::Subnet>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subnet_name: subnet_name.into(),
subnet_parameters: subnet_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified subnet."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subnet_name`: The name of the subnet."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subnet_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subnet_name: subnet_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Prepares a subnet by applying network intent policies."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subnet_name`: The name of the subnet."]
#[doc = "* `prepare_network_policies_request_parameters`: Parameters supplied to prepare subnet by applying network intent policies."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn prepare_network_policies(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subnet_name: impl Into<String>,
prepare_network_policies_request_parameters: impl Into<models::PrepareNetworkPoliciesRequest>,
subscription_id: impl Into<String>,
) -> prepare_network_policies::RequestBuilder {
prepare_network_policies::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subnet_name: subnet_name.into(),
prepare_network_policies_request_parameters: prepare_network_policies_request_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Unprepares a subnet by removing network intent policies."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subnet_name`: The name of the subnet."]
#[doc = "* `unprepare_network_policies_request_parameters`: Parameters supplied to unprepare subnet to remove network intent policies."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn unprepare_network_policies(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subnet_name: impl Into<String>,
unprepare_network_policies_request_parameters: impl Into<models::UnprepareNetworkPoliciesRequest>,
subscription_id: impl Into<String>,
) -> unprepare_network_policies::RequestBuilder {
unprepare_network_policies::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subnet_name: subnet_name.into(),
unprepare_network_policies_request_parameters: unprepare_network_policies_request_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all subnets in a virtual network."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Subnet> {
let bytes = self.0.into_body().collect().await?;
let body: models::Subnet = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subnet_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name,
&this.subnet_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Subnet>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Subnet> {
let bytes = self.0.into_body().collect().await?;
let body: models::Subnet = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subnet_name: String,
pub(crate) subnet_parameters: models::Subnet,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name,
&this.subnet_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.subnet_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Subnet>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subnet_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name,
&this.subnet_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod prepare_network_policies {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subnet_name: String,
pub(crate) prepare_network_policies_request_parameters: models::PrepareNetworkPoliciesRequest,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}/PrepareNetworkPolicies" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_name , & this . subnet_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.prepare_network_policies_request_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod unprepare_network_policies {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subnet_name: String,
pub(crate) unprepare_network_policies_request_parameters: models::UnprepareNetworkPoliciesRequest,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}/UnprepareNetworkPolicies" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_name , & this . subnet_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.unprepare_network_policies_request_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SubnetListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SubnetListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::SubnetListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod resource_navigation_links {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets a list of resource navigation links for a subnet."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subnet_name`: The name of the subnet."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subnet_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subnet_name: subnet_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ResourceNavigationLinksListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ResourceNavigationLinksListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subnet_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}/ResourceNavigationLinks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_name , & this . subnet_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ResourceNavigationLinksListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod service_association_links {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets a list of service association links for a subnet."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subnet_name`: The name of the subnet."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subnet_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subnet_name: subnet_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceAssociationLinksListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceAssociationLinksListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subnet_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}/ServiceAssociationLinks" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_name , & this . subnet_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ServiceAssociationLinksListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod virtual_network_peerings {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified virtual network peering."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `virtual_network_peering_name`: The name of the virtual network peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
virtual_network_peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
virtual_network_peering_name: virtual_network_peering_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a peering in the specified virtual network."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `virtual_network_peering_name`: The name of the peering."]
#[doc = "* `virtual_network_peering_parameters`: Parameters supplied to the create or update virtual network peering operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
virtual_network_peering_name: impl Into<String>,
virtual_network_peering_parameters: impl Into<models::VirtualNetworkPeering>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
virtual_network_peering_name: virtual_network_peering_name.into(),
virtual_network_peering_parameters: virtual_network_peering_parameters.into(),
subscription_id: subscription_id.into(),
sync_remote_address_space: None,
}
}
#[doc = "Deletes the specified virtual network peering."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `virtual_network_peering_name`: The name of the virtual network peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
virtual_network_peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
virtual_network_peering_name: virtual_network_peering_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all virtual network peerings in a virtual network."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_name`: The name of the virtual network."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
virtual_network_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_name: virtual_network_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkPeering> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkPeering = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) virtual_network_peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/virtualNetworkPeerings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_name , & this . virtual_network_peering_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkPeering>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkPeering> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkPeering = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) virtual_network_peering_name: String,
pub(crate) virtual_network_peering_parameters: models::VirtualNetworkPeering,
pub(crate) subscription_id: String,
pub(crate) sync_remote_address_space: Option<String>,
}
impl RequestBuilder {
#[doc = "Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated."]
pub fn sync_remote_address_space(mut self, sync_remote_address_space: impl Into<String>) -> Self {
self.sync_remote_address_space = Some(sync_remote_address_space.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/virtualNetworkPeerings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_name , & this . virtual_network_peering_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.virtual_network_peering_parameters)?;
if let Some(sync_remote_address_space) = &this.sync_remote_address_space {
req.url_mut()
.query_pairs_mut()
.append_pair("syncRemoteAddressSpace", sync_remote_address_space);
}
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkPeering>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) virtual_network_peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/virtualNetworkPeerings/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_name , & this . virtual_network_peering_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkPeeringListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkPeeringListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualNetworkPeeringListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/virtualNetworkPeerings",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod network_security_groups {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified network security group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a network security group in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `parameters`: Parameters supplied to the create or update network security group operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
parameters: impl Into<models::NetworkSecurityGroup>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a network security group tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `parameters`: Parameters supplied to update network security group tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified network security group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network security groups in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network security groups in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkSecurityGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkSecurityGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_security_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkSecurityGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkSecurityGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkSecurityGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) parameters: models::NetworkSecurityGroup,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_security_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkSecurityGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkSecurityGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkSecurityGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_security_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkSecurityGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_security_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkSecurityGroupListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkSecurityGroupListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkSecurityGroupListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/networkSecurityGroups",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkSecurityGroupListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkSecurityGroupListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkSecurityGroupListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod security_rules {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get the specified network security rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `security_rule_name`: The name of the security rule."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
security_rule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
security_rule_name: security_rule_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a security rule in the specified network security group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `security_rule_name`: The name of the security rule."]
#[doc = "* `security_rule_parameters`: Parameters supplied to the create or update network security rule operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
security_rule_name: impl Into<String>,
security_rule_parameters: impl Into<models::SecurityRule>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
security_rule_name: security_rule_name.into(),
security_rule_parameters: security_rule_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified network security rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `security_rule_name`: The name of the security rule."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
security_rule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
security_rule_name: security_rule_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all security rules in a network security group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) security_rule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_security_group_name,
&this.security_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SecurityRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) security_rule_name: String,
pub(crate) security_rule_parameters: models::SecurityRule,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_security_group_name,
&this.security_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.security_rule_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SecurityRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) security_rule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_security_group_name,
&this.security_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityRuleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityRuleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::SecurityRuleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_security_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod default_security_rules {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all default security rules in a network security group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Get the specified default network security rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_security_group_name`: The name of the network security group."]
#[doc = "* `default_security_rule_name`: The name of the default security rule."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_security_group_name: impl Into<String>,
default_security_rule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_security_group_name: network_security_group_name.into(),
default_security_rule_name: default_security_rule_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityRuleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityRuleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::SecurityRuleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/defaultSecurityRules" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_security_group_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_security_group_name: String,
pub(crate) default_security_rule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/defaultSecurityRules/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_security_group_name , & this . default_security_rule_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SecurityRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod application_security_groups {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets information about the specified application security group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_security_group_name`: The name of the application security group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
application_security_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_security_group_name: application_security_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates an application security group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_security_group_name`: The name of the application security group."]
#[doc = "* `parameters`: Parameters supplied to the create or update ApplicationSecurityGroup operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
application_security_group_name: impl Into<String>,
parameters: impl Into<models::ApplicationSecurityGroup>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_security_group_name: application_security_group_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates an application security group's tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_security_group_name`: The name of the application security group."]
#[doc = "* `parameters`: Parameters supplied to update application security group tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
application_security_group_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_security_group_name: application_security_group_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified application security group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `application_security_group_name`: The name of the application security group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
application_security_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
application_security_group_name: application_security_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all application security groups in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the application security groups in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationSecurityGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationSecurityGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_security_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_security_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationSecurityGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationSecurityGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationSecurityGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_security_group_name: String,
pub(crate) parameters: models::ApplicationSecurityGroup,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_security_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationSecurityGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationSecurityGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationSecurityGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_security_group_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_security_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ApplicationSecurityGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) application_security_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.application_security_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationSecurityGroupListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationSecurityGroupListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ApplicationSecurityGroupListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/applicationSecurityGroups",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ApplicationSecurityGroupListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ApplicationSecurityGroupListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ApplicationSecurityGroupListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod network_watchers {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified network watcher by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a network watcher in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `parameters`: Parameters that define the network watcher resource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::NetworkWatcher>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a network watcher tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `parameters`: Parameters supplied to update network watcher tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified network watcher resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network watchers by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network watchers by subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the current network topology by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `parameters`: Parameters that define the representation of topology."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_topology(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::TopologyParameters>,
subscription_id: impl Into<String>,
) -> get_topology::RequestBuilder {
get_topology::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Verify IP flow from the specified VM to a location given the currently configured NSG rules."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `parameters`: Parameters that define the IP flow to be verified."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn verify_ip_flow(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::VerificationIpFlowParameters>,
subscription_id: impl Into<String>,
) -> verify_ip_flow::RequestBuilder {
verify_ip_flow::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the next hop from the specified VM."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `parameters`: Parameters that define the source and destination endpoint."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_next_hop(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::NextHopParameters>,
subscription_id: impl Into<String>,
) -> get_next_hop::RequestBuilder {
get_next_hop::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the configured and effective security group rules on the specified VM."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `parameters`: Parameters that define the VM to check security groups for."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_vm_security_rules(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::SecurityGroupViewParameters>,
subscription_id: impl Into<String>,
) -> get_vm_security_rules::RequestBuilder {
get_vm_security_rules::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Initiate troubleshooting on a specified resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher resource."]
#[doc = "* `parameters`: Parameters that define the resource to troubleshoot."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_troubleshooting(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::TroubleshootingParameters>,
subscription_id: impl Into<String>,
) -> get_troubleshooting::RequestBuilder {
get_troubleshooting::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Get the last completed troubleshooting result on a specified resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher resource."]
#[doc = "* `parameters`: Parameters that define the resource to query the troubleshooting result."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_troubleshooting_result(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::QueryTroubleshootingParameters>,
subscription_id: impl Into<String>,
) -> get_troubleshooting_result::RequestBuilder {
get_troubleshooting_result::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Configures flow log and traffic analytics (optional) on a specified resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the network watcher resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher resource."]
#[doc = "* `parameters`: Parameters that define the configuration of flow log."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn set_flow_log_configuration(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::FlowLogInformation>,
subscription_id: impl Into<String>,
) -> set_flow_log_configuration::RequestBuilder {
set_flow_log_configuration::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Queries status of flow log and traffic analytics (optional) on a specified resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the network watcher resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher resource."]
#[doc = "* `parameters`: Parameters that define a resource to query flow log and traffic analytics (optional) status."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_flow_log_status(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::FlowLogStatusParameters>,
subscription_id: impl Into<String>,
) -> get_flow_log_status::RequestBuilder {
get_flow_log_status::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the network watcher resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher resource."]
#[doc = "* `parameters`: Parameters that determine how the connectivity check will be performed."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn check_connectivity(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::ConnectivityParameters>,
subscription_id: impl Into<String>,
) -> check_connectivity::RequestBuilder {
check_connectivity::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the network watcher resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher resource."]
#[doc = "* `parameters`: Parameters that determine Azure reachability report configuration."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_azure_reachability_report(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::AzureReachabilityReportParameters>,
subscription_id: impl Into<String>,
) -> get_azure_reachability_report::RequestBuilder {
get_azure_reachability_report::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the network watcher resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher resource."]
#[doc = "* `parameters`: Parameters that scope the list of available providers."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_available_providers(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::AvailableProvidersListParameters>,
subscription_id: impl Into<String>,
) -> list_available_providers::RequestBuilder {
list_available_providers::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `parameters`: Parameters to get network configuration diagnostic."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_network_configuration_diagnostic(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
parameters: impl Into<models::NetworkConfigurationDiagnosticParameters>,
subscription_id: impl Into<String>,
) -> get_network_configuration_diagnostic::RequestBuilder {
get_network_configuration_diagnostic::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkWatcher> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkWatcher = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkWatcher>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkWatcher> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkWatcher = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::NetworkWatcher,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkWatcher>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkWatcher> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkWatcher = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkWatcher>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkWatcherListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkWatcherListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkWatcherListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkWatcherListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkWatcherListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/networkWatchers",
this.client.endpoint(),
&this.subscription_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkWatcherListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_topology {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Topology> {
let bytes = self.0.into_body().collect().await?;
let body: models::Topology = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::TopologyParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/topology",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Topology>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod verify_ip_flow {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VerificationIpFlowResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VerificationIpFlowResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::VerificationIpFlowParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/ipFlowVerify",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VerificationIpFlowResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_next_hop {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NextHopResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NextHopResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::NextHopParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/nextHop",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NextHopResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_vm_security_rules {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityGroupViewResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityGroupViewResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::SecurityGroupViewParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/securityGroupView",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SecurityGroupViewResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_troubleshooting {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::TroubleshootingResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::TroubleshootingResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::TroubleshootingParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/troubleshoot",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::TroubleshootingResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_troubleshooting_result {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::TroubleshootingResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::TroubleshootingResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::QueryTroubleshootingParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/queryTroubleshootResult",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::TroubleshootingResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod set_flow_log_configuration {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FlowLogInformation> {
let bytes = self.0.into_body().collect().await?;
let body: models::FlowLogInformation = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::FlowLogInformation,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/configureFlowLog",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FlowLogInformation>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_flow_log_status {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FlowLogInformation> {
let bytes = self.0.into_body().collect().await?;
let body: models::FlowLogInformation = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::FlowLogStatusParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/queryFlowLogStatus",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FlowLogInformation>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod check_connectivity {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectivityInformation> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectivityInformation = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::ConnectivityParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/connectivityCheck",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectivityInformation>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_azure_reachability_report {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AzureReachabilityReport> {
let bytes = self.0.into_body().collect().await?;
let body: models::AzureReachabilityReport = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::AzureReachabilityReportParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/azureReachabilityReport",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AzureReachabilityReport>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_available_providers {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AvailableProvidersList> {
let bytes = self.0.into_body().collect().await?;
let body: models::AvailableProvidersList = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::AvailableProvidersListParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/availableProvidersList",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AvailableProvidersList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_network_configuration_diagnostic {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkConfigurationDiagnosticResponse> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkConfigurationDiagnosticResponse = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) parameters: models::NetworkConfigurationDiagnosticParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/networkConfigurationDiagnostic" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_watcher_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkConfigurationDiagnosticResponse>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod packet_captures {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets a packet capture session by name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `packet_capture_name`: The name of the packet capture session."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
packet_capture_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
packet_capture_name: packet_capture_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create and start a packet capture on the specified VM."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `packet_capture_name`: The name of the packet capture session."]
#[doc = "* `parameters`: Parameters that define the create packet capture operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
packet_capture_name: impl Into<String>,
parameters: impl Into<models::PacketCapture>,
subscription_id: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
packet_capture_name: packet_capture_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified packet capture session."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `packet_capture_name`: The name of the packet capture session."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
packet_capture_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
packet_capture_name: packet_capture_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Stops a specified packet capture session."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `packet_capture_name`: The name of the packet capture session."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn stop(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
packet_capture_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> stop::RequestBuilder {
stop::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
packet_capture_name: packet_capture_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Query the status of a running packet capture session."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `packet_capture_name`: The name given to the packet capture session."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_status(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
packet_capture_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_status::RequestBuilder {
get_status::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
packet_capture_name: packet_capture_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all packet capture sessions within the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PacketCaptureResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PacketCaptureResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) packet_capture_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/packetCaptures/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.packet_capture_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PacketCaptureResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PacketCaptureResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PacketCaptureResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) packet_capture_name: String,
pub(crate) parameters: models::PacketCapture,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/packetCaptures/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.packet_capture_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PacketCaptureResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) packet_capture_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/packetCaptures/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.packet_capture_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod stop {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) packet_capture_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/packetCaptures/{}/stop",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.packet_capture_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_status {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PacketCaptureQueryStatusResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PacketCaptureQueryStatusResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) packet_capture_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/packetCaptures/{}/queryStatus" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_watcher_name , & this . packet_capture_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PacketCaptureQueryStatusResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PacketCaptureListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PacketCaptureListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/packetCaptures",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PacketCaptureListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod connection_monitors {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets a connection monitor by name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group containing Network Watcher."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `connection_monitor_name`: The name of the connection monitor."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
connection_monitor_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
connection_monitor_name: connection_monitor_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create or update a connection monitor."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group containing Network Watcher."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `connection_monitor_name`: The name of the connection monitor."]
#[doc = "* `parameters`: Parameters that define the operation to create a connection monitor."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
connection_monitor_name: impl Into<String>,
parameters: impl Into<models::ConnectionMonitor>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
connection_monitor_name: connection_monitor_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
migrate: None,
}
}
#[doc = "Update tags of the specified connection monitor."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `connection_monitor_name`: The name of the connection monitor."]
#[doc = "* `parameters`: Parameters supplied to update connection monitor tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
connection_monitor_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
connection_monitor_name: connection_monitor_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified connection monitor."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group containing Network Watcher."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `connection_monitor_name`: The name of the connection monitor."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
connection_monitor_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
connection_monitor_name: connection_monitor_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Stops the specified connection monitor."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group containing Network Watcher."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `connection_monitor_name`: The name of the connection monitor."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn stop(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
connection_monitor_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> stop::RequestBuilder {
stop::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
connection_monitor_name: connection_monitor_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Starts the specified connection monitor."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group containing Network Watcher."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `connection_monitor_name`: The name of the connection monitor."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn start(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
connection_monitor_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> start::RequestBuilder {
start::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
connection_monitor_name: connection_monitor_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Query a snapshot of the most recent connection states."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group containing Network Watcher."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `connection_monitor_name`: The name given to the connection monitor."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn query(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
connection_monitor_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> query::RequestBuilder {
query::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
connection_monitor_name: connection_monitor_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all connection monitors for the specified Network Watcher."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group containing Network Watcher."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionMonitorResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionMonitorResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) connection_monitor_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/connectionMonitors/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.connection_monitor_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionMonitorResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionMonitorResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionMonitorResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) connection_monitor_name: String,
pub(crate) parameters: models::ConnectionMonitor,
pub(crate) subscription_id: String,
pub(crate) migrate: Option<String>,
}
impl RequestBuilder {
#[doc = "Value indicating whether connection monitor V1 should be migrated to V2 format."]
pub fn migrate(mut self, migrate: impl Into<String>) -> Self {
self.migrate = Some(migrate.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/connectionMonitors/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.connection_monitor_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
if let Some(migrate) = &this.migrate {
req.url_mut().query_pairs_mut().append_pair("migrate", migrate);
}
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionMonitorResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionMonitorResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionMonitorResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) connection_monitor_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/connectionMonitors/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.connection_monitor_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionMonitorResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) connection_monitor_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/connectionMonitors/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.connection_monitor_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod stop {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) connection_monitor_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/connectionMonitors/{}/stop" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_watcher_name , & this . connection_monitor_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod start {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) connection_monitor_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/connectionMonitors/{}/start" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_watcher_name , & this . connection_monitor_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod query {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionMonitorQueryResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionMonitorQueryResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) connection_monitor_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/connectionMonitors/{}/query" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_watcher_name , & this . connection_monitor_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionMonitorQueryResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionMonitorListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionMonitorListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/connectionMonitors",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionMonitorListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod flow_logs {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets a flow log resource by name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `flow_log_name`: The name of the flow log resource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
flow_log_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
flow_log_name: flow_log_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create or update a flow log for the specified network security group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `flow_log_name`: The name of the flow log."]
#[doc = "* `parameters`: Parameters that define the create or update flow log resource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
flow_log_name: impl Into<String>,
parameters: impl Into<models::FlowLog>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
flow_log_name: flow_log_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update tags of the specified flow log."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `flow_log_name`: The name of the flow log."]
#[doc = "* `parameters`: Parameters supplied to update flow log tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
flow_log_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
flow_log_name: flow_log_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified flow log resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_watcher_name`: The name of the network watcher."]
#[doc = "* `flow_log_name`: The name of the flow log resource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
flow_log_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
flow_log_name: flow_log_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all flow log resources for the specified Network Watcher."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group containing Network Watcher."]
#[doc = "* `network_watcher_name`: The name of the Network Watcher resource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
network_watcher_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_watcher_name: network_watcher_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FlowLog> {
let bytes = self.0.into_body().collect().await?;
let body: models::FlowLog = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) flow_log_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/flowLogs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.flow_log_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FlowLog>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FlowLog> {
let bytes = self.0.into_body().collect().await?;
let body: models::FlowLog = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) flow_log_name: String,
pub(crate) parameters: models::FlowLog,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/flowLogs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.flow_log_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FlowLog>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FlowLog> {
let bytes = self.0.into_body().collect().await?;
let body: models::FlowLog = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) flow_log_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/flowLogs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.flow_log_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FlowLog>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) flow_log_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/flowLogs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name,
&this.flow_log_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FlowLogListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::FlowLogListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_watcher_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::FlowLogListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkWatchers/{}/flowLogs",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_watcher_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod route_tables {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified route table."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_table_name`: The name of the route table."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
route_table_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_table_name: route_table_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Create or updates a route table in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_table_name`: The name of the route table."]
#[doc = "* `parameters`: Parameters supplied to the create or update route table operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
route_table_name: impl Into<String>,
parameters: impl Into<models::RouteTable>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_table_name: route_table_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a route table tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_table_name`: The name of the route table."]
#[doc = "* `parameters`: Parameters supplied to update route table tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
route_table_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_table_name: route_table_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified route table."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_table_name`: The name of the route table."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
route_table_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_table_name: route_table_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all route tables in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all route tables in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteTable> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteTable = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_table_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RouteTable>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteTable> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteTable = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_table_name: String,
pub(crate) parameters: models::RouteTable,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RouteTable>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteTable> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteTable = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_table_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RouteTable>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_table_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteTableListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteTableListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::RouteTableListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteTableListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteTableListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::RouteTableListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/routeTables",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod routes {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified route from a route table."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_table_name`: The name of the route table."]
#[doc = "* `route_name`: The name of the route."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
route_table_name: impl Into<String>,
route_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_table_name: route_table_name.into(),
route_name: route_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a route in the specified route table."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_table_name`: The name of the route table."]
#[doc = "* `route_name`: The name of the route."]
#[doc = "* `route_parameters`: Parameters supplied to the create or update route operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
route_table_name: impl Into<String>,
route_name: impl Into<String>,
route_parameters: impl Into<models::Route>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_table_name: route_table_name.into(),
route_name: route_name.into(),
route_parameters: route_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified route from a route table."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_table_name`: The name of the route table."]
#[doc = "* `route_name`: The name of the route."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
route_table_name: impl Into<String>,
route_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_table_name: route_table_name.into(),
route_name: route_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all routes in a route table."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_table_name`: The name of the route table."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
route_table_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_table_name: route_table_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Route> {
let bytes = self.0.into_body().collect().await?;
let body: models::Route = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_table_name: String,
pub(crate) route_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_table_name,
&this.route_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Route>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Route> {
let bytes = self.0.into_body().collect().await?;
let body: models::Route = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_table_name: String,
pub(crate) route_name: String,
pub(crate) route_parameters: models::Route,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_table_name,
&this.route_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.route_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Route>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_table_name: String,
pub(crate) route_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_table_name,
&this.route_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_table_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::RouteListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_table_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod service_endpoint_policies {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified service Endpoint Policies in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_endpoint_policy_name`: The name of the service endpoint policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
service_endpoint_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_endpoint_policy_name: service_endpoint_policy_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a service Endpoint Policies."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_endpoint_policy_name`: The name of the service endpoint policy."]
#[doc = "* `parameters`: Parameters supplied to the create or update service endpoint policy operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
service_endpoint_policy_name: impl Into<String>,
parameters: impl Into<models::ServiceEndpointPolicy>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_endpoint_policy_name: service_endpoint_policy_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates tags of a service endpoint policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_endpoint_policy_name`: The name of the service endpoint policy."]
#[doc = "* `parameters`: Parameters supplied to update service endpoint policy tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
service_endpoint_policy_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_endpoint_policy_name: service_endpoint_policy_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified service endpoint policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_endpoint_policy_name`: The name of the service endpoint policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
service_endpoint_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_endpoint_policy_name: service_endpoint_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the service endpoint policies in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all service endpoint Policies in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceEndpointPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_endpoint_policy_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.service_endpoint_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceEndpointPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_endpoint_policy_name: String,
pub(crate) parameters: models::ServiceEndpointPolicy,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.service_endpoint_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceEndpointPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_endpoint_policy_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.service_endpoint_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_endpoint_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.service_endpoint_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointPolicyListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceEndpointPolicyListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ServiceEndpointPolicyListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/ServiceEndpointPolicies",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointPolicyListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceEndpointPolicyListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ServiceEndpointPolicyListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod service_endpoint_policy_definitions {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get the specified service endpoint policy definitions from service endpoint policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_endpoint_policy_name`: The name of the service endpoint policy name."]
#[doc = "* `service_endpoint_policy_definition_name`: The name of the service endpoint policy definition name."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
service_endpoint_policy_name: impl Into<String>,
service_endpoint_policy_definition_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_endpoint_policy_name: service_endpoint_policy_name.into(),
service_endpoint_policy_definition_name: service_endpoint_policy_definition_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a service endpoint policy definition in the specified service endpoint policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_endpoint_policy_name`: The name of the service endpoint policy."]
#[doc = "* `service_endpoint_policy_definition_name`: The name of the service endpoint policy definition name."]
#[doc = "* `service_endpoint_policy_definitions`: Parameters supplied to the create or update service endpoint policy operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
service_endpoint_policy_name: impl Into<String>,
service_endpoint_policy_definition_name: impl Into<String>,
service_endpoint_policy_definitions: impl Into<models::ServiceEndpointPolicyDefinition>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_endpoint_policy_name: service_endpoint_policy_name.into(),
service_endpoint_policy_definition_name: service_endpoint_policy_definition_name.into(),
service_endpoint_policy_definitions: service_endpoint_policy_definitions.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified ServiceEndpoint policy definitions."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_endpoint_policy_name`: The name of the Service Endpoint Policy."]
#[doc = "* `service_endpoint_policy_definition_name`: The name of the service endpoint policy definition."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
service_endpoint_policy_name: impl Into<String>,
service_endpoint_policy_definition_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_endpoint_policy_name: service_endpoint_policy_name.into(),
service_endpoint_policy_definition_name: service_endpoint_policy_definition_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all service endpoint policy definitions in a service end point policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_endpoint_policy_name`: The name of the service endpoint policy name."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
service_endpoint_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_endpoint_policy_name: service_endpoint_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointPolicyDefinition> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceEndpointPolicyDefinition = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_endpoint_policy_name: String,
pub(crate) service_endpoint_policy_definition_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_endpoint_policy_name , & this . service_endpoint_policy_definition_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointPolicyDefinition>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointPolicyDefinition> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceEndpointPolicyDefinition = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_endpoint_policy_name: String,
pub(crate) service_endpoint_policy_definition_name: String,
pub(crate) service_endpoint_policy_definitions: models::ServiceEndpointPolicyDefinition,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_endpoint_policy_name , & this . service_endpoint_policy_definition_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.service_endpoint_policy_definitions)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ServiceEndpointPolicyDefinition>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_endpoint_policy_name: String,
pub(crate) service_endpoint_policy_definition_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_endpoint_policy_name , & this . service_endpoint_policy_definition_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceEndpointPolicyDefinitionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceEndpointPolicyDefinitionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_endpoint_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ServiceEndpointPolicyDefinitionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_endpoint_policy_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod private_endpoints {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified private endpoint by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `private_endpoint_name`: The name of the private endpoint."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
private_endpoint_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
private_endpoint_name: private_endpoint_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates an private endpoint in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `private_endpoint_name`: The name of the private endpoint."]
#[doc = "* `parameters`: Parameters supplied to the create or update private endpoint operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
private_endpoint_name: impl Into<String>,
parameters: impl Into<models::PrivateEndpoint>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
private_endpoint_name: private_endpoint_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified private endpoint."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `private_endpoint_name`: The name of the private endpoint."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
private_endpoint_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
private_endpoint_name: private_endpoint_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all private endpoints in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all private endpoints in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_subscription(&self, subscription_id: impl Into<String>) -> list_by_subscription::RequestBuilder {
list_by_subscription::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateEndpoint> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpoint = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) private_endpoint_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateEndpoints/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.private_endpoint_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateEndpoint>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateEndpoint> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpoint = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) private_endpoint_name: String,
pub(crate) parameters: models::PrivateEndpoint,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateEndpoints/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.private_endpoint_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateEndpoint>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) private_endpoint_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateEndpoints/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.private_endpoint_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateEndpointListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpointListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PrivateEndpointListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateEndpoints",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_subscription {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateEndpointListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpointListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PrivateEndpointListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/privateEndpoints",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod available_private_endpoint_types {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location of the domain name."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, location: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
location: location.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location of the domain name."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
location: impl Into<String>,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
location: location.into(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AvailablePrivateEndpointTypesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AvailablePrivateEndpointTypesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AvailablePrivateEndpointTypesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/availablePrivateEndpointTypes",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AvailablePrivateEndpointTypesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AvailablePrivateEndpointTypesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AvailablePrivateEndpointTypesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/locations/{}/availablePrivateEndpointTypes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod private_dns_zone_groups {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the private dns zone group resource by specified private dns zone group name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `private_endpoint_name`: The name of the private endpoint."]
#[doc = "* `private_dns_zone_group_name`: The name of the private dns zone group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
private_endpoint_name: impl Into<String>,
private_dns_zone_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
private_endpoint_name: private_endpoint_name.into(),
private_dns_zone_group_name: private_dns_zone_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a private dns zone group in the specified private endpoint."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `private_endpoint_name`: The name of the private endpoint."]
#[doc = "* `private_dns_zone_group_name`: The name of the private dns zone group."]
#[doc = "* `parameters`: Parameters supplied to the create or update private dns zone group operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
private_endpoint_name: impl Into<String>,
private_dns_zone_group_name: impl Into<String>,
parameters: impl Into<models::PrivateDnsZoneGroup>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
private_endpoint_name: private_endpoint_name.into(),
private_dns_zone_group_name: private_dns_zone_group_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified private dns zone group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `private_endpoint_name`: The name of the private endpoint."]
#[doc = "* `private_dns_zone_group_name`: The name of the private dns zone group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
private_endpoint_name: impl Into<String>,
private_dns_zone_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
private_endpoint_name: private_endpoint_name.into(),
private_dns_zone_group_name: private_dns_zone_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all private dns zone groups in a private endpoint."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `private_endpoint_name`: The name of the private endpoint."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
private_endpoint_name: impl Into<String>,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
private_endpoint_name: private_endpoint_name.into(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateDnsZoneGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateDnsZoneGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) private_endpoint_name: String,
pub(crate) private_dns_zone_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateEndpoints/{}/privateDnsZoneGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.private_endpoint_name,
&this.private_dns_zone_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateDnsZoneGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateDnsZoneGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateDnsZoneGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) private_endpoint_name: String,
pub(crate) private_dns_zone_group_name: String,
pub(crate) parameters: models::PrivateDnsZoneGroup,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateEndpoints/{}/privateDnsZoneGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.private_endpoint_name,
&this.private_dns_zone_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateDnsZoneGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) private_endpoint_name: String,
pub(crate) private_dns_zone_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateEndpoints/{}/privateDnsZoneGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.private_endpoint_name,
&this.private_dns_zone_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateDnsZoneGroupListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateDnsZoneGroupListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) private_endpoint_name: String,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PrivateDnsZoneGroupListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateEndpoints/{}/privateDnsZoneGroups",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.private_endpoint_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod private_link_services {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified private link service by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_name`: The name of the private link service."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
service_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_name: service_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates an private link service in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_name`: The name of the private link service."]
#[doc = "* `parameters`: Parameters supplied to the create or update private link service operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
service_name: impl Into<String>,
parameters: impl Into<models::PrivateLinkService>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_name: service_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified private link service."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_name`: The name of the private link service."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
service_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_name: service_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all private link services in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all private link service in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_subscription(&self, subscription_id: impl Into<String>) -> list_by_subscription::RequestBuilder {
list_by_subscription::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Get the specific private end point connection by specific private link service in the resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_name`: The name of the private link service."]
#[doc = "* `pe_connection_name`: The name of the private end point connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_private_endpoint_connection(
&self,
resource_group_name: impl Into<String>,
service_name: impl Into<String>,
pe_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_private_endpoint_connection::RequestBuilder {
get_private_endpoint_connection::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_name: service_name.into(),
pe_connection_name: pe_connection_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Approve or reject private end point connection for a private link service in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_name`: The name of the private link service."]
#[doc = "* `pe_connection_name`: The name of the private end point connection."]
#[doc = "* `parameters`: Parameters supplied to approve or reject the private end point connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_private_endpoint_connection(
&self,
resource_group_name: impl Into<String>,
service_name: impl Into<String>,
pe_connection_name: impl Into<String>,
parameters: impl Into<models::PrivateEndpointConnection>,
subscription_id: impl Into<String>,
) -> update_private_endpoint_connection::RequestBuilder {
update_private_endpoint_connection::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_name: service_name.into(),
pe_connection_name: pe_connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete private end point connection for a private link service in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_name`: The name of the private link service."]
#[doc = "* `pe_connection_name`: The name of the private end point connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete_private_endpoint_connection(
&self,
resource_group_name: impl Into<String>,
service_name: impl Into<String>,
pe_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete_private_endpoint_connection::RequestBuilder {
delete_private_endpoint_connection::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_name: service_name.into(),
pe_connection_name: pe_connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all private end point connections for a specific private link service."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `service_name`: The name of the private link service."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_private_endpoint_connections(
&self,
resource_group_name: impl Into<String>,
service_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_private_endpoint_connections::RequestBuilder {
list_private_endpoint_connections::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
service_name: service_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Checks whether the subscription is visible to private link service."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location of the domain name."]
#[doc = "* `parameters`: The request body of CheckPrivateLinkService API call."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn check_private_link_service_visibility(
&self,
location: impl Into<String>,
parameters: impl Into<models::CheckPrivateLinkServiceVisibilityRequest>,
subscription_id: impl Into<String>,
) -> check_private_link_service_visibility::RequestBuilder {
check_private_link_service_visibility::RequestBuilder {
client: self.0.clone(),
location: location.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Checks whether the subscription is visible to private link service in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location of the domain name."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `parameters`: The request body of CheckPrivateLinkService API call."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn check_private_link_service_visibility_by_resource_group(
&self,
location: impl Into<String>,
resource_group_name: impl Into<String>,
parameters: impl Into<models::CheckPrivateLinkServiceVisibilityRequest>,
subscription_id: impl Into<String>,
) -> check_private_link_service_visibility_by_resource_group::RequestBuilder {
check_private_link_service_visibility_by_resource_group::RequestBuilder {
client: self.0.clone(),
location: location.into(),
resource_group_name: resource_group_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location of the domain name."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_auto_approved_private_link_services(
&self,
location: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_auto_approved_private_link_services::RequestBuilder {
list_auto_approved_private_link_services::RequestBuilder {
client: self.0.clone(),
location: location.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location of the domain name."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_auto_approved_private_link_services_by_resource_group(
&self,
location: impl Into<String>,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_auto_approved_private_link_services_by_resource_group::RequestBuilder {
list_auto_approved_private_link_services_by_resource_group::RequestBuilder {
client: self.0.clone(),
location: location.into(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateLinkService> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateLinkService = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateLinkServices/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.service_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateLinkService>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateLinkService> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateLinkService = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_name: String,
pub(crate) parameters: models::PrivateLinkService,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateLinkServices/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.service_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateLinkService>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateLinkServices/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.service_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateLinkServiceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateLinkServiceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PrivateLinkServiceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateLinkServices",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_subscription {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateLinkServiceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateLinkServiceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PrivateLinkServiceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/privateLinkServices",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_private_endpoint_connection {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateEndpointConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_name: String,
pub(crate) pe_connection_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateLinkServices/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . pe_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateEndpointConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_private_endpoint_connection {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateEndpointConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_name: String,
pub(crate) pe_connection_name: String,
pub(crate) parameters: models::PrivateEndpointConnection,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateLinkServices/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . pe_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateEndpointConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete_private_endpoint_connection {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_name: String,
pub(crate) pe_connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateLinkServices/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name , & this . pe_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_private_endpoint_connections {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateEndpointConnectionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpointConnectionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) service_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PrivateEndpointConnectionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/privateLinkServices/{}/privateEndpointConnections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . service_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod check_private_link_service_visibility {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateLinkServiceVisibility> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateLinkServiceVisibility = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) parameters: models::CheckPrivateLinkServiceVisibilityRequest,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/checkPrivateLinkServiceVisibility",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateLinkServiceVisibility>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod check_private_link_service_visibility_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateLinkServiceVisibility> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateLinkServiceVisibility = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) resource_group_name: String,
pub(crate) parameters: models::CheckPrivateLinkServiceVisibilityRequest,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/locations/{}/checkPrivateLinkServiceVisibility" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . location)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateLinkServiceVisibility>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_auto_approved_private_link_services {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AutoApprovedPrivateLinkServicesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AutoApprovedPrivateLinkServicesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AutoApprovedPrivateLinkServicesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/autoApprovedPrivateLinkServices",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_auto_approved_private_link_services_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AutoApprovedPrivateLinkServicesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AutoApprovedPrivateLinkServicesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AutoApprovedPrivateLinkServicesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/locations/{}/autoApprovedPrivateLinkServices" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . location)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod network_profiles {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified network profile in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_profile_name`: The name of the public IP prefix."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_profile_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_profile_name: network_profile_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a network profile."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_profile_name`: The name of the network profile."]
#[doc = "* `parameters`: Parameters supplied to the create or update network profile operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_profile_name: impl Into<String>,
parameters: impl Into<models::NetworkProfile>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_profile_name: network_profile_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates network profile tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_profile_name`: The name of the network profile."]
#[doc = "* `parameters`: Parameters supplied to update network profile tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
network_profile_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_profile_name: network_profile_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified network profile."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_profile_name`: The name of the NetworkProfile."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_profile_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_profile_name: network_profile_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the network profiles in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all network profiles in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkProfile> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkProfile = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_profile_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkProfiles/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_profile_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkProfile>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkProfile> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkProfile = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_profile_name: String,
pub(crate) parameters: models::NetworkProfile,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkProfiles/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_profile_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkProfile>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkProfile> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkProfile = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_profile_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkProfiles/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_profile_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkProfile>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_profile_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkProfiles/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_profile_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkProfileListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkProfileListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkProfileListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/networkProfiles",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkProfileListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkProfileListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkProfileListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkProfiles",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod public_ip_addresses {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified public IP address in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `public_ip_address_name`: The name of the public IP address."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
public_ip_address_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
public_ip_address_name: public_ip_address_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a static or dynamic public IP address."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `public_ip_address_name`: The name of the public IP address."]
#[doc = "* `parameters`: Parameters supplied to the create or update public IP address operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
public_ip_address_name: impl Into<String>,
parameters: impl Into<models::PublicIpAddress>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
public_ip_address_name: public_ip_address_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates public IP address tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `public_ip_address_name`: The name of the public IP address."]
#[doc = "* `parameters`: Parameters supplied to update public IP address tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
public_ip_address_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
public_ip_address_name: public_ip_address_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified public IP address."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `public_ip_address_name`: The name of the public IP address."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
public_ip_address_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
public_ip_address_name: public_ip_address_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the public IP addresses in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all public IP addresses in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets information about all public IP addresses on a cloud service level."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cloud_service_name`: The name of the cloud service."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_cloud_service_public_ip_addresses(
&self,
resource_group_name: impl Into<String>,
cloud_service_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_cloud_service_public_ip_addresses::RequestBuilder {
list_cloud_service_public_ip_addresses::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cloud_service_name: cloud_service_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets information about all public IP addresses in a role instance IP configuration in a cloud service."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cloud_service_name`: The name of the cloud service."]
#[doc = "* `role_instance_name`: The name of role instance."]
#[doc = "* `network_interface_name`: The network interface name."]
#[doc = "* `ip_configuration_name`: The IP configuration name."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_cloud_service_role_instance_public_ip_addresses(
&self,
resource_group_name: impl Into<String>,
cloud_service_name: impl Into<String>,
role_instance_name: impl Into<String>,
network_interface_name: impl Into<String>,
ip_configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_cloud_service_role_instance_public_ip_addresses::RequestBuilder {
list_cloud_service_role_instance_public_ip_addresses::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cloud_service_name: cloud_service_name.into(),
role_instance_name: role_instance_name.into(),
network_interface_name: network_interface_name.into(),
ip_configuration_name: ip_configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Get the specified public IP address in a cloud service."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cloud_service_name`: The name of the cloud service."]
#[doc = "* `role_instance_name`: The role instance name."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `ip_configuration_name`: The name of the IP configuration."]
#[doc = "* `public_ip_address_name`: The name of the public IP Address."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_cloud_service_public_ip_address(
&self,
resource_group_name: impl Into<String>,
cloud_service_name: impl Into<String>,
role_instance_name: impl Into<String>,
network_interface_name: impl Into<String>,
ip_configuration_name: impl Into<String>,
public_ip_address_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_cloud_service_public_ip_address::RequestBuilder {
get_cloud_service_public_ip_address::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cloud_service_name: cloud_service_name.into(),
role_instance_name: role_instance_name.into(),
network_interface_name: network_interface_name.into(),
ip_configuration_name: ip_configuration_name.into(),
public_ip_address_name: public_ip_address_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Gets information about all public IP addresses on a virtual machine scale set level."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_machine_scale_set_name`: The name of the virtual machine scale set."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_virtual_machine_scale_set_public_ip_addresses(
&self,
resource_group_name: impl Into<String>,
virtual_machine_scale_set_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_virtual_machine_scale_set_public_ip_addresses::RequestBuilder {
list_virtual_machine_scale_set_public_ip_addresses::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_machine_scale_set_name: virtual_machine_scale_set_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_machine_scale_set_name`: The name of the virtual machine scale set."]
#[doc = "* `virtualmachine_index`: The virtual machine index."]
#[doc = "* `network_interface_name`: The network interface name."]
#[doc = "* `ip_configuration_name`: The IP configuration name."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_virtual_machine_scale_set_vm_public_ip_addresses(
&self,
resource_group_name: impl Into<String>,
virtual_machine_scale_set_name: impl Into<String>,
virtualmachine_index: impl Into<String>,
network_interface_name: impl Into<String>,
ip_configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_virtual_machine_scale_set_vm_public_ip_addresses::RequestBuilder {
list_virtual_machine_scale_set_vm_public_ip_addresses::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_machine_scale_set_name: virtual_machine_scale_set_name.into(),
virtualmachine_index: virtualmachine_index.into(),
network_interface_name: network_interface_name.into(),
ip_configuration_name: ip_configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Get the specified public IP address in a virtual machine scale set."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_machine_scale_set_name`: The name of the virtual machine scale set."]
#[doc = "* `virtualmachine_index`: The virtual machine index."]
#[doc = "* `network_interface_name`: The name of the network interface."]
#[doc = "* `ip_configuration_name`: The name of the IP configuration."]
#[doc = "* `public_ip_address_name`: The name of the public IP Address."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_virtual_machine_scale_set_public_ip_address(
&self,
resource_group_name: impl Into<String>,
virtual_machine_scale_set_name: impl Into<String>,
virtualmachine_index: impl Into<String>,
network_interface_name: impl Into<String>,
ip_configuration_name: impl Into<String>,
public_ip_address_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_virtual_machine_scale_set_public_ip_address::RequestBuilder {
get_virtual_machine_scale_set_public_ip_address::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_machine_scale_set_name: virtual_machine_scale_set_name.into(),
virtualmachine_index: virtualmachine_index.into(),
network_interface_name: network_interface_name.into(),
ip_configuration_name: ip_configuration_name.into(),
public_ip_address_name: public_ip_address_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddress> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddress = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) public_ip_address_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.public_ip_address_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PublicIpAddress>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddress> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddress = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) public_ip_address_name: String,
pub(crate) parameters: models::PublicIpAddress,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.public_ip_address_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PublicIpAddress>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddress> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddress = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) public_ip_address_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.public_ip_address_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PublicIpAddress>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) public_ip_address_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.public_ip_address_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddressListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddressListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PublicIpAddressListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/publicIPAddresses",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddressListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddressListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PublicIpAddressListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_cloud_service_public_ip_addresses {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddressListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddressListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cloud_service_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PublicIpAddressListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Compute/cloudServices/{}/publicipaddresses",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.cloud_service_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_cloud_service_role_instance_public_ip_addresses {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddressListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddressListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cloud_service_name: String,
pub(crate) role_instance_name: String,
pub(crate) network_interface_name: String,
pub(crate) ip_configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PublicIpAddressListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Compute/cloudServices/{}/roleInstances/{}/networkInterfaces/{}/ipconfigurations/{}/publicipaddresses" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cloud_service_name , & this . role_instance_name , & this . network_interface_name , & this . ip_configuration_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_cloud_service_public_ip_address {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddress> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddress = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cloud_service_name: String,
pub(crate) role_instance_name: String,
pub(crate) network_interface_name: String,
pub(crate) ip_configuration_name: String,
pub(crate) public_ip_address_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Compute/cloudServices/{}/roleInstances/{}/networkInterfaces/{}/ipconfigurations/{}/publicipaddresses/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cloud_service_name , & this . role_instance_name , & this . network_interface_name , & this . ip_configuration_name , & this . public_ip_address_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PublicIpAddress>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_virtual_machine_scale_set_public_ip_addresses {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddressListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddressListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_machine_scale_set_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PublicIpAddressListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Compute/virtualMachineScaleSets/{}/publicipaddresses" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_machine_scale_set_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_virtual_machine_scale_set_vm_public_ip_addresses {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddressListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddressListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_machine_scale_set_name: String,
pub(crate) virtualmachine_index: String,
pub(crate) network_interface_name: String,
pub(crate) ip_configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PublicIpAddressListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Compute/virtualMachineScaleSets/{}/virtualMachines/{}/networkInterfaces/{}/ipconfigurations/{}/publicipaddresses" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_machine_scale_set_name , & this . virtualmachine_index , & this . network_interface_name , & this . ip_configuration_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_virtual_machine_scale_set_public_ip_address {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpAddress> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpAddress = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_machine_scale_set_name: String,
pub(crate) virtualmachine_index: String,
pub(crate) network_interface_name: String,
pub(crate) ip_configuration_name: String,
pub(crate) public_ip_address_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Compute/virtualMachineScaleSets/{}/virtualMachines/{}/networkInterfaces/{}/ipconfigurations/{}/publicipaddresses/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_machine_scale_set_name , & this . virtualmachine_index , & this . network_interface_name , & this . ip_configuration_name , & this . public_ip_address_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-10-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PublicIpAddress>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod nat_gateways {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified nat gateway in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `nat_gateway_name`: The name of the nat gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
nat_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
nat_gateway_name: nat_gateway_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a nat gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `nat_gateway_name`: The name of the nat gateway."]
#[doc = "* `parameters`: Parameters supplied to the create or update nat gateway operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
nat_gateway_name: impl Into<String>,
parameters: impl Into<models::NatGateway>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
nat_gateway_name: nat_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates nat gateway tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `nat_gateway_name`: The name of the nat gateway."]
#[doc = "* `parameters`: Parameters supplied to update nat gateway tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
nat_gateway_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
nat_gateway_name: nat_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified nat gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `nat_gateway_name`: The name of the nat gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
nat_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
nat_gateway_name: nat_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the Nat Gateways in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all nat gateways in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NatGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::NatGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) nat_gateway_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/natGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.nat_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NatGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NatGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::NatGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) nat_gateway_name: String,
pub(crate) parameters: models::NatGateway,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/natGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.nat_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NatGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NatGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::NatGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) nat_gateway_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/natGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.nat_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NatGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) nat_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/natGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.nat_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NatGatewayListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NatGatewayListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NatGatewayListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/natGateways",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NatGatewayListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NatGatewayListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NatGatewayListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/natGateways",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod available_delegations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all of the available subnet delegations for this subscription in this region."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location of the subnet."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, location: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
location: location.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AvailableDelegationsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AvailableDelegationsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AvailableDelegationsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/availableDelegations",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod available_resource_group_delegations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all of the available subnet delegations for this resource group in this region."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location of the domain name."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
location: impl Into<String>,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
location: location.into(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AvailableDelegationsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AvailableDelegationsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AvailableDelegationsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/locations/{}/availableDelegations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod available_service_aliases {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all available service aliases for this subscription in this region."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, location: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
location: location.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all available service aliases for this resource group in this region."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `location`: The location."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
location: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
location: location.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AvailableServiceAliasesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AvailableServiceAliasesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AvailableServiceAliasesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/availableServiceAliases",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AvailableServiceAliasesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AvailableServiceAliasesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) location: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AvailableServiceAliasesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/locations/{}/availableServiceAliases",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod azure_firewalls {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Azure Firewall."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `azure_firewall_name`: The name of the Azure Firewall."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
azure_firewall_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
azure_firewall_name: azure_firewall_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates the specified Azure Firewall."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `azure_firewall_name`: The name of the Azure Firewall."]
#[doc = "* `parameters`: Parameters supplied to the create or update Azure Firewall operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
azure_firewall_name: impl Into<String>,
parameters: impl Into<models::AzureFirewall>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
azure_firewall_name: azure_firewall_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates tags of an Azure Firewall resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `azure_firewall_name`: The name of the Azure Firewall."]
#[doc = "* `parameters`: Parameters supplied to update azure firewall tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
azure_firewall_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
azure_firewall_name: azure_firewall_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified Azure Firewall."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `azure_firewall_name`: The name of the Azure Firewall."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
azure_firewall_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
azure_firewall_name: azure_firewall_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all Azure Firewalls in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the Azure Firewalls in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AzureFirewall> {
let bytes = self.0.into_body().collect().await?;
let body: models::AzureFirewall = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) azure_firewall_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/azureFirewalls/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.azure_firewall_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AzureFirewall>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AzureFirewall> {
let bytes = self.0.into_body().collect().await?;
let body: models::AzureFirewall = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) azure_firewall_name: String,
pub(crate) parameters: models::AzureFirewall,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/azureFirewalls/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.azure_firewall_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AzureFirewall>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) azure_firewall_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/azureFirewalls/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.azure_firewall_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) azure_firewall_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/azureFirewalls/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.azure_firewall_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AzureFirewallListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AzureFirewallListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AzureFirewallListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/azureFirewalls",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AzureFirewallListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AzureFirewallListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AzureFirewallListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/azureFirewalls",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod azure_firewall_fqdn_tags {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the Azure Firewall FQDN Tags in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AzureFirewallFqdnTagListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AzureFirewallFqdnTagListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AzureFirewallFqdnTagListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/azureFirewallFqdnTags",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod web_categories {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Azure Web Category."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `name`: The name of the azureWebCategory."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(&self, name: impl Into<String>, subscription_id: impl Into<String>) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
name: name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Gets all the Azure Web Categories in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_subscription(&self, subscription_id: impl Into<String>) -> list_by_subscription::RequestBuilder {
list_by_subscription::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AzureWebCategory> {
let bytes = self.0.into_body().collect().await?;
let body: models::AzureWebCategory = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands resourceIds back referenced by the azureWebCategory resource."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/azureWebCategories/{}",
this.client.endpoint(),
&this.subscription_id,
&this.name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AzureWebCategory>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_subscription {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AzureWebCategoryListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AzureWebCategoryListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AzureWebCategoryListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/azureWebCategories",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod bastion_hosts {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Bastion Host."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `bastion_host_name`: The name of the Bastion Host."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
bastion_host_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
bastion_host_name: bastion_host_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates the specified Bastion Host."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `bastion_host_name`: The name of the Bastion Host."]
#[doc = "* `parameters`: Parameters supplied to the create or update Bastion Host operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
bastion_host_name: impl Into<String>,
parameters: impl Into<models::BastionHost>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
bastion_host_name: bastion_host_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates Tags for BastionHost resource"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `bastion_host_name`: The name of the Bastion Host."]
#[doc = "* `parameters`: Parameters supplied to update BastionHost tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
bastion_host_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
bastion_host_name: bastion_host_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Deletes the specified Bastion Host."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `bastion_host_name`: The name of the Bastion Host."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
bastion_host_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
bastion_host_name: bastion_host_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all Bastion Hosts in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all Bastion Hosts in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BastionHost> {
let bytes = self.0.into_body().collect().await?;
let body: models::BastionHost = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) bastion_host_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.bastion_host_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::BastionHost>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BastionHost> {
let bytes = self.0.into_body().collect().await?;
let body: models::BastionHost = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) bastion_host_name: String,
pub(crate) parameters: models::BastionHost,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.bastion_host_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::BastionHost>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BastionHost> {
let bytes = self.0.into_body().collect().await?;
let body: models::BastionHost = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) bastion_host_name: String,
pub(crate) parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.bastion_host_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::BastionHost>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) bastion_host_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.bastion_host_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BastionHostListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::BastionHostListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::BastionHostListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/bastionHosts",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BastionHostListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::BastionHostListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::BastionHostListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
impl Client {
#[doc = "Creates a Bastion Shareable Links for all the VMs specified in the request."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `bastion_host_name`: The name of the Bastion Host."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `bsl_request`: Post request for all the Bastion Shareable Link endpoints."]
pub fn put_bastion_shareable_link(
&self,
resource_group_name: impl Into<String>,
bastion_host_name: impl Into<String>,
subscription_id: impl Into<String>,
bsl_request: impl Into<models::BastionShareableLinkListRequest>,
) -> put_bastion_shareable_link::RequestBuilder {
put_bastion_shareable_link::RequestBuilder {
client: self.clone(),
resource_group_name: resource_group_name.into(),
bastion_host_name: bastion_host_name.into(),
subscription_id: subscription_id.into(),
bsl_request: bsl_request.into(),
}
}
#[doc = "Deletes the Bastion Shareable Links for all the VMs specified in the request."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `bastion_host_name`: The name of the Bastion Host."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `bsl_request`: Post request for all the Bastion Shareable Link endpoints."]
pub fn delete_bastion_shareable_link(
&self,
resource_group_name: impl Into<String>,
bastion_host_name: impl Into<String>,
subscription_id: impl Into<String>,
bsl_request: impl Into<models::BastionShareableLinkListRequest>,
) -> delete_bastion_shareable_link::RequestBuilder {
delete_bastion_shareable_link::RequestBuilder {
client: self.clone(),
resource_group_name: resource_group_name.into(),
bastion_host_name: bastion_host_name.into(),
subscription_id: subscription_id.into(),
bsl_request: bsl_request.into(),
}
}
#[doc = "Return the Bastion Shareable Links for all the VMs specified in the request."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `bastion_host_name`: The name of the Bastion Host."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `bsl_request`: Post request for all the Bastion Shareable Link endpoints."]
pub fn get_bastion_shareable_link(
&self,
resource_group_name: impl Into<String>,
bastion_host_name: impl Into<String>,
subscription_id: impl Into<String>,
bsl_request: impl Into<models::BastionShareableLinkListRequest>,
) -> get_bastion_shareable_link::RequestBuilder {
get_bastion_shareable_link::RequestBuilder {
client: self.clone(),
resource_group_name: resource_group_name.into(),
bastion_host_name: bastion_host_name.into(),
subscription_id: subscription_id.into(),
bsl_request: bsl_request.into(),
}
}
#[doc = "Returns the list of currently active sessions on the Bastion."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `bastion_host_name`: The name of the Bastion Host."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_active_sessions(
&self,
resource_group_name: impl Into<String>,
bastion_host_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_active_sessions::RequestBuilder {
get_active_sessions::RequestBuilder {
client: self.clone(),
resource_group_name: resource_group_name.into(),
bastion_host_name: bastion_host_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Returns the list of currently active sessions on the Bastion."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `bastion_host_name`: The name of the Bastion Host."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `session_ids`: The list of sessionids to disconnect."]
pub fn disconnect_active_sessions(
&self,
resource_group_name: impl Into<String>,
bastion_host_name: impl Into<String>,
subscription_id: impl Into<String>,
session_ids: impl Into<models::SessionIds>,
) -> disconnect_active_sessions::RequestBuilder {
disconnect_active_sessions::RequestBuilder {
client: self.clone(),
resource_group_name: resource_group_name.into(),
bastion_host_name: bastion_host_name.into(),
subscription_id: subscription_id.into(),
session_ids: session_ids.into(),
}
}
#[doc = "Checks whether a domain name in the cloudapp.azure.com zone is available for use."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location of the domain name."]
#[doc = "* `domain_name_label`: The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn check_dns_name_availability(
&self,
location: impl Into<String>,
domain_name_label: impl Into<String>,
subscription_id: impl Into<String>,
) -> check_dns_name_availability::RequestBuilder {
check_dns_name_availability::RequestBuilder {
client: self.clone(),
location: location.into(),
domain_name_label: domain_name_label.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gives the supported security providers for the virtual wan."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name."]
#[doc = "* `virtual_wan_name`: The name of the VirtualWAN for which supported security providers are needed."]
pub fn supported_security_providers(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_wan_name: impl Into<String>,
) -> supported_security_providers::RequestBuilder {
supported_security_providers::RequestBuilder {
client: self.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_wan_name: virtual_wan_name.into(),
}
}
#[doc = "Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name."]
#[doc = "* `virtual_wan_name`: The name of the VirtualWAN whose associated VpnServerConfigurations is needed."]
#[doc = "* `vpn_client_params`: Parameters supplied to the generate VirtualWan VPN profile generation operation."]
pub fn generatevirtualwanvpnserverconfigurationvpnprofile(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_wan_name: impl Into<String>,
vpn_client_params: impl Into<models::VirtualWanVpnProfileParameters>,
) -> generatevirtualwanvpnserverconfigurationvpnprofile::RequestBuilder {
generatevirtualwanvpnserverconfigurationvpnprofile::RequestBuilder {
client: self.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_wan_name: virtual_wan_name.into(),
vpn_client_params: vpn_client_params.into(),
}
}
}
pub mod put_bastion_shareable_link {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BastionShareableLinkListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::BastionShareableLinkListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::Client,
pub(crate) resource_group_name: String,
pub(crate) bastion_host_name: String,
pub(crate) subscription_id: String,
pub(crate) bsl_request: models::BastionShareableLinkListRequest,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::BastionShareableLinkListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts/{}/createShareableLinks",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.bastion_host_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.bsl_request)?;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
azure_core::StatusCode::Accepted => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod delete_bastion_shareable_link {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::Client,
pub(crate) resource_group_name: String,
pub(crate) bastion_host_name: String,
pub(crate) subscription_id: String,
pub(crate) bsl_request: models::BastionShareableLinkListRequest,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts/{}/deleteShareableLinks",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.bastion_host_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.bsl_request)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_bastion_shareable_link {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BastionShareableLinkListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::BastionShareableLinkListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::Client,
pub(crate) resource_group_name: String,
pub(crate) bastion_host_name: String,
pub(crate) subscription_id: String,
pub(crate) bsl_request: models::BastionShareableLinkListRequest,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::BastionShareableLinkListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts/{}/getShareableLinks",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.bastion_host_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.bsl_request)?;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_active_sessions {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BastionActiveSessionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::BastionActiveSessionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::Client,
pub(crate) resource_group_name: String,
pub(crate) bastion_host_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::BastionActiveSessionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts/{}/getActiveSessions",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.bastion_host_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
azure_core::StatusCode::Accepted => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod disconnect_active_sessions {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BastionSessionDeleteResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::BastionSessionDeleteResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::Client,
pub(crate) resource_group_name: String,
pub(crate) bastion_host_name: String,
pub(crate) subscription_id: String,
pub(crate) session_ids: models::SessionIds,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::BastionSessionDeleteResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/bastionHosts/{}/disconnectActiveSessions",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.bastion_host_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.session_ids)?;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod check_dns_name_availability {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DnsNameAvailabilityResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DnsNameAvailabilityResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::Client,
pub(crate) location: String,
pub(crate) domain_name_label: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/CheckDnsNameAvailability",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let domain_name_label = &this.domain_name_label;
req.url_mut().query_pairs_mut().append_pair("domainNameLabel", domain_name_label);
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DnsNameAvailabilityResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod supported_security_providers {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualWanSecurityProviders> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualWanSecurityProviders = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_wan_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualWans/{}/supportedSecurityProviders",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_wan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualWanSecurityProviders>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod generatevirtualwanvpnserverconfigurationvpnprofile {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnProfileResponse> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnProfileResponse = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_wan_name: String,
pub(crate) vpn_client_params: models::VirtualWanVpnProfileParameters,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualWans/{}/GenerateVpnProfile",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_wan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.vpn_client_params)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnProfileResponse>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod custom_ip_prefixes {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified custom IP prefix in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `custom_ip_prefix_name`: The name of the custom IP prefix."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
custom_ip_prefix_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
custom_ip_prefix_name: custom_ip_prefix_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a custom IP prefix."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `custom_ip_prefix_name`: The name of the custom IP prefix."]
#[doc = "* `parameters`: Parameters supplied to the create or update custom IP prefix operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
custom_ip_prefix_name: impl Into<String>,
parameters: impl Into<models::CustomIpPrefix>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
custom_ip_prefix_name: custom_ip_prefix_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates custom IP prefix tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `custom_ip_prefix_name`: The name of the custom IP prefix."]
#[doc = "* `parameters`: Parameters supplied to update custom IP prefix tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
custom_ip_prefix_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
custom_ip_prefix_name: custom_ip_prefix_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified custom IP prefix."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `custom_ip_prefix_name`: The name of the CustomIpPrefix."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
custom_ip_prefix_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
custom_ip_prefix_name: custom_ip_prefix_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the custom IP prefixes in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all custom IP prefixes in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::CustomIpPrefix> {
let bytes = self.0.into_body().collect().await?;
let body: models::CustomIpPrefix = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) custom_ip_prefix_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/customIpPrefixes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.custom_ip_prefix_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::CustomIpPrefix>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::CustomIpPrefix> {
let bytes = self.0.into_body().collect().await?;
let body: models::CustomIpPrefix = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) custom_ip_prefix_name: String,
pub(crate) parameters: models::CustomIpPrefix,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/customIpPrefixes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.custom_ip_prefix_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::CustomIpPrefix>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::CustomIpPrefix> {
let bytes = self.0.into_body().collect().await?;
let body: models::CustomIpPrefix = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) custom_ip_prefix_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/customIpPrefixes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.custom_ip_prefix_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::CustomIpPrefix>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) custom_ip_prefix_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/customIpPrefixes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.custom_ip_prefix_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::CustomIpPrefixListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::CustomIpPrefixListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::CustomIpPrefixListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/customIpPrefixes",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::CustomIpPrefixListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::CustomIpPrefixListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::CustomIpPrefixListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/customIpPrefixes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod ddos_custom_policies {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets information about the specified DDoS custom policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ddos_custom_policy_name`: The name of the DDoS custom policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
ddos_custom_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ddos_custom_policy_name: ddos_custom_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a DDoS custom policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ddos_custom_policy_name`: The name of the DDoS custom policy."]
#[doc = "* `parameters`: Parameters supplied to the create or update operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
ddos_custom_policy_name: impl Into<String>,
parameters: impl Into<models::DdosCustomPolicy>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ddos_custom_policy_name: ddos_custom_policy_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update a DDoS custom policy tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ddos_custom_policy_name`: The name of the DDoS custom policy."]
#[doc = "* `parameters`: Parameters supplied to update DDoS custom policy resource tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
ddos_custom_policy_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ddos_custom_policy_name: ddos_custom_policy_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified DDoS custom policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ddos_custom_policy_name`: The name of the DDoS custom policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
ddos_custom_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ddos_custom_policy_name: ddos_custom_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DdosCustomPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::DdosCustomPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ddos_custom_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ddosCustomPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ddos_custom_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DdosCustomPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DdosCustomPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::DdosCustomPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ddos_custom_policy_name: String,
pub(crate) parameters: models::DdosCustomPolicy,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ddosCustomPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ddos_custom_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DdosCustomPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DdosCustomPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::DdosCustomPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ddos_custom_policy_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ddosCustomPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ddos_custom_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DdosCustomPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ddos_custom_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ddosCustomPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ddos_custom_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod ddos_protection_plans {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets information about the specified DDoS protection plan."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ddos_protection_plan_name`: The name of the DDoS protection plan."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
ddos_protection_plan_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ddos_protection_plan_name: ddos_protection_plan_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a DDoS protection plan."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ddos_protection_plan_name`: The name of the DDoS protection plan."]
#[doc = "* `parameters`: Parameters supplied to the create or update operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
ddos_protection_plan_name: impl Into<String>,
parameters: impl Into<models::DdosProtectionPlan>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ddos_protection_plan_name: ddos_protection_plan_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update a DDoS protection plan tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ddos_protection_plan_name`: The name of the DDoS protection plan."]
#[doc = "* `parameters`: Parameters supplied to the update DDoS protection plan resource tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
ddos_protection_plan_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ddos_protection_plan_name: ddos_protection_plan_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified DDoS protection plan."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ddos_protection_plan_name`: The name of the DDoS protection plan."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
ddos_protection_plan_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ddos_protection_plan_name: ddos_protection_plan_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all DDoS protection plans in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the DDoS protection plans in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DdosProtectionPlan> {
let bytes = self.0.into_body().collect().await?;
let body: models::DdosProtectionPlan = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ddos_protection_plan_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ddosProtectionPlans/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ddos_protection_plan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DdosProtectionPlan>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DdosProtectionPlan> {
let bytes = self.0.into_body().collect().await?;
let body: models::DdosProtectionPlan = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ddos_protection_plan_name: String,
pub(crate) parameters: models::DdosProtectionPlan,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ddosProtectionPlans/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ddos_protection_plan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DdosProtectionPlan>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DdosProtectionPlan> {
let bytes = self.0.into_body().collect().await?;
let body: models::DdosProtectionPlan = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ddos_protection_plan_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ddosProtectionPlans/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ddos_protection_plan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DdosProtectionPlan>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ddos_protection_plan_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ddosProtectionPlans/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ddos_protection_plan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DdosProtectionPlanListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DdosProtectionPlanListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::DdosProtectionPlanListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/ddosProtectionPlans",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DdosProtectionPlanListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DdosProtectionPlanListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::DdosProtectionPlanListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ddosProtectionPlans",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod dscp_configuration {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets a DSCP Configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `dscp_configuration_name`: The name of the resource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
dscp_configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
dscp_configuration_name: dscp_configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a DSCP Configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `dscp_configuration_name`: The name of the resource."]
#[doc = "* `parameters`: Parameters supplied to the create or update dscp configuration operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
dscp_configuration_name: impl Into<String>,
parameters: impl Into<models::DscpConfiguration>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
dscp_configuration_name: dscp_configuration_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes a DSCP Configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `dscp_configuration_name`: The name of the resource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
dscp_configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
dscp_configuration_name: dscp_configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets a DSCP Configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all dscp configurations in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscpConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscpConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) dscp_configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dscpConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.dscp_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscpConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscpConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscpConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) dscp_configuration_name: String,
pub(crate) parameters: models::DscpConfiguration,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dscpConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.dscp_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscpConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) dscp_configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dscpConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.dscp_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscpConfigurationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscpConfigurationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::DscpConfigurationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/dscpConfigurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscpConfigurationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscpConfigurationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::DscpConfigurationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/dscpConfigurations",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod available_endpoint_services {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "List what values of endpoint services are available for use."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location to check available endpoint services."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, location: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
location: location.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::EndpointServicesListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::EndpointServicesListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::EndpointServicesListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/virtualNetworkAvailableEndpointServices",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod express_route_circuit_authorizations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified authorization from the specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `authorization_name`: The name of the authorization."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
authorization_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
authorization_name: authorization_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates an authorization in the specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `authorization_name`: The name of the authorization."]
#[doc = "* `authorization_parameters`: Parameters supplied to the create or update express route circuit authorization operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
authorization_name: impl Into<String>,
authorization_parameters: impl Into<models::ExpressRouteCircuitAuthorization>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
authorization_name: authorization_name.into(),
authorization_parameters: authorization_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified authorization from the specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `authorization_name`: The name of the authorization."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
authorization_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
authorization_name: authorization_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all authorizations in an express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the circuit."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitAuthorization> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitAuthorization = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) authorization_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/authorizations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name,
&this.authorization_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitAuthorization>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitAuthorization> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitAuthorization = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) authorization_name: String,
pub(crate) authorization_parameters: models::ExpressRouteCircuitAuthorization,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/authorizations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name,
&this.authorization_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.authorization_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitAuthorization>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) authorization_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/authorizations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name,
&this.authorization_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AuthorizationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AuthorizationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AuthorizationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/authorizations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod express_route_circuit_peerings {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified peering for the express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a peering in the specified express route circuits."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `peering_parameters`: Parameters supplied to the create or update express route circuit peering operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
peering_parameters: impl Into<models::ExpressRouteCircuitPeering>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
peering_parameters: peering_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified peering from the specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all peerings in a specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitPeering> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitPeering = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitPeering>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitPeering> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitPeering = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) peering_parameters: models::ExpressRouteCircuitPeering,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.peering_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitPeering>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitPeeringListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitPeeringListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRouteCircuitPeeringListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod express_route_circuit_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Express Route Circuit Connection from the specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `connection_name`: The name of the express route circuit connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a Express Route Circuit Connection in the specified express route circuits."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `connection_name`: The name of the express route circuit connection."]
#[doc = "* `express_route_circuit_connection_parameters`: Parameters supplied to the create or update express route circuit connection operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
connection_name: impl Into<String>,
express_route_circuit_connection_parameters: impl Into<models::ExpressRouteCircuitConnection>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
connection_name: connection_name.into(),
express_route_circuit_connection_parameters: express_route_circuit_connection_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified Express Route Circuit Connection from the specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `connection_name`: The name of the express route circuit connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all global reach connections associated with a private peering in an express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/connections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . circuit_name , & this . peering_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) connection_name: String,
pub(crate) express_route_circuit_connection_parameters: models::ExpressRouteCircuitConnection,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/connections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . circuit_name , & this . peering_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.express_route_circuit_connection_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/connections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . circuit_name , & this . peering_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitConnectionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitConnectionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRouteCircuitConnectionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/connections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . circuit_name , & this . peering_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod peer_express_route_circuit_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Peer Express Route Circuit Connection from the specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `connection_name`: The name of the peer express route circuit connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all global reach peer connections associated with a private peering in an express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PeerExpressRouteCircuitConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::PeerExpressRouteCircuitConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/peerConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . circuit_name , & this . peering_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PeerExpressRouteCircuitConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PeerExpressRouteCircuitConnectionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PeerExpressRouteCircuitConnectionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(
self,
) -> azure_core::Pageable<models::PeerExpressRouteCircuitConnectionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/peerConnections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . circuit_name , & this . peering_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod express_route_circuits {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets information about the specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of express route circuit."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates an express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the circuit."]
#[doc = "* `parameters`: Parameters supplied to the create or update express route circuit operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
parameters: impl Into<models::ExpressRouteCircuit>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates an express route circuit tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the circuit."]
#[doc = "* `parameters`: Parameters supplied to update express route circuit tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified express route circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the currently advertised ARP table associated with the express route circuit in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `device_path`: The path of the device."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_arp_table(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
device_path: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_arp_table::RequestBuilder {
list_arp_table::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
device_path: device_path.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the currently advertised routes table associated with the express route circuit in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `device_path`: The path of the device."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_routes_table(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
device_path: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_routes_table::RequestBuilder {
list_routes_table::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
device_path: device_path.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the currently advertised routes table summary associated with the express route circuit in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `device_path`: The path of the device."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_routes_table_summary(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
device_path: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_routes_table_summary::RequestBuilder {
list_routes_table_summary::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
device_path: device_path.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the stats from an express route circuit in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_stats(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_stats::RequestBuilder {
get_stats::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all stats from an express route circuit in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `circuit_name`: The name of the express route circuit."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_peering_stats(
&self,
resource_group_name: impl Into<String>,
circuit_name: impl Into<String>,
peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_peering_stats::RequestBuilder {
get_peering_stats::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
circuit_name: circuit_name.into(),
peering_name: peering_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the express route circuits in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the express route circuits in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuit> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuit = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuit>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuit> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuit = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) parameters: models::ExpressRouteCircuit,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuit>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuit> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuit = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuit>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_arp_table {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitsArpTableListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitsArpTableListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) device_path: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/arpTables/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . circuit_name , & this . peering_name , & this . device_path)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitsArpTableListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_routes_table {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitsRoutesTableListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitsRoutesTableListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) device_path: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/routeTables/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . circuit_name , & this . peering_name , & this . device_path)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitsRoutesTableListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_routes_table_summary {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitsRoutesTableSummaryListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitsRoutesTableSummaryListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) device_path: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/routeTablesSummary/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . circuit_name , & this . peering_name , & this . device_path)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitsRoutesTableSummaryListResult>>
{
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_stats {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitStats> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitStats = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/stats",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitStats>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_peering_stats {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitStats> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitStats = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) circuit_name: String,
pub(crate) peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits/{}/peerings/{}/stats",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.circuit_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitStats>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRouteCircuitListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCircuits",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRouteCircuitListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/expressRouteCircuits",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod express_route_service_providers {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the available express route service providers."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteServiceProviderListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteServiceProviderListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRouteServiceProviderListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/expressRouteServiceProviders",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod virtual_wans {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a VirtualWAN."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The resource group name of the VirtualWan."]
#[doc = "* `virtual_wan_name`: The name of the VirtualWAN being retrieved."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
virtual_wan_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_wan_name: virtual_wan_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualWan."]
#[doc = "* `virtual_wan_name`: The name of the VirtualWAN being created or updated."]
#[doc = "* `wan_parameters`: Parameters supplied to create or update VirtualWAN."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_wan_name: impl Into<String>,
wan_parameters: impl Into<models::VirtualWan>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_wan_name: virtual_wan_name.into(),
wan_parameters: wan_parameters.into(),
}
}
#[doc = "Updates a VirtualWAN tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualWan."]
#[doc = "* `virtual_wan_name`: The name of the VirtualWAN being updated."]
#[doc = "* `wan_parameters`: Parameters supplied to Update VirtualWAN tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_wan_name: impl Into<String>,
wan_parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_wan_name: virtual_wan_name.into(),
wan_parameters: wan_parameters.into(),
}
}
#[doc = "Deletes a VirtualWAN."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualWan."]
#[doc = "* `virtual_wan_name`: The name of the VirtualWAN being deleted."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_wan_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_wan_name: virtual_wan_name.into(),
}
}
#[doc = "Lists all the VirtualWANs in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualWan."]
pub fn list_by_resource_group(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
}
}
#[doc = "Lists all the VirtualWANs in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualWan> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualWan = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_wan_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualWans/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_wan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualWan>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualWan> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualWan = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_wan_name: String,
pub(crate) wan_parameters: models::VirtualWan,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualWans/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_wan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.wan_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualWan>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualWan> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualWan = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_wan_name: String,
pub(crate) wan_parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualWans/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_wan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.wan_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualWan>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_wan_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualWans/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_wan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVirtualWaNsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVirtualWaNsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVirtualWaNsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualWans",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVirtualWaNsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVirtualWaNsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVirtualWaNsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/virtualWans",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod vpn_sites {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a VPN site."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnSite."]
#[doc = "* `vpn_site_name`: The name of the VpnSite being retrieved."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_site_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_site_name: vpn_site_name.into(),
}
}
#[doc = "Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnSite."]
#[doc = "* `vpn_site_name`: The name of the VpnSite being created or updated."]
#[doc = "* `vpn_site_parameters`: Parameters supplied to create or update VpnSite."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_site_name: impl Into<String>,
vpn_site_parameters: impl Into<models::VpnSite>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_site_name: vpn_site_name.into(),
vpn_site_parameters: vpn_site_parameters.into(),
}
}
#[doc = "Updates VpnSite tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnSite."]
#[doc = "* `vpn_site_name`: The name of the VpnSite being updated."]
#[doc = "* `vpn_site_parameters`: Parameters supplied to update VpnSite tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_site_name: impl Into<String>,
vpn_site_parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_site_name: vpn_site_name.into(),
vpn_site_parameters: vpn_site_parameters.into(),
}
}
#[doc = "Deletes a VpnSite."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnSite."]
#[doc = "* `vpn_site_name`: The name of the VpnSite being deleted."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_site_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_site_name: vpn_site_name.into(),
}
}
#[doc = "Lists all the vpnSites in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnSite."]
pub fn list_by_resource_group(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
}
}
#[doc = "Lists all the VpnSites in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnSite> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnSite = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_site_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnSites/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_site_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnSite>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnSite> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnSite = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_site_name: String,
pub(crate) vpn_site_parameters: models::VpnSite,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnSites/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_site_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.vpn_site_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnSite>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnSite> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnSite = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_site_name: String,
pub(crate) vpn_site_parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnSites/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_site_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.vpn_site_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnSite>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_site_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnSites/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_site_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnSitesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnSitesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnSitesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnSites",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnSitesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnSitesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnSitesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/vpnSites",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod vpn_site_links {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a VPN site link."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnSite."]
#[doc = "* `vpn_site_name`: The name of the VpnSite."]
#[doc = "* `vpn_site_link_name`: The name of the VpnSiteLink being retrieved."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_site_name: impl Into<String>,
vpn_site_link_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_site_name: vpn_site_name.into(),
vpn_site_link_name: vpn_site_link_name.into(),
}
}
#[doc = "Lists all the vpnSiteLinks in a resource group for a vpn site."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnSite."]
#[doc = "* `vpn_site_name`: The name of the VpnSite."]
pub fn list_by_vpn_site(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_site_name: impl Into<String>,
) -> list_by_vpn_site::RequestBuilder {
list_by_vpn_site::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_site_name: vpn_site_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnSiteLink> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnSiteLink = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_site_name: String,
pub(crate) vpn_site_link_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnSites/{}/vpnSiteLinks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_site_name,
&this.vpn_site_link_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnSiteLink>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_vpn_site {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnSiteLinksResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnSiteLinksResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_site_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnSiteLinksResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnSites/{}/vpnSiteLinks",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_site_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod vpn_sites_configuration {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gives the sas-url to download the configurations for vpn-sites in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name."]
#[doc = "* `virtual_wan_name`: The name of the VirtualWAN for which configuration of all vpn-sites is needed."]
#[doc = "* `request`: Parameters supplied to download vpn-sites configuration."]
pub fn download(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_wan_name: impl Into<String>,
request: impl Into<models::GetVpnSitesConfigurationRequest>,
) -> download::RequestBuilder {
download::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_wan_name: virtual_wan_name.into(),
request: request.into(),
}
}
}
pub mod download {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_wan_name: String,
pub(crate) request: models::GetVpnSitesConfigurationRequest,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualWans/{}/vpnConfiguration",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_wan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.request)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod vpn_server_configurations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a VpnServerConfiguration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnServerConfiguration."]
#[doc = "* `vpn_server_configuration_name`: The name of the VpnServerConfiguration being retrieved."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_server_configuration_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_server_configuration_name: vpn_server_configuration_name.into(),
}
}
#[doc = "Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnServerConfiguration."]
#[doc = "* `vpn_server_configuration_name`: The name of the VpnServerConfiguration being created or updated."]
#[doc = "* `vpn_server_configuration_parameters`: Parameters supplied to create or update VpnServerConfiguration."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_server_configuration_name: impl Into<String>,
vpn_server_configuration_parameters: impl Into<models::VpnServerConfiguration>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_server_configuration_name: vpn_server_configuration_name.into(),
vpn_server_configuration_parameters: vpn_server_configuration_parameters.into(),
}
}
#[doc = "Updates VpnServerConfiguration tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnServerConfiguration."]
#[doc = "* `vpn_server_configuration_name`: The name of the VpnServerConfiguration being updated."]
#[doc = "* `vpn_server_configuration_parameters`: Parameters supplied to update VpnServerConfiguration tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_server_configuration_name: impl Into<String>,
vpn_server_configuration_parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_server_configuration_name: vpn_server_configuration_name.into(),
vpn_server_configuration_parameters: vpn_server_configuration_parameters.into(),
}
}
#[doc = "Deletes a VpnServerConfiguration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnServerConfiguration."]
#[doc = "* `vpn_server_configuration_name`: The name of the VpnServerConfiguration being deleted."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
vpn_server_configuration_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
vpn_server_configuration_name: vpn_server_configuration_name.into(),
}
}
#[doc = "Lists all the vpnServerConfigurations in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnServerConfiguration."]
pub fn list_by_resource_group(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
}
}
#[doc = "Lists all the VpnServerConfigurations in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnServerConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnServerConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_server_configuration_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnServerConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_server_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnServerConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnServerConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnServerConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_server_configuration_name: String,
pub(crate) vpn_server_configuration_parameters: models::VpnServerConfiguration,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnServerConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_server_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.vpn_server_configuration_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnServerConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnServerConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnServerConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_server_configuration_name: String,
pub(crate) vpn_server_configuration_parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnServerConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_server_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.vpn_server_configuration_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnServerConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) vpn_server_configuration_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnServerConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.vpn_server_configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnServerConfigurationsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnServerConfigurationsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnServerConfigurationsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnServerConfigurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnServerConfigurationsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnServerConfigurationsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnServerConfigurationsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/vpnServerConfigurations",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod virtual_hubs {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a VirtualHub."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
}
}
#[doc = "Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `virtual_hub_parameters`: Parameters supplied to create or update VirtualHub."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
virtual_hub_parameters: impl Into<models::VirtualHub>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
virtual_hub_parameters: virtual_hub_parameters.into(),
}
}
#[doc = "Updates VirtualHub tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `virtual_hub_parameters`: Parameters supplied to update VirtualHub tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
virtual_hub_parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
virtual_hub_parameters: virtual_hub_parameters.into(),
}
}
#[doc = "Deletes a VirtualHub."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
}
}
#[doc = "Lists all the VirtualHubs in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
pub fn list_by_resource_group(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
}
}
#[doc = "Lists all the VirtualHubs in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the effective routes configured for the Virtual Hub resource or the specified resource ."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
pub fn get_effective_virtual_hub_routes(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
) -> get_effective_virtual_hub_routes::RequestBuilder {
get_effective_virtual_hub_routes::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
effective_routes_parameters: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualHub> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualHub = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualHub>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualHub> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualHub = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) virtual_hub_parameters: models::VirtualHub,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.virtual_hub_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualHub>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualHub> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualHub = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) virtual_hub_parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.virtual_hub_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualHub>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVirtualHubsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVirtualHubsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVirtualHubsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVirtualHubsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVirtualHubsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVirtualHubsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/virtualHubs",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_effective_virtual_hub_routes {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) effective_routes_parameters: Option<models::EffectiveRoutesParameters>,
}
impl RequestBuilder {
#[doc = "Parameters supplied to get the effective routes for a specific resource."]
pub fn effective_routes_parameters(
mut self,
effective_routes_parameters: impl Into<models::EffectiveRoutesParameters>,
) -> Self {
self.effective_routes_parameters = Some(effective_routes_parameters.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/effectiveRoutes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = if let Some(effective_routes_parameters) = &this.effective_routes_parameters {
req.insert_header("content-type", "application/json");
azure_core::to_json(effective_routes_parameters)?
} else {
azure_core::EMPTY_BODY
};
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod hub_virtual_network_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a HubVirtualNetworkConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `connection_name`: The name of the vpn connection."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
connection_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
connection_name: connection_name.into(),
}
}
#[doc = "Creates a hub virtual network connection if it doesn't exist else updates the existing one."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the HubVirtualNetworkConnection."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `connection_name`: The name of the HubVirtualNetworkConnection."]
#[doc = "* `hub_virtual_network_connection_parameters`: Parameters supplied to create or update a hub virtual network connection."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
connection_name: impl Into<String>,
hub_virtual_network_connection_parameters: impl Into<models::HubVirtualNetworkConnection>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
connection_name: connection_name.into(),
hub_virtual_network_connection_parameters: hub_virtual_network_connection_parameters.into(),
}
}
#[doc = "Deletes a HubVirtualNetworkConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `connection_name`: The name of the HubVirtualNetworkConnection."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
connection_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
connection_name: connection_name.into(),
}
}
#[doc = "Retrieves the details of all HubVirtualNetworkConnections."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::HubVirtualNetworkConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::HubVirtualNetworkConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) connection_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/hubVirtualNetworkConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_hub_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::HubVirtualNetworkConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::HubVirtualNetworkConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::HubVirtualNetworkConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) connection_name: String,
pub(crate) hub_virtual_network_connection_parameters: models::HubVirtualNetworkConnection,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/hubVirtualNetworkConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_hub_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.hub_virtual_network_connection_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::HubVirtualNetworkConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) connection_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/hubVirtualNetworkConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_hub_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListHubVirtualNetworkConnectionsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListHubVirtualNetworkConnectionsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListHubVirtualNetworkConnectionsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/hubVirtualNetworkConnections",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod vpn_gateways {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a virtual wan vpn gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
}
}
#[doc = "Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `vpn_gateway_parameters`: Parameters supplied to create or Update a virtual wan vpn gateway."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
vpn_gateway_parameters: impl Into<models::VpnGateway>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
vpn_gateway_parameters: vpn_gateway_parameters.into(),
}
}
#[doc = "Updates virtual wan vpn gateway tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `vpn_gateway_parameters`: Parameters supplied to update a virtual wan vpn gateway tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
vpn_gateway_parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
vpn_gateway_parameters: vpn_gateway_parameters.into(),
}
}
#[doc = "Deletes a virtual wan vpn gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
}
}
#[doc = "Resets the primary of the vpn gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn reset(
&self,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> reset::RequestBuilder {
reset::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Starts packet capture on vpn gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn start_packet_capture(
&self,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> start_packet_capture::RequestBuilder {
start_packet_capture::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
subscription_id: subscription_id.into(),
parameters: None,
}
}
#[doc = "Stops packet capture on vpn gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn stop_packet_capture(
&self,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> stop_packet_capture::RequestBuilder {
stop_packet_capture::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
subscription_id: subscription_id.into(),
parameters: None,
}
}
#[doc = "Lists all the VpnGateways in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
pub fn list_by_resource_group(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
}
}
#[doc = "Lists all the VpnGateways in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) vpn_gateway_parameters: models::VpnGateway,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.vpn_gateway_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) vpn_gateway_parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.vpn_gateway_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod reset {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/reset",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod start_packet_capture {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) subscription_id: String,
pub(crate) parameters: Option<models::VpnGatewayPacketCaptureStartParameters>,
}
impl RequestBuilder {
#[doc = "Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway."]
pub fn parameters(mut self, parameters: impl Into<models::VpnGatewayPacketCaptureStartParameters>) -> Self {
self.parameters = Some(parameters.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/startpacketcapture",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = if let Some(parameters) = &this.parameters {
req.insert_header("content-type", "application/json");
azure_core::to_json(parameters)?
} else {
azure_core::EMPTY_BODY
};
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod stop_packet_capture {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) subscription_id: String,
pub(crate) parameters: Option<models::VpnGatewayPacketCaptureStopParameters>,
}
impl RequestBuilder {
#[doc = "Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway."]
pub fn parameters(mut self, parameters: impl Into<models::VpnGatewayPacketCaptureStopParameters>) -> Self {
self.parameters = Some(parameters.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/stoppacketcapture",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = if let Some(parameters) = &this.parameters {
req.insert_header("content-type", "application/json");
azure_core::to_json(parameters)?
} else {
azure_core::EMPTY_BODY
};
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnGatewaysResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnGatewaysResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnGatewaysResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnGatewaysResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnGatewaysResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnGatewaysResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/vpnGateways",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod vpn_link_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Resets the VpnLink connection specified."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `connection_name`: The name of the vpn connection."]
#[doc = "* `link_connection_name`: The name of the vpn link connection."]
pub fn reset_connection(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
connection_name: impl Into<String>,
link_connection_name: impl Into<String>,
) -> reset_connection::RequestBuilder {
reset_connection::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
connection_name: connection_name.into(),
link_connection_name: link_connection_name.into(),
}
}
#[doc = "Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `connection_name`: The name of the vpn connection."]
#[doc = "* `link_connection_name`: The name of the vpn link connection."]
pub fn get_ike_sas(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
connection_name: impl Into<String>,
link_connection_name: impl Into<String>,
) -> get_ike_sas::RequestBuilder {
get_ike_sas::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
connection_name: connection_name.into(),
link_connection_name: link_connection_name.into(),
}
}
#[doc = "Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the vpn gateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `connection_name`: The name of the vpn connection."]
pub fn list_by_vpn_connection(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
connection_name: impl Into<String>,
) -> list_by_vpn_connection::RequestBuilder {
list_by_vpn_connection::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
connection_name: connection_name.into(),
}
}
}
pub mod reset_connection {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) connection_name: String,
pub(crate) link_connection_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections/{}/vpnLinkConnections/{}/resetconnection" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . gateway_name , & this . connection_name , & this . link_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_ike_sas {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) connection_name: String,
pub(crate) link_connection_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections/{}/vpnLinkConnections/{}/getikesas" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . gateway_name , & this . connection_name , & this . link_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_vpn_connection {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnSiteLinkConnectionsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnSiteLinkConnectionsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) connection_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnSiteLinkConnectionsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections/{}/vpnLinkConnections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . gateway_name , & this . connection_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod vpn_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a vpn connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `connection_name`: The name of the vpn connection."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
connection_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
connection_name: connection_name.into(),
}
}
#[doc = "Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `connection_name`: The name of the connection."]
#[doc = "* `vpn_connection_parameters`: Parameters supplied to create or Update a VPN Connection."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
connection_name: impl Into<String>,
vpn_connection_parameters: impl Into<models::VpnConnection>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
connection_name: connection_name.into(),
vpn_connection_parameters: vpn_connection_parameters.into(),
}
}
#[doc = "Deletes a vpn connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `connection_name`: The name of the connection."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
connection_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
connection_name: connection_name.into(),
}
}
#[doc = "Starts packet capture on Vpn connection in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `vpn_connection_name`: The name of the vpn connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn start_packet_capture(
&self,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
vpn_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> start_packet_capture::RequestBuilder {
start_packet_capture::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
vpn_connection_name: vpn_connection_name.into(),
subscription_id: subscription_id.into(),
parameters: None,
}
}
#[doc = "Stops packet capture on Vpn connection in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `vpn_connection_name`: The name of the vpn connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn stop_packet_capture(
&self,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
vpn_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> stop_packet_capture::RequestBuilder {
stop_packet_capture::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
vpn_connection_name: vpn_connection_name.into(),
subscription_id: subscription_id.into(),
parameters: None,
}
}
#[doc = "Retrieves all vpn connections for a particular virtual wan vpn gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
pub fn list_by_vpn_gateway(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
) -> list_by_vpn_gateway::RequestBuilder {
list_by_vpn_gateway::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) connection_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) connection_name: String,
pub(crate) vpn_connection_parameters: models::VpnConnection,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.vpn_connection_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) connection_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod start_packet_capture {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) vpn_connection_name: String,
pub(crate) subscription_id: String,
pub(crate) parameters: Option<models::VpnConnectionPacketCaptureStartParameters>,
}
impl RequestBuilder {
#[doc = "Vpn Connection packet capture parameters supplied to start packet capture on gateway connection."]
pub fn parameters(mut self, parameters: impl Into<models::VpnConnectionPacketCaptureStartParameters>) -> Self {
self.parameters = Some(parameters.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections/{}/startpacketcapture" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . gateway_name , & this . vpn_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = if let Some(parameters) = &this.parameters {
req.insert_header("content-type", "application/json");
azure_core::to_json(parameters)?
} else {
azure_core::EMPTY_BODY
};
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod stop_packet_capture {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) vpn_connection_name: String,
pub(crate) subscription_id: String,
pub(crate) parameters: Option<models::VpnConnectionPacketCaptureStopParameters>,
}
impl RequestBuilder {
#[doc = "Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection."]
pub fn parameters(mut self, parameters: impl Into<models::VpnConnectionPacketCaptureStopParameters>) -> Self {
self.parameters = Some(parameters.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections/{}/stoppacketcapture" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . gateway_name , & this . vpn_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = if let Some(parameters) = &this.parameters {
req.insert_header("content-type", "application/json");
azure_core::to_json(parameters)?
} else {
azure_core::EMPTY_BODY
};
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_vpn_gateway {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnConnectionsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnConnectionsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnConnectionsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod vpn_site_link_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a vpn site link connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `connection_name`: The name of the vpn connection."]
#[doc = "* `link_connection_name`: The name of the vpn connection."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
connection_name: impl Into<String>,
link_connection_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
connection_name: connection_name.into(),
link_connection_name: link_connection_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnSiteLinkConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnSiteLinkConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) connection_name: String,
pub(crate) link_connection_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/vpnConnections/{}/vpnLinkConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . gateway_name , & this . connection_name , & this . link_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnSiteLinkConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod nat_rules {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a nat ruleGet."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `nat_rule_name`: The name of the nat rule."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
nat_rule_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
nat_rule_name: nat_rule_name.into(),
}
}
#[doc = "Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `nat_rule_name`: The name of the nat rule."]
#[doc = "* `nat_rule_parameters`: Parameters supplied to create or Update a Nat Rule."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
nat_rule_name: impl Into<String>,
nat_rule_parameters: impl Into<models::VpnGatewayNatRule>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
nat_rule_name: nat_rule_name.into(),
nat_rule_parameters: nat_rule_parameters.into(),
}
}
#[doc = "Deletes a nat rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `nat_rule_name`: The name of the nat rule."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
nat_rule_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
nat_rule_name: nat_rule_name.into(),
}
}
#[doc = "Retrieves all nat rules for a particular virtual wan vpn gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
pub fn list_by_vpn_gateway(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
) -> list_by_vpn_gateway::RequestBuilder {
list_by_vpn_gateway::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnGatewayNatRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnGatewayNatRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) nat_rule_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/natRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name,
&this.nat_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnGatewayNatRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnGatewayNatRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnGatewayNatRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) nat_rule_name: String,
pub(crate) nat_rule_parameters: models::VpnGatewayNatRule,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/natRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name,
&this.nat_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.nat_rule_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnGatewayNatRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) nat_rule_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/natRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name,
&this.nat_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_vpn_gateway {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVpnGatewayNatRulesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVpnGatewayNatRulesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVpnGatewayNatRulesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/vpnGateways/{}/natRules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod p2s_vpn_gateways {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a virtual wan p2s vpn gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the P2SVpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
}
}
#[doc = "Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the P2SVpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `p2_s_vpn_gateway_parameters`: Parameters supplied to create or Update a virtual wan p2s vpn gateway."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
p2_s_vpn_gateway_parameters: impl Into<models::P2sVpnGateway>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
p2_s_vpn_gateway_parameters: p2_s_vpn_gateway_parameters.into(),
}
}
#[doc = "Updates virtual wan p2s vpn gateway tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the P2SVpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `p2_s_vpn_gateway_parameters`: Parameters supplied to update a virtual wan p2s vpn gateway tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
p2_s_vpn_gateway_parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
p2_s_vpn_gateway_parameters: p2_s_vpn_gateway_parameters.into(),
}
}
#[doc = "Deletes a virtual wan p2s vpn gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the P2SVpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
}
}
#[doc = "Lists all the P2SVpnGateways in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the P2SVpnGateway."]
pub fn list_by_resource_group(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
}
}
#[doc = "Lists all the P2SVpnGateways in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Resets the primary of the p2s vpn gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The resource group name of the P2SVpnGateway."]
#[doc = "* `gateway_name`: The name of the gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn reset(
&self,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> reset::RequestBuilder {
reset::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `gateway_name`: The name of the P2SVpnGateway."]
#[doc = "* `parameters`: Parameters supplied to the generate P2SVpnGateway VPN client package operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn generate_vpn_profile(
&self,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
parameters: impl Into<models::P2sVpnProfileParameters>,
subscription_id: impl Into<String>,
) -> generate_vpn_profile::RequestBuilder {
generate_vpn_profile::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `gateway_name`: The name of the P2SVpnGateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_p2s_vpn_connection_health(
&self,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_p2s_vpn_connection_health::RequestBuilder {
get_p2s_vpn_connection_health::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `gateway_name`: The name of the P2SVpnGateway."]
#[doc = "* `request`: Request parameters supplied to get p2s vpn connections detailed health."]
pub fn get_p2s_vpn_connection_health_detailed(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
gateway_name: impl Into<String>,
request: impl Into<models::P2sVpnConnectionHealthRequest>,
) -> get_p2s_vpn_connection_health_detailed::RequestBuilder {
get_p2s_vpn_connection_health_detailed::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
gateway_name: gateway_name.into(),
request: request.into(),
}
}
#[doc = "Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `p2s_vpn_gateway_name`: The name of the P2S Vpn Gateway."]
#[doc = "* `request`: The parameters are supplied to disconnect p2s vpn connections."]
pub fn disconnect_p2s_vpn_connections(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
p2s_vpn_gateway_name: impl Into<String>,
request: impl Into<models::P2sVpnConnectionRequest>,
) -> disconnect_p2s_vpn_connections::RequestBuilder {
disconnect_p2s_vpn_connections::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
p2s_vpn_gateway_name: p2s_vpn_gateway_name.into(),
request: request.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::P2sVpnGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::P2sVpnGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::P2sVpnGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::P2sVpnGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::P2sVpnGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) p2_s_vpn_gateway_parameters: models::P2sVpnGateway,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.p2_s_vpn_gateway_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::P2sVpnGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) p2_s_vpn_gateway_parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.p2_s_vpn_gateway_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListP2sVpnGatewaysResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListP2sVpnGatewaysResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListP2sVpnGatewaysResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListP2sVpnGatewaysResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListP2sVpnGatewaysResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListP2sVpnGatewaysResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/p2svpnGateways",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod reset {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::P2sVpnGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::P2sVpnGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways/{}/reset",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::P2sVpnGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod generate_vpn_profile {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnProfileResponse> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnProfileResponse = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) parameters: models::P2sVpnProfileParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways/{}/generatevpnprofile",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnProfileResponse>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_p2s_vpn_connection_health {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::P2sVpnGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::P2sVpnGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways/{}/getP2sVpnConnectionHealth",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::P2sVpnGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_p2s_vpn_connection_health_detailed {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::P2sVpnConnectionHealth> {
let bytes = self.0.into_body().collect().await?;
let body: models::P2sVpnConnectionHealth = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) gateway_name: String,
pub(crate) request: models::P2sVpnConnectionHealthRequest,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways/{}/getP2sVpnConnectionHealthDetailed" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.request)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::P2sVpnConnectionHealth>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod disconnect_p2s_vpn_connections {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) p2s_vpn_gateway_name: String,
pub(crate) request: models::P2sVpnConnectionRequest,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/p2svpnGateways/{}/disconnectP2sVpnConnections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . p2s_vpn_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.request)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod vpn_server_configurations_associated_with_virtual_wan {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name."]
#[doc = "* `virtual_wan_name`: The name of the VirtualWAN whose associated VpnServerConfigurations is needed."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_wan_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_wan_name: virtual_wan_name.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnServerConfigurationsResponse> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnServerConfigurationsResponse = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_wan_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualWans/{}/vpnServerConfigurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_wan_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnServerConfigurationsResponse>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod virtual_hub_route_table_v2s {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a VirtualHubRouteTableV2."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHubRouteTableV2."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `route_table_name`: The name of the VirtualHubRouteTableV2."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
route_table_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
route_table_name: route_table_name.into(),
}
}
#[doc = "Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `route_table_name`: The name of the VirtualHubRouteTableV2."]
#[doc = "* `virtual_hub_route_table_v2_parameters`: Parameters supplied to create or update VirtualHubRouteTableV2."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
route_table_name: impl Into<String>,
virtual_hub_route_table_v2_parameters: impl Into<models::VirtualHubRouteTableV2>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
route_table_name: route_table_name.into(),
virtual_hub_route_table_v2_parameters: virtual_hub_route_table_v2_parameters.into(),
}
}
#[doc = "Deletes a VirtualHubRouteTableV2."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHubRouteTableV2."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `route_table_name`: The name of the VirtualHubRouteTableV2."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
route_table_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
route_table_name: route_table_name.into(),
}
}
#[doc = "Retrieves the details of all VirtualHubRouteTableV2s."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualHubRouteTableV2> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualHubRouteTableV2 = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) route_table_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/routeTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualHubRouteTableV2>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualHubRouteTableV2> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualHubRouteTableV2 = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) route_table_name: String,
pub(crate) virtual_hub_route_table_v2_parameters: models::VirtualHubRouteTableV2,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/routeTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.virtual_hub_route_table_v2_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualHubRouteTableV2>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) route_table_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/routeTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVirtualHubRouteTableV2sResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVirtualHubRouteTableV2sResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVirtualHubRouteTableV2sResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/routeTables",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod express_route_gateways {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Lists ExpressRoute gateways under a given subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_subscription(&self, subscription_id: impl Into<String>) -> list_by_subscription::RequestBuilder {
list_by_subscription::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists ExpressRoute gateways in a given resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Fetches the details of a ExpressRoute gateway in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_gateway_name`: The name of the ExpressRoute gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
express_route_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
express_route_gateway_name: express_route_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a ExpressRoute gateway in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_gateway_name`: The name of the ExpressRoute gateway."]
#[doc = "* `put_express_route_gateway_parameters`: Parameters required in an ExpressRoute gateway PUT operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
express_route_gateway_name: impl Into<String>,
put_express_route_gateway_parameters: impl Into<models::ExpressRouteGateway>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
express_route_gateway_name: express_route_gateway_name.into(),
put_express_route_gateway_parameters: put_express_route_gateway_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates express route gateway tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the ExpressRouteGateway."]
#[doc = "* `express_route_gateway_name`: The name of the gateway."]
#[doc = "* `express_route_gateway_parameters`: Parameters supplied to update a virtual wan express route gateway tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
express_route_gateway_name: impl Into<String>,
express_route_gateway_parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
express_route_gateway_name: express_route_gateway_name.into(),
express_route_gateway_parameters: express_route_gateway_parameters.into(),
}
}
#[doc = "Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be deleted when there are no connection subresources."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_gateway_name`: The name of the ExpressRoute gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
express_route_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
express_route_gateway_name: express_route_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list_by_subscription {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteGatewayList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteGatewayList = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/expressRouteGateways",
this.client.endpoint(),
&this.subscription_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteGatewayList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteGatewayList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteGatewayList = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteGateways",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteGatewayList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) express_route_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) express_route_gateway_name: String,
pub(crate) put_express_route_gateway_parameters: models::ExpressRouteGateway,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.put_express_route_gateway_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) express_route_gateway_name: String,
pub(crate) express_route_gateway_parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.express_route_gateway_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) express_route_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod express_route_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified ExpressRouteConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_gateway_name`: The name of the ExpressRoute gateway."]
#[doc = "* `connection_name`: The name of the ExpressRoute connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
express_route_gateway_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
express_route_gateway_name: express_route_gateway_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_gateway_name`: The name of the ExpressRoute gateway."]
#[doc = "* `connection_name`: The name of the connection subresource."]
#[doc = "* `put_express_route_connection_parameters`: Parameters required in an ExpressRouteConnection PUT operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
express_route_gateway_name: impl Into<String>,
connection_name: impl Into<String>,
put_express_route_connection_parameters: impl Into<models::ExpressRouteConnection>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
express_route_gateway_name: express_route_gateway_name.into(),
connection_name: connection_name.into(),
put_express_route_connection_parameters: put_express_route_connection_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes a connection to a ExpressRoute circuit."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_gateway_name`: The name of the ExpressRoute gateway."]
#[doc = "* `connection_name`: The name of the connection subresource."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
express_route_gateway_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
express_route_gateway_name: express_route_gateway_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists ExpressRouteConnections."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_gateway_name`: The name of the ExpressRoute gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
express_route_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
express_route_gateway_name: express_route_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) express_route_gateway_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteGateways/{}/expressRouteConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . express_route_gateway_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) express_route_gateway_name: String,
pub(crate) connection_name: String,
pub(crate) put_express_route_connection_parameters: models::ExpressRouteConnection,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteGateways/{}/expressRouteConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . express_route_gateway_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.put_express_route_connection_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) express_route_gateway_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteGateways/{}/expressRouteConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . express_route_gateway_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteConnectionList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteConnectionList = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) express_route_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteGateways/{}/expressRouteConnections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . express_route_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteConnectionList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod virtual_hub_bgp_connection {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a Virtual Hub Bgp Connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `connection_name`: The name of the connection."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
connection_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
connection_name: connection_name.into(),
}
}
#[doc = "Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `connection_name`: The name of the connection."]
#[doc = "* `parameters`: Parameters of Bgp connection."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
connection_name: impl Into<String>,
parameters: impl Into<models::BgpConnection>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
connection_name: connection_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Deletes a VirtualHubBgpConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHubBgpConnection."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `connection_name`: The name of the connection."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
connection_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
connection_name: connection_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BgpConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::BgpConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) connection_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/bgpConnections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::BgpConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BgpConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::BgpConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) connection_name: String,
pub(crate) parameters: models::BgpConnection,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/bgpConnections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::BgpConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) connection_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/bgpConnections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod virtual_hub_bgp_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of all VirtualHubBgpConnections."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
}
}
#[doc = "Retrieves a list of routes the virtual hub bgp connection has learned."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `hub_name`: The name of the virtual hub."]
#[doc = "* `connection_name`: The name of the virtual hub bgp connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_learned_routes(
&self,
resource_group_name: impl Into<String>,
hub_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_learned_routes::RequestBuilder {
list_learned_routes::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
hub_name: hub_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `hub_name`: The name of the virtual hub."]
#[doc = "* `connection_name`: The name of the virtual hub bgp connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_advertised_routes(
&self,
resource_group_name: impl Into<String>,
hub_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_advertised_routes::RequestBuilder {
list_advertised_routes::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
hub_name: hub_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVirtualHubBgpConnectionResults> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVirtualHubBgpConnectionResults = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVirtualHubBgpConnectionResults, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/bgpConnections",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_learned_routes {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PeerRouteList> {
let bytes = self.0.into_body().collect().await?;
let body: models::PeerRouteList = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) hub_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/bgpConnections/{}/learnedRoutes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . hub_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PeerRouteList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_advertised_routes {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PeerRouteList> {
let bytes = self.0.into_body().collect().await?;
let body: models::PeerRouteList = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) hub_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/bgpConnections/{}/advertisedRoutes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . hub_name , & this . connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PeerRouteList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod virtual_hub_ip_configuration {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a Virtual Hub Ip configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `ip_config_name`: The name of the ipconfig."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
ip_config_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
ip_config_name: ip_config_name.into(),
}
}
#[doc = "Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing VirtualHubIpConfiguration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `ip_config_name`: The name of the ipconfig."]
#[doc = "* `parameters`: Hub Ip Configuration parameters."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
ip_config_name: impl Into<String>,
parameters: impl Into<models::HubIpConfiguration>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
ip_config_name: ip_config_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Deletes a VirtualHubIpConfiguration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHubBgpConnection."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `ip_config_name`: The name of the ipconfig."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
ip_config_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
ip_config_name: ip_config_name.into(),
}
}
#[doc = "Retrieves the details of all VirtualHubIpConfigurations."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::HubIpConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::HubIpConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) ip_config_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/ipConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.ip_config_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::HubIpConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::HubIpConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::HubIpConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) ip_config_name: String,
pub(crate) parameters: models::HubIpConfiguration,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/ipConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.ip_config_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::HubIpConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) ip_config_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/ipConfigurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.ip_config_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVirtualHubIpConfigurationResults> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVirtualHubIpConfigurationResults = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVirtualHubIpConfigurationResults, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/ipConfigurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod hub_route_tables {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a RouteTable."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `route_table_name`: The name of the RouteTable."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
route_table_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
route_table_name: route_table_name.into(),
}
}
#[doc = "Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `route_table_name`: The name of the RouteTable."]
#[doc = "* `route_table_parameters`: Parameters supplied to create or update RouteTable."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
route_table_name: impl Into<String>,
route_table_parameters: impl Into<models::HubRouteTable>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
route_table_name: route_table_name.into(),
route_table_parameters: route_table_parameters.into(),
}
}
#[doc = "Deletes a RouteTable."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the RouteTable."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `route_table_name`: The name of the RouteTable."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
route_table_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
route_table_name: route_table_name.into(),
}
}
#[doc = "Retrieves the details of all RouteTables."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::HubRouteTable> {
let bytes = self.0.into_body().collect().await?;
let body: models::HubRouteTable = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) route_table_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/hubRouteTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::HubRouteTable>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::HubRouteTable> {
let bytes = self.0.into_body().collect().await?;
let body: models::HubRouteTable = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) route_table_name: String,
pub(crate) route_table_parameters: models::HubRouteTable,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/hubRouteTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.route_table_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::HubRouteTable>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) route_table_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/hubRouteTables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.route_table_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListHubRouteTablesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListHubRouteTablesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListHubRouteTablesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/hubRouteTables",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod routing_intent {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a RoutingIntent."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the RoutingIntent."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `routing_intent_name`: The name of the RoutingIntent."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
routing_intent_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
routing_intent_name: routing_intent_name.into(),
}
}
#[doc = "Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the RoutingIntent."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `routing_intent_name`: The name of the per VirtualHub singleton Routing Intent resource."]
#[doc = "* `routing_intent_parameters`: Parameters supplied to create or update RoutingIntent."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
routing_intent_name: impl Into<String>,
routing_intent_parameters: impl Into<models::RoutingIntent>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
routing_intent_name: routing_intent_name.into(),
routing_intent_parameters: routing_intent_parameters.into(),
}
}
#[doc = "Deletes a RoutingIntent."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the RoutingIntent."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
#[doc = "* `routing_intent_name`: The name of the RoutingIntent."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
routing_intent_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
routing_intent_name: routing_intent_name.into(),
}
}
#[doc = "Retrieves the details of all RoutingIntent child resources of the VirtualHub."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the VirtualHub."]
#[doc = "* `virtual_hub_name`: The name of the VirtualHub."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_hub_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_hub_name: virtual_hub_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RoutingIntent> {
let bytes = self.0.into_body().collect().await?;
let body: models::RoutingIntent = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) routing_intent_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/routingIntent/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.routing_intent_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RoutingIntent>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RoutingIntent> {
let bytes = self.0.into_body().collect().await?;
let body: models::RoutingIntent = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) routing_intent_name: String,
pub(crate) routing_intent_parameters: models::RoutingIntent,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/routingIntent/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.routing_intent_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.routing_intent_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RoutingIntent>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
pub(crate) routing_intent_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/routingIntent/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name,
&this.routing_intent_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListRoutingIntentResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListRoutingIntentResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_hub_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListRoutingIntentResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualHubs/{}/routingIntent",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_hub_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod virtual_network_gateways {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified virtual network gateway by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a virtual network gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `parameters`: Parameters supplied to create or update virtual network gateway operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
parameters: impl Into<models::VirtualNetworkGateway>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a virtual network gateway tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `parameters`: Parameters supplied to update virtual network gateway tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified virtual network gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all virtual network gateways by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the connections in a virtual network gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_connections(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_connections::RequestBuilder {
list_connections::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Resets the primary of the virtual network gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn reset(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> reset::RequestBuilder {
reset::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
gateway_vip: None,
}
}
#[doc = "Resets the VPN client shared key of the virtual network gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn reset_vpn_client_shared_key(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> reset_vpn_client_shared_key::RequestBuilder {
reset_vpn_client_shared_key::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Generates VPN client package for P2S client of the virtual network gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `parameters`: Parameters supplied to the generate virtual network gateway VPN client package operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn generatevpnclientpackage(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
parameters: impl Into<models::VpnClientParameters>,
subscription_id: impl Into<String>,
) -> generatevpnclientpackage::RequestBuilder {
generatevpnclientpackage::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `parameters`: Parameters supplied to the generate virtual network gateway VPN client package operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn generate_vpn_profile(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
parameters: impl Into<models::VpnClientParameters>,
subscription_id: impl Into<String>,
) -> generate_vpn_profile::RequestBuilder {
generate_vpn_profile::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_vpn_profile_package_url(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_vpn_profile_package_url::RequestBuilder {
get_vpn_profile_package_url::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "The GetBgpPeerStatus operation retrieves the status of all BGP peers."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_bgp_peer_status(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_bgp_peer_status::RequestBuilder {
get_bgp_peer_status::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
peer: None,
}
}
#[doc = "Gets a xml format representation for supported vpn devices."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn supported_vpn_devices(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> supported_vpn_devices::RequestBuilder {
supported_vpn_devices::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_learned_routes(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_learned_routes::RequestBuilder {
get_learned_routes::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `peer`: The IP address of the peer."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_advertised_routes(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
peer: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_advertised_routes::RequestBuilder {
get_advertised_routes::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
peer: peer.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `vpnclient_ipsec_params`: Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn set_vpnclient_ipsec_parameters(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
vpnclient_ipsec_params: impl Into<models::VpnClientIPsecParameters>,
subscription_id: impl Into<String>,
) -> set_vpnclient_ipsec_parameters::RequestBuilder {
set_vpnclient_ipsec_parameters::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
vpnclient_ipsec_params: vpnclient_ipsec_params.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The virtual network gateway name."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_vpnclient_ipsec_parameters(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_vpnclient_ipsec_parameters::RequestBuilder {
get_vpnclient_ipsec_parameters::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets a xml format representation for vpn device configuration script."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The name of the virtual network gateway connection for which the configuration script is generated."]
#[doc = "* `parameters`: Parameters supplied to the generate vpn device script operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn vpn_device_configuration_script(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
parameters: impl Into<models::VpnDeviceScriptParameters>,
subscription_id: impl Into<String>,
) -> vpn_device_configuration_script::RequestBuilder {
vpn_device_configuration_script::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Starts packet capture on virtual network gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn start_packet_capture(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> start_packet_capture::RequestBuilder {
start_packet_capture::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
parameters: None,
}
}
#[doc = "Stops packet capture on virtual network gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `parameters`: Virtual network gateway packet capture parameters supplied to stop packet capture on gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn stop_packet_capture(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
parameters: impl Into<models::VpnPacketCaptureStopParameters>,
subscription_id: impl Into<String>,
) -> stop_packet_capture::RequestBuilder {
stop_packet_capture::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_vpnclient_connection_health(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_vpnclient_connection_health::RequestBuilder {
get_vpnclient_connection_health::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Disconnect vpn connections of virtual network gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_name`: The name of the virtual network gateway."]
#[doc = "* `request`: The parameters are supplied to disconnect vpn connections."]
pub fn disconnect_virtual_network_gateway_vpn_connections(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
request: impl Into<models::P2sVpnConnectionRequest>,
) -> disconnect_virtual_network_gateway_vpn_connections::RequestBuilder {
disconnect_virtual_network_gateway_vpn_connections::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
request: request.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) parameters: models::VirtualNetworkGateway,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkGatewayListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkGatewayListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualNetworkGatewayListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_connections {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkGatewayListConnectionsResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkGatewayListConnectionsResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualNetworkGatewayListConnectionsResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/connections",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod reset {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
pub(crate) gateway_vip: Option<String>,
}
impl RequestBuilder {
#[doc = "Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway."]
pub fn gateway_vip(mut self, gateway_vip: impl Into<String>) -> Self {
self.gateway_vip = Some(gateway_vip.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/reset",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(gateway_vip) = &this.gateway_vip {
req.url_mut().query_pairs_mut().append_pair("gatewayVip", gateway_vip);
}
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod reset_vpn_client_shared_key {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/resetvpnclientsharedkey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod generatevpnclientpackage {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) parameters: models::VpnClientParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/generatevpnclientpackage" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod generate_vpn_profile {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) parameters: models::VpnClientParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/generatevpnprofile" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_vpn_profile_package_url {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/getvpnprofilepackageurl" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_bgp_peer_status {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BgpPeerStatusListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::BgpPeerStatusListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
pub(crate) peer: Option<String>,
}
impl RequestBuilder {
#[doc = "The IP address of the peer to retrieve the status of."]
pub fn peer(mut self, peer: impl Into<String>) -> Self {
self.peer = Some(peer.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/getBgpPeerStatus",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(peer) = &this.peer {
req.url_mut().query_pairs_mut().append_pair("peer", peer);
}
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::BgpPeerStatusListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod supported_vpn_devices {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/supportedvpndevices" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_learned_routes {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::GatewayRouteListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::GatewayRouteListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/getLearnedRoutes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::GatewayRouteListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_advertised_routes {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::GatewayRouteListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::GatewayRouteListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) peer: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/getAdvertisedRoutes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let peer = &this.peer;
req.url_mut().query_pairs_mut().append_pair("peer", peer);
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::GatewayRouteListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod set_vpnclient_ipsec_parameters {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) vpnclient_ipsec_params: models::VpnClientIPsecParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/setvpnclientipsecparameters" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.vpnclient_ipsec_params)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_vpnclient_ipsec_parameters {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnClientIPsecParameters> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnClientIPsecParameters = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/getvpnclientipsecparameters" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnClientIPsecParameters>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod vpn_device_configuration_script {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) parameters: models::VpnDeviceScriptParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}/vpndeviceconfigurationscript",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod start_packet_capture {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
pub(crate) parameters: Option<models::VpnPacketCaptureStartParameters>,
}
impl RequestBuilder {
#[doc = "Virtual network gateway packet capture parameters supplied to start packet capture on gateway."]
pub fn parameters(mut self, parameters: impl Into<models::VpnPacketCaptureStartParameters>) -> Self {
self.parameters = Some(parameters.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/startPacketCapture" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = if let Some(parameters) = &this.parameters {
req.insert_header("content-type", "application/json");
azure_core::to_json(parameters)?
} else {
azure_core::EMPTY_BODY
};
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod stop_packet_capture {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) parameters: models::VpnPacketCaptureStopParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/stopPacketCapture",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_vpnclient_connection_health {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VpnClientConnectionHealthDetailListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VpnClientConnectionHealthDetailListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/getVpnClientConnectionHealth" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::VpnClientConnectionHealthDetailListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod disconnect_virtual_network_gateway_vpn_connections {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) request: models::P2sVpnConnectionRequest,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/disconnectVirtualNetworkGatewayVpnConnections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . virtual_network_gateway_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.request)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod virtual_network_gateway_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified virtual network gateway connection by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The name of the virtual network gateway connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a virtual network gateway connection in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The name of the virtual network gateway connection."]
#[doc = "* `parameters`: Parameters supplied to the create or update virtual network gateway connection operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
parameters: impl Into<models::VirtualNetworkGatewayConnection>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a virtual network gateway connection tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The name of the virtual network gateway connection."]
#[doc = "* `parameters`: Parameters supplied to update virtual network gateway connection tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified virtual network Gateway connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The name of the virtual network gateway connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The virtual network gateway connection shared key name."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_shared_key(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_shared_key::RequestBuilder {
get_shared_key::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The virtual network gateway connection name."]
#[doc = "* `parameters`: Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn set_shared_key(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
parameters: impl Into<models::ConnectionSharedKey>,
subscription_id: impl Into<String>,
) -> set_shared_key::RequestBuilder {
set_shared_key::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The virtual network gateway connection reset shared key Name."]
#[doc = "* `parameters`: Parameters supplied to the begin reset virtual network gateway connection shared key operation through network resource provider."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn reset_shared_key(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
parameters: impl Into<models::ConnectionResetSharedKey>,
subscription_id: impl Into<String>,
) -> reset_shared_key::RequestBuilder {
reset_shared_key::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Starts packet capture on virtual network gateway connection in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The name of the virtual network gateway connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn start_packet_capture(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> start_packet_capture::RequestBuilder {
start_packet_capture::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
subscription_id: subscription_id.into(),
parameters: None,
}
}
#[doc = "Stops packet capture on virtual network gateway connection in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The name of the virtual network gateway Connection."]
#[doc = "* `parameters`: Virtual network gateway packet capture parameters supplied to stop packet capture on gateway connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn stop_packet_capture(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
parameters: impl Into<models::VpnPacketCaptureStopParameters>,
subscription_id: impl Into<String>,
) -> stop_packet_capture::RequestBuilder {
stop_packet_capture::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists IKE Security Associations for the virtual network gateway connection in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The name of the virtual network gateway Connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_ike_sas(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_ike_sas::RequestBuilder {
get_ike_sas::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Resets the virtual network gateway connection specified."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_network_gateway_connection_name`: The name of the virtual network gateway Connection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn reset_connection(
&self,
resource_group_name: impl Into<String>,
virtual_network_gateway_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> reset_connection::RequestBuilder {
reset_connection::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_connection_name: virtual_network_gateway_connection_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkGatewayConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkGatewayConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkGatewayConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkGatewayConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkGatewayConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) parameters: models::VirtualNetworkGatewayConnection,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkGatewayConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_shared_key {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionSharedKey> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionSharedKey = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}/sharedkey",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionSharedKey>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod set_shared_key {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionSharedKey> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionSharedKey = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) parameters: models::ConnectionSharedKey,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}/sharedkey",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionSharedKey>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkGatewayConnectionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkGatewayConnectionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualNetworkGatewayConnectionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod reset_shared_key {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionResetSharedKey> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionResetSharedKey = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) parameters: models::ConnectionResetSharedKey,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}/sharedkey/reset",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionResetSharedKey>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod start_packet_capture {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) subscription_id: String,
pub(crate) parameters: Option<models::VpnPacketCaptureStartParameters>,
}
impl RequestBuilder {
#[doc = "Virtual network gateway packet capture parameters supplied to start packet capture on gateway connection."]
pub fn parameters(mut self, parameters: impl Into<models::VpnPacketCaptureStartParameters>) -> Self {
self.parameters = Some(parameters.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}/startPacketCapture",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = if let Some(parameters) = &this.parameters {
req.insert_header("content-type", "application/json");
azure_core::to_json(parameters)?
} else {
azure_core::EMPTY_BODY
};
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod stop_packet_capture {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) parameters: models::VpnPacketCaptureStopParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}/stopPacketCapture",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_ike_sas {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}/getikesas",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod reset_connection {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/connections/{}/resetconnection",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod local_network_gateways {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified local network gateway in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `local_network_gateway_name`: The name of the local network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
local_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
local_network_gateway_name: local_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a local network gateway in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `local_network_gateway_name`: The name of the local network gateway."]
#[doc = "* `parameters`: Parameters supplied to the create or update local network gateway operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
local_network_gateway_name: impl Into<String>,
parameters: impl Into<models::LocalNetworkGateway>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
local_network_gateway_name: local_network_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a local network gateway tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `local_network_gateway_name`: The name of the local network gateway."]
#[doc = "* `parameters`: Parameters supplied to update local network gateway tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
local_network_gateway_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
local_network_gateway_name: local_network_gateway_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified local network gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `local_network_gateway_name`: The name of the local network gateway."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
local_network_gateway_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
local_network_gateway_name: local_network_gateway_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the local network gateways in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LocalNetworkGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::LocalNetworkGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) local_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/localNetworkGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.local_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::LocalNetworkGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LocalNetworkGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::LocalNetworkGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) local_network_gateway_name: String,
pub(crate) parameters: models::LocalNetworkGateway,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/localNetworkGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.local_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::LocalNetworkGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LocalNetworkGateway> {
let bytes = self.0.into_body().collect().await?;
let body: models::LocalNetworkGateway = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) local_network_gateway_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/localNetworkGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.local_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::LocalNetworkGateway>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) local_network_gateway_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/localNetworkGateways/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.local_network_gateway_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LocalNetworkGatewayListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::LocalNetworkGatewayListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::LocalNetworkGatewayListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/localNetworkGateways",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod virtual_network_gateway_nat_rules {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the details of a nat rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the Virtual Network Gateway."]
#[doc = "* `virtual_network_gateway_name`: The name of the gateway."]
#[doc = "* `nat_rule_name`: The name of the nat rule."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
nat_rule_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
nat_rule_name: nat_rule_name.into(),
}
}
#[doc = "Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the Virtual Network Gateway."]
#[doc = "* `virtual_network_gateway_name`: The name of the gateway."]
#[doc = "* `nat_rule_name`: The name of the nat rule."]
#[doc = "* `nat_rule_parameters`: Parameters supplied to create or Update a Nat Rule."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
nat_rule_name: impl Into<String>,
nat_rule_parameters: impl Into<models::VirtualNetworkGatewayNatRule>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
nat_rule_name: nat_rule_name.into(),
nat_rule_parameters: nat_rule_parameters.into(),
}
}
#[doc = "Deletes a nat rule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the Virtual Network Gateway."]
#[doc = "* `virtual_network_gateway_name`: The name of the gateway."]
#[doc = "* `nat_rule_name`: The name of the nat rule."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
nat_rule_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
nat_rule_name: nat_rule_name.into(),
}
}
#[doc = "Retrieves all nat rules for a particular virtual network gateway."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of the virtual network gateway."]
#[doc = "* `virtual_network_gateway_name`: The name of the gateway."]
pub fn list_by_virtual_network_gateway(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
virtual_network_gateway_name: impl Into<String>,
) -> list_by_virtual_network_gateway::RequestBuilder {
list_by_virtual_network_gateway::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
virtual_network_gateway_name: virtual_network_gateway_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkGatewayNatRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkGatewayNatRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) nat_rule_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/natRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name,
&this.nat_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkGatewayNatRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualNetworkGatewayNatRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualNetworkGatewayNatRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) nat_rule_name: String,
pub(crate) nat_rule_parameters: models::VirtualNetworkGatewayNatRule,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/natRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name,
&this.nat_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.nat_rule_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualNetworkGatewayNatRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
pub(crate) nat_rule_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/natRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name,
&this.nat_rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_virtual_network_gateway {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ListVirtualNetworkGatewayNatRulesResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ListVirtualNetworkGatewayNatRulesResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) virtual_network_gateway_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ListVirtualNetworkGatewayNatRulesResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkGateways/{}/natRules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_network_gateway_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod express_route_cross_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves all the ExpressRouteCrossConnections in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieves all the ExpressRouteCrossConnections in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets details about the specified ExpressRouteCrossConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group (peering location of the circuit)."]
#[doc = "* `cross_connection_name`: The name of the ExpressRouteCrossConnection (service key of the circuit)."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update the specified ExpressRouteCrossConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cross_connection_name`: The name of the ExpressRouteCrossConnection."]
#[doc = "* `parameters`: Parameters supplied to the update express route crossConnection operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
parameters: impl Into<models::ExpressRouteCrossConnection>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates an express route cross connection tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cross_connection_name`: The name of the cross connection."]
#[doc = "* `cross_connection_parameters`: Parameters supplied to update express route cross connection tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
cross_connection_parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
cross_connection_parameters: cross_connection_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the currently advertised ARP table associated with the express route cross connection in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cross_connection_name`: The name of the ExpressRouteCrossConnection."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `device_path`: The path of the device."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_arp_table(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
peering_name: impl Into<String>,
device_path: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_arp_table::RequestBuilder {
list_arp_table::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
peering_name: peering_name.into(),
device_path: device_path.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the route table summary associated with the express route cross connection in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cross_connection_name`: The name of the ExpressRouteCrossConnection."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `device_path`: The path of the device."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_routes_table_summary(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
peering_name: impl Into<String>,
device_path: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_routes_table_summary::RequestBuilder {
list_routes_table_summary::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
peering_name: peering_name.into(),
device_path: device_path.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the currently advertised routes table associated with the express route cross connection in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cross_connection_name`: The name of the ExpressRouteCrossConnection."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `device_path`: The path of the device."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_routes_table(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
peering_name: impl Into<String>,
device_path: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_routes_table::RequestBuilder {
list_routes_table::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
peering_name: peering_name.into(),
device_path: device_path.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCrossConnectionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCrossConnectionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRouteCrossConnectionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/expressRouteCrossConnections",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCrossConnectionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCrossConnectionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRouteCrossConnectionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCrossConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCrossConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.cross_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCrossConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCrossConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCrossConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) parameters: models::ExpressRouteCrossConnection,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.cross_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCrossConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCrossConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCrossConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) cross_connection_parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.cross_connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.cross_connection_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCrossConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_arp_table {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitsArpTableListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitsArpTableListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) peering_name: String,
pub(crate) device_path: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}/peerings/{}/arpTables/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cross_connection_name , & this . peering_name , & this . device_path)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitsArpTableListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_routes_table_summary {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCrossConnectionsRoutesTableSummaryListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCrossConnectionsRoutesTableSummaryListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) peering_name: String,
pub(crate) device_path: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}/peerings/{}/routeTablesSummary/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cross_connection_name , & this . peering_name , & this . device_path)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCrossConnectionsRoutesTableSummaryListResult>>
{
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_routes_table {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCircuitsRoutesTableListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCircuitsRoutesTableListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) peering_name: String,
pub(crate) device_path: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}/peerings/{}/routeTables/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . cross_connection_name , & this . peering_name , & this . device_path)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCircuitsRoutesTableListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod express_route_cross_connection_peerings {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all peerings in a specified ExpressRouteCrossConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cross_connection_name`: The name of the ExpressRouteCrossConnection."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets the specified peering for the ExpressRouteCrossConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cross_connection_name`: The name of the ExpressRouteCrossConnection."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
peering_name: peering_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a peering in the specified ExpressRouteCrossConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cross_connection_name`: The name of the ExpressRouteCrossConnection."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `peering_parameters`: Parameters supplied to the create or update ExpressRouteCrossConnection peering operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
peering_name: impl Into<String>,
peering_parameters: impl Into<models::ExpressRouteCrossConnectionPeering>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
peering_name: peering_name.into(),
peering_parameters: peering_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified peering from the ExpressRouteCrossConnection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `cross_connection_name`: The name of the ExpressRouteCrossConnection."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
cross_connection_name: impl Into<String>,
peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
cross_connection_name: cross_connection_name.into(),
peering_name: peering_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCrossConnectionPeeringList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCrossConnectionPeeringList = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRouteCrossConnectionPeeringList, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}/peerings",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.cross_connection_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCrossConnectionPeering> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCrossConnectionPeering = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}/peerings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.cross_connection_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCrossConnectionPeering>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteCrossConnectionPeering> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteCrossConnectionPeering = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) peering_name: String,
pub(crate) peering_parameters: models::ExpressRouteCrossConnectionPeering,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}/peerings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.cross_connection_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.peering_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteCrossConnectionPeering>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) cross_connection_name: String,
pub(crate) peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRouteCrossConnections/{}/peerings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.cross_connection_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod express_route_ports_locations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. Available bandwidths can only be obtained when retrieving a specific peering location."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at said peering location."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `location_name`: Name of the requested ExpressRoutePort peering location."]
pub fn get(&self, subscription_id: impl Into<String>, location_name: impl Into<String>) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
location_name: location_name.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRoutePortsLocationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRoutePortsLocationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRoutePortsLocationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/ExpressRoutePortsLocations",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRoutePortsLocation> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRoutePortsLocation = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) location_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/ExpressRoutePortsLocations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.location_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRoutePortsLocation>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod express_route_ports {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the requested ExpressRoutePort resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_port_name`: The name of ExpressRoutePort."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
express_route_port_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
express_route_port_name: express_route_port_name.into(),
}
}
#[doc = "Creates or updates the specified ExpressRoutePort resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_port_name`: The name of the ExpressRoutePort resource."]
#[doc = "* `parameters`: Parameters supplied to the create ExpressRoutePort operation."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
express_route_port_name: impl Into<String>,
parameters: impl Into<models::ExpressRoutePort>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
express_route_port_name: express_route_port_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Update ExpressRoutePort tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_port_name`: The name of the ExpressRoutePort resource."]
#[doc = "* `parameters`: Parameters supplied to update ExpressRoutePort resource tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
express_route_port_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
express_route_port_name: express_route_port_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Deletes the specified ExpressRoutePort resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_port_name`: The name of the ExpressRoutePort resource."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
express_route_port_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
express_route_port_name: express_route_port_name.into(),
}
}
#[doc = "List all the ExpressRoutePort resources in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
pub fn list_by_resource_group(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
}
}
#[doc = "List all the ExpressRoutePort resources in the specified subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Generate a letter of authorization for the requested ExpressRoutePort resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_port_name`: The name of ExpressRoutePort."]
#[doc = "* `request`: Request parameters supplied to generate a letter of authorization."]
pub fn generate_loa(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
express_route_port_name: impl Into<String>,
request: impl Into<models::GenerateExpressRoutePortsLoaRequest>,
) -> generate_loa::RequestBuilder {
generate_loa::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
express_route_port_name: express_route_port_name.into(),
request: request.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRoutePort> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRoutePort = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) express_route_port_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ExpressRoutePorts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_port_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRoutePort>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRoutePort> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRoutePort = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) express_route_port_name: String,
pub(crate) parameters: models::ExpressRoutePort,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ExpressRoutePorts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_port_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRoutePort>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRoutePort> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRoutePort = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) express_route_port_name: String,
pub(crate) parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ExpressRoutePorts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_port_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRoutePort>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) express_route_port_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ExpressRoutePorts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_port_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRoutePortListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRoutePortListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRoutePortListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ExpressRoutePorts",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRoutePortListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRoutePortListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRoutePortListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/ExpressRoutePorts",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod generate_loa {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::GenerateExpressRoutePortsLoaResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::GenerateExpressRoutePortsLoaResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) express_route_port_name: String,
pub(crate) request: models::GenerateExpressRoutePortsLoaRequest,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/expressRoutePorts/{}/generateLoa",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_port_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.request)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::GenerateExpressRoutePortsLoaResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod express_route_links {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the specified ExpressRouteLink resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_port_name`: The name of the ExpressRoutePort resource."]
#[doc = "* `link_name`: The name of the ExpressRouteLink resource."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
express_route_port_name: impl Into<String>,
link_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
express_route_port_name: express_route_port_name.into(),
link_name: link_name.into(),
}
}
#[doc = "Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `express_route_port_name`: The name of the ExpressRoutePort resource."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
express_route_port_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
express_route_port_name: express_route_port_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteLink> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteLink = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) express_route_port_name: String,
pub(crate) link_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ExpressRoutePorts/{}/links/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_port_name,
&this.link_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExpressRouteLink>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExpressRouteLinkListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExpressRouteLinkListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) express_route_port_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ExpressRouteLinkListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ExpressRoutePorts/{}/links",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.express_route_port_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod firewall_policies {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Firewall Policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates the specified Firewall Policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `parameters`: Parameters supplied to the create or update Firewall Policy operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
parameters: impl Into<models::FirewallPolicy>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified Firewall Policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all Firewall Policies in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the Firewall Policies in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FirewallPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::FirewallPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FirewallPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FirewallPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::FirewallPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) parameters: models::FirewallPolicy,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FirewallPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FirewallPolicyListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::FirewallPolicyListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::FirewallPolicyListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FirewallPolicyListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::FirewallPolicyListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::FirewallPolicyListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/firewallPolicies",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod firewall_policy_rule_collection_groups {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified FirewallPolicyRuleCollectionGroup."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `rule_collection_group_name`: The name of the FirewallPolicyRuleCollectionGroup."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
rule_collection_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
rule_collection_group_name: rule_collection_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates the specified FirewallPolicyRuleCollectionGroup."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `rule_collection_group_name`: The name of the FirewallPolicyRuleCollectionGroup."]
#[doc = "* `parameters`: Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
rule_collection_group_name: impl Into<String>,
parameters: impl Into<models::FirewallPolicyRuleCollectionGroup>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
rule_collection_group_name: rule_collection_group_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified FirewallPolicyRuleCollectionGroup."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `rule_collection_group_name`: The name of the FirewallPolicyRuleCollectionGroup."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
rule_collection_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
rule_collection_group_name: rule_collection_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FirewallPolicyRuleCollectionGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::FirewallPolicyRuleCollectionGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) rule_collection_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/ruleCollectionGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name,
&this.rule_collection_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FirewallPolicyRuleCollectionGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FirewallPolicyRuleCollectionGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::FirewallPolicyRuleCollectionGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) rule_collection_group_name: String,
pub(crate) parameters: models::FirewallPolicyRuleCollectionGroup,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/ruleCollectionGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name,
&this.rule_collection_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::FirewallPolicyRuleCollectionGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) rule_collection_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/ruleCollectionGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name,
&this.rule_collection_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FirewallPolicyRuleCollectionGroupListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::FirewallPolicyRuleCollectionGroupListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(
self,
) -> azure_core::Pageable<models::FirewallPolicyRuleCollectionGroupListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/ruleCollectionGroups",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod firewall_policy_idps_signatures {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the current status of IDPS signatures for the relevant policy"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
parameters: impl Into<models::IdpsQueryObject>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
subscription_id: subscription_id.into(),
parameters: parameters.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::QueryResults> {
let bytes = self.0.into_body().collect().await?;
let body: models::QueryResults = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) subscription_id: String,
pub(crate) parameters: models::IdpsQueryObject,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/listIdpsSignatures",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::QueryResults>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod firewall_policy_idps_signatures_overrides {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Returns all signatures overrides for a specific policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Will override/create a new signature overrides for the policy's IDPS"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `parameters`: Will contain all properties of the object to put"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn put(
&self,
parameters: impl Into<models::SignaturesOverrides>,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> put::RequestBuilder {
put::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Will update the status of policy's signature overrides for IDPS"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `parameters`: Will contain all properties of the object to put"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn patch(
&self,
parameters: impl Into<models::SignaturesOverrides>,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> patch::RequestBuilder {
patch::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Returns all signatures overrides objects for a specific policy as a list containing a single value."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SignaturesOverrides> {
let bytes = self.0.into_body().collect().await?;
let body: models::SignaturesOverrides = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/signatureOverrides/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . firewall_policy_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SignaturesOverrides>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod put {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SignaturesOverrides> {
let bytes = self.0.into_body().collect().await?;
let body: models::SignaturesOverrides = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) parameters: models::SignaturesOverrides,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/signatureOverrides/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . firewall_policy_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SignaturesOverrides>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod patch {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SignaturesOverrides> {
let bytes = self.0.into_body().collect().await?;
let body: models::SignaturesOverrides = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) parameters: models::SignaturesOverrides,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/signatureOverrides/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . firewall_policy_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SignaturesOverrides>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SignaturesOverridesList> {
let bytes = self.0.into_body().collect().await?;
let body: models::SignaturesOverridesList = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/signatureOverrides",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SignaturesOverridesList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod firewall_policy_idps_signatures_filter_values {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves the current filter values for the signatures overrides"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `firewall_policy_name`: The name of the Firewall Policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
parameters: impl Into<models::SignatureOverridesFilterValuesQuery>,
resource_group_name: impl Into<String>,
firewall_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
resource_group_name: resource_group_name.into(),
firewall_policy_name: firewall_policy_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SignatureOverridesFilterValuesResponse> {
let bytes = self.0.into_body().collect().await?;
let body: models::SignatureOverridesFilterValuesResponse = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) parameters: models::SignatureOverridesFilterValuesQuery,
pub(crate) resource_group_name: String,
pub(crate) firewall_policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/firewallPolicies/{}/listIdpsFilterOptions",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.firewall_policy_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::SignatureOverridesFilterValuesResponse>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod ip_allocations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified IpAllocation by resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ip_allocation_name`: The name of the IpAllocation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
ip_allocation_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ip_allocation_name: ip_allocation_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates an IpAllocation in the specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ip_allocation_name`: The name of the IpAllocation."]
#[doc = "* `parameters`: Parameters supplied to the create or update virtual network operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
ip_allocation_name: impl Into<String>,
parameters: impl Into<models::IpAllocation>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ip_allocation_name: ip_allocation_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a IpAllocation tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ip_allocation_name`: The name of the IpAllocation."]
#[doc = "* `parameters`: Parameters supplied to update IpAllocation tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
ip_allocation_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ip_allocation_name: ip_allocation_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified IpAllocation."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ip_allocation_name`: The name of the IpAllocation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
ip_allocation_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ip_allocation_name: ip_allocation_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all IpAllocations in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all IpAllocations in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpAllocation> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpAllocation = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ip_allocation_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/IpAllocations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ip_allocation_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::IpAllocation>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpAllocation> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpAllocation = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ip_allocation_name: String,
pub(crate) parameters: models::IpAllocation,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/IpAllocations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ip_allocation_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::IpAllocation>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpAllocation> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpAllocation = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ip_allocation_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/IpAllocations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ip_allocation_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::IpAllocation>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ip_allocation_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/IpAllocations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ip_allocation_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpAllocationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpAllocationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::IpAllocationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/IpAllocations",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpAllocationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpAllocationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::IpAllocationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/IpAllocations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod ip_groups {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified ipGroups."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ip_groups_name`: The name of the ipGroups."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
ip_groups_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ip_groups_name: ip_groups_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates an ipGroups in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ip_groups_name`: The name of the ipGroups."]
#[doc = "* `parameters`: Parameters supplied to the create or update IpGroups operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
ip_groups_name: impl Into<String>,
parameters: impl Into<models::IpGroup>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ip_groups_name: ip_groups_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates tags of an IpGroups resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ip_groups_name`: The name of the ipGroups."]
#[doc = "* `parameters`: Parameters supplied to the update ipGroups operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_groups(
&self,
resource_group_name: impl Into<String>,
ip_groups_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_groups::RequestBuilder {
update_groups::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ip_groups_name: ip_groups_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified ipGroups."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `ip_groups_name`: The name of the ipGroups."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
ip_groups_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
ip_groups_name: ip_groups_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all IpGroups in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all IpGroups in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ip_groups_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups resource."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ipGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ip_groups_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::IpGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ip_groups_name: String,
pub(crate) parameters: models::IpGroup,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ipGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ip_groups_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::IpGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_groups {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ip_groups_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ipGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ip_groups_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::IpGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) ip_groups_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ipGroups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.ip_groups_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpGroupListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpGroupListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::IpGroupListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ipGroups",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::IpGroupListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::IpGroupListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::IpGroupListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/ipGroups",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod network_virtual_appliances {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Network Virtual Appliance."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_virtual_appliance_name`: The name of Network Virtual Appliance."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_virtual_appliance_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_virtual_appliance_name: network_virtual_appliance_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates the specified Network Virtual Appliance."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_virtual_appliance_name`: The name of Network Virtual Appliance."]
#[doc = "* `parameters`: Parameters supplied to the create or update Network Virtual Appliance."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_virtual_appliance_name: impl Into<String>,
parameters: impl Into<models::NetworkVirtualAppliance>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_virtual_appliance_name: network_virtual_appliance_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates a Network Virtual Appliance."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: The resource group name of Network Virtual Appliance."]
#[doc = "* `network_virtual_appliance_name`: The name of Network Virtual Appliance being updated."]
#[doc = "* `parameters`: Parameters supplied to Update Network Virtual Appliance Tags."]
pub fn update_tags(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
network_virtual_appliance_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
network_virtual_appliance_name: network_virtual_appliance_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Deletes the specified Network Virtual Appliance."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_virtual_appliance_name`: The name of Network Virtual Appliance."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_virtual_appliance_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_virtual_appliance_name: network_virtual_appliance_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all Network Virtual Appliances in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all Network Virtual Appliances in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkVirtualAppliance> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkVirtualAppliance = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_virtual_appliance_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_virtual_appliance_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkVirtualAppliance>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkVirtualAppliance> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkVirtualAppliance = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_virtual_appliance_name: String,
pub(crate) parameters: models::NetworkVirtualAppliance,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_virtual_appliance_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkVirtualAppliance>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkVirtualAppliance> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkVirtualAppliance = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) network_virtual_appliance_name: String,
pub(crate) parameters: models::TagsObject,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_virtual_appliance_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkVirtualAppliance>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_virtual_appliance_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.network_virtual_appliance_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkVirtualApplianceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkVirtualApplianceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkVirtualApplianceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkVirtualApplianceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkVirtualApplianceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkVirtualApplianceListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/networkVirtualAppliances",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod virtual_appliance_sites {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Virtual Appliance Site."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_virtual_appliance_name`: The name of the Network Virtual Appliance."]
#[doc = "* `site_name`: The name of the site."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
network_virtual_appliance_name: impl Into<String>,
site_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_virtual_appliance_name: network_virtual_appliance_name.into(),
site_name: site_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates the specified Network Virtual Appliance Site."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_virtual_appliance_name`: The name of the Network Virtual Appliance."]
#[doc = "* `site_name`: The name of the site."]
#[doc = "* `parameters`: Parameters supplied to the create or update Network Virtual Appliance Site operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_virtual_appliance_name: impl Into<String>,
site_name: impl Into<String>,
parameters: impl Into<models::VirtualApplianceSite>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_virtual_appliance_name: network_virtual_appliance_name.into(),
site_name: site_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified site from a Virtual Appliance."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_virtual_appliance_name`: The name of the Network Virtual Appliance."]
#[doc = "* `site_name`: The name of the site."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
network_virtual_appliance_name: impl Into<String>,
site_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_virtual_appliance_name: network_virtual_appliance_name.into(),
site_name: site_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_virtual_appliance_name`: The name of the Network Virtual Appliance."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
network_virtual_appliance_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_virtual_appliance_name: network_virtual_appliance_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualApplianceSite> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualApplianceSite = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_virtual_appliance_name: String,
pub(crate) site_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances/{}/virtualApplianceSites/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_virtual_appliance_name , & this . site_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualApplianceSite>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualApplianceSite> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualApplianceSite = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_virtual_appliance_name: String,
pub(crate) site_name: String,
pub(crate) parameters: models::VirtualApplianceSite,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances/{}/virtualApplianceSites/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_virtual_appliance_name , & this . site_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualApplianceSite>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_virtual_appliance_name: String,
pub(crate) site_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances/{}/virtualApplianceSites/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_virtual_appliance_name , & this . site_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkVirtualApplianceSiteListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkVirtualApplianceSiteListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_virtual_appliance_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkVirtualApplianceSiteListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances/{}/virtualApplianceSites" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_virtual_appliance_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod virtual_appliance_skus {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "List all SKUs available for a virtual appliance."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieves a single available sku for network virtual appliance."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `sku_name`: Name of the Sku."]
pub fn get(&self, subscription_id: impl Into<String>, sku_name: impl Into<String>) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
sku_name: sku_name.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkVirtualApplianceSkuListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkVirtualApplianceSkuListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::NetworkVirtualApplianceSkuListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/networkVirtualApplianceSkus",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkVirtualApplianceSku> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkVirtualApplianceSku = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) sku_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/networkVirtualApplianceSkus/{}",
this.client.endpoint(),
&this.subscription_id,
&this.sku_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NetworkVirtualApplianceSku>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod inbound_security_rule {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Creates or updates the specified Network Virtual Appliance Inbound Security Rules."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `network_virtual_appliance_name`: The name of the Network Virtual Appliance."]
#[doc = "* `rule_collection_name`: The name of security rule collection."]
#[doc = "* `parameters`: Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
network_virtual_appliance_name: impl Into<String>,
rule_collection_name: impl Into<String>,
parameters: impl Into<models::InboundSecurityRule>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
network_virtual_appliance_name: network_virtual_appliance_name.into(),
rule_collection_name: rule_collection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::InboundSecurityRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::InboundSecurityRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) network_virtual_appliance_name: String,
pub(crate) rule_collection_name: String,
pub(crate) parameters: models::InboundSecurityRule,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkVirtualAppliances/{}/inboundSecurityRules/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . network_virtual_appliance_name , & this . rule_collection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::InboundSecurityRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod operations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Lists all of the available Network Rest API operations."]
pub fn list(&self) -> list::RequestBuilder {
list::RequestBuilder { client: self.0.clone() }
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::OperationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::OperationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::OperationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url =
azure_core::Url::parse(&format!("{}/providers/Microsoft.Network/operations", this.client.endpoint(),))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod public_ip_prefixes {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified public IP prefix in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `public_ip_prefix_name`: The name of the public IP prefix."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
public_ip_prefix_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
public_ip_prefix_name: public_ip_prefix_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a static or dynamic public IP prefix."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `public_ip_prefix_name`: The name of the public IP prefix."]
#[doc = "* `parameters`: Parameters supplied to the create or update public IP prefix operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
public_ip_prefix_name: impl Into<String>,
parameters: impl Into<models::PublicIpPrefix>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
public_ip_prefix_name: public_ip_prefix_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates public IP prefix tags."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `public_ip_prefix_name`: The name of the public IP prefix."]
#[doc = "* `parameters`: Parameters supplied to update public IP prefix tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
public_ip_prefix_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
public_ip_prefix_name: public_ip_prefix_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified public IP prefix."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `public_ip_prefix_name`: The name of the PublicIpPrefix."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
public_ip_prefix_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
public_ip_prefix_name: public_ip_prefix_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the public IP prefixes in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all public IP prefixes in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpPrefix> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpPrefix = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) public_ip_prefix_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPPrefixes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.public_ip_prefix_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PublicIpPrefix>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpPrefix> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpPrefix = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) public_ip_prefix_name: String,
pub(crate) parameters: models::PublicIpPrefix,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPPrefixes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.public_ip_prefix_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PublicIpPrefix>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpPrefix> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpPrefix = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) public_ip_prefix_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPPrefixes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.public_ip_prefix_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PublicIpPrefix>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) public_ip_prefix_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPPrefixes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.public_ip_prefix_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpPrefixListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpPrefixListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PublicIpPrefixListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/publicIPPrefixes",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicIpPrefixListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicIpPrefixListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::PublicIpPrefixListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPPrefixes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod route_filters {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified route filter."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_filter_name`: The name of the route filter."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
route_filter_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_filter_name: route_filter_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates a route filter in a specified resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_filter_name`: The name of the route filter."]
#[doc = "* `route_filter_parameters`: Parameters supplied to the create or update route filter operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
route_filter_name: impl Into<String>,
route_filter_parameters: impl Into<models::RouteFilter>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_filter_name: route_filter_name.into(),
route_filter_parameters: route_filter_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates tags of a route filter."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_filter_name`: The name of the route filter."]
#[doc = "* `parameters`: Parameters supplied to update route filter tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
route_filter_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_filter_name: route_filter_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified route filter."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_filter_name`: The name of the route filter."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
route_filter_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_filter_name: route_filter_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all route filters in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all route filters in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteFilter> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteFilter = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_filter_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced express route bgp peering resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeFilters/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_filter_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RouteFilter>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteFilter> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteFilter = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_filter_name: String,
pub(crate) route_filter_parameters: models::RouteFilter,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeFilters/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_filter_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.route_filter_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RouteFilter>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteFilter> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteFilter = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_filter_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeFilters/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_filter_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RouteFilter>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_filter_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeFilters/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_filter_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteFilterListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteFilterListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::RouteFilterListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeFilters",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteFilterListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteFilterListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::RouteFilterListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/routeFilters",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod route_filter_rules {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified rule from a route filter."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_filter_name`: The name of the route filter."]
#[doc = "* `rule_name`: The name of the rule."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
route_filter_name: impl Into<String>,
rule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_filter_name: route_filter_name.into(),
rule_name: rule_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates a route in the specified route filter."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_filter_name`: The name of the route filter."]
#[doc = "* `rule_name`: The name of the route filter rule."]
#[doc = "* `route_filter_rule_parameters`: Parameters supplied to the create or update route filter rule operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
route_filter_name: impl Into<String>,
rule_name: impl Into<String>,
route_filter_rule_parameters: impl Into<models::RouteFilterRule>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_filter_name: route_filter_name.into(),
rule_name: rule_name.into(),
route_filter_rule_parameters: route_filter_rule_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified rule from a route filter."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_filter_name`: The name of the route filter."]
#[doc = "* `rule_name`: The name of the rule."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
route_filter_name: impl Into<String>,
rule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_filter_name: route_filter_name.into(),
rule_name: rule_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all RouteFilterRules in a route filter."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `route_filter_name`: The name of the route filter."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_route_filter(
&self,
resource_group_name: impl Into<String>,
route_filter_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_route_filter::RequestBuilder {
list_by_route_filter::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
route_filter_name: route_filter_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteFilterRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteFilterRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_filter_name: String,
pub(crate) rule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeFilters/{}/routeFilterRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_filter_name,
&this.rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RouteFilterRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteFilterRule> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteFilterRule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_filter_name: String,
pub(crate) rule_name: String,
pub(crate) route_filter_rule_parameters: models::RouteFilterRule,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeFilters/{}/routeFilterRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_filter_name,
&this.rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.route_filter_rule_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RouteFilterRule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_filter_name: String,
pub(crate) rule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeFilters/{}/routeFilterRules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_filter_name,
&this.rule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_route_filter {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RouteFilterRuleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::RouteFilterRuleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) route_filter_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::RouteFilterRuleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeFilters/{}/routeFilterRules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.route_filter_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod security_partner_providers {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Security Partner Provider."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `security_partner_provider_name`: The name of the Security Partner Provider."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
security_partner_provider_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
security_partner_provider_name: security_partner_provider_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates the specified Security Partner Provider."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `security_partner_provider_name`: The name of the Security Partner Provider."]
#[doc = "* `parameters`: Parameters supplied to the create or update Security Partner Provider operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
security_partner_provider_name: impl Into<String>,
parameters: impl Into<models::SecurityPartnerProvider>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
security_partner_provider_name: security_partner_provider_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Updates tags of a Security Partner Provider resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `security_partner_provider_name`: The name of the Security Partner Provider."]
#[doc = "* `parameters`: Parameters supplied to update Security Partner Provider tags."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update_tags(
&self,
resource_group_name: impl Into<String>,
security_partner_provider_name: impl Into<String>,
parameters: impl Into<models::TagsObject>,
subscription_id: impl Into<String>,
) -> update_tags::RequestBuilder {
update_tags::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
security_partner_provider_name: security_partner_provider_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified Security Partner Provider."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `security_partner_provider_name`: The name of the Security Partner Provider."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
security_partner_provider_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
security_partner_provider_name: security_partner_provider_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all Security Partner Providers in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the Security Partner Providers in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityPartnerProvider> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityPartnerProvider = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) security_partner_provider_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/securityPartnerProviders/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.security_partner_provider_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SecurityPartnerProvider>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityPartnerProvider> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityPartnerProvider = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) security_partner_provider_name: String,
pub(crate) parameters: models::SecurityPartnerProvider,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/securityPartnerProviders/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.security_partner_provider_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SecurityPartnerProvider>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_tags {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityPartnerProvider> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityPartnerProvider = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) security_partner_provider_name: String,
pub(crate) parameters: models::TagsObject,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/securityPartnerProviders/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.security_partner_provider_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SecurityPartnerProvider>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) security_partner_provider_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/securityPartnerProviders/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.security_partner_provider_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityPartnerProviderListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityPartnerProviderListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::SecurityPartnerProviderListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/securityPartnerProviders",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecurityPartnerProviderListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecurityPartnerProviderListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::SecurityPartnerProviderListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/securityPartnerProviders",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod bgp_service_communities {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the available bgp service communities."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BgpServiceCommunityListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::BgpServiceCommunityListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::BgpServiceCommunityListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/bgpServiceCommunities",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod service_tags {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets a list of service tag information resources."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location that will be used as a reference for version (not as a filter based on location, you will get the list of service tags with prefix details across all regions but limited to the cloud that your subscription belongs to)."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, location: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
location: location.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceTagsListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceTagsListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/serviceTags",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ServiceTagsListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod service_tag_information {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets a list of service tag information resources with pagination."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location that will be used as a reference for cloud (not as a filter based on location, you will get the list of service tags with prefix details across all regions but limited to the cloud that your subscription belongs to)."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, location: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
location: location.into(),
subscription_id: subscription_id.into(),
no_address_prefixes: None,
tag_name: None,
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ServiceTagInformationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ServiceTagInformationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) subscription_id: String,
pub(crate) no_address_prefixes: Option<bool>,
pub(crate) tag_name: Option<String>,
}
impl RequestBuilder {
#[doc = "Do not return address prefixes for the tag(s)."]
pub fn no_address_prefixes(mut self, no_address_prefixes: bool) -> Self {
self.no_address_prefixes = Some(no_address_prefixes);
self
}
#[doc = "Return tag information for a particular tag."]
pub fn tag_name(mut self, tag_name: impl Into<String>) -> Self {
self.tag_name = Some(tag_name.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::ServiceTagInformationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/serviceTagDetails",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(no_address_prefixes) = &this.no_address_prefixes {
req.url_mut()
.query_pairs_mut()
.append_pair("noAddressPrefixes", &no_address_prefixes.to_string());
}
if let Some(tag_name) = &this.tag_name {
req.url_mut().query_pairs_mut().append_pair("tagName", tag_name);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod usages {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "List network usages for a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `location`: The location where resource usage is queried."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, location: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
location: location.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::UsagesListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::UsagesListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) location: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::UsagesListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/locations/{}/usages",
this.client.endpoint(),
&this.subscription_id,
&this.location
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod virtual_routers {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Virtual Router."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_router_name`: The name of the Virtual Router."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
virtual_router_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_router_name: virtual_router_name.into(),
subscription_id: subscription_id.into(),
expand: None,
}
}
#[doc = "Creates or updates the specified Virtual Router."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_router_name`: The name of the Virtual Router."]
#[doc = "* `parameters`: Parameters supplied to the create or update Virtual Router."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
virtual_router_name: impl Into<String>,
parameters: impl Into<models::VirtualRouter>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_router_name: virtual_router_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified Virtual Router."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_router_name`: The name of the Virtual Router."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
virtual_router_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_router_name: virtual_router_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all Virtual Routers in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the Virtual Routers in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualRouter> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualRouter = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_router_name: String,
pub(crate) subscription_id: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Expands referenced resources."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualRouters/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_router_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualRouter>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualRouter> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualRouter = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_router_name: String,
pub(crate) parameters: models::VirtualRouter,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualRouters/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_router_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualRouter>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_router_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualRouters/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_router_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualRouterListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualRouterListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualRouterListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualRouters",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualRouterListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualRouterListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualRouterListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/virtualRouters",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod virtual_router_peerings {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the specified Virtual Router Peering."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_router_name`: The name of the Virtual Router."]
#[doc = "* `peering_name`: The name of the Virtual Router Peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
virtual_router_name: impl Into<String>,
peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_router_name: virtual_router_name.into(),
peering_name: peering_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or updates the specified Virtual Router Peering."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_router_name`: The name of the Virtual Router."]
#[doc = "* `peering_name`: The name of the Virtual Router Peering."]
#[doc = "* `parameters`: Parameters supplied to the create or update Virtual Router Peering operation."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
virtual_router_name: impl Into<String>,
peering_name: impl Into<String>,
parameters: impl Into<models::VirtualRouterPeering>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_router_name: virtual_router_name.into(),
peering_name: peering_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Deletes the specified peering from a Virtual Router."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_router_name`: The name of the Virtual Router."]
#[doc = "* `peering_name`: The name of the peering."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
virtual_router_name: impl Into<String>,
peering_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_router_name: virtual_router_name.into(),
peering_name: peering_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists all Virtual Router Peerings in a Virtual Router resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `virtual_router_name`: The name of the Virtual Router."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(
&self,
resource_group_name: impl Into<String>,
virtual_router_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
virtual_router_name: virtual_router_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualRouterPeering> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualRouterPeering = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_router_name: String,
pub(crate) peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualRouters/{}/peerings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_router_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualRouterPeering>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualRouterPeering> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualRouterPeering = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_router_name: String,
pub(crate) peering_name: String,
pub(crate) parameters: models::VirtualRouterPeering,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualRouters/{}/peerings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_router_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::VirtualRouterPeering>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_router_name: String,
pub(crate) peering_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualRouters/{}/peerings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_router_name,
&this.peering_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VirtualRouterPeeringListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VirtualRouterPeeringListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) virtual_router_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VirtualRouterPeeringListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualRouters/{}/peerings",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.virtual_router_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod web_application_firewall_policies {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Lists all of the protection policies within a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, resource_group_name: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Gets all the WAF policies in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_all(&self, subscription_id: impl Into<String>) -> list_all::RequestBuilder {
list_all::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve protection policy with specified name within a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `policy_name`: The name of the policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
policy_name: policy_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates or update policy with specified rule set name within a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `policy_name`: The name of the policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `parameters`: Policy to be created."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
policy_name: impl Into<String>,
subscription_id: impl Into<String>,
parameters: impl Into<models::WebApplicationFirewallPolicy>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
policy_name: policy_name.into(),
subscription_id: subscription_id.into(),
parameters: parameters.into(),
}
}
#[doc = "Deletes Policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: The name of the resource group."]
#[doc = "* `policy_name`: The name of the policy."]
#[doc = "* `subscription_id`: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
policy_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
policy_name: policy_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::WebApplicationFirewallPolicyListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::WebApplicationFirewallPolicyListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::WebApplicationFirewallPolicyListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list_all {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::WebApplicationFirewallPolicyListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::WebApplicationFirewallPolicyListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::WebApplicationFirewallPolicyListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::WebApplicationFirewallPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::WebApplicationFirewallPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . policy_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::WebApplicationFirewallPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::WebApplicationFirewallPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::WebApplicationFirewallPolicy = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) policy_name: String,
pub(crate) subscription_id: String,
pub(crate) parameters: models::WebApplicationFirewallPolicy,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . policy_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::WebApplicationFirewallPolicy>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) policy_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . policy_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2021-05-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}