Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/data_cosmos/src/authorization_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ fn generate_resource_link(request: &Request) -> String {
/// - "primary": one of the two service-level tokens
/// - "resource": e.g. a single database
/// - "aad": Azure Active Directory token
///
/// In the "primary" case the signature must be constructed by signing the HTTP method,
/// resource type, resource link (the relative URI) and the current time.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ impl TokenCredential for DefaultAzureCredentialKind {
/// - `EnvironmentCredential`
/// - `ManagedIdentityCredential`
/// - `AzureCliCredential`
///
/// Consult the documentation of these credential types for more information on how they attempt authentication.
#[derive(Debug)]
pub struct DefaultAzureCredential {
Expand Down
1 change: 1 addition & 0 deletions sdk/iot_hub/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ impl std::fmt::Debug for IoTHubCredentials {
/// There are several ways to construct the `IoTHub` Service object. Either by:
/// - providing the `IoT` Hub name and the private key.
/// - providing the connection string.
///
/// The `IoTHubService` then uses the provided information to create a SAS token that it will
/// use to communicate with the `IoT` Hub.
#[derive(Clone, Debug)]
Expand Down
4 changes: 2 additions & 2 deletions sdk/messaging_servicebus/src/service_bus/queue_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl QueueClient {
/// Non-destructively read a message
///
/// * `timeout` : Sets the maximum duration for the HTTP connection when receiving a message.
/// If no message is received within this time, an empty 204 HTTP response will be returned.
/// If no message is received within this time, an empty 204 HTTP response will be returned.
///
/// Note: This function does not return the delete location
/// of the message, so, after reading, you will lose
Expand All @@ -107,7 +107,7 @@ impl QueueClient {
/// Non-destructively read a message but track it
///
/// * `timeout` : Sets the maximum duration for the HTTP connection when receiving a message.
/// If no message is received within this time, an empty 204 HTTP response will be returned.
/// If no message is received within this time, an empty 204 HTTP response will be returned.
///
/// Note: This function returns a `PeekLockResponse`
/// that contains a helper `delete_message` function.
Expand Down
4 changes: 2 additions & 2 deletions sdk/messaging_servicebus/src/service_bus/topic_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl SubscriptionReceiver {
/// Non-destructively read a message
///
/// * `timeout` : Sets the maximum duration for the HTTP connection when receiving a message.
/// If no message is received within this time, an empty 204 HTTP response will be returned.
/// If no message is received within this time, an empty 204 HTTP response will be returned.
///
/// Note: This function does not return the delete location
/// of the message, so, after reading, you will lose
Expand All @@ -143,7 +143,7 @@ impl SubscriptionReceiver {
/// Non-destructively read a message but track it
///
/// * `timeout` : Sets the maximum duration for the HTTP connection when receiving a message.
/// If no message is received within this time, an empty 204 HTTP response will be returned.
/// If no message is received within this time, an empty 204 HTTP response will be returned.
///
/// Note: This function returns a `PeekLockResponse`
/// that contains a helper `delete_message` function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ impl ToTokens for RequestBuilderSendCode {
quote! { &self.#url_arg }
});
let url_str_args = quote! { #(#url_args),* };

let fpath = format!("{{}}{}", &format_path(&new_request_code.path));
let fpath = PARAM_RE.replace_all(&new_request_code.path, "{}");

let mut match_status = TokenStream::new();
for status_response in &self.response_code.status_responses {
Expand All @@ -58,7 +57,8 @@ impl ToTokens for RequestBuilderSendCode {
let api_version = &self.request_builder.api_version;
quote! {
fn url(&self) -> azure_core::Result<azure_core::Url> {
let mut url = azure_core::Url::parse(&format!(#fpath, self.client.endpoint(), #url_str_args))?;
let mut url = self.client.endpoint().clone();
url.set_path(&format!(#fpath, #url_str_args));

let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
Expand All @@ -70,7 +70,9 @@ impl ToTokens for RequestBuilderSendCode {
} else {
quote! {
fn url(&self) -> azure_core::Result<azure_core::Url> {
let url = azure_core::Url::parse(&format!(#fpath, self.client.endpoint(), #url_str_args))?;
let mut url = self.client.endpoint().clone();
url.set_path(&format!(#fpath, #url_str_args));

Ok(url)
}
}
Expand Down Expand Up @@ -211,10 +213,6 @@ impl ToTokens for RequestBuilderSendCode {
}
}

fn format_path(path: &str) -> String {
PARAM_RE.replace_all(path, "{}").to_string()
}

fn get_continuable_param(next_link_name: &str, request_builder: &SetRequestCode) -> Option<String> {
let next_link_name = next_link_name.to_snake_case();
let link_name = next_link_name.strip_prefix("next_");
Expand Down