Skip to content

Commit 3842bdc

Browse files
[Storage] Flattened Client Refactor (Azure#3176)
1 parent a85bef1 commit 3842bdc

38 files changed

+1219
-992
lines changed

eng/emitter-package-lock.json

Lines changed: 192 additions & 200 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/emitter-package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"main": "dist/src/index.js",
33
"dependencies": {
4-
"@azure-tools/typespec-rust": "0.24.0"
4+
"@azure-tools/typespec-rust": "0.24.1"
55
},
66
"devDependencies": {
7-
"@azure-tools/typespec-azure-core": "0.60",
8-
"@azure-tools/typespec-azure-rulesets": "0.60",
9-
"@azure-tools/typespec-client-generator-core": "0.60",
10-
"@typespec/compiler": "1.4",
11-
"@typespec/http": "1.4",
12-
"@typespec/openapi": "1.4",
13-
"@typespec/rest": "0.74",
14-
"@typespec/versioning": "0.74",
15-
"@typespec/xml": "0.74"
7+
"@azure-tools/typespec-azure-core": "~0.61",
8+
"@azure-tools/typespec-azure-rulesets": "~0.61",
9+
"@azure-tools/typespec-client-generator-core": ">=0.61.1",
10+
"@typespec/compiler": "^1.4.0",
11+
"@typespec/http": "^1.4.0",
12+
"@typespec/openapi": "^1.4.0",
13+
"@typespec/rest": "~0.75.0",
14+
"@typespec/versioning": "~0.75.0",
15+
"@typespec/xml": "~0.75.0"
1616
}
17-
}
17+
}

sdk/eventhubs/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "rust",
44
"TagPrefix": "rust/eventhubs",
5-
"Tag": "rust/eventhubs_12266aa668"
5+
"Tag": "rust/eventhubs_ad9b84912d"
66
}

sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
8888
let credential = DeveloperToolsCredential::new(None)?;
8989
let blob_client = BlobContainerClient::new(
9090
"https://yourstorageaccount.blob.core.windows.net",
91-
"yourcontainername".to_string(),
92-
credential.clone(),
91+
"yourcontainername",
92+
Some(credential.clone()),
9393
None,
9494
)?;
9595

sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/examples/checkpoint_store_basic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
4646
// Instantiate a blob client with OpenTelemetry instrumentation enabled
4747
let blob_container_client = BlobContainerClient::new(
4848
&storage_account_url,
49-
container,
50-
credential,
49+
&container,
50+
Some(credential),
5151
Some(BlobContainerClientOptions {
5252
client_options: ClientOptions {
5353
instrumentation: InstrumentationOptions {

sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/examples/processor_with_blob_checkpoints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
3333
let credential = DeveloperToolsCredential::new(None)?;
3434
let blob_container_client = BlobContainerClient::new(
3535
&storage_account_url,
36-
container_name,
37-
credential.clone(),
36+
&container_name,
37+
Some(credential.clone()),
3838
None,
3939
)?;
4040
let consumer = ConsumerClient::builder()

sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/src/checkpoint_store.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ impl BlobCheckpointStore {
6868
blob_name: &str,
6969
metadata: HashMap<String, String>,
7070
) -> Result<(Option<OffsetDateTime>, Option<Etag>)> {
71-
let blob_client = self
72-
.blob_container_client
73-
.blob_client(blob_name.to_string());
71+
let blob_client = self.blob_container_client.blob_client(blob_name);
7472

7573
let result = blob_client.set_metadata(metadata.clone(), None).await;
7674
match result {
@@ -106,9 +104,7 @@ impl BlobCheckpointStore {
106104
metadata: Option<HashMap<String, String>>,
107105
etag: Option<Etag>,
108106
) -> Result<(Option<OffsetDateTime>, Option<Etag>)> {
109-
let blob_client = self
110-
.blob_container_client
111-
.blob_client(blob_name.to_string());
107+
let blob_client = self.blob_container_client.blob_client(blob_name);
112108

113109
if etag.is_some() {
114110
debug!(

sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/tests/checkpoint_unit_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub fn create_test_checkpoint_store(recording: &Recording) -> Result<Arc<BlobChe
1717
recording.instrument(&mut options.client_options);
1818
let blob_container_client = BlobContainerClient::new(
1919
&recording.var("AZURE_STORAGE_BLOB_ENDPOINT", None),
20-
recording.var("AZURE_STORAGE_BLOB_CONTAINER", None),
21-
credential.clone(),
20+
&recording.var("AZURE_STORAGE_BLOB_CONTAINER", None),
21+
Some(credential),
2222
Some(options),
2323
)?;
2424

sdk/storage/.dict.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ appendpos
44
blockid
55
blocklist
66
blocklisttype
7+
Btext
78
copyid
89
deletedwithversions
910
deletetype
@@ -12,7 +13,9 @@ immutabilitypolicy
1213
incrementalcopy
1314
legalhold
1415
missingcontainer
16+
numofmessages
1517
pagelist
18+
peekonly
1619
policyid
1720
prevsnapshot
1821
RAGRS
@@ -27,5 +30,3 @@ testcontainer
2730
uncommittedblobs
2831
westus
2932
yourtagname
30-
numofmessages
31-
peekonly

sdk/storage/azure_storage_blob/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@
44

55
### Features Added
66

7+
- Added support for client construction directly from URLs:
8+
- `AppendBlobClient::from_url()`
9+
- `BlobClient::from_url()`
10+
- `BlobContainerClient::from_url()`
11+
- `BlockBlobClient::from_url()`
12+
- `PageBlobClient::from_url()`
13+
- Added support for SAS (shared access signature) URLs via the new `from_url()` methods.
14+
715
### Breaking Changes
816

17+
- Removed the `container_name()` and `blob_name()` accessors on relevant clients.
18+
- Removed the `endpoint` struct field on all clients, as this value is now returned directly from the underlying generated client.
19+
- Changed the `container_name` and `blob_name` parameters from owned `String` to `&str` reference on relevant client constructor methods (`new()`).
20+
- The `credential` parameter is now `Optional` on `new()` client constructors, allowing for construction of public access clients.
21+
922
### Bugs Fixed
1023

1124
### Other Changes

0 commit comments

Comments
 (0)