-
Notifications
You must be signed in to change notification settings - Fork 299
Added sdk/storage/azure_storage_queue (#2730) #2732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements initial support for the 2018-03-28 Queue API in the Azure Storage Queue SDK for Rust. Key changes include the introduction of new client functions for managing queues, a comprehensive test suite covering the new operations, and several example programs and documentation updates.
Reviewed Changes
Copilot reviewed 18 out of 36 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
sdk/storage/azure_storage_queue/tsp-location.yaml | Adds configuration metadata for the queue API |
sdk/storage/azure_storage_queue/tests/queue_service_client.rs | Introduces recorded tests for queue service |
sdk/storage/azure_storage_queue/src/lib.rs | Sets up module exports for clients and models |
sdk/storage/azure_storage_queue/src/clients/queue_service_client.rs | Implements QueueServiceClient API functions |
sdk/storage/azure_storage_queue/examples/* | Provides usage examples and helper functions |
sdk/storage/azure_storage_queue/Cargo.toml | Configures the crate with required dependencies and features |
sdk/storage/azure_storage_queue/CHANGELOG.md | Documents the initial supported release |
sdk/storage/assets.json | Updates asset references |
sdk/storage/.dict.txt | Updates custom dictionary with new terms |
Cargo.toml | Adds the queue SDK to the workspace members |
Comments suppressed due to low confidence (1)
sdk/storage/azure_storage_queue/src/clients/queue_service_client.rs:90
- The documentation for the 'queue_name' parameter in the delete_queue function incorrectly states that it is 'to create' the queue. Please update the description to indicate that it is the name of the queue to delete.
/// * `queue_name` - The name of the queue to create
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
1833dda
to
114ff2e
Compare
sdk/storage/azure_storage_queue/src/clients/queue_service_client.rs
Outdated
Show resolved
Hide resolved
2a7798a
to
334d48f
Compare
334d48f
to
439ef72
Compare
Fixes #2708 Added support for the 2018-03-28 Queue API. The following functions have been created on the new QueueClient, roughly following the pattern in the .Net SDK: queue_client: new create create_if_not_exists clear delete delete_if_exists delete_message exists get_metadata get_properties enqueue_message dequeue_message dequeue_messages peek_message peek_messages set_metadata update_message get_access_policy set_access_policy queue_service_client: new create_queue delete_queue get_properties set_properties list_queues_segment (paginated) Examples of how to use each method has been provided in the ~/sdk/storage/examples/queue_client.rs file. Recorded tests has also been pushed to the repo Azure/azure-sdk-assets and the assets.json updated. The client is generated using tsp-client using remote Azure/azure-rest-api-specs repo.
* Regenerated client based on new TSP * Switching set and get metadata to use the generated client. * Added get_statistics * Updated samples to show how to pass realistic parameters.
…json for the queue crate. Removing access policy api as there is issue with (de)serialization and this is also not yet implemented in blob.
- Updated change logs to mention unreleased - Removed all functions list from the README.md - Renaming examples to samples to match pattern in other languages - Removed singular helper functions and exists helper functions - Adjusting code based on update to the dependencies - Changed StorageServiceProperties to QueueServiceProperties - Exposing clients and client options from the crate root - Update test names to reflect operation
…argument in the method directly rather than in the option bag.
439ef72
to
fbc34b4
Compare
sdk/storage/azure_storage_queue/src/clients/queue_service_client.rs
Outdated
Show resolved
Hide resolved
…ceStats`. Updated `QueueClient::send_message` to return `Result<Response<SentMessage, XmlFormat>>` in place of `Result<Response<Option<SentMessage>, XmlFormat>>`
Fixes #2708
Added support for the 2018-03-28 Queue API. The following functions have been created on the new QueueClient, roughly following the pattern in the .Net SDK:
QueueServiceClient
The
QueueServiceClient
provides operations to interact with the Azure Storage Queue service at the account level.new
endpoint: &str
credential: Arc<dyn TokenCredential>
options: Option<QueueServiceClientOptions>
Result<Self>
endpoint
&self
&Url
queue_client
&self
queue_name: String
QueueClient
create_queue
&self
queue_name: &str
options: Option<QueueClientCreateOptions<'_>>
Result<Response<(), NoFormat>>
delete_queue
&self
queue_name: &str
options: Option<QueueClientDeleteOptions<'_>>
Result<Response<(), NoFormat>>
get_properties
&self
options: Option<QueueServiceClientGetPropertiesOptions<'_>>
Result<Response<StorageServiceProperties, XmlFormat>>
set_properties
&self
storage_service_properties: RequestContent<StorageServiceProperties>
options: Option<QueueServiceClientSetPropertiesOptions<'_>>
Result<Response<(), NoFormat>>
list_queues_segment
&self
options: Option<QueueServiceClientListQueuesSegmentOptions<'_>>
Result<PageIterator<Response<ListQueuesSegmentResponse, XmlFormat>>>
get_statistics
&self
options: Option<QueueServiceClientGetStatisticsOptions<'_>>
Result<Response<StorageServiceStats, XmlFormat>>
QueueClient
The
QueueClient
provides operations to interact with a specific Azure Storage Queue.new
endpoint: &str
queue_name: &str
credential: Arc<dyn TokenCredential>
options: Option<QueueClientOptions>
Result<Self>
endpoint
&self
&Url
queue_name
&self
&str
Queue Management
create
&self
options: Option<QueueClientCreateOptions<'_>>
Result<Response<(), NoFormat>>
delete
&self
options: Option<QueueClientDeleteOptions<'_>>
Result<Response<(), NoFormat>>
exists
&self
Result<bool>
clear
&self
options: Option<QueueClientClearOptions<'_>>
Result<Response<(), NoFormat>>
Metadata Operations
set_metadata
&self
options: Option<QueueClientSetMetadataOptions<'_>>
Result<Response<(), NoFormat>>
get_metadata
&self
options: Option<QueueClientGetMetadataOptions<'_>>
Result<Response<QueueClientGetMetadataResult, NoFormat>>
Message Operations
send_message
&self
queue_message: RequestContent<QueueMessage>
options: Option<QueueClientSendMessageOptions<'_>>
Result<Response<Option<SentMessage>, XmlFormat>>
receive_messages
&self
options: Option<QueueClientReceiveMessagesOptions<'_>>
Result<Response<ListOfReceivedMessage, XmlFormat>>
peek_messages
&self
options: Option<QueueClientPeekOptions<'_>>
Result<Response<ListOfPeekedMessage, XmlFormat>>
delete_message
&self
message_id: &str
pop_receipt: &str
options: Option<QueueClientDeleteMessageOptions<'_>>
Result<Response<(), NoFormat>>
update_message
&self
message_id: &str
pop_receipt: &str
visibility_timeout: i32
options: Option<QueueClientUpdateOptions<'_>>
Result<Response<(), NoFormat>>
Access Policy Operations
get_access_policy
&self
options: Option<QueueClientGetAccessPolicyOptions<'_>>
Result<Response<ListOfSignedIdentifier, XmlFormat>>
set_access_policy
&self
queue_acl: RequestContent<ListOfSignedIdentifier>
options: Option<QueueClientSetAccessPolicyOptions<'_>>
Result<Response<QueueClientSetAccessPolicyResult, NoFormat>>
Examples of how to use each method has been provided in the
sdk/storage/examples/queue_client.rs
file.Recorded tests has also been pushed to the repo
Azure/azure-sdk-assets
and theassets.json
updated.The client is generated using tsp-client using remote
Azure/azure-rest-api-specs
repo.