Skip to content

Commit c8e748b

Browse files
Updated to current Typespec emitter and regenerated SDK clients (Azure#2968)
Co-authored-by: Heath Stewart <[email protected]>
1 parent 911c143 commit c8e748b

File tree

44 files changed

+4021
-588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4021
-588
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/emitter-package-lock.json

Lines changed: 212 additions & 226 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: 10 additions & 10 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.20.0"
4+
"@azure-tools/typespec-rust": "0.21.0"
55
},
66
"devDependencies": {
7-
"@azure-tools/typespec-azure-core": "0.58.0",
8-
"@azure-tools/typespec-azure-rulesets": "0.58.0",
9-
"@azure-tools/typespec-client-generator-core": "0.58.0",
10-
"@typespec/compiler": "1.2.1",
11-
"@typespec/http": "1.2.1",
12-
"@typespec/openapi": "1.2.1",
13-
"@typespec/rest": "0.72.1",
14-
"@typespec/versioning": "0.72.1",
15-
"@typespec/xml": "0.72.1"
7+
"@azure-tools/typespec-azure-core": "0.59.0",
8+
"@azure-tools/typespec-azure-rulesets": "0.59.0",
9+
"@azure-tools/typespec-client-generator-core": "0.59.1",
10+
"@typespec/compiler": "1.3",
11+
"@typespec/http": "1.3",
12+
"@typespec/openapi": "1.3",
13+
"@typespec/rest": "0.73",
14+
"@typespec/versioning": "0.73",
15+
"@typespec/xml": "0.73"
1616
}
1717
}

sdk/core/azure_core/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ reqwest = { version = "0.12.23", features = ["rustls-tls-webpki-roots"] }
9191

9292
You could even completely replace `reqwest` and provide your own `HttpClient` implementation. See [an example](#other-http-client) below.
9393

94-
** NOTE:** The `debug` feature may expose PII and/or secrets to logs or tracing spans which would normally be redacted.
94+
**NOTE:** The `debug` feature may expose PII and/or secrets to logs or tracing spans which would normally be redacted.
9595

9696
## Examples
9797

@@ -155,14 +155,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
155155
)?;
156156

157157
// call a service method, which returns Response<T>
158-
let response = client.get_secret("secret-name", "", None).await?;
158+
let response = client.get_secret("secret-name", None).await?;
159159

160160
// Response<T> has two main accessors:
161161
// 1. The `into_body()` function consumes self to deserialize into a model type
162162
let secret = response.into_body().await?;
163163

164164
// get response again because it was moved in above statement
165-
let response: Response<Secret> = client.get_secret("secret-name", "", None).await?;
165+
let response: Response<Secret> = client.get_secret("secret-name", None).await?;
166166

167167
// 2. The deconstruct() method for accessing all the details of the HTTP response
168168
let (status, headers, body) = response.deconstruct();
@@ -198,7 +198,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
198198
None,
199199
)?;
200200

201-
match client.get_secret("secret-name", "", None).await {
201+
match client.get_secret("secret-name", None).await {
202202
Ok(secret) => println!("Secret: {:?}", secret.into_body().await?.value),
203203
Err(e) => match e.kind() {
204204
ErrorKind::HttpResponse { status, error_code, .. } if *status == StatusCode::NotFound => {
@@ -575,7 +575,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
575575
)?;
576576

577577
// get a secret
578-
let secret = client.get_secret("secret-name", "", None)
578+
let secret = client.get_secret("secret-name", None)
579579
.await?
580580
.into_body()
581581
.await?;

sdk/core/azure_core/examples/core_remove_user_agent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async fn test_remove_user_agent() -> Result<(), Box<dyn std::error::Error>> {
6363

6464
// We'll fetch a secret and let the mock client assert the User-Agent header was removed.
6565
let secret = client
66-
.get_secret("my-secret", "", None)
66+
.get_secret("my-secret", None)
6767
.await?
6868
.into_body()
6969
.await?;

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_8405b278af"
5+
"Tag": "rust/eventhubs_e00fc5e364"
66
}

sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/src/checkpoint_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl BlobCheckpointStore {
137137
let blob_content = RequestContent::<Bytes, NoFormat>::from(Vec::new());
138138
let options = BlockBlobClientUploadOptions {
139139
metadata: metadata.clone(),
140-
if_match: Some("*".to_string()), // Upload without an etag, creating a new blob
140+
if_none_match: Some("*".to_string()), // Upload without an etag, creating a new blob
141141
..Default::default()
142142
};
143143

sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/tests/ownership_unit_tests.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@
44
//! Unit tests for the blob checkpoint store models and utilities.
55
66
use azure_core::{http::Etag, time::OffsetDateTime, Result};
7-
use azure_core_test::{recorded, TestContext};
7+
use azure_core_test::{recorded, Recording, TestContext};
88
use azure_messaging_eventhubs::{models::Ownership, CheckpointStore};
99
mod checkpoint_unit_tests;
1010
use checkpoint_unit_tests::create_test_checkpoint_store;
1111
use tracing::trace;
1212

13+
fn create_test_namespace(recording: &Recording) -> String {
14+
let namespace = recording.var("EVENTHUBS_HOST", None);
15+
recording.random_string::<55>(Some(namespace.as_str()))
16+
}
17+
1318
#[recorded::test]
1419
async fn list_ownerships(ctx: TestContext) -> Result<()> {
1520
let recording = ctx.recording();
1621
const TEST_PARTITION_ID: &str = "list_ownerships";
1722
let checkpoint_store = create_test_checkpoint_store(recording)?;
1823

19-
let namespace = recording.var("EVENTHUBS_HOST", None);
24+
let namespace = create_test_namespace(recording);
2025
let consumer_group = recording
2126
.var_opt("EVENTHUBS_CONSUMER_GROUP", None)
2227
.unwrap_or("$Default".to_string());
@@ -81,7 +86,7 @@ async fn claim_ownership_single_partition(ctx: TestContext) -> Result<()> {
8186

8287
const TEST_PARTITION_ID: &str = "claim_ownership_single_partition";
8388

84-
let namespace = recording.var("EVENTHUBS_HOST", None);
89+
let namespace = create_test_namespace(recording);
8590
let consumer_group = recording
8691
.var_opt("EVENTHUBS_CONSUMER_GROUP", None)
8792
.unwrap_or("$Default".to_string());
@@ -129,7 +134,7 @@ async fn claim_ownership_multiple_partitions(ctx: TestContext) -> Result<()> {
129134
let recording = ctx.recording();
130135
let checkpoint_store = create_test_checkpoint_store(recording)?;
131136

132-
let namespace = recording.var("EVENTHUBS_HOST", None);
137+
let namespace = create_test_namespace(recording);
133138
let consumer_group = recording
134139
.var_opt("EVENTHUBS_CONSUMER_GROUP", None)
135140
.unwrap_or("$Default".to_string());
@@ -213,7 +218,7 @@ async fn claim_ownership_update_existing(ctx: TestContext) -> Result<()> {
213218
const TEST_PARTITION_ID: &str = "ownership_update_existing";
214219
let checkpoint_store = create_test_checkpoint_store(recording)?;
215220

216-
let namespace = recording.var("EVENTHUBS_HOST", None);
221+
let namespace = create_test_namespace(recording);
217222
let consumer_group = recording
218223
.var_opt("EVENTHUBS_CONSUMER_GROUP", None)
219224
.unwrap_or("$Default".to_string());
@@ -264,7 +269,7 @@ async fn claim_ownership_concurrent_update_should_fail(ctx: TestContext) -> Resu
264269
let recording = ctx.recording();
265270
let checkpoint_store = create_test_checkpoint_store(recording)?;
266271

267-
let namespace = recording.var("EVENTHUBS_HOST", None);
272+
let namespace = create_test_namespace(recording);
268273
let consumer_group = recording
269274
.var_opt("EVENTHUBS_CONSUMER_GROUP", None)
270275
.unwrap_or("$Default".to_string());
@@ -309,7 +314,7 @@ async fn claim_ownership_no_owner_id(ctx: TestContext) -> Result<()> {
309314
let recording = ctx.recording();
310315
let checkpoint_store = create_test_checkpoint_store(recording)?;
311316

312-
let namespace = recording.var("EVENTHUBS_HOST", None);
317+
let namespace = create_test_namespace(recording);
313318
let consumer_group = recording
314319
.var_opt("EVENTHUBS_CONSUMER_GROUP", None)
315320
.unwrap_or("$Default".to_string());

sdk/keyvault/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/keyvault",
5-
"Tag": "rust/keyvault_c904be268a"
5+
"Tag": "rust/keyvault_456b9ceaa6"
66
}

sdk/keyvault/azure_security_keyvault_certificates/CHANGELOG.md

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

55
### Features Added
66

7+
- Updated to latest version of fixes for the "7.6" specification after TypeSpec migration.
8+
79
### Breaking Changes
810

11+
- Moved certificate version parameters to client method options.
12+
913
### Bugs Fixed
1014

1115
### Other Changes

0 commit comments

Comments
 (0)