Skip to content

Commit 3e1a695

Browse files
authored
[EngSys] rush update-snippets (#33905)
This PR includes changes from `rush update-snippets`.
1 parent 564ca37 commit 3e1a695

File tree

31 files changed

+148
-86
lines changed

31 files changed

+148
-86
lines changed

sdk/advisor/arm-advisor/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6464
import { InteractiveBrowserCredential } from "@azure/identity";
6565
import { AdvisorManagementClient } from "@azure/arm-advisor";
6666

67+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6768
const credential = new InteractiveBrowserCredential({
6869
tenantId: "<YOUR_TENANT_ID>",
6970
clientId: "<YOUR_CLIENT_ID>",

sdk/agricultureplatform/arm-agricultureplatform/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6565
import { InteractiveBrowserCredential } from "@azure/identity";
6666
import { AgriculturePlatformClient } from "@azure/arm-agricultureplatform";
6767

68+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6869
const credential = new InteractiveBrowserCredential({
6970
tenantId: "<YOUR_TENANT_ID>",
70-
clientId: "<YOUR_CLIENT_ID>"
71-
});
71+
clientId: "<YOUR_CLIENT_ID>",
72+
});
7273
const client = new AgriculturePlatformClient(credential, subscriptionId);
7374
```
7475

sdk/communication/communication-sms/README.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ You may also add pass in an options object to specify whether the delivery repor
8787
An array of `SmsSendResult` is returned. A `successful` flag is used to validate if each individual message was sent successfully.
8888

8989
```ts snippet:ReadmeSampleSendSms
90+
import { DefaultAzureCredential } from "@azure/identity";
91+
import { SmsClient } from "@azure/communication-sms";
92+
93+
const endpoint = "https://<resource-name>.communication.azure.com";
94+
const credential = new DefaultAzureCredential();
95+
const client = new SmsClient(endpoint, credential);
96+
9097
const sendResults = await client.send(
9198
{
9299
from: "<from-phone-number>", // Your E.164 formatted phone number used to send SMS
@@ -113,9 +120,16 @@ for (const sendResult of sendResults) {
113120
To check if the recipients are in the Opt Out list, call the `check` function from the `SmsClient.optOuts` with a list of recipient phone numbers.
114121

115122
```ts snippet:ReadmeSampleOptOutCheck
123+
import { DefaultAzureCredential } from "@azure/identity";
124+
import { SmsClient } from "@azure/communication-sms";
125+
126+
const endpoint = "https://<resource-name>.communication.azure.com";
127+
const credential = new DefaultAzureCredential();
128+
const client = new SmsClient(endpoint, credential);
129+
116130
const optOutCheckResults = await client.optOuts.check(
117131
"<from-phone-number>", // Your E.164 formatted phone number used to send SMS
118-
["<to-phone-number-1>", "<to-phone-number-2>"], // E.164 formatted recipient phone numbers
132+
["<to-phone-number-1>", "<to-phone-number-2>"],
119133
);
120134

121135
for (const optOutCheckResult of optOutCheckResults) {
@@ -132,12 +146,19 @@ for (const optOutCheckResult of optOutCheckResults) {
132146

133147
## Add a list of recipients to Opt Out list
134148

135-
To add the list of recipients to Opt Out list, call the `add` function from the `SmsClient.pptOuts` with a list of recipient phone numbers.
149+
To add the list of recipients to Opt Out list, call the `add` function from the `SmsClient.optOuts` with a list of recipient phone numbers.
136150

137151
```ts snippet:ReadmeSampleOptOutAdd
152+
import { DefaultAzureCredential } from "@azure/identity";
153+
import { SmsClient } from "@azure/communication-sms";
154+
155+
const endpoint = "https://<resource-name>.communication.azure.com";
156+
const credential = new DefaultAzureCredential();
157+
const client = new SmsClient(endpoint, credential);
158+
138159
const optOutAddResults = await client.optOuts.add(
139160
"<from-phone-number>", // Your E.164 formatted phone number used to send SMS
140-
["<to-phone-number-1>", "<to-phone-number-2>"], // E.164 formatted recipient phone numbers
161+
["<to-phone-number-1>", "<to-phone-number-2>"],
141162
);
142163

143164
for (const optOutAddResult of optOutAddResults) {
@@ -157,9 +178,16 @@ for (const optOutAddResult of optOutAddResults) {
157178
To remove the list of recipients to Opt Out list, call the `remove` function from the `SmsClient.optOuts.` with a list of recipient phone numbers.
158179

159180
```ts snippet:ReadmeSampleOptOutRemove
181+
import { DefaultAzureCredential } from "@azure/identity";
182+
import { SmsClient } from "@azure/communication-sms";
183+
184+
const endpoint = "https://<resource-name>.communication.azure.com";
185+
const credential = new DefaultAzureCredential();
186+
const client = new SmsClient(endpoint, credential);
187+
160188
const optOutRemoveResults = await client.optOuts.remove(
161189
"<from-phone-number>", // Your E.164 formatted phone number used to send SMS
162-
["<to-phone-number-1>", "<to-phone-number-2>"], // E.164 formatted recipient phone numbers
190+
["<to-phone-number-1>", "<to-phone-number-2>"],
163191
);
164192

165193
for (const optOutRemoveResult of optOutRemoveResults) {
@@ -181,6 +209,13 @@ Exceptions will not be thrown if the error is caused by an individual message, o
181209
Please use the `successful` flag to validate each individual result to verify if the message was sent.
182210

183211
```ts snippet:ReadmeSampleSendSmsErrorHandling
212+
import { DefaultAzureCredential } from "@azure/identity";
213+
import { SmsClient } from "@azure/communication-sms";
214+
215+
const endpoint = "https://<resource-name>.communication.azure.com";
216+
const credential = new DefaultAzureCredential();
217+
const client = new SmsClient(endpoint, credential);
218+
184219
try {
185220
const sendResults = await client.send({
186221
from: "<from-phone-number>", // Your E.164 formatted phone number used to send SMS

sdk/compute/arm-compute-rest/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,17 @@ The following section shows you how to initialize and authenticate your client,
6262

6363
```ts snippet:ReadmeSampleVirtualMachinesList
6464
import { DefaultAzureCredential } from "@azure/identity";
65-
import ComputeManagementClient, { paginate } from "@azure-rest/arm-compute";
65+
import ComputeManagementClient, {
66+
VirtualMachinesListParameters,
67+
paginate,
68+
} from "@azure-rest/arm-compute";
6669

6770
const credential = new DefaultAzureCredential();
6871
const client = ComputeManagementClient(credential);
6972

7073
const subscriptionId = "";
7174
const resourceGroupName = "rgcompute";
72-
const options = {
75+
const options: VirtualMachinesListParameters = {
7376
queryParameters: {
7477
$filter: "aaaaaaaaaaaaaaaaaaaaaaa",
7578
"api-version": "2022-08-01",

sdk/compute/arm-compute/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6363
import { InteractiveBrowserCredential } from "@azure/identity";
6464
import { ComputeManagementClient } from "@azure/arm-compute";
6565

66+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6667
const credential = new InteractiveBrowserCredential({
6768
tenantId: "<YOUR_TENANT_ID>",
68-
clientId: "<YOUR_CLIENT_ID>"
69-
});
69+
clientId: "<YOUR_CLIENT_ID>",
70+
});
7071
const client = new ComputeManagementClient(credential, subscriptionId);
7172
```
7273

sdk/connectedvmware/arm-connectedvmware/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,25 @@ For more information about how to create an Azure AD Application check out [this
5151
Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client.
5252

5353
```ts snippet:ReadmeSampleCreateClient_Node
54-
const { AzureArcVMwareManagementServiceAPI } = require("@azure/arm-connectedvmware");
55-
const { DefaultAzureCredential } = require("@azure/identity");
56-
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
54+
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
55+
import { DefaultAzureCredential } from "@azure/identity";
5756

5857
const subscriptionId = "00000000-0000-0000-0000-000000000000";
5958
const client = new AzureArcVMwareManagementServiceAPI(new DefaultAzureCredential(), subscriptionId);
60-
61-
// For client-side applications running in the browser, use this code instead:
62-
// const credential = new InteractiveBrowserCredential({
63-
// tenantId: "<YOUR_TENANT_ID>",
64-
// clientId: "<YOUR_CLIENT_ID>"
65-
// });
66-
// const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
6759
```
6860

6961
For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate.
7062

7163
```ts snippet:ReadmeSampleCreateClient_Browser
64+
import { InteractiveBrowserCredential } from "@azure/identity";
65+
import { AzureArcVMwareManagementServiceAPI } from "@azure/arm-connectedvmware";
7266

67+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
68+
const credential = new InteractiveBrowserCredential({
69+
tenantId: "<YOUR_TENANT_ID>",
70+
clientId: "<YOUR_CLIENT_ID>",
71+
});
72+
const client = new AzureArcVMwareManagementServiceAPI(credential, subscriptionId);
7373
```
7474

7575
### JavaScript Bundle
@@ -89,7 +89,8 @@ To use this client library in the browser, first you need to use a bundler. For
8989
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
9090

9191
```ts snippet:SetLogLevel
92-
const { setLogLevel } = require("@azure/logger");
92+
import { setLogLevel } from "@azure/logger";
93+
9394
setLogLevel("info");
9495
```
9596

sdk/containerservice/arm-containerservice/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6363
import { InteractiveBrowserCredential } from "@azure/identity";
6464
import { ContainerServiceClient } from "@azure/arm-containerservice";
6565

66+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6667
const credential = new InteractiveBrowserCredential({
6768
tenantId: "<YOUR_TENANT_ID>",
68-
clientId: "<YOUR_CLIENT_ID>"
69-
});
70-
const subscriptionId = "00000000-0000-0000-0000-000000000000";
69+
clientId: "<YOUR_CLIENT_ID>",
70+
});
7171
const client = new ContainerServiceClient(credential, subscriptionId);
7272
```
7373

sdk/containerservice/arm-containerservicefleet/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6565
import { InteractiveBrowserCredential } from "@azure/identity";
6666
import { ContainerServiceFleetClient } from "@azure/arm-containerservicefleet";
6767

68+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6869
const credential = new InteractiveBrowserCredential({
6970
tenantId: "<YOUR_TENANT_ID>",
70-
clientId: "<YOUR_CLIENT_ID>"
71-
});
71+
clientId: "<YOUR_CLIENT_ID>",
72+
});
7273
const client = new ContainerServiceFleetClient(credential, subscriptionId);
7374
```
7475

sdk/databasewatcher/arm-databasewatcher/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For more information about how to create an Azure AD Application check out [this
5252
Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client.
5353

5454
```ts snippet:ReadmeSampleCreateClient_Node
55-
import { DatabaseWatcherClient } from "../src/index.js";
55+
import { DatabaseWatcherClient } from "@azure/arm-databasewatcher";
5656
import { DefaultAzureCredential } from "@azure/identity";
5757

5858
const subscriptionId = "00000000-0000-0000-0000-000000000000";
@@ -63,7 +63,7 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6363

6464
```ts snippet:ReadmeSampleCreateClient_Browser
6565
import { InteractiveBrowserCredential } from "@azure/identity";
66-
import { DatabaseWatcherClient } from "../src/index.js";
66+
import { DatabaseWatcherClient } from "@azure/arm-databasewatcher";
6767

6868
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6969
const credential = new InteractiveBrowserCredential({

sdk/databox/arm-databox/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6363
import { InteractiveBrowserCredential } from "@azure/identity";
6464
import { DataBoxManagementClient } from "@azure/arm-databox";
6565

66+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6667
const credential = new InteractiveBrowserCredential({
6768
tenantId: "<YOUR_TENANT_ID>",
68-
clientId: "<YOUR_CLIENT_ID>"
69-
});
69+
clientId: "<YOUR_CLIENT_ID>",
70+
});
7071
const client = new DataBoxManagementClient(credential, subscriptionId);
7172
```
7273

sdk/durabletask/arm-durabletask/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6565
import { InteractiveBrowserCredential } from "@azure/identity";
6666
import { DurableTaskClient } from "@azure/arm-durabletask";
6767

68+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6869
const credential = new InteractiveBrowserCredential({
6970
tenantId: "<YOUR_TENANT_ID>",
70-
clientId: "<YOUR_CLIENT_ID>"
71-
});
71+
clientId: "<YOUR_CLIENT_ID>",
72+
});
7273
const client = new DurableTaskClient(credential, subscriptionId);
7374
```
7475

sdk/eventgrid/arm-eventgrid/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6363
import { InteractiveBrowserCredential } from "@azure/identity";
6464
import { EventGridManagementClient } from "@azure/arm-eventgrid";
6565

66+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6667
const credential = new InteractiveBrowserCredential({
6768
tenantId: "<YOUR_TENANT_ID>",
68-
clientId: "<YOUR_CLIENT_ID>"
69-
});
69+
clientId: "<YOUR_CLIENT_ID>",
70+
});
7071
const client = new EventGridManagementClient(credential, subscriptionId);
7172
```
7273

sdk/face/ai-vision-face-rest/README.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,13 @@ const client = FaceClient(endpoint, credential);
377377

378378
console.log("Create a new liveness session.");
379379
const createLivenessSessionResponse = await client
380-
.path("/detectLiveness-sessions")
380+
.path("/detectLiveness/singleModal/sessions")
381381
.post({
382382
body: {
383383
livenessOperationMode: "Passive",
384384
deviceCorrelationId: randomUUID(),
385-
enableSessionImage: true,
385+
sendResultsToClient: false,
386+
authTokenTimeToLiveInSeconds: 60,
386387
},
387388
});
388389

@@ -395,7 +396,7 @@ const { sessionId } = createLivenessSessionResponse.body;
395396

396397
console.log("Get liveness detection results.");
397398
const getLivenessSessionResponse = await client
398-
.path("/detectLiveness-sessions/{sessionId}", sessionId)
399+
.path("/detectLiveness/singleModal/sessions/{sessionId}", sessionId)
399400
.get();
400401

401402
if (isUnexpected(getLivenessSessionResponse)) {
@@ -418,26 +419,22 @@ const client = FaceClient(endpoint, credential);
418419

419420
console.log("Create a new liveness with verify session with verify image.");
420421
const createLivenessSessionResponse = await client
421-
.path("/detectLivenessWithVerify-sessions")
422+
.path("/detectLivenessWithVerify/singleModal/sessions")
422423
.post({
423424
contentType: "multipart/form-data",
424425
body: [
425426
{
426-
name: "verifyImage",
427+
name: "VerifyImage",
427428
body: readFileSync("path/to/verify/image"),
428-
filename: "verifyImage.jpg",
429429
},
430430
{
431-
name: "livenessOperationMode",
432-
body: "Passive",
433-
},
434-
{
435-
name: "deviceCorrelationId",
436-
body: randomUUID(),
437-
},
438-
{
439-
name: "enableSessionImage",
440-
body: true,
431+
name: "Parameters",
432+
body: {
433+
livenessOperationMode: "Passive",
434+
sendResultsToClient: false,
435+
authTokenTimeToLiveInSeconds: 60,
436+
deviceCorrelationId: randomUUID(),
437+
},
441438
},
442439
],
443440
});
@@ -451,7 +448,7 @@ const { sessionId } = createLivenessSessionResponse.body;
451448

452449
console.log("Get the liveness detection and verification result.");
453450
const getLivenessSessionResultResponse = await client
454-
.path("/detectLivenessWithVerify-sessions/{sessionId}", sessionId)
451+
.path("/detectLivenessWithVerify/singleModal/sessions/{sessionId}", sessionId)
455452
.get();
456453

457454
if (isUnexpected(getLivenessSessionResultResponse)) {

sdk/hybridconnectivity/arm-hybridconnectivity/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,25 @@ For more information about how to create an Azure AD Application check out [this
5252
Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client.
5353

5454
```ts snippet:ReadmeSampleCreateClient_Node
55-
import { HybridConnectivityClient } from "@azure/arm-hybridconnectivity";
55+
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
5656
import { DefaultAzureCredential } from "@azure/identity";
5757

5858
const subscriptionId = "00000000-0000-0000-0000-000000000000";
59-
const client = new HybridConnectivityClient(new DefaultAzureCredential(), subscriptionId);
59+
const client = new HybridConnectivityManagementAPI(new DefaultAzureCredential(), subscriptionId);
6060
```
6161

6262
For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate.
6363

6464
```ts snippet:ReadmeSampleCreateClient_Browser
6565
import { InteractiveBrowserCredential } from "@azure/identity";
66-
import { HybridConnectivityClient } from "@azure/arm-hybridconnectivity";
66+
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
6767

68+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6869
const credential = new InteractiveBrowserCredential({
6970
tenantId: "<YOUR_TENANT_ID>",
70-
clientId: "<YOUR_CLIENT_ID>"
71-
});
72-
const client = new HybridConnectivityClient(credential, subscriptionId);
71+
clientId: "<YOUR_CLIENT_ID>",
72+
});
73+
const client = new HybridConnectivityManagementAPI(credential, subscriptionId);
7374
```
7475

7576

sdk/hybridkubernetes/arm-hybridkubernetes/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur
6363
import { InteractiveBrowserCredential } from "@azure/identity";
6464
import { ConnectedKubernetesClient } from "@azure/arm-hybridkubernetes";
6565

66+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
6667
const credential = new InteractiveBrowserCredential({
6768
tenantId: "<YOUR_TENANT_ID>",
68-
clientId: "<YOUR_CLIENT_ID>"
69-
});
70-
const subscriptionId = "00000000-0000-0000-0000-000000000000";
69+
clientId: "<YOUR_CLIENT_ID>",
70+
});
7171
const client = new ConnectedKubernetesClient(credential, subscriptionId);
7272
```
7373

0 commit comments

Comments
 (0)