Skip to content

[Storage] get_account_info for all clients, set/get_tags for BlobClient #2661

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion sdk/storage/assets.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "rust",
"Tag": "rust/azure_storage_blob_231754d877",
"Tag": "rust/azure_storage_blob_3efb7d4663",
"TagPrefix": "rust/azure_storage_blob"
}
49 changes: 44 additions & 5 deletions sdk/storage/azure_storage_blob/src/clients/blob_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
use crate::{
generated::clients::BlobClient as GeneratedBlobClient,
generated::models::{
BlobClientDownloadResult, BlobClientGetPropertiesResult,
BlobClientDownloadResult, BlobClientGetAccountInfoResult, BlobClientGetPropertiesResult,
BlockBlobClientCommitBlockListResult, BlockBlobClientStageBlockResult,
BlockBlobClientUploadResult,
},
models::{
AccessTier, BlobClientDeleteOptions, BlobClientDownloadOptions,
BlobClientGetPropertiesOptions, BlobClientSetMetadataOptions,
BlobClientSetPropertiesOptions, BlobClientSetTierOptions,
BlockBlobClientCommitBlockListOptions, BlockBlobClientUploadOptions, BlockList,
BlockListType, BlockLookupList,
BlobClientGetAccountInfoOptions, BlobClientGetPropertiesOptions, BlobClientGetTagsOptions,
BlobClientSetMetadataOptions, BlobClientSetPropertiesOptions, BlobClientSetTagsOptions,
BlobClientSetTierOptions, BlobTags, BlockBlobClientCommitBlockListOptions,
BlockBlobClientUploadOptions, BlockList, BlockListType, BlockLookupList,
},
pipeline::StorageHeadersPolicy,
BlobClientOptions, BlockBlobClient,
Expand Down Expand Up @@ -211,4 +211,43 @@ impl BlobClient {
) -> Result<Response<()>> {
self.client.set_tier(tier, options).await
}

/// Sets tags on a blob. Note that each call to this operation replaces all existing tags. To remove
/// all tags from the blob, call this operation with no tags specified.
///
/// # Arguments
///
/// * `options` - Optional configuration for the request.
pub async fn set_tags(
&self,
tags: RequestContent<BlobTags>,
options: Option<BlobClientSetTagsOptions<'_>>,
) -> Result<Response<()>> {
self.client.set_tags(tags, options).await
}

/// Gets the tags on a blob.
///
/// # Arguments
///
/// * `options` - Optional configuration for the request.
pub async fn get_tags(
&self,
options: Option<BlobClientGetTagsOptions<'_>>,
) -> Result<Response<BlobTags>> {
self.client.get_tags(options).await
}

/// Gets information related to the Storage account in which the blob resides.
/// This includes the `sku_name` and `account_kind`.
///
/// # Arguments
///
/// * `options` - Optional configuration for the request.
pub async fn get_account_info(
&self,
options: Option<BlobClientGetAccountInfoOptions<'_>>,
) -> Result<Response<BlobClientGetAccountInfoResult>> {
self.client.get_account_info(options).await
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@

use crate::{
generated::clients::BlobContainerClient as GeneratedBlobContainerClient,
generated::models::BlobContainerClientGetPropertiesResult,
generated::models::{
BlobContainerClientGetAccountInfoResult, BlobContainerClientGetPropertiesResult,
},
models::{
BlobContainerClientCreateOptions, BlobContainerClientDeleteOptions,
BlobContainerClientGetPropertiesOptions, BlobContainerClientListBlobFlatSegmentOptions,
BlobContainerClientSetMetadataOptions, ListBlobsFlatSegmentResponse,
BlobContainerClientGetAccountInfoOptions, BlobContainerClientGetPropertiesOptions,
BlobContainerClientListBlobFlatSegmentOptions, BlobContainerClientSetMetadataOptions,
ListBlobsFlatSegmentResponse,
},
pipeline::StorageHeadersPolicy,
BlobClient, BlobContainerClientOptions,
Expand Down Expand Up @@ -157,4 +160,17 @@ impl BlobContainerClient {
) -> Result<Pager<ListBlobsFlatSegmentResponse>> {
self.client.list_blob_flat_segment(options)
}

/// Gets information related to the Storage account in which the container resides.
/// This includes the `sku_name` and `account_kind`.
///
/// # Arguments
///
/// * `options` - Optional configuration for the request.
pub async fn get_account_info(
&self,
options: Option<BlobContainerClientGetAccountInfoOptions<'_>>,
) -> Result<Response<BlobContainerClientGetAccountInfoResult>> {
self.client.get_account_info(options).await
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

use crate::{
generated::clients::BlobServiceClient as GeneratedBlobServiceClient,
models::{BlobServiceClientGetPropertiesOptions, StorageServiceProperties},
generated::models::BlobServiceClientGetAccountInfoResult,
models::{
BlobServiceClientGetAccountInfoOptions, BlobServiceClientGetPropertiesOptions,
StorageServiceProperties,
},
pipeline::StorageHeadersPolicy,
BlobContainerClient, BlobServiceClientOptions,
};
Expand Down Expand Up @@ -89,4 +93,17 @@ impl BlobServiceClient {
) -> Result<Response<StorageServiceProperties>> {
self.client.get_properties(options).await
}

/// Gets information related to the Storage account.
/// This includes the `sku_name` and `account_kind`.
///
/// # Arguments
///
/// * `options` - Optional configuration for the request.
pub async fn get_account_info(
&self,
options: Option<BlobServiceClientGetAccountInfoOptions<'_>>,
) -> Result<Response<BlobServiceClientGetAccountInfoResult>> {
self.client.get_account_info(options).await
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading