From d4b35cdbaf43166f2bc009e16de0160a61182a68 Mon Sep 17 00:00:00 2001 From: Matthew Podwysocki Date: Fri, 24 Jan 2025 09:28:07 -0500 Subject: [PATCH] [containerregistry] Update containerregistry projects to use snippets extraction (#32679) ### Packages impacted by this PR - @azure/arm-containerregistry - @azure/container-registry ### Issues associated with this PR - https://github.com/Azure/azure-sdk-for-js/issues/32416 ### Describe the problem that is addressed by this PR Updates all projects under `containerregistry` to use snippets extraction. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary) --- .../arm-containerregistry/README.md | 33 +- .../arm-containerregistry/_meta.json | 2 +- .../arm-containerregistry/package.json | 25 +- .../samples-dev/agentPoolsCreateSample.ts | 23 +- .../samples-dev/agentPoolsDeleteSample.ts | 15 +- .../agentPoolsGetQueueStatusSample.ts | 15 +- .../samples-dev/agentPoolsGetSample.ts | 19 +- .../samples-dev/agentPoolsListSample.ts | 18 +- .../samples-dev/agentPoolsUpdateSample.ts | 21 +- .../archiveVersionsCreateSample.ts | 15 +- .../archiveVersionsDeleteSample.ts | 15 +- .../samples-dev/archiveVersionsGetSample.ts | 15 +- .../samples-dev/archiveVersionsListSample.ts | 17 +- .../samples-dev/archivesCreateSample.ts | 23 +- .../samples-dev/archivesDeleteSample.ts | 15 +- .../samples-dev/archivesGetSample.ts | 15 +- .../samples-dev/archivesListSample.ts | 19 +- .../samples-dev/archivesUpdateSample.ts | 23 +- .../samples-dev/cacheRulesCreateSample.ts | 23 +- .../samples-dev/cacheRulesDeleteSample.ts | 15 +- .../samples-dev/cacheRulesGetSample.ts | 19 +- .../samples-dev/cacheRulesListSample.ts | 18 +- .../samples-dev/cacheRulesUpdateSample.ts | 23 +- .../connectedRegistriesCreateSample.ts | 29 +- .../connectedRegistriesDeactivateSample.ts | 15 +- .../connectedRegistriesDeleteSample.ts | 15 +- .../connectedRegistriesGetSample.ts | 15 +- .../connectedRegistriesListSample.ts | 18 +- .../connectedRegistriesUpdateSample.ts | 27 +- .../samples-dev/credentialSetsCreateSample.ts | 31 +- .../samples-dev/credentialSetsDeleteSample.ts | 15 +- .../samples-dev/credentialSetsGetSample.ts | 15 +- .../samples-dev/credentialSetsListSample.ts | 18 +- .../samples-dev/credentialSetsUpdateSample.ts | 31 +- .../exportPipelinesCreateSample.ts | 25 +- .../exportPipelinesDeleteSample.ts | 15 +- .../samples-dev/exportPipelinesGetSample.ts | 15 +- .../samples-dev/exportPipelinesListSample.ts | 18 +- .../importPipelinesCreateSample.ts | 30 +- .../importPipelinesDeleteSample.ts | 15 +- .../samples-dev/importPipelinesGetSample.ts | 15 +- .../samples-dev/importPipelinesListSample.ts | 18 +- .../samples-dev/operationsListSample.ts | 12 +- .../samples-dev/pipelineRunsCreateSample.ts | 44 +- .../samples-dev/pipelineRunsDeleteSample.ts | 15 +- .../samples-dev/pipelineRunsGetSample.ts | 19 +- .../samples-dev/pipelineRunsListSample.ts | 18 +- ...EndpointConnectionsCreateOrUpdateSample.ts | 25 +- .../privateEndpointConnectionsDeleteSample.ts | 15 +- .../privateEndpointConnectionsGetSample.ts | 15 +- .../privateEndpointConnectionsListSample.ts | 17 +- .../registriesCheckNameAvailabilitySample.ts | 36 +- .../samples-dev/registriesCreateSample.ts | 38 +- .../samples-dev/registriesDeleteSample.ts | 18 +- .../registriesGenerateCredentialsSample.ts | 23 +- ...registriesGetBuildSourceUploadUrlSample.ts | 18 +- .../registriesGetPrivateLinkResourceSample.ts | 15 +- .../samples-dev/registriesGetSample.ts | 13 +- .../registriesImportImageSample.ts | 59 +-- .../registriesListByResourceGroupSample.ts | 17 +- .../registriesListCredentialsSample.ts | 18 +- ...egistriesListPrivateLinkResourcesSample.ts | 17 +- .../samples-dev/registriesListSample.ts | 12 +- .../samples-dev/registriesListUsagesSample.ts | 18 +- .../registriesRegenerateCredentialSample.ts | 23 +- .../registriesScheduleRunSample.ts | 157 +++---- .../samples-dev/registriesUpdateSample.ts | 23 +- .../samples-dev/replicationsCreateSample.ts | 38 +- .../samples-dev/replicationsDeleteSample.ts | 15 +- .../samples-dev/replicationsGetSample.ts | 19 +- .../samples-dev/replicationsListSample.ts | 18 +- .../samples-dev/replicationsUpdateSample.ts | 23 +- .../samples-dev/runsCancelSample.ts | 19 +- .../samples-dev/runsGetLogSasUrlSample.ts | 19 +- .../samples-dev/runsGetSample.ts | 13 +- .../samples-dev/runsListSample.ts | 25 +- .../samples-dev/runsUpdateSample.ts | 21 +- .../samples-dev/scopeMapsCreateSample.ts | 26 +- .../samples-dev/scopeMapsDeleteSample.ts | 15 +- .../samples-dev/scopeMapsGetSample.ts | 19 +- .../samples-dev/scopeMapsListSample.ts | 18 +- .../samples-dev/scopeMapsUpdateSample.ts | 26 +- .../samples-dev/taskRunsCreateSample.ts | 31 +- .../samples-dev/taskRunsDeleteSample.ts | 15 +- .../samples-dev/taskRunsGetDetailsSample.ts | 19 +- .../samples-dev/taskRunsGetSample.ts | 19 +- .../samples-dev/taskRunsListSample.ts | 18 +- .../samples-dev/taskRunsUpdateSample.ts | 31 +- .../samples-dev/tasksCreateSample.ts | 160 +++---- .../samples-dev/tasksDeleteSample.ts | 19 +- .../samples-dev/tasksGetDetailsSample.ts | 19 +- .../samples-dev/tasksGetSample.ts | 19 +- .../samples-dev/tasksListSample.ts | 15 +- .../samples-dev/tasksUpdateSample.ts | 149 +++--- .../samples-dev/tokensCreateSample.ts | 29 +- .../samples-dev/tokensDeleteSample.ts | 19 +- .../samples-dev/tokensGetSample.ts | 19 +- .../samples-dev/tokensListSample.ts | 15 +- .../samples-dev/tokensUpdateSample.ts | 29 +- .../samples-dev/webhooksCreateSample.ts | 23 +- .../samples-dev/webhooksDeleteSample.ts | 15 +- .../webhooksGetCallbackConfigSample.ts | 15 +- .../samples-dev/webhooksGetSample.ts | 19 +- .../samples-dev/webhooksListEventsSample.ts | 17 +- .../samples-dev/webhooksListSample.ts | 18 +- .../samples-dev/webhooksPingSample.ts | 19 +- .../samples-dev/webhooksUpdateSample.ts | 23 +- .../typescript/src/agentPoolsCreateSample.ts | 4 +- .../typescript/src/agentPoolsDeleteSample.ts | 4 +- .../src/agentPoolsGetQueueStatusSample.ts | 4 +- .../typescript/src/agentPoolsGetSample.ts | 4 +- .../typescript/src/agentPoolsListSample.ts | 4 +- .../typescript/src/agentPoolsUpdateSample.ts | 4 +- .../src/archiveVersionsCreateSample.ts | 4 +- .../src/archiveVersionsDeleteSample.ts | 4 +- .../src/archiveVersionsGetSample.ts | 4 +- .../src/archiveVersionsListSample.ts | 4 +- .../typescript/src/archivesCreateSample.ts | 4 +- .../typescript/src/archivesDeleteSample.ts | 4 +- .../typescript/src/archivesGetSample.ts | 4 +- .../typescript/src/archivesListSample.ts | 4 +- .../typescript/src/archivesUpdateSample.ts | 4 +- .../typescript/src/cacheRulesCreateSample.ts | 4 +- .../typescript/src/cacheRulesDeleteSample.ts | 4 +- .../typescript/src/cacheRulesGetSample.ts | 4 +- .../typescript/src/cacheRulesListSample.ts | 4 +- .../typescript/src/cacheRulesUpdateSample.ts | 4 +- .../src/connectedRegistriesCreateSample.ts | 4 +- .../connectedRegistriesDeactivateSample.ts | 4 +- .../src/connectedRegistriesDeleteSample.ts | 4 +- .../src/connectedRegistriesGetSample.ts | 4 +- .../src/connectedRegistriesListSample.ts | 4 +- .../src/connectedRegistriesUpdateSample.ts | 4 +- .../src/credentialSetsCreateSample.ts | 4 +- .../src/credentialSetsDeleteSample.ts | 4 +- .../typescript/src/credentialSetsGetSample.ts | 4 +- .../src/credentialSetsListSample.ts | 4 +- .../src/credentialSetsUpdateSample.ts | 4 +- .../src/exportPipelinesCreateSample.ts | 4 +- .../src/exportPipelinesDeleteSample.ts | 4 +- .../src/exportPipelinesGetSample.ts | 4 +- .../src/exportPipelinesListSample.ts | 4 +- .../src/importPipelinesCreateSample.ts | 4 +- .../src/importPipelinesDeleteSample.ts | 4 +- .../src/importPipelinesGetSample.ts | 4 +- .../src/importPipelinesListSample.ts | 4 +- .../typescript/src/operationsListSample.ts | 4 +- .../src/pipelineRunsCreateSample.ts | 6 +- .../src/pipelineRunsDeleteSample.ts | 4 +- .../typescript/src/pipelineRunsGetSample.ts | 4 +- .../typescript/src/pipelineRunsListSample.ts | 4 +- ...EndpointConnectionsCreateOrUpdateSample.ts | 4 +- .../privateEndpointConnectionsDeleteSample.ts | 4 +- .../privateEndpointConnectionsGetSample.ts | 4 +- .../privateEndpointConnectionsListSample.ts | 4 +- .../registriesCheckNameAvailabilitySample.ts | 6 +- .../typescript/src/registriesCreateSample.ts | 6 +- .../typescript/src/registriesDeleteSample.ts | 4 +- .../registriesGenerateCredentialsSample.ts | 4 +- ...registriesGetBuildSourceUploadUrlSample.ts | 4 +- .../registriesGetPrivateLinkResourceSample.ts | 4 +- .../typescript/src/registriesGetSample.ts | 4 +- .../src/registriesImportImageSample.ts | 8 +- .../registriesListByResourceGroupSample.ts | 4 +- .../src/registriesListCredentialsSample.ts | 4 +- ...egistriesListPrivateLinkResourcesSample.ts | 4 +- .../typescript/src/registriesListSample.ts | 4 +- .../src/registriesListUsagesSample.ts | 4 +- .../registriesRegenerateCredentialSample.ts | 4 +- .../src/registriesScheduleRunSample.ts | 16 +- .../typescript/src/registriesUpdateSample.ts | 4 +- .../src/replicationsCreateSample.ts | 6 +- .../src/replicationsDeleteSample.ts | 4 +- .../typescript/src/replicationsGetSample.ts | 4 +- .../typescript/src/replicationsListSample.ts | 4 +- .../src/replicationsUpdateSample.ts | 4 +- .../typescript/src/runsCancelSample.ts | 4 +- .../typescript/src/runsGetLogSasUrlSample.ts | 4 +- .../v11-beta/typescript/src/runsGetSample.ts | 4 +- .../v11-beta/typescript/src/runsListSample.ts | 4 +- .../typescript/src/runsUpdateSample.ts | 4 +- .../typescript/src/scopeMapsCreateSample.ts | 4 +- .../typescript/src/scopeMapsDeleteSample.ts | 4 +- .../typescript/src/scopeMapsGetSample.ts | 4 +- .../typescript/src/scopeMapsListSample.ts | 4 +- .../typescript/src/scopeMapsUpdateSample.ts | 4 +- .../typescript/src/taskRunsCreateSample.ts | 4 +- .../typescript/src/taskRunsDeleteSample.ts | 4 +- .../src/taskRunsGetDetailsSample.ts | 4 +- .../typescript/src/taskRunsGetSample.ts | 4 +- .../typescript/src/taskRunsListSample.ts | 4 +- .../typescript/src/taskRunsUpdateSample.ts | 4 +- .../typescript/src/tasksCreateSample.ts | 12 +- .../typescript/src/tasksDeleteSample.ts | 4 +- .../typescript/src/tasksGetDetailsSample.ts | 4 +- .../v11-beta/typescript/src/tasksGetSample.ts | 4 +- .../typescript/src/tasksListSample.ts | 4 +- .../typescript/src/tasksUpdateSample.ts | 12 +- .../typescript/src/tokensCreateSample.ts | 4 +- .../typescript/src/tokensDeleteSample.ts | 4 +- .../typescript/src/tokensGetSample.ts | 4 +- .../typescript/src/tokensListSample.ts | 4 +- .../typescript/src/tokensUpdateSample.ts | 4 +- .../typescript/src/webhooksCreateSample.ts | 4 +- .../typescript/src/webhooksDeleteSample.ts | 4 +- .../src/webhooksGetCallbackConfigSample.ts | 4 +- .../typescript/src/webhooksGetSample.ts | 4 +- .../src/webhooksListEventsSample.ts | 4 +- .../typescript/src/webhooksListSample.ts | 4 +- .../typescript/src/webhooksPingSample.ts | 4 +- .../typescript/src/webhooksUpdateSample.ts | 4 +- .../test/containerregistry_examples.spec.ts | 282 +++++------ .../test/snippets.spec.ts | 30 ++ .../tsconfig.browser.config.json | 19 +- .../vitest.browser.config.ts | 6 +- .../arm-containerregistry/vitest.config.ts | 3 +- .../container-registry/README.md | 436 +++++++----------- .../container-registry/TROUBLESHOOTING.md | 21 +- .../container-registry/package.json | 4 +- .../src/containerRegistryClient.ts | 68 ++- .../src/containerRepository.ts | 118 ++--- .../content/containerRegistryContentClient.ts | 12 +- .../src/registryArtifact.ts | 156 +++---- .../container-registry/test/snippets.spec.ts | 340 ++++++++++++++ .../tsconfig.browser.config.json | 3 - 225 files changed, 1843 insertions(+), 2690 deletions(-) create mode 100644 sdk/containerregistry/arm-containerregistry/test/snippets.spec.ts create mode 100644 sdk/containerregistry/container-registry/test/snippets.spec.ts delete mode 100644 sdk/containerregistry/container-registry/tsconfig.browser.config.json diff --git a/sdk/containerregistry/arm-containerregistry/README.md b/sdk/containerregistry/arm-containerregistry/README.md index 246926b96a89..52e74ce90e00 100644 --- a/sdk/containerregistry/arm-containerregistry/README.md +++ b/sdk/containerregistry/arm-containerregistry/README.md @@ -46,20 +46,28 @@ Set the values of the client ID, tenant ID, and client secret of the AAD applica For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). -```javascript -const { ContainerRegistryManagementClient } = require("@azure/arm-containerregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. +Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. + +```ts snippet:ReadmeSampleCreateClient_Node +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; +import { DefaultAzureCredential } from "@azure/identity"; const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ContainerRegistryManagementClient(new DefaultAzureCredential(), subscriptionId); +``` + +For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new ContainerRegistryManagementClient(credential, subscriptionId); +```ts snippet:ReadmeSampleCreateClient_Browser +import { InteractiveBrowserCredential } from "@azure/identity"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", +}); +const client = new ContainerRegistryManagementClient(credential, subscriptionId); ``` ### JavaScript Bundle @@ -78,8 +86,9 @@ To use this client library in the browser, first you need to use a bundler. For 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`: -```javascript -const { setLogLevel } = require("@azure/logger"); +```ts snippet:SetLogLevel +import { setLogLevel } from "@azure/logger"; + setLogLevel("info"); ``` diff --git a/sdk/containerregistry/arm-containerregistry/_meta.json b/sdk/containerregistry/arm-containerregistry/_meta.json index 7df2b84acce8..99b4992b6647 100644 --- a/sdk/containerregistry/arm-containerregistry/_meta.json +++ b/sdk/containerregistry/arm-containerregistry/_meta.json @@ -5,4 +5,4 @@ "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", "use": "@autorest/typescript@6.0.12" -} \ No newline at end of file +} diff --git a/sdk/containerregistry/arm-containerregistry/package.json b/sdk/containerregistry/arm-containerregistry/package.json index 5d7d1381eeef..f70b906423c6 100644 --- a/sdk/containerregistry/arm-containerregistry/package.json +++ b/sdk/containerregistry/arm-containerregistry/package.json @@ -8,20 +8,21 @@ "node": ">=18.0.0" }, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.7.0", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-client": "^1.9.2", "@azure/core-lro": "^2.5.4", - "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.12.0", - "tslib": "^2.2.0" + "@azure/core-paging": "^1.6.2", + "@azure/core-rest-pipeline": "^1.18.2", + "tslib": "^2.8.1" }, "keywords": [ "node", "azure", "typescript", "browser", - "isomorphic" + "isomorphic", + "cloud" ], "license": "MIT", "main": "./dist/commonjs/index.js", @@ -32,7 +33,8 @@ "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", + "@azure/identity": "^4.6.0", + "@azure/logger": "^1.1.4", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.3", "@vitest/coverage-istanbul": "^3.0.3", @@ -41,10 +43,7 @@ "typescript": "~5.7.2", "vitest": "^3.0.3" }, - "repository": { - "type": "git", - "url": "https://github.com/Azure/azure-sdk-for-js.git" - }, + "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -79,7 +78,7 @@ "unit-test": "npm run unit-test:node && npm run unit-test:browser", "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run test:vitest", - "update-snippets": "echo skipped" + "update-snippets": "dev-tool run update-snippets" }, "sideEffects": false, "//metadata": { diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsCreateSample.ts index 82fbcfb3b44e..679cdb89db4d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AgentPool, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { AgentPool } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function agentPoolsCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const agentPoolName = "myAgentPool"; const agentPool: AgentPool = { @@ -34,18 +28,15 @@ async function agentPoolsCreate(): Promise { location: "WESTUS", os: "Linux", tags: { key: "value" }, - tier: "S1" + tier: "S1", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.agentPools.beginCreateAndWait( resourceGroupName, registryName, agentPoolName, - agentPool + agentPool, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsDeleteSample.ts index a267f83c8165..cd0cb69f5942 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function agentPoolsDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const agentPoolName = "myAgentPool"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.agentPools.beginDeleteAndWait( resourceGroupName, registryName, - agentPoolName + agentPoolName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsGetQueueStatusSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsGetQueueStatusSample.ts index af93b7acb203..cb49a3338a99 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsGetQueueStatusSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsGetQueueStatusSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function agentPoolsGetQueueStatus(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const agentPoolName = "myAgentPool"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.agentPools.getQueueStatus( resourceGroupName, registryName, - agentPoolName + agentPoolName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsGetSample.ts index 08033437d78d..2296f1f9c3ca 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function agentPoolsGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const agentPoolName = "myAgentPool"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.agentPools.get( - resourceGroupName, - registryName, - agentPoolName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.agentPools.get(resourceGroupName, registryName, agentPoolName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsListSample.ts index 4e0a563dfe38..2e8cf35e4e14 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function agentPoolsList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.agentPools.list( - resourceGroupName, - registryName - )) { + for await (const item of client.agentPools.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsUpdateSample.ts index 3309e01946d9..ab97872ac38c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/agentPoolsUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AgentPoolUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { AgentPoolUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,23 +19,18 @@ import "dotenv/config"; */ async function agentPoolsUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const agentPoolName = "myAgentPool"; const updateParameters: AgentPoolUpdateParameters = { count: 1 }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.agentPools.beginUpdateAndWait( resourceGroupName, registryName, agentPoolName, - updateParameters + updateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsCreateSample.ts index aceed7bed2c4..cd4fb2665c3b 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsCreateSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,25 +18,20 @@ import "dotenv/config"; */ async function archiveVersionCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const packageType = "rpm"; const archiveName = "myArchiveName"; const archiveVersionName = "myArchiveVersionName"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.archiveVersions.beginCreateAndWait( resourceGroupName, registryName, packageType, archiveName, - archiveVersionName + archiveVersionName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsDeleteSample.ts index fd39899f626b..b787853037e7 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,25 +18,20 @@ import "dotenv/config"; */ async function archiveVersionDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const packageType = "myPackageType"; const archiveName = "myArchiveName"; const archiveVersionName = "myArchiveVersionName"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.archiveVersions.beginDeleteAndWait( resourceGroupName, registryName, packageType, archiveName, - archiveVersionName + archiveVersionName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsGetSample.ts index d7117165ce59..af8f80548d1c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,25 +18,20 @@ import "dotenv/config"; */ async function archiveVersionGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const packageType = "rpm"; const archiveName = "myArchiveName"; const archiveVersionName = "myArchiveVersionName"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.archiveVersions.get( resourceGroupName, registryName, packageType, archiveName, - archiveVersionName + archiveVersionName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsListSample.ts index 88ba09693623..2d52d8cb556e 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/archiveVersionsListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,24 +18,19 @@ import "dotenv/config"; */ async function archiveVersionList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const packageType = "myPackageType"; const archiveName = "myArchiveName"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.archiveVersions.list( + for await (const item of client.archiveVersions.list( resourceGroupName, registryName, packageType, - archiveName + archiveName, )) { resArray.push(item); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesCreateSample.ts index 096729f7cdfc..147476ff1bfe 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Archive, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { Archive } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,29 +19,24 @@ import "dotenv/config"; */ async function archiveCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const packageType = "rpm"; const archiveName = "myArchiveName"; const archiveCreateParameters: Archive = { packageSource: { type: "remote", url: "string" }, publishedVersion: "string", - repositoryEndpointPrefix: "string" + repositoryEndpointPrefix: "string", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.archives.beginCreateAndWait( resourceGroupName, registryName, packageType, archiveName, - archiveCreateParameters + archiveCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesDeleteSample.ts index 5dbd933fae93..834b6c9f6004 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,23 +18,18 @@ import "dotenv/config"; */ async function archiveDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const packageType = "myPackageType"; const archiveName = "myArchiveName"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.archives.beginDeleteAndWait( resourceGroupName, registryName, packageType, - archiveName + archiveName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesGetSample.ts index 83848bc3c2ef..abde64f4eab3 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,23 +18,18 @@ import "dotenv/config"; */ async function archiveGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const packageType = "myPackageType"; const archiveName = "myArchiveName"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.archives.get( resourceGroupName, registryName, packageType, - archiveName + archiveName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesListSample.ts index 03b003287c60..3c6b10350858 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,23 +18,14 @@ import "dotenv/config"; */ async function archiveList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const packageType = "myPackageType"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.archives.list( - resourceGroupName, - registryName, - packageType - )) { + for await (const item of client.archives.list(resourceGroupName, registryName, packageType)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesUpdateSample.ts index 080df3f8d34f..f719a622fac8 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/archivesUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/archivesUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ArchiveUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { ArchiveUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,27 +19,22 @@ import "dotenv/config"; */ async function archiveUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const packageType = "myPackageType"; const archiveName = "myArchiveName"; const archiveUpdateParameters: ArchiveUpdateParameters = { - publishedVersion: "string" + publishedVersion: "string", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.archives.update( resourceGroupName, registryName, packageType, archiveName, - archiveUpdateParameters + archiveUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesCreateSample.ts index 10c62f232b4b..a353e38fb273 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CacheRule, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { CacheRule } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,28 +19,23 @@ import "dotenv/config"; */ async function cacheRuleCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const cacheRuleName = "myCacheRule"; const cacheRuleCreateParameters: CacheRule = { credentialSetResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet", sourceRepository: "docker.io/library/hello-world", - targetRepository: "cached-docker-hub/hello-world" + targetRepository: "cached-docker-hub/hello-world", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.cacheRules.beginCreateAndWait( resourceGroupName, registryName, cacheRuleName, - cacheRuleCreateParameters + cacheRuleCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesDeleteSample.ts index 393ba5ee936f..80f4ba6e4974 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function cacheRuleDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const cacheRuleName = "myCacheRule"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.cacheRules.beginDeleteAndWait( resourceGroupName, registryName, - cacheRuleName + cacheRuleName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesGetSample.ts index 29a31194a9cd..59111f60d62a 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function cacheRuleGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const cacheRuleName = "myCacheRule"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.cacheRules.get( - resourceGroupName, - registryName, - cacheRuleName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.cacheRules.get(resourceGroupName, registryName, cacheRuleName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesListSample.ts index 158c6398ab18..b913c722439a 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function cacheRuleList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.cacheRules.list( - resourceGroupName, - registryName - )) { + for await (const item of client.cacheRules.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesUpdateSample.ts index 3239350e4f68..6a079098c107 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/cacheRulesUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CacheRuleUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { CacheRuleUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,26 +19,21 @@ import "dotenv/config"; */ async function cacheRuleUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const cacheRuleName = "myCacheRule"; const cacheRuleUpdateParameters: CacheRuleUpdateParameters = { credentialSetResourceId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2" + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.cacheRules.beginUpdateAndWait( resourceGroupName, registryName, cacheRuleName, - cacheRuleUpdateParameters + cacheRuleUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesCreateSample.ts index 6ccd1104cb80..abf86d1501a4 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ConnectedRegistry, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { ConnectedRegistry } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,15 +19,13 @@ import "dotenv/config"; */ async function connectedRegistryCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const connectedRegistryName = "myConnectedRegistry"; const connectedRegistryCreateParameters: ConnectedRegistry = { clientTokenIds: [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token" + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token", ], mode: "ReadWrite", notificationsList: ["hello-world:*:*", "sample/repo/*:1.0:*"], @@ -41,20 +35,17 @@ async function connectedRegistryCreate(): Promise { schedule: "0 9 * * *", syncWindow: "PT3H", tokenId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken" - } - } + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken", + }, + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.connectedRegistries.beginCreateAndWait( resourceGroupName, registryName, connectedRegistryName, - connectedRegistryCreateParameters + connectedRegistryCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesDeactivateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesDeactivateSample.ts index ac8f54ebda19..9255e11e6ac1 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesDeactivateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesDeactivateSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function connectedRegistryDeactivate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const connectedRegistryName = "myConnectedRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.connectedRegistries.beginDeactivateAndWait( resourceGroupName, registryName, - connectedRegistryName + connectedRegistryName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesDeleteSample.ts index 72a35315a9cf..0d06bd334846 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function connectedRegistryDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const connectedRegistryName = "myConnectedRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.connectedRegistries.beginDeleteAndWait( resourceGroupName, registryName, - connectedRegistryName + connectedRegistryName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesGetSample.ts index 82939029d5b3..d80e324bb4a5 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function connectedRegistryGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const connectedRegistryName = "myConnectedRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.connectedRegistries.get( resourceGroupName, registryName, - connectedRegistryName + connectedRegistryName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesListSample.ts index 9caefecc6008..cd3dd1b30284 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function connectedRegistryList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.connectedRegistries.list( - resourceGroupName, - registryName - )) { + for await (const item of client.connectedRegistries.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesUpdateSample.ts index c2580b15faa1..565f7f82c836 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/connectedRegistriesUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ConnectedRegistryUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { ConnectedRegistryUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,35 +19,30 @@ import "dotenv/config"; */ async function connectedRegistryUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const connectedRegistryName = "myScopeMap"; const connectedRegistryUpdateParameters: ConnectedRegistryUpdateParameters = { clientTokenIds: [ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token" + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token", ], logging: { auditLogStatus: "Enabled", logLevel: "Debug" }, notificationsList: ["hello-world:*:*", "sample/repo/*:1.0:*"], syncProperties: { messageTtl: "P30D", schedule: "0 0 */10 * *", - syncWindow: "P2D" - } + syncWindow: "P2D", + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.connectedRegistries.beginUpdateAndWait( resourceGroupName, registryName, connectedRegistryName, - connectedRegistryUpdateParameters + connectedRegistryUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsCreateSample.ts index e592a8de8c22..f25f20fad0e8 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CredentialSet, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { CredentialSet } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,35 +19,28 @@ import "dotenv/config"; */ async function credentialSetCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credentialSetName = "myCredentialSet"; const credentialSetCreateParameters: CredentialSet = { authCredentials: [ { name: "Credential1", - passwordSecretIdentifier: - "https://myvault.vault.azure.net/secrets/password", - usernameSecretIdentifier: - "https://myvault.vault.azure.net/secrets/username" - } + passwordSecretIdentifier: "https://myvault.vault.azure.net/secrets/password", + usernameSecretIdentifier: "https://myvault.vault.azure.net/secrets/username", + }, ], identity: { type: "SystemAssigned" }, - loginServer: "docker.io" + loginServer: "docker.io", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.credentialSets.beginCreateAndWait( resourceGroupName, registryName, credentialSetName, - credentialSetCreateParameters + credentialSetCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsDeleteSample.ts index b7e6c60a77b4..e582be98d1f2 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function credentialSetDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credentialSetName = "myCredentialSet"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.credentialSets.beginDeleteAndWait( resourceGroupName, registryName, - credentialSetName + credentialSetName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsGetSample.ts index 740411ae30e7..50f6831f4df4 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function credentialSetGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credentialSetName = "myCredentialSet"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.credentialSets.get( resourceGroupName, registryName, - credentialSetName + credentialSetName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsListSample.ts index 17ab0dbb7e85..d8e7fbeebbf0 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function credentialSetList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.credentialSets.list( - resourceGroupName, - registryName - )) { + for await (const item of client.credentialSets.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsUpdateSample.ts index 415492801525..03f4f99736d4 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/credentialSetsUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CredentialSetUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { CredentialSetUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,33 +19,26 @@ import "dotenv/config"; */ async function credentialSetUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credentialSetName = "myCredentialSet"; const credentialSetUpdateParameters: CredentialSetUpdateParameters = { authCredentials: [ { name: "Credential1", - passwordSecretIdentifier: - "https://myvault.vault.azure.net/secrets/password2", - usernameSecretIdentifier: - "https://myvault.vault.azure.net/secrets/username2" - } - ] + passwordSecretIdentifier: "https://myvault.vault.azure.net/secrets/password2", + usernameSecretIdentifier: "https://myvault.vault.azure.net/secrets/username2", + }, + ], }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.credentialSets.beginUpdateAndWait( resourceGroupName, registryName, credentialSetName, - credentialSetUpdateParameters + credentialSetUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesCreateSample.ts index d486b2c1fe29..b2f3fde0f95e 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ExportPipeline, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { ExportPipeline } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function exportPipelineCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const exportPipelineName = "myExportPipeline"; const exportPipelineCreateParameters: ExportPipeline = { @@ -36,19 +30,16 @@ async function exportPipelineCreate(): Promise { target: { type: "AzureStorageBlobContainer", keyVaultUri: "https://myvault.vault.azure.net/secrets/acrexportsas", - uri: "https://accountname.blob.core.windows.net/containername" - } + uri: "https://accountname.blob.core.windows.net/containername", + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.exportPipelines.beginCreateAndWait( resourceGroupName, registryName, exportPipelineName, - exportPipelineCreateParameters + exportPipelineCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesDeleteSample.ts index 469a620439d4..3fb02bec7e49 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function exportPipelineDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const exportPipelineName = "myExportPipeline"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.exportPipelines.beginDeleteAndWait( resourceGroupName, registryName, - exportPipelineName + exportPipelineName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesGetSample.ts index 1ecec85b20a5..bddaca4842e3 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function exportPipelineGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const exportPipelineName = "myExportPipeline"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.exportPipelines.get( resourceGroupName, registryName, - exportPipelineName + exportPipelineName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesListSample.ts index 44e41615dabe..da05c845e960 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/exportPipelinesListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function exportPipelineList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.exportPipelines.list( - resourceGroupName, - registryName - )) { + for await (const item of client.exportPipelines.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesCreateSample.ts index 396d09c7b71f..64d91ec41b89 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ImportPipeline, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { ImportPipeline } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,37 +19,33 @@ import "dotenv/config"; */ async function importPipelineCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const importPipelineName = "myImportPipeline"; const importPipelineCreateParameters: ImportPipeline = { identity: { type: "UserAssigned", userAssignedIdentities: { - "/subscriptions/f9d7ebedAdbd4cb4B973Aaf82c136138/resourcegroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity2": {} - } + "/subscriptions/f9d7ebedAdbd4cb4B973Aaf82c136138/resourcegroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity2": + {}, + }, }, location: "westus", options: ["OverwriteTags", "DeleteSourceBlobOnSuccess", "ContinueOnErrors"], source: { type: "AzureStorageBlobContainer", keyVaultUri: "https://myvault.vault.azure.net/secrets/acrimportsas", - uri: "https://accountname.blob.core.windows.net/containername" - } + uri: "https://accountname.blob.core.windows.net/containername", + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.importPipelines.beginCreateAndWait( resourceGroupName, registryName, importPipelineName, - importPipelineCreateParameters + importPipelineCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesDeleteSample.ts index e5f3b1fb9379..2cf2894fc9b1 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function importPipelineDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const importPipelineName = "myImportPipeline"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.importPipelines.beginDeleteAndWait( resourceGroupName, registryName, - importPipelineName + importPipelineName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesGetSample.ts index 653f952aa848..a21e0aaf3635 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function importPipelineGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const importPipelineName = "myImportPipeline"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.importPipelines.get( resourceGroupName, registryName, - importPipelineName + importPipelineName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesListSample.ts index 9cc4898344f8..587833b38424 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/importPipelinesListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function importPipelineList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.importPipelines.list( - resourceGroupName, - registryName - )) { + for await (const item of client.importPipelines.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/operationsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/operationsListSample.ts index 679163069446..ac44b7c6e635 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/operationsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/operationsListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,15 +18,11 @@ import "dotenv/config"; */ async function operationList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.operations.list()) { + for await (const item of client.operations.list()) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsCreateSample.ts index be7ec6b7ec8a..8d8d9e7647a4 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - PipelineRun, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { PipelineRun } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,33 +19,28 @@ import "dotenv/config"; */ async function pipelineRunCreateExport(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const pipelineRunName = "myPipelineRun"; const pipelineRunCreateParameters: PipelineRun = { request: { artifacts: [ "sourceRepository/hello-world", - "sourceRepository2@sha256:00000000000000000000000000000000000" + "sourceRepository2@sha256:00000000000000000000000000000000000", ], pipelineResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline", - target: { name: "myblob.tar.gz", type: "AzureStorageBlob" } - } + target: { name: "myblob.tar.gz", type: "AzureStorageBlob" }, + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.pipelineRuns.beginCreateAndWait( resourceGroupName, registryName, pipelineRunName, - pipelineRunCreateParameters + pipelineRunCreateParameters, ); console.log(result); } @@ -62,10 +53,8 @@ async function pipelineRunCreateExport(): Promise { */ async function pipelineRunCreateImport(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const pipelineRunName = "myPipelineRun"; const pipelineRunCreateParameters: PipelineRun = { @@ -74,19 +63,16 @@ async function pipelineRunCreateImport(): Promise { catalogDigest: "sha256@", pipelineResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline", - source: { name: "myblob.tar.gz", type: "AzureStorageBlob" } - } + source: { name: "myblob.tar.gz", type: "AzureStorageBlob" }, + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.pipelineRuns.beginCreateAndWait( resourceGroupName, registryName, pipelineRunName, - pipelineRunCreateParameters + pipelineRunCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsDeleteSample.ts index 02ccf9130526..f86c2fde3ebe 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function pipelineRunDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const pipelineRunName = "myPipelineRun"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.pipelineRuns.beginDeleteAndWait( resourceGroupName, registryName, - pipelineRunName + pipelineRunName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsGetSample.ts index 1ea53cfd0571..23d2bafb56f0 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function pipelineRunGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const pipelineRunName = "myPipelineRun"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.pipelineRuns.get( - resourceGroupName, - registryName, - pipelineRunName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.pipelineRuns.get(resourceGroupName, registryName, pipelineRunName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsListSample.ts index a30db60d6dfb..8e49e078abb4 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/pipelineRunsListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function pipelineRunList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.pipelineRuns.list( - resourceGroupName, - registryName - )) { + for await (const item of client.pipelineRuns.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts index 9694b6661ff9..2b0525cb6e6a 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - PrivateEndpointConnection, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { PrivateEndpointConnection } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,28 +19,23 @@ import "dotenv/config"; */ async function privateEndpointConnectionCreateOrUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const privateEndpointConnectionName = "myConnection"; const privateEndpointConnection: PrivateEndpointConnection = { privateLinkServiceConnectionState: { description: "Auto-Approved", - status: "Approved" - } + status: "Approved", + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.privateEndpointConnections.beginCreateOrUpdateAndWait( resourceGroupName, registryName, privateEndpointConnectionName, - privateEndpointConnection + privateEndpointConnection, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsDeleteSample.ts index 1415971dead2..6adea3f40f24 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function privateEndpointConnectionDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const privateEndpointConnectionName = "myConnection"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.privateEndpointConnections.beginDeleteAndWait( resourceGroupName, registryName, - privateEndpointConnectionName + privateEndpointConnectionName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsGetSample.ts index 03974f1c9ee7..90ecb17aa8f2 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function privateEndpointConnectionGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const privateEndpointConnectionName = "myConnection"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.privateEndpointConnections.get( resourceGroupName, registryName, - privateEndpointConnectionName + privateEndpointConnectionName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsListSample.ts index 58612ec3f6bd..f36663eb6303 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/privateEndpointConnectionsListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,20 +18,15 @@ import "dotenv/config"; */ async function privateEndpointConnectionList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.privateEndpointConnections.list( + for await (const item of client.privateEndpointConnections.list( resourceGroupName, - registryName + registryName, )) { resArray.push(item); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesCheckNameAvailabilitySample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesCheckNameAvailabilitySample.ts index 16d1f1f3ff7b..a06e16ea588f 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesCheckNameAvailabilitySample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesCheckNameAvailabilitySample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - RegistryNameCheckRequest, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { RegistryNameCheckRequest } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,20 +19,14 @@ import "dotenv/config"; */ async function registryCheckNameAvailable(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const registryNameCheckRequest: RegistryNameCheckRequest = { name: "myRegistry", - type: "Microsoft.ContainerRegistry/registries" + type: "Microsoft.ContainerRegistry/registries", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.registries.checkNameAvailability( - registryNameCheckRequest - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.registries.checkNameAvailability(registryNameCheckRequest); console.log(result); } @@ -48,20 +38,14 @@ async function registryCheckNameAvailable(): Promise { */ async function registryCheckNameNotAvailable(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const registryNameCheckRequest: RegistryNameCheckRequest = { name: "myRegistry", - type: "Microsoft.ContainerRegistry/registries" + type: "Microsoft.ContainerRegistry/registries", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.registries.checkNameAvailability( - registryNameCheckRequest - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.registries.checkNameAvailability(registryNameCheckRequest); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesCreateSample.ts index 75c50071adec..c215fd67e29f 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Registry, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { Registry } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,26 +19,21 @@ import "dotenv/config"; */ async function registryCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const registry: Registry = { adminUserEnabled: true, location: "westus", sku: { name: "Standard" }, - tags: { key: "value" } + tags: { key: "value" }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginCreateAndWait( resourceGroupName, registryName, - registry + registry, ); console.log(result); } @@ -55,26 +46,21 @@ async function registryCreate(): Promise { */ async function registryCreateZoneRedundant(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const registry: Registry = { location: "westus", sku: { name: "Standard" }, tags: { key: "value" }, - zoneRedundancy: "Enabled" + zoneRedundancy: "Enabled", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginCreateAndWait( resourceGroupName, registryName, - registry + registry, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesDeleteSample.ts index 5df7866da142..5fef56a72ab5 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,20 +18,12 @@ import "dotenv/config"; */ async function registryDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.registries.beginDeleteAndWait( - resourceGroupName, - registryName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.registries.beginDeleteAndWait(resourceGroupName, registryName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGenerateCredentialsSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGenerateCredentialsSample.ts index 3f4c3d90a52d..27b695d5b1ab 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGenerateCredentialsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGenerateCredentialsSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - GenerateCredentialsParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { GenerateCredentialsParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,25 +19,20 @@ import "dotenv/config"; */ async function registryGenerateCredentials(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const generateCredentialsParameters: GenerateCredentialsParameters = { expiry: new Date("2020-12-31T15:59:59.0707808Z"), tokenId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken" + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginGenerateCredentialsAndWait( resourceGroupName, registryName, - generateCredentialsParameters + generateCredentialsParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetBuildSourceUploadUrlSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetBuildSourceUploadUrlSample.ts index 38361a9fcf87..1700ac4d103b 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetBuildSourceUploadUrlSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetBuildSourceUploadUrlSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,20 +18,12 @@ import "dotenv/config"; */ async function registriesGetBuildSourceUploadUrl(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.registries.getBuildSourceUploadUrl( - resourceGroupName, - registryName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.registries.getBuildSourceUploadUrl(resourceGroupName, registryName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetPrivateLinkResourceSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetPrivateLinkResourceSample.ts index 76c983369826..06d02a51cc15 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetPrivateLinkResourceSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetPrivateLinkResourceSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function registryGetPrivateLinkResource(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const groupName = "registry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.getPrivateLinkResource( resourceGroupName, registryName, - groupName + groupName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetSample.ts index d1d763192fa4..d83013b69b20 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,16 +18,11 @@ import "dotenv/config"; */ async function registryGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.get(resourceGroupName, registryName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesImportImageSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesImportImageSample.ts index d79e311328c0..31d7533ac7fc 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesImportImageSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesImportImageSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ImportImageParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { ImportImageParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function importImageByManifestDigest(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const parameters: ImportImageParameters = { mode: "Force", @@ -34,20 +28,17 @@ async function importImageByManifestDigest(): Promise { resourceId: "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry", sourceImage: - "sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000" + "sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000", }, targetTags: ["targetRepository:targetTag"], - untaggedTargetRepositories: ["targetRepository1"] + untaggedTargetRepositories: ["targetRepository1"], }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginImportImageAndWait( resourceGroupName, registryName, - parameters + parameters, ); console.log(result); } @@ -60,30 +51,25 @@ async function importImageByManifestDigest(): Promise { */ async function importImageByTag(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const parameters: ImportImageParameters = { mode: "Force", source: { resourceId: "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry", - sourceImage: "sourceRepository:sourceTag" + sourceImage: "sourceRepository:sourceTag", }, targetTags: ["targetRepository:targetTag"], - untaggedTargetRepositories: ["targetRepository1"] + untaggedTargetRepositories: ["targetRepository1"], }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginImportImageAndWait( resourceGroupName, registryName, - parameters + parameters, ); console.log(result); } @@ -96,29 +82,24 @@ async function importImageByTag(): Promise { */ async function importImageFromPublicRegistry(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const parameters: ImportImageParameters = { mode: "Force", source: { registryUri: "registry.hub.docker.com", - sourceImage: "library/hello-world" + sourceImage: "library/hello-world", }, targetTags: ["targetRepository:targetTag"], - untaggedTargetRepositories: ["targetRepository1"] + untaggedTargetRepositories: ["targetRepository1"], }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginImportImageAndWait( resourceGroupName, registryName, - parameters + parameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListByResourceGroupSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListByResourceGroupSample.ts index 7c414c67e203..b9510beb3f35 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListByResourceGroupSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListByResourceGroupSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,19 +18,12 @@ import "dotenv/config"; */ async function registryListByResourceGroup(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.registries.listByResourceGroup( - resourceGroupName - )) { + for await (const item of client.registries.listByResourceGroup(resourceGroupName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListCredentialsSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListCredentialsSample.ts index cf65904aede0..d5a7645fe09f 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListCredentialsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListCredentialsSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,20 +18,12 @@ import "dotenv/config"; */ async function registryListCredentials(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.registries.listCredentials( - resourceGroupName, - registryName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.registries.listCredentials(resourceGroupName, registryName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListPrivateLinkResourcesSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListPrivateLinkResourcesSample.ts index be198302beab..db76d8dcfccd 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListPrivateLinkResourcesSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListPrivateLinkResourcesSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,20 +18,15 @@ import "dotenv/config"; */ async function registryListPrivateLinkResources(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.registries.listPrivateLinkResources( + for await (const item of client.registries.listPrivateLinkResources( resourceGroupName, - registryName + registryName, )) { resArray.push(item); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListSample.ts index 3f7366aa99bd..69c68d33f174 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,15 +18,11 @@ import "dotenv/config"; */ async function registryList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.registries.list()) { + for await (const item of client.registries.list()) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListUsagesSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListUsagesSample.ts index e27f2175a344..bf7acda4ab0c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListUsagesSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesListUsagesSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,20 +18,12 @@ import "dotenv/config"; */ async function registryListUsages(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.registries.listUsages( - resourceGroupName, - registryName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.registries.listUsages(resourceGroupName, registryName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesRegenerateCredentialSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesRegenerateCredentialSample.ts index 88f16ebde860..224686742454 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesRegenerateCredentialSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesRegenerateCredentialSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - RegenerateCredentialParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { RegenerateCredentialParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,23 +19,18 @@ import "dotenv/config"; */ async function registryRegenerateCredential(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const regenerateCredentialParameters: RegenerateCredentialParameters = { - name: "password" + name: "password", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.regenerateCredential( resourceGroupName, registryName, - regenerateCredentialParameters + regenerateCredentialParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesScheduleRunSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesScheduleRunSample.ts index dde0254a05c6..88736c034d90 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesScheduleRunSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesScheduleRunSample.ts @@ -6,15 +6,13 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { +import type { DockerBuildRequest, EncodedTaskRunRequest, FileTaskRunRequest, TaskRunRequest, - ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -26,10 +24,8 @@ import "dotenv/config"; */ async function registriesScheduleRun(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runRequest: DockerBuildRequest = { type: "DockerBuildRequest", @@ -39,8 +35,8 @@ async function registriesScheduleRun(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } + value: "mysecrettestvalue", + }, ], dockerFilePath: "DockerFile", imageNames: ["azurerest:testtag"], @@ -49,17 +45,14 @@ async function registriesScheduleRun(): Promise { noCache: true, platform: { architecture: "amd64", os: "Linux" }, sourceLocation: - "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D" + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginScheduleRunAndWait( resourceGroupName, registryName, - runRequest + runRequest, ); console.log(result); } @@ -72,10 +65,8 @@ async function registriesScheduleRun(): Promise { */ async function registriesScheduleRunEncodedTaskRun(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runRequest: EncodedTaskRunRequest = { type: "EncodedTaskRunRequest", @@ -89,19 +80,16 @@ async function registriesScheduleRunEncodedTaskRun(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } - ] + value: "mysecrettestvalue", + }, + ], }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginScheduleRunAndWait( resourceGroupName, registryName, - runRequest + runRequest, ); console.log(result); } @@ -114,10 +102,8 @@ async function registriesScheduleRunEncodedTaskRun(): Promise { */ async function registriesScheduleRunFileTaskRun(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runRequest: FileTaskRunRequest = { type: "FileTaskRunRequest", @@ -131,20 +117,17 @@ async function registriesScheduleRunFileTaskRun(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } + value: "mysecrettestvalue", + }, ], - valuesFilePath: "prod-values.yaml" + valuesFilePath: "prod-values.yaml", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginScheduleRunAndWait( resourceGroupName, registryName, - runRequest + runRequest, ); console.log(result); } @@ -157,10 +140,8 @@ async function registriesScheduleRunFileTaskRun(): Promise { */ async function registriesScheduleRunTask(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runRequest: TaskRunRequest = { type: "TaskRunRequest", @@ -170,28 +151,25 @@ async function registriesScheduleRunTask(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } + value: "mysecrettestvalue", + }, ], file: "overriddenDockerfile", target: "build", updateTriggerToken: "aGVsbG8gd29ybGQ=", values: [ { name: "mytestname", isSecret: false, value: "mytestvalue" }, - { name: "mysecrettestname", isSecret: true, value: "mysecrettestvalue" } - ] + { name: "mysecrettestname", isSecret: true, value: "mysecrettestvalue" }, + ], }, - taskId: "myTask" + taskId: "myTask", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginScheduleRunAndWait( resourceGroupName, registryName, - runRequest + runRequest, ); console.log(result); } @@ -204,10 +182,8 @@ async function registriesScheduleRunTask(): Promise { */ async function registriesScheduleRunTaskWithCustomCredentials(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runRequest: FileTaskRunRequest = { type: "FileTaskRunRequest", @@ -215,10 +191,10 @@ async function registriesScheduleRunTaskWithCustomCredentials(): Promise { customRegistries: { myregistryAzurecrIo: { password: { type: "Opaque", value: "***" }, - userName: { type: "Opaque", value: "reg1" } - } + userName: { type: "Opaque", value: "reg1" }, + }, }, - sourceRegistry: { loginMode: "Default" } + sourceRegistry: { loginMode: "Default" }, }, platform: { os: "Linux" }, taskFilePath: "acb.yaml", @@ -227,19 +203,16 @@ async function registriesScheduleRunTaskWithCustomCredentials(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } - ] + value: "mysecrettestvalue", + }, + ], }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginScheduleRunAndWait( resourceGroupName, registryName, - runRequest + runRequest, ); console.log(result); } @@ -252,10 +225,8 @@ async function registriesScheduleRunTaskWithCustomCredentials(): Promise { */ async function registriesScheduleRunWithCustomCredentials(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runRequest: DockerBuildRequest = { type: "DockerBuildRequest", @@ -265,21 +236,21 @@ async function registriesScheduleRunWithCustomCredentials(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } + value: "mysecrettestvalue", + }, ], credentials: { customRegistries: { myregistryAzurecrIo: { password: { type: "Opaque", value: "***" }, - userName: { type: "Opaque", value: "reg1" } + userName: { type: "Opaque", value: "reg1" }, }, myregistry2AzurecrIo: { password: { type: "Opaque", value: "***" }, - userName: { type: "Opaque", value: "reg2" } - } + userName: { type: "Opaque", value: "reg2" }, + }, }, - sourceRegistry: { loginMode: "Default" } + sourceRegistry: { loginMode: "Default" }, }, dockerFilePath: "DockerFile", imageNames: ["azurerest:testtag"], @@ -289,17 +260,14 @@ async function registriesScheduleRunWithCustomCredentials(): Promise { platform: { architecture: "amd64", os: "Linux" }, sourceLocation: "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D", - target: "stage1" + target: "stage1", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginScheduleRunAndWait( resourceGroupName, registryName, - runRequest + runRequest, ); console.log(result); } @@ -312,10 +280,8 @@ async function registriesScheduleRunWithCustomCredentials(): Promise { */ async function registriesScheduleRunWithLogTemplate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runRequest: DockerBuildRequest = { type: "DockerBuildRequest", @@ -325,8 +291,8 @@ async function registriesScheduleRunWithLogTemplate(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } + value: "mysecrettestvalue", + }, ], dockerFilePath: "DockerFile", imageNames: ["azurerest:testtag"], @@ -336,17 +302,14 @@ async function registriesScheduleRunWithLogTemplate(): Promise { noCache: true, platform: { architecture: "amd64", os: "Linux" }, sourceLocation: - "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D" + "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginScheduleRunAndWait( resourceGroupName, registryName, - runRequest + runRequest, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesUpdateSample.ts index cc609e143a2f..1a2e0fff4fe1 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/registriesUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/registriesUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - RegistryUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { RegistryUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,25 +19,20 @@ import "dotenv/config"; */ async function registryUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const registryUpdateParameters: RegistryUpdateParameters = { adminUserEnabled: true, sku: { name: "Standard" }, - tags: { key: "value" } + tags: { key: "value" }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.registries.beginUpdateAndWait( resourceGroupName, registryName, - registryUpdateParameters + registryUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsCreateSample.ts index 457453356859..bca4d407cccc 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Replication, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { Replication } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,26 +19,21 @@ import "dotenv/config"; */ async function replicationCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const replicationName = "myReplication"; const replication: Replication = { location: "eastus", - tags: { key: "value" } + tags: { key: "value" }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.replications.beginCreateAndWait( resourceGroupName, registryName, replicationName, - replication + replication, ); console.log(result); } @@ -55,28 +46,23 @@ async function replicationCreate(): Promise { */ async function replicationCreateZoneRedundant(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const replicationName = "myReplication"; const replication: Replication = { location: "eastus", regionEndpointEnabled: true, tags: { key: "value" }, - zoneRedundancy: "Enabled" + zoneRedundancy: "Enabled", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.replications.beginCreateAndWait( resourceGroupName, registryName, replicationName, - replication + replication, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsDeleteSample.ts index d4dc1a56ddf9..491460a18104 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function replicationDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const replicationName = "myReplication"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.replications.beginDeleteAndWait( resourceGroupName, registryName, - replicationName + replicationName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsGetSample.ts index a2f156f818c1..21349f468e38 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function replicationGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const replicationName = "myReplication"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.replications.get( - resourceGroupName, - registryName, - replicationName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.replications.get(resourceGroupName, registryName, replicationName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsListSample.ts index e8e87d202a7e..99b8477612c8 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function replicationList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.replications.list( - resourceGroupName, - registryName - )) { + for await (const item of client.replications.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsUpdateSample.ts index abe7260c6b75..2210785fdcf1 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/replicationsUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ReplicationUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { ReplicationUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,25 +19,20 @@ import "dotenv/config"; */ async function replicationUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const replicationName = "myReplication"; const replicationUpdateParameters: ReplicationUpdateParameters = { - tags: { key: "value" } + tags: { key: "value" }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.replications.beginUpdateAndWait( resourceGroupName, registryName, replicationName, - replicationUpdateParameters + replicationUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/runsCancelSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/runsCancelSample.ts index 30dbf426b3a3..9ce831db9557 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/runsCancelSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/runsCancelSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function runsCancel(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runId = "0accec26-d6de-4757-8e74-d080f38eaaab"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.runs.beginCancelAndWait( - resourceGroupName, - registryName, - runId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.runs.beginCancelAndWait(resourceGroupName, registryName, runId); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/runsGetLogSasUrlSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/runsGetLogSasUrlSample.ts index 222696ca0f28..8e10051a7279 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/runsGetLogSasUrlSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/runsGetLogSasUrlSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function runsGetLogSasUrl(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runId = "0accec26-d6de-4757-8e74-d080f38eaaab"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.runs.getLogSasUrl( - resourceGroupName, - registryName, - runId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.runs.getLogSasUrl(resourceGroupName, registryName, runId); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/runsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/runsGetSample.ts index 35b1041ce616..cf6265d24a85 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/runsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/runsGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,17 +18,12 @@ import "dotenv/config"; */ async function runsGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runId = "0accec26-d6de-4757-8e74-d080f38eaaab"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.runs.get(resourceGroupName, registryName, runId); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/runsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/runsListSample.ts index 011baf694eaa..49281f285828 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/runsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/runsListSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - RunsListOptionalParams, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { RunsListOptionalParams } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,25 +19,16 @@ import "dotenv/config"; */ async function runsList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const filter = ""; const top = 10; const options: RunsListOptionalParams = { filter, top }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.runs.list( - resourceGroupName, - registryName, - options - )) { + for await (const item of client.runs.list(resourceGroupName, registryName, options)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/runsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/runsUpdateSample.ts index 1b45a87a18f4..c6425e2c9cfc 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/runsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/runsUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - RunUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { RunUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,23 +19,18 @@ import "dotenv/config"; */ async function runsUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const runId = "0accec26-d6de-4757-8e74-d080f38eaaab"; const runUpdateParameters: RunUpdateParameters = { isArchiveEnabled: true }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.runs.beginUpdateAndWait( resourceGroupName, registryName, runId, - runUpdateParameters + runUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsCreateSample.ts index c3ee897f5d67..2141555be4ca 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopeMap, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { ScopeMap } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,29 +19,21 @@ import "dotenv/config"; */ async function scopeMapCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const scopeMapName = "myScopeMap"; const scopeMapCreateParameters: ScopeMap = { description: "Developer Scopes", - actions: [ - "repositories/myrepository/contentWrite", - "repositories/myrepository/delete" - ] + actions: ["repositories/myrepository/contentWrite", "repositories/myrepository/delete"], }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.scopeMaps.beginCreateAndWait( resourceGroupName, registryName, scopeMapName, - scopeMapCreateParameters + scopeMapCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsDeleteSample.ts index f773c91f0458..9b15e22186b4 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function scopeMapDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const scopeMapName = "myScopeMap"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.scopeMaps.beginDeleteAndWait( resourceGroupName, registryName, - scopeMapName + scopeMapName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsGetSample.ts index 11ca1c9dfcbd..d0863a9d7563 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function scopeMapGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const scopeMapName = "myScopeMap"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.scopeMaps.get( - resourceGroupName, - registryName, - scopeMapName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.scopeMaps.get(resourceGroupName, registryName, scopeMapName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsListSample.ts index 4e190839880f..2a69feba4d53 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function scopeMapList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.scopeMaps.list( - resourceGroupName, - registryName - )) { + for await (const item of client.scopeMaps.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsUpdateSample.ts index 7584f3f28a34..5180281e0f57 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/scopeMapsUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ScopeMapUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { ScopeMapUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,29 +19,21 @@ import "dotenv/config"; */ async function scopeMapUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const scopeMapName = "myScopeMap"; const scopeMapUpdateParameters: ScopeMapUpdateParameters = { description: "Developer Scopes", - actions: [ - "repositories/myrepository/contentWrite", - "repositories/myrepository/contentRead" - ] + actions: ["repositories/myrepository/contentWrite", "repositories/myrepository/contentRead"], }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.scopeMaps.beginUpdateAndWait( resourceGroupName, registryName, scopeMapName, - scopeMapUpdateParameters + scopeMapUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsCreateSample.ts index 6ab5fbce73ae..5e63b08b7a1e 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TaskRun, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { TaskRun } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function taskRunsCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskRunName = "myRun"; const taskRun: TaskRun = { @@ -34,24 +28,19 @@ async function taskRunsCreate(): Promise { runRequest: { type: "EncodedTaskRunRequest", credentials: {}, - encodedTaskContent: - "c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K", - encodedValuesContent: - "Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg==", + encodedTaskContent: "c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K", + encodedValuesContent: "Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg==", platform: { architecture: "amd64", os: "Linux" }, - values: [] - } + values: [], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.taskRuns.beginCreateAndWait( resourceGroupName, registryName, taskRunName, - taskRun + taskRun, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsDeleteSample.ts index cf6a647bc672..7a402df20ef6 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function taskRunsDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskRunName = "myRun"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.taskRuns.beginDeleteAndWait( resourceGroupName, registryName, - taskRunName + taskRunName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsGetDetailsSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsGetDetailsSample.ts index 8d285ab075dd..48009c8ae901 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsGetDetailsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsGetDetailsSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function taskRunsGetDetails(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskRunName = "myRun"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.taskRuns.getDetails( - resourceGroupName, - registryName, - taskRunName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.taskRuns.getDetails(resourceGroupName, registryName, taskRunName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsGetSample.ts index 745dca01c966..49942ead1c83 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function taskRunsGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskRunName = "myRun"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.taskRuns.get( - resourceGroupName, - registryName, - taskRunName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.taskRuns.get(resourceGroupName, registryName, taskRunName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsListSample.ts index 44c709fb0547..921a76b919b5 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function taskRunsList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.taskRuns.list( - resourceGroupName, - registryName - )) { + for await (const item of client.taskRuns.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsUpdateSample.ts index 48223dd3a6d4..23c8c8c215fb 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/taskRunsUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TaskRunUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { TaskRunUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function taskRunsUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskRunName = "myRun"; const updateParameters: TaskRunUpdateParameters = { @@ -34,25 +28,20 @@ async function taskRunsUpdate(): Promise { runRequest: { type: "EncodedTaskRunRequest", credentials: {}, - encodedTaskContent: - "c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K", - encodedValuesContent: - "Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg==", + encodedTaskContent: "c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K", + encodedValuesContent: "Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg==", isArchiveEnabled: true, platform: { architecture: "amd64", os: "Linux" }, - values: [] - } + values: [], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.taskRuns.beginUpdateAndWait( resourceGroupName, registryName, taskRunName, - updateParameters + updateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksCreateSample.ts index dd8868f3d558..01f892bb089d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Task, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { Task } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function tasksCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "mytTask"; const taskCreateParameters: Task = { @@ -44,14 +38,14 @@ async function tasksCreate(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } + value: "mysecrettestvalue", + }, ], contextPath: "src", dockerFilePath: "src/DockerFile", imageNames: ["azurerest:testtag"], isPushEnabled: true, - noCache: false + noCache: false, }, tags: { testkey: "value" }, trigger: { @@ -59,7 +53,7 @@ async function tasksCreate(): Promise { name: "myBaseImageTrigger", baseImageTriggerType: "Runtime", updateTriggerEndpoint: "https://user:pass@mycicd.webhook.com?token=foo", - updateTriggerPayloadType: "Token" + updateTriggerPayloadType: "Token", }, sourceTriggers: [ { @@ -68,24 +62,21 @@ async function tasksCreate(): Promise { branch: "master", repositoryUrl: "https://github.com/Azure/azure-rest-api-specs", sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" }, - sourceControlType: "Github" + sourceControlType: "Github", }, - sourceTriggerEvents: ["commit"] - } + sourceTriggerEvents: ["commit"], + }, ], - timerTriggers: [{ name: "myTimerTrigger", schedule: "30 9 * * 1-5" }] - } + timerTriggers: [{ name: "myTimerTrigger", schedule: "30 9 * * 1-5" }], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginCreateAndWait( resourceGroupName, registryName, taskName, - taskCreateParameters + taskCreateParameters, ); console.log(result); } @@ -98,10 +89,8 @@ async function tasksCreate(): Promise { */ async function tasksCreateQuickTask(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "quicktask"; const taskCreateParameters: Task = { @@ -110,18 +99,15 @@ async function tasksCreateQuickTask(): Promise { location: "eastus", logTemplate: "acr/tasks:{{.Run.OS}}", status: "Enabled", - tags: { testkey: "value" } + tags: { testkey: "value" }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginCreateAndWait( resourceGroupName, registryName, taskName, - taskCreateParameters + taskCreateParameters, ); console.log(result); } @@ -134,10 +120,8 @@ async function tasksCreateQuickTask(): Promise { */ async function tasksCreateWithSystemAndUserIdentities(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "mytTask"; const taskCreateParameters: Task = { @@ -145,8 +129,9 @@ async function tasksCreateWithSystemAndUserIdentities(): Promise { identity: { type: "SystemAssigned, UserAssigned", userAssignedIdentities: { - "/subscriptions/f9d7ebedAdbd4cb4B973Aaf82c136138/resourcegroups/myResourceGroup1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity2": {} - } + "/subscriptions/f9d7ebedAdbd4cb4B973Aaf82c136138/resourcegroups/myResourceGroup1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity2": + {}, + }, }, isSystemTask: false, location: "eastus", @@ -160,14 +145,14 @@ async function tasksCreateWithSystemAndUserIdentities(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } + value: "mysecrettestvalue", + }, ], contextPath: "src", dockerFilePath: "src/DockerFile", imageNames: ["azurerest:testtag"], isPushEnabled: true, - noCache: false + noCache: false, }, tags: { testkey: "value" }, trigger: { @@ -175,7 +160,7 @@ async function tasksCreateWithSystemAndUserIdentities(): Promise { name: "myBaseImageTrigger", baseImageTriggerType: "Runtime", updateTriggerEndpoint: "https://user:pass@mycicd.webhook.com?token=foo", - updateTriggerPayloadType: "Default" + updateTriggerPayloadType: "Default", }, sourceTriggers: [ { @@ -184,24 +169,21 @@ async function tasksCreateWithSystemAndUserIdentities(): Promise { branch: "master", repositoryUrl: "https://github.com/Azure/azure-rest-api-specs", sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" }, - sourceControlType: "Github" + sourceControlType: "Github", }, - sourceTriggerEvents: ["commit"] - } + sourceTriggerEvents: ["commit"], + }, ], - timerTriggers: [{ name: "myTimerTrigger", schedule: "30 9 * * 1-5" }] - } + timerTriggers: [{ name: "myTimerTrigger", schedule: "30 9 * * 1-5" }], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginCreateAndWait( resourceGroupName, registryName, taskName, - taskCreateParameters + taskCreateParameters, ); console.log(result); } @@ -214,10 +196,8 @@ async function tasksCreateWithSystemAndUserIdentities(): Promise { */ async function tasksCreateWithUserIdentities(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "mytTask"; const taskCreateParameters: Task = { @@ -225,9 +205,11 @@ async function tasksCreateWithUserIdentities(): Promise { identity: { type: "UserAssigned", userAssignedIdentities: { - "/subscriptions/f9d7ebedAdbd4cb4B973Aaf82c136138/resourcegroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {}, - "/subscriptions/f9d7ebedAdbd4cb4B973Aaf82c136138/resourcegroups/myResourceGroup1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity2": {} - } + "/subscriptions/f9d7ebedAdbd4cb4B973Aaf82c136138/resourcegroups/myResourceGroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + "/subscriptions/f9d7ebedAdbd4cb4B973Aaf82c136138/resourcegroups/myResourceGroup1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity2": + {}, + }, }, isSystemTask: false, location: "eastus", @@ -241,14 +223,14 @@ async function tasksCreateWithUserIdentities(): Promise { { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } + value: "mysecrettestvalue", + }, ], contextPath: "src", dockerFilePath: "src/DockerFile", imageNames: ["azurerest:testtag"], isPushEnabled: true, - noCache: false + noCache: false, }, tags: { testkey: "value" }, trigger: { @@ -256,7 +238,7 @@ async function tasksCreateWithUserIdentities(): Promise { name: "myBaseImageTrigger", baseImageTriggerType: "Runtime", updateTriggerEndpoint: "https://user:pass@mycicd.webhook.com?token=foo", - updateTriggerPayloadType: "Default" + updateTriggerPayloadType: "Default", }, sourceTriggers: [ { @@ -265,24 +247,21 @@ async function tasksCreateWithUserIdentities(): Promise { branch: "master", repositoryUrl: "https://github.com/Azure/azure-rest-api-specs", sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" }, - sourceControlType: "Github" + sourceControlType: "Github", }, - sourceTriggerEvents: ["commit"] - } + sourceTriggerEvents: ["commit"], + }, ], - timerTriggers: [{ name: "myTimerTrigger", schedule: "30 9 * * 1-5" }] - } + timerTriggers: [{ name: "myTimerTrigger", schedule: "30 9 * * 1-5" }], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginCreateAndWait( resourceGroupName, registryName, taskName, - taskCreateParameters + taskCreateParameters, ); console.log(result); } @@ -295,10 +274,8 @@ async function tasksCreateWithUserIdentities(): Promise { */ async function tasksCreateWithUserIdentitiesWithSystemIdentity(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "mytTask"; const taskCreateParameters: Task = { @@ -316,20 +293,20 @@ async function tasksCreateWithUserIdentitiesWithSystemIdentity(): Promise { name: "mysecrettestargument", isSecret: true, - value: "mysecrettestvalue" - } + value: "mysecrettestvalue", + }, ], contextPath: "src", dockerFilePath: "src/DockerFile", imageNames: ["azurerest:testtag"], isPushEnabled: true, - noCache: false + noCache: false, }, tags: { testkey: "value" }, trigger: { baseImageTrigger: { name: "myBaseImageTrigger", - baseImageTriggerType: "Runtime" + baseImageTriggerType: "Runtime", }, sourceTriggers: [ { @@ -338,24 +315,21 @@ async function tasksCreateWithUserIdentitiesWithSystemIdentity(): Promise branch: "master", repositoryUrl: "https://github.com/Azure/azure-rest-api-specs", sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" }, - sourceControlType: "Github" + sourceControlType: "Github", }, - sourceTriggerEvents: ["commit"] - } + sourceTriggerEvents: ["commit"], + }, ], - timerTriggers: [{ name: "myTimerTrigger", schedule: "30 9 * * 1-5" }] - } + timerTriggers: [{ name: "myTimerTrigger", schedule: "30 9 * * 1-5" }], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginCreateAndWait( resourceGroupName, registryName, taskName, - taskCreateParameters + taskCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksDeleteSample.ts index 8a08be56da80..92d3f3acdd1d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function tasksDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "myTask"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.tasks.beginDeleteAndWait( - resourceGroupName, - registryName, - taskName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.tasks.beginDeleteAndWait(resourceGroupName, registryName, taskName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksGetDetailsSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksGetDetailsSample.ts index 27815418969e..daf4d9972fa8 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksGetDetailsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksGetDetailsSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function tasksGetDetails(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "myTask"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.tasks.getDetails( - resourceGroupName, - registryName, - taskName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.tasks.getDetails(resourceGroupName, registryName, taskName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksGetSample.ts index f8eaf9c43ab5..237a3350942c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function tasksGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "myTask"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.tasks.get( - resourceGroupName, - registryName, - taskName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.tasks.get(resourceGroupName, registryName, taskName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksListSample.ts index 30ecca07a535..de227243f7da 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,18 +18,13 @@ import "dotenv/config"; */ async function tasksList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.tasks.list(resourceGroupName, registryName)) { + for await (const item of client.tasks.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksUpdateSample.ts index 80746ed18627..9082f47e37e8 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tasksUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tasksUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TaskUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { TaskUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function tasksUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "myTask"; const taskUpdateParameters: TaskUpdateParameters = { @@ -37,18 +31,18 @@ async function tasksUpdate(): Promise { identity: "[system]", password: { type: "Vaultsecret", - value: "https://myacbvault.vault.azure.net/secrets/password" + value: "https://myacbvault.vault.azure.net/secrets/password", }, - userName: { type: "Opaque", value: "username" } - } - } + userName: { type: "Opaque", value: "username" }, + }, + }, }, logTemplate: "acr/tasks:{{.Run.OS}}", status: "Enabled", step: { type: "Docker", dockerFilePath: "src/DockerFile", - imageNames: ["azurerest:testtag1"] + imageNames: ["azurerest:testtag1"], }, tags: { testkey: "value" }, trigger: { @@ -56,23 +50,20 @@ async function tasksUpdate(): Promise { { name: "mySourceTrigger", sourceRepository: { - sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" } + sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" }, }, - sourceTriggerEvents: ["commit"] - } - ] - } + sourceTriggerEvents: ["commit"], + }, + ], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginUpdateAndWait( resourceGroupName, registryName, taskName, - taskUpdateParameters + taskUpdateParameters, ); console.log(result); } @@ -85,27 +76,22 @@ async function tasksUpdate(): Promise { */ async function tasksUpdateQuickTask(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "quicktask"; const taskUpdateParameters: TaskUpdateParameters = { logTemplate: "acr/tasks:{{.Run.OS}}", status: "Enabled", - tags: { testkey: "value" } + tags: { testkey: "value" }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginUpdateAndWait( resourceGroupName, registryName, taskName, - taskUpdateParameters + taskUpdateParameters, ); console.log(result); } @@ -118,10 +104,8 @@ async function tasksUpdateQuickTask(): Promise { */ async function tasksUpdateWithKeyVaultCustomCredentials(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "myTask"; const taskUpdateParameters: TaskUpdateParameters = { @@ -132,21 +116,21 @@ async function tasksUpdateWithKeyVaultCustomCredentials(): Promise { identity: "[system]", password: { type: "Vaultsecret", - value: "https://myacbvault.vault.azure.net/secrets/password" + value: "https://myacbvault.vault.azure.net/secrets/password", }, userName: { type: "Vaultsecret", - value: "https://myacbvault.vault.azure.net/secrets/username" - } - } - } + value: "https://myacbvault.vault.azure.net/secrets/username", + }, + }, + }, }, logTemplate: undefined, status: "Enabled", step: { type: "Docker", dockerFilePath: "src/DockerFile", - imageNames: ["azurerest:testtag1"] + imageNames: ["azurerest:testtag1"], }, tags: { testkey: "value" }, trigger: { @@ -154,23 +138,20 @@ async function tasksUpdateWithKeyVaultCustomCredentials(): Promise { { name: "mySourceTrigger", sourceRepository: { - sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" } + sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" }, }, - sourceTriggerEvents: ["commit"] - } - ] - } + sourceTriggerEvents: ["commit"], + }, + ], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginUpdateAndWait( resourceGroupName, registryName, taskName, - taskUpdateParameters + taskUpdateParameters, ); console.log(result); } @@ -183,23 +164,21 @@ async function tasksUpdateWithKeyVaultCustomCredentials(): Promise { */ async function tasksUpdateWithMsiCustomCredentials(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "myTask"; const taskUpdateParameters: TaskUpdateParameters = { agentConfiguration: { cpu: 3 }, credentials: { - customRegistries: { myregistryAzurecrIo: { identity: "[system]" } } + customRegistries: { myregistryAzurecrIo: { identity: "[system]" } }, }, logTemplate: undefined, status: "Enabled", step: { type: "Docker", dockerFilePath: "src/DockerFile", - imageNames: ["azurerest:testtag1"] + imageNames: ["azurerest:testtag1"], }, tags: { testkey: "value" }, trigger: { @@ -207,23 +186,20 @@ async function tasksUpdateWithMsiCustomCredentials(): Promise { { name: "mySourceTrigger", sourceRepository: { - sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" } + sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" }, }, - sourceTriggerEvents: ["commit"] - } - ] - } + sourceTriggerEvents: ["commit"], + }, + ], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginUpdateAndWait( resourceGroupName, registryName, taskName, - taskUpdateParameters + taskUpdateParameters, ); console.log(result); } @@ -236,10 +212,8 @@ async function tasksUpdateWithMsiCustomCredentials(): Promise { */ async function tasksUpdateWithOpaqueCustomCredentials(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "4385cf00-2d3a-425a-832f-f4285b1c9dce"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const taskName = "myTask"; const taskUpdateParameters: TaskUpdateParameters = { @@ -248,16 +222,16 @@ async function tasksUpdateWithOpaqueCustomCredentials(): Promise { customRegistries: { myregistryAzurecrIo: { password: { type: "Opaque", value: "***" }, - userName: { type: "Opaque", value: "username" } - } - } + userName: { type: "Opaque", value: "username" }, + }, + }, }, logTemplate: undefined, status: "Enabled", step: { type: "Docker", dockerFilePath: "src/DockerFile", - imageNames: ["azurerest:testtag1"] + imageNames: ["azurerest:testtag1"], }, tags: { testkey: "value" }, trigger: { @@ -265,23 +239,20 @@ async function tasksUpdateWithOpaqueCustomCredentials(): Promise { { name: "mySourceTrigger", sourceRepository: { - sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" } + sourceControlAuthProperties: { token: "xxxxx", tokenType: "PAT" }, }, - sourceTriggerEvents: ["commit"] - } - ] - } + sourceTriggerEvents: ["commit"], + }, + ], + }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tasks.beginUpdateAndWait( resourceGroupName, registryName, taskName, - taskUpdateParameters + taskUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensCreateSample.ts index 106ccf3644c8..b9529ed21127 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Token, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { Token } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function tokenCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const tokenName = "myToken"; const tokenCreateParameters: Token = { @@ -35,24 +29,21 @@ async function tokenCreate(): Promise { { name: "certificate1", encodedPemCertificate: - "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==" - } - ] + "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==", + }, + ], }, scopeMapId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap", - status: "disabled" + status: "disabled", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tokens.beginCreateAndWait( resourceGroupName, registryName, tokenName, - tokenCreateParameters + tokenCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensDeleteSample.ts index a4fe1501db5c..56ae3fa1f189 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function tokenDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const tokenName = "myToken"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.tokens.beginDeleteAndWait( - resourceGroupName, - registryName, - tokenName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.tokens.beginDeleteAndWait(resourceGroupName, registryName, tokenName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensGetSample.ts index 272962aa33be..a13e78932bc0 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function tokenGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const tokenName = "myToken"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.tokens.get( - resourceGroupName, - registryName, - tokenName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.tokens.get(resourceGroupName, registryName, tokenName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensListSample.ts index 76f1b0d97193..4884baf0d90e 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,18 +18,13 @@ import "dotenv/config"; */ async function tokenList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.tokens.list(resourceGroupName, registryName)) { + for await (const item of client.tokens.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensUpdateSample.ts index 897622341c3a..d97ae4e1cf67 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/tokensUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/tokensUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TokenUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { TokenUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function tokenUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const tokenName = "myToken"; const tokenUpdateParameters: TokenUpdateParameters = { @@ -35,23 +29,20 @@ async function tokenUpdate(): Promise { { name: "certificate1", encodedPemCertificate: - "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==" - } - ] + "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==", + }, + ], }, scopeMapId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap" + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap", }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.tokens.beginUpdateAndWait( resourceGroupName, registryName, tokenName, - tokenUpdateParameters + tokenUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksCreateSample.ts index cd6be6cc1333..6828bf20193c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksCreateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - WebhookCreateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { WebhookCreateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function webhookCreate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const webhookName = "myWebhook"; const webhookCreateParameters: WebhookCreateParameters = { @@ -36,18 +30,15 @@ async function webhookCreate(): Promise { scope: "myRepository", serviceUri: "http://myservice.com", status: "enabled", - tags: { key: "value" } + tags: { key: "value" }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.webhooks.beginCreateAndWait( resourceGroupName, registryName, webhookName, - webhookCreateParameters + webhookCreateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksDeleteSample.ts index ccbf60bc0593..50b6a64a4c27 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksDeleteSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function webhookDelete(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const webhookName = "myWebhook"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.webhooks.beginDeleteAndWait( resourceGroupName, registryName, - webhookName + webhookName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksGetCallbackConfigSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksGetCallbackConfigSample.ts index a23ab6a63ba9..a8fc5402350b 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksGetCallbackConfigSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksGetCallbackConfigSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,16 @@ import "dotenv/config"; */ async function webhookGetCallbackConfig(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const webhookName = "myWebhook"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.webhooks.getCallbackConfig( resourceGroupName, registryName, - webhookName + webhookName, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksGetSample.ts index ed664eaff031..f0fc293f2aba 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksGetSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function webhookGet(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const webhookName = "myWebhook"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.webhooks.get( - resourceGroupName, - registryName, - webhookName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.webhooks.get(resourceGroupName, registryName, webhookName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksListEventsSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksListEventsSample.ts index b4cf13cc6e7b..1fdbd45ac237 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksListEventsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksListEventsSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,17 @@ import "dotenv/config"; */ async function webhookListEvents(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const webhookName = "myWebhook"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.webhooks.listEvents( + for await (const item of client.webhooks.listEvents( resourceGroupName, registryName, - webhookName + webhookName, )) { resArray.push(item); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksListSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksListSample.ts index e9b6ec3f8a9c..35eb3407c9fd 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksListSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,21 +18,13 @@ import "dotenv/config"; */ async function webhookList(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (let item of client.webhooks.list( - resourceGroupName, - registryName - )) { + for await (const item of client.webhooks.list(resourceGroupName, registryName)) { resArray.push(item); } console.log(resArray); diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksPingSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksPingSample.ts index 10bfff879a00..fd4e087667a3 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksPingSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksPingSample.ts @@ -6,8 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -20,22 +18,13 @@ import "dotenv/config"; */ async function webhookPing(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const webhookName = "myWebhook"; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); - const result = await client.webhooks.ping( - resourceGroupName, - registryName, - webhookName - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + const result = await client.webhooks.ping(resourceGroupName, registryName, webhookName); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksUpdateSample.ts index 72a71e789660..9e117d5864ca 100644 --- a/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples-dev/webhooksUpdateSample.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - WebhookUpdateParameters, - ContainerRegistryManagementClient -} from "@azure/arm-containerregistry"; +import type { WebhookUpdateParameters } from "@azure/arm-containerregistry"; +import { ContainerRegistryManagementClient } from "@azure/arm-containerregistry"; import { DefaultAzureCredential } from "@azure/identity"; import "dotenv/config"; @@ -23,10 +19,8 @@ import "dotenv/config"; */ async function webhookUpdate(): Promise { const subscriptionId = - process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; + process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup"; const registryName = "myRegistry"; const webhookName = "myWebhook"; const webhookUpdateParameters: WebhookUpdateParameters = { @@ -35,18 +29,15 @@ async function webhookUpdate(): Promise { scope: "myRepository", serviceUri: "http://myservice.com", status: "enabled", - tags: { key: "value" } + tags: { key: "value" }, }; const credential = new DefaultAzureCredential(); - const client = new ContainerRegistryManagementClient( - credential, - subscriptionId - ); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); const result = await client.webhooks.beginUpdateAndWait( resourceGroupName, registryName, webhookName, - webhookUpdateParameters + webhookUpdateParameters, ); console.log(result); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsCreateSample.ts index 9191268f42b4..3120bffc146a 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates an agent pool for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsCreate.json */ -async function agentPoolsCreate() { +async function agentPoolsCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -50,7 +50,7 @@ async function agentPoolsCreate() { console.log(result); } -async function main() { +async function main(): Promise { agentPoolsCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsDeleteSample.ts index edffacc2c75d..03677c25f168 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a specified agent pool resource. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsDelete.json */ -async function agentPoolsDelete() { +async function agentPoolsDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function agentPoolsDelete() { console.log(result); } -async function main() { +async function main(): Promise { agentPoolsDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsGetQueueStatusSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsGetQueueStatusSample.ts index f35564d959f6..8f986b708638 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsGetQueueStatusSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsGetQueueStatusSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the count of queued runs for a given agent pool. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGetQueueStatus.json */ -async function agentPoolsGetQueueStatus() { +async function agentPoolsGetQueueStatus(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function agentPoolsGetQueueStatus() { console.log(result); } -async function main() { +async function main(): Promise { agentPoolsGetQueueStatus(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsGetSample.ts index 739acb856e90..5a3f09cd8340 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the detailed information for a given agent pool. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json */ -async function agentPoolsGet() { +async function agentPoolsGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function agentPoolsGet() { console.log(result); } -async function main() { +async function main(): Promise { agentPoolsGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsListSample.ts index c6c33faf0fc0..d021b56e86ff 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the agent pools for a specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsList.json */ -async function agentPoolsList() { +async function agentPoolsList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -40,7 +40,7 @@ async function agentPoolsList() { console.log(resArray); } -async function main() { +async function main(): Promise { agentPoolsList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsUpdateSample.ts index fe2b155b3e7a..d45178497b6d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/agentPoolsUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates an agent pool with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsUpdate.json */ -async function agentPoolsUpdate() { +async function agentPoolsUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -44,7 +44,7 @@ async function agentPoolsUpdate() { console.log(result); } -async function main() { +async function main(): Promise { agentPoolsUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsCreateSample.ts index 1ae6c0c3ca4a..213a33df4337 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsCreateSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Creates a archive for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionCreate.json */ -async function archiveVersionCreate() { +async function archiveVersionCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -43,7 +43,7 @@ async function archiveVersionCreate() { console.log(result); } -async function main() { +async function main(): Promise { archiveVersionCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsDeleteSample.ts index 429f14cc3401..4d895f15c36e 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a archive version from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionDelete.json */ -async function archiveVersionDelete() { +async function archiveVersionDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -43,7 +43,7 @@ async function archiveVersionDelete() { console.log(result); } -async function main() { +async function main(): Promise { archiveVersionDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsGetSample.ts index 21e688b8a485..5ec05bdf7db6 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the archive version. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionGet.json */ -async function archiveVersionGet() { +async function archiveVersionGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -43,7 +43,7 @@ async function archiveVersionGet() { console.log(result); } -async function main() { +async function main(): Promise { archiveVersionGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsListSample.ts index 067afe56387a..b0ab3e9cf143 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archiveVersionsListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all archive versions for the specified container registry, repository type and archive name. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionList.json */ -async function archiveVersionList() { +async function archiveVersionList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -44,7 +44,7 @@ async function archiveVersionList() { console.log(resArray); } -async function main() { +async function main(): Promise { archiveVersionList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesCreateSample.ts index e10e39c2bddc..ed29f677f4f7 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a archive for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveCreate.json */ -async function archiveCreate() { +async function archiveCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -50,7 +50,7 @@ async function archiveCreate() { console.log(result); } -async function main() { +async function main(): Promise { archiveCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesDeleteSample.ts index 843692296dd7..ce9763faf66c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a archive from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveDelete.json */ -async function archiveDelete() { +async function archiveDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -41,7 +41,7 @@ async function archiveDelete() { console.log(result); } -async function main() { +async function main(): Promise { archiveDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesGetSample.ts index 7583068b1cfc..a223d2e94534 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the archive. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveGet.json */ -async function archiveGet() { +async function archiveGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -41,7 +41,7 @@ async function archiveGet() { console.log(result); } -async function main() { +async function main(): Promise { archiveGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesListSample.ts index 17cbcc28ea24..c4b50437dd5e 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all archives for the specified container registry and package type. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveList.json */ -async function archiveList() { +async function archiveList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -42,7 +42,7 @@ async function archiveList() { console.log(resArray); } -async function main() { +async function main(): Promise { archiveList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesUpdateSample.ts index 2d0c483d5157..faf972317a03 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/archivesUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a archive for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveUpdate.json */ -async function archiveUpdate() { +async function archiveUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -48,7 +48,7 @@ async function archiveUpdate() { console.log(result); } -async function main() { +async function main(): Promise { archiveUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesCreateSample.ts index fab43c09f432..daacd9e38333 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a cache rule for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleCreate.json */ -async function cacheRuleCreate() { +async function cacheRuleCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -49,7 +49,7 @@ async function cacheRuleCreate() { console.log(result); } -async function main() { +async function main(): Promise { cacheRuleCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesDeleteSample.ts index 1ba3ca315ab7..fb98303f7e81 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a cache rule resource from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleDelete.json */ -async function cacheRuleDelete() { +async function cacheRuleDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function cacheRuleDelete() { console.log(result); } -async function main() { +async function main(): Promise { cacheRuleDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesGetSample.ts index 797cac9a8812..b1d9db75c89c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the specified cache rule resource. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleGet.json */ -async function cacheRuleGet() { +async function cacheRuleGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function cacheRuleGet() { console.log(result); } -async function main() { +async function main(): Promise { cacheRuleGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesListSample.ts index 9335869d8001..b06acb0295e6 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all cache rule resources for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleList.json */ -async function cacheRuleList() { +async function cacheRuleList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function cacheRuleList() { console.log(resArray); } -async function main() { +async function main(): Promise { cacheRuleList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesUpdateSample.ts index ddab9e5c3b8b..ed4fa3bf22ac 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/cacheRulesUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a cache rule for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleUpdate.json */ -async function cacheRuleUpdate() { +async function cacheRuleUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -47,7 +47,7 @@ async function cacheRuleUpdate() { console.log(result); } -async function main() { +async function main(): Promise { cacheRuleUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesCreateSample.ts index 079f947c96ce..dfdcb41391ba 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a connected registry for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryCreate.json */ -async function connectedRegistryCreate() { +async function connectedRegistryCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -59,7 +59,7 @@ async function connectedRegistryCreate() { console.log(result); } -async function main() { +async function main(): Promise { connectedRegistryCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesDeactivateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesDeactivateSample.ts index 185a6d6bc018..54e6b38c9c3c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesDeactivateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesDeactivateSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deactivates the connected registry instance. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryDeactivate.json */ -async function connectedRegistryDeactivate() { +async function connectedRegistryDeactivate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function connectedRegistryDeactivate() { console.log(result); } -async function main() { +async function main(): Promise { connectedRegistryDeactivate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesDeleteSample.ts index e18aee70163c..9c08d315fb36 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a connected registry from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryDelete.json */ -async function connectedRegistryDelete() { +async function connectedRegistryDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function connectedRegistryDelete() { console.log(result); } -async function main() { +async function main(): Promise { connectedRegistryDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesGetSample.ts index b1cfaf513e25..a9a78f813430 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the connected registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryGet.json */ -async function connectedRegistryGet() { +async function connectedRegistryGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function connectedRegistryGet() { console.log(result); } -async function main() { +async function main(): Promise { connectedRegistryGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesListSample.ts index 39143b8de842..59d0868c8365 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all connected registries for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryList.json */ -async function connectedRegistryList() { +async function connectedRegistryList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function connectedRegistryList() { console.log(resArray); } -async function main() { +async function main(): Promise { connectedRegistryList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesUpdateSample.ts index f59336c38ef8..31d688153413 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/connectedRegistriesUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a connected registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ConnectedRegistryUpdate.json */ -async function connectedRegistryUpdate() { +async function connectedRegistryUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -56,7 +56,7 @@ async function connectedRegistryUpdate() { console.log(result); } -async function main() { +async function main(): Promise { connectedRegistryUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsCreateSample.ts index 2b3b93e0244b..0730c0a1c647 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a credential set for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetCreate.json */ -async function credentialSetCreate() { +async function credentialSetCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -56,7 +56,7 @@ async function credentialSetCreate() { console.log(result); } -async function main() { +async function main(): Promise { credentialSetCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsDeleteSample.ts index 9797dcd480b0..5e81630492b3 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a credential set from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetDelete.json */ -async function credentialSetDelete() { +async function credentialSetDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function credentialSetDelete() { console.log(result); } -async function main() { +async function main(): Promise { credentialSetDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsGetSample.ts index 733ee52971df..ef12f517d6e6 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the specified credential set resource. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetGet.json */ -async function credentialSetGet() { +async function credentialSetGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function credentialSetGet() { console.log(result); } -async function main() { +async function main(): Promise { credentialSetGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsListSample.ts index 56574b04ec67..6553b205890a 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all credential set resources for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetList.json */ -async function credentialSetList() { +async function credentialSetList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function credentialSetList() { console.log(resArray); } -async function main() { +async function main(): Promise { credentialSetList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsUpdateSample.ts index 8e2c17692edb..a402d76c824a 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/credentialSetsUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a credential set for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetUpdate.json */ -async function credentialSetUpdate() { +async function credentialSetUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -54,7 +54,7 @@ async function credentialSetUpdate() { console.log(result); } -async function main() { +async function main(): Promise { credentialSetUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesCreateSample.ts index 476f3d8d27df..6ca45820b4ea 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates an export pipeline for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineCreate.json */ -async function exportPipelineCreate() { +async function exportPipelineCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -53,7 +53,7 @@ async function exportPipelineCreate() { console.log(result); } -async function main() { +async function main(): Promise { exportPipelineCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesDeleteSample.ts index dae7a54594fc..a17e8d0b5fc9 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes an export pipeline from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineDelete.json */ -async function exportPipelineDelete() { +async function exportPipelineDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function exportPipelineDelete() { console.log(result); } -async function main() { +async function main(): Promise { exportPipelineDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesGetSample.ts index dac07666a55a..15bc5e52a9f5 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the export pipeline. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineGet.json */ -async function exportPipelineGet() { +async function exportPipelineGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function exportPipelineGet() { console.log(result); } -async function main() { +async function main(): Promise { exportPipelineGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesListSample.ts index 941eea435f4e..cb79da64c8fc 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/exportPipelinesListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all export pipelines for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineList.json */ -async function exportPipelineList() { +async function exportPipelineList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function exportPipelineList() { console.log(resArray); } -async function main() { +async function main(): Promise { exportPipelineList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesCreateSample.ts index 8b77587b3027..e2d2ed20d38b 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates an import pipeline for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineCreate.json */ -async function importPipelineCreate() { +async function importPipelineCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -58,7 +58,7 @@ async function importPipelineCreate() { console.log(result); } -async function main() { +async function main(): Promise { importPipelineCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesDeleteSample.ts index 7a2b6e9dc6eb..639c086f721d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes an import pipeline from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineDelete.json */ -async function importPipelineDelete() { +async function importPipelineDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function importPipelineDelete() { console.log(result); } -async function main() { +async function main(): Promise { importPipelineDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesGetSample.ts index 3eb937d0c1ed..1d24b74ec105 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the import pipeline. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineGet.json */ -async function importPipelineGet() { +async function importPipelineGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function importPipelineGet() { console.log(result); } -async function main() { +async function main(): Promise { importPipelineGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesListSample.ts index 47a6384f8959..45edc3720a4a 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/importPipelinesListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all import pipelines for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineList.json */ -async function importPipelineList() { +async function importPipelineList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function importPipelineList() { console.log(resArray); } -async function main() { +async function main(): Promise { importPipelineList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/operationsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/operationsListSample.ts index bc6110b1d5ca..f02ac3109c23 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/operationsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/operationsListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all of the available Azure Container Registry REST API operations. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/OperationList.json */ -async function operationList() { +async function operationList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -34,7 +34,7 @@ async function operationList() { console.log(resArray); } -async function main() { +async function main(): Promise { operationList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsCreateSample.ts index d1dc023d3d2d..bca6cbeeda2f 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a pipeline run for a container registry with the specified parameters * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunCreate_Export.json */ -async function pipelineRunCreateExport() { +async function pipelineRunCreateExport(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -60,7 +60,7 @@ async function pipelineRunCreateExport() { * @summary Creates a pipeline run for a container registry with the specified parameters * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunCreate_Import.json */ -async function pipelineRunCreateImport() { +async function pipelineRunCreateImport(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -91,7 +91,7 @@ async function pipelineRunCreateImport() { console.log(result); } -async function main() { +async function main(): Promise { pipelineRunCreateExport(); pipelineRunCreateImport(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsDeleteSample.ts index 98d32887741c..d0de13a79007 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a pipeline run from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunDelete.json */ -async function pipelineRunDelete() { +async function pipelineRunDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function pipelineRunDelete() { console.log(result); } -async function main() { +async function main(): Promise { pipelineRunDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsGetSample.ts index c62d58d6aecf..a2c6df45a026 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the detailed information for a given pipeline run. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunGet.json */ -async function pipelineRunGet() { +async function pipelineRunGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function pipelineRunGet() { console.log(result); } -async function main() { +async function main(): Promise { pipelineRunGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsListSample.ts index 9c65a2353e66..6cfdae855031 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/pipelineRunsListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the pipeline runs for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunList.json */ -async function pipelineRunList() { +async function pipelineRunList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function pipelineRunList() { console.log(resArray); } -async function main() { +async function main(): Promise { pipelineRunList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts index 02e046b4acee..1a3c892c9bba 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Update the state of specified private endpoint connection associated with the container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json */ -async function privateEndpointConnectionCreateOrUpdate() { +async function privateEndpointConnectionCreateOrUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -49,7 +49,7 @@ async function privateEndpointConnectionCreateOrUpdate() { console.log(result); } -async function main() { +async function main(): Promise { privateEndpointConnectionCreateOrUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts index de27d4369ac5..7cc602b99480 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes the specified private endpoint connection associated with the container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionDelete.json */ -async function privateEndpointConnectionDelete() { +async function privateEndpointConnectionDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function privateEndpointConnectionDelete() { console.log(result); } -async function main() { +async function main(): Promise { privateEndpointConnectionDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsGetSample.ts index b44b130a98d1..3a5b6bb9a90d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Get the specified private endpoint connection associated with the container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionGet.json */ -async function privateEndpointConnectionGet() { +async function privateEndpointConnectionGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function privateEndpointConnectionGet() { console.log(result); } -async function main() { +async function main(): Promise { privateEndpointConnectionGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsListSample.ts index f92df98343b6..1f521e215adc 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/privateEndpointConnectionsListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary List all private endpoint connections in a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionList.json */ -async function privateEndpointConnectionList() { +async function privateEndpointConnectionList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function privateEndpointConnectionList() { console.log(resArray); } -async function main() { +async function main(): Promise { privateEndpointConnectionList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesCheckNameAvailabilitySample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesCheckNameAvailabilitySample.ts index cb4aa4c60e5d..2cc47fa49b00 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesCheckNameAvailabilitySample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesCheckNameAvailabilitySample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCheckNameAvailable.json */ -async function registryCheckNameAvailable() { +async function registryCheckNameAvailable(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -46,7 +46,7 @@ async function registryCheckNameAvailable() { * @summary Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCheckNameNotAvailable.json */ -async function registryCheckNameNotAvailable() { +async function registryCheckNameNotAvailable(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -65,7 +65,7 @@ async function registryCheckNameNotAvailable() { console.log(result); } -async function main() { +async function main(): Promise { registryCheckNameAvailable(); registryCheckNameNotAvailable(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesCreateSample.ts index ed39e1139914..60174d635c6f 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCreate.json */ -async function registryCreate() { +async function registryCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -53,7 +53,7 @@ async function registryCreate() { * @summary Creates a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCreateZoneRedundant.json */ -async function registryCreateZoneRedundant() { +async function registryCreateZoneRedundant(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -79,7 +79,7 @@ async function registryCreateZoneRedundant() { console.log(result); } -async function main() { +async function main(): Promise { registryCreate(); registryCreateZoneRedundant(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesDeleteSample.ts index b5ff55becfe6..fd98d08f9ff5 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryDelete.json */ -async function registryDelete() { +async function registryDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -37,7 +37,7 @@ async function registryDelete() { console.log(result); } -async function main() { +async function main(): Promise { registryDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGenerateCredentialsSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGenerateCredentialsSample.ts index 15539a8c0c11..ef319a7b0009 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGenerateCredentialsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGenerateCredentialsSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Generate keys for a token of a specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGenerateCredentials.json */ -async function registryGenerateCredentials() { +async function registryGenerateCredentials(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -46,7 +46,7 @@ async function registryGenerateCredentials() { console.log(result); } -async function main() { +async function main(): Promise { registryGenerateCredentials(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetBuildSourceUploadUrlSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetBuildSourceUploadUrlSample.ts index 22fca90de975..ba086df298a2 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetBuildSourceUploadUrlSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetBuildSourceUploadUrlSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Get the upload location for the user to be able to upload the source. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json */ -async function registriesGetBuildSourceUploadUrl() { +async function registriesGetBuildSourceUploadUrl(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -37,7 +37,7 @@ async function registriesGetBuildSourceUploadUrl() { console.log(result); } -async function main() { +async function main(): Promise { registriesGetBuildSourceUploadUrl(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetPrivateLinkResourceSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetPrivateLinkResourceSample.ts index 0a56b566c598..ad8d239b1fb9 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetPrivateLinkResourceSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetPrivateLinkResourceSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets a private link resource by a specified group name for a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGetPrivateLinkResource.json */ -async function registryGetPrivateLinkResource() { +async function registryGetPrivateLinkResource(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function registryGetPrivateLinkResource() { console.log(result); } -async function main() { +async function main(): Promise { registryGetPrivateLinkResource(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetSample.ts index bb06a12515ad..067e60928751 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGet.json */ -async function registryGet() { +async function registryGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -34,7 +34,7 @@ async function registryGet() { console.log(result); } -async function main() { +async function main(): Promise { registryGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesImportImageSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesImportImageSample.ts index 3e518d2681ef..ccfe2c2ecd63 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesImportImageSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesImportImageSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Copies an image to this container registry from the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageByManifestDigest.json */ -async function importImageByManifestDigest() { +async function importImageByManifestDigest(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -58,7 +58,7 @@ async function importImageByManifestDigest() { * @summary Copies an image to this container registry from the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageByTag.json */ -async function importImageByTag() { +async function importImageByTag(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -94,7 +94,7 @@ async function importImageByTag() { * @summary Copies an image to this container registry from the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageFromPublicRegistry.json */ -async function importImageFromPublicRegistry() { +async function importImageFromPublicRegistry(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -123,7 +123,7 @@ async function importImageFromPublicRegistry() { console.log(result); } -async function main() { +async function main(): Promise { importImageByManifestDigest(); importImageByTag(); importImageFromPublicRegistry(); diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListByResourceGroupSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListByResourceGroupSample.ts index 70c615cbf197..a607de2f56c6 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListByResourceGroupSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListByResourceGroupSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the container registries under the specified resource group. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListByResourceGroup.json */ -async function registryListByResourceGroup() { +async function registryListByResourceGroup(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -38,7 +38,7 @@ async function registryListByResourceGroup() { console.log(resArray); } -async function main() { +async function main(): Promise { registryListByResourceGroup(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListCredentialsSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListCredentialsSample.ts index 49b1fbc2ee1e..aa6335e38502 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListCredentialsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListCredentialsSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists the login credentials for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListCredentials.json */ -async function registryListCredentials() { +async function registryListCredentials(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -37,7 +37,7 @@ async function registryListCredentials() { console.log(result); } -async function main() { +async function main(): Promise { registryListCredentials(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListPrivateLinkResourcesSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListPrivateLinkResourcesSample.ts index e20472de6edb..5ccc7830c487 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListPrivateLinkResourcesSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListPrivateLinkResourcesSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists the private link resources for a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListPrivateLinkResources.json */ -async function registryListPrivateLinkResources() { +async function registryListPrivateLinkResources(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function registryListPrivateLinkResources() { console.log(resArray); } -async function main() { +async function main(): Promise { registryListPrivateLinkResources(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListSample.ts index c327db31f748..37888a635e2b 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the container registries under the specified subscription. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryList.json */ -async function registryList() { +async function registryList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -34,7 +34,7 @@ async function registryList() { console.log(resArray); } -async function main() { +async function main(): Promise { registryList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListUsagesSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListUsagesSample.ts index 630f00d275b5..e78505edfa26 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListUsagesSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesListUsagesSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the quota usages for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListUsages.json */ -async function registryListUsages() { +async function registryListUsages(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -37,7 +37,7 @@ async function registryListUsages() { console.log(result); } -async function main() { +async function main(): Promise { registryListUsages(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesRegenerateCredentialSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesRegenerateCredentialSample.ts index b7ababd9b9d3..dbf6f882196c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesRegenerateCredentialSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesRegenerateCredentialSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Regenerates one of the login credentials for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryRegenerateCredential.json */ -async function registryRegenerateCredential() { +async function registryRegenerateCredential(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -44,7 +44,7 @@ async function registryRegenerateCredential() { console.log(result); } -async function main() { +async function main(): Promise { registryRegenerateCredential(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesScheduleRunSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesScheduleRunSample.ts index 06d258b913ed..054361d5af3a 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesScheduleRunSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesScheduleRunSample.ts @@ -24,7 +24,7 @@ import "dotenv/config"; * @summary Schedules a new run based on the request parameters and add it to the run queue. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun.json */ -async function registriesScheduleRun() { +async function registriesScheduleRun(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -70,7 +70,7 @@ async function registriesScheduleRun() { * @summary Schedules a new run based on the request parameters and add it to the run queue. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json */ -async function registriesScheduleRunEncodedTaskRun() { +async function registriesScheduleRunEncodedTaskRun(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -112,7 +112,7 @@ async function registriesScheduleRunEncodedTaskRun() { * @summary Schedules a new run based on the request parameters and add it to the run queue. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json */ -async function registriesScheduleRunFileTaskRun() { +async function registriesScheduleRunFileTaskRun(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -155,7 +155,7 @@ async function registriesScheduleRunFileTaskRun() { * @summary Schedules a new run based on the request parameters and add it to the run queue. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_Task.json */ -async function registriesScheduleRunTask() { +async function registriesScheduleRunTask(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -202,7 +202,7 @@ async function registriesScheduleRunTask() { * @summary Schedules a new run based on the request parameters and add it to the run queue. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json */ -async function registriesScheduleRunTaskWithCustomCredentials() { +async function registriesScheduleRunTaskWithCustomCredentials(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -250,7 +250,7 @@ async function registriesScheduleRunTaskWithCustomCredentials() { * @summary Schedules a new run based on the request parameters and add it to the run queue. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json */ -async function registriesScheduleRunWithCustomCredentials() { +async function registriesScheduleRunWithCustomCredentials(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -310,7 +310,7 @@ async function registriesScheduleRunWithCustomCredentials() { * @summary Schedules a new run based on the request parameters and add it to the run queue. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json */ -async function registriesScheduleRunWithLogTemplate() { +async function registriesScheduleRunWithLogTemplate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -351,7 +351,7 @@ async function registriesScheduleRunWithLogTemplate() { console.log(result); } -async function main() { +async function main(): Promise { registriesScheduleRun(); registriesScheduleRunEncodedTaskRun(); registriesScheduleRunFileTaskRun(); diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesUpdateSample.ts index 527f475750fb..efacb0caca6c 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/registriesUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryUpdate.json */ -async function registryUpdate() { +async function registryUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -46,7 +46,7 @@ async function registryUpdate() { console.log(result); } -async function main() { +async function main(): Promise { registryUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsCreateSample.ts index 97057f48001a..b71197ab5ea3 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a replication for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationCreate.json */ -async function replicationCreate() { +async function replicationCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -53,7 +53,7 @@ async function replicationCreate() { * @summary Creates a replication for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationCreateZoneRedundant.json */ -async function replicationCreateZoneRedundant() { +async function replicationCreateZoneRedundant(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -81,7 +81,7 @@ async function replicationCreateZoneRedundant() { console.log(result); } -async function main() { +async function main(): Promise { replicationCreate(); replicationCreateZoneRedundant(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsDeleteSample.ts index 3d2bf9501cbc..903973c8fa18 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a replication from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationDelete.json */ -async function replicationDelete() { +async function replicationDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function replicationDelete() { console.log(result); } -async function main() { +async function main(): Promise { replicationDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsGetSample.ts index 8297fdbc9fa2..d41078ad4118 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the specified replication. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationGet.json */ -async function replicationGet() { +async function replicationGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function replicationGet() { console.log(result); } -async function main() { +async function main(): Promise { replicationGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsListSample.ts index 1e46cf298ae6..76828c5049de 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the replications for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationList.json */ -async function replicationList() { +async function replicationList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function replicationList() { console.log(resArray); } -async function main() { +async function main(): Promise { replicationList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsUpdateSample.ts index 68d4854d2000..6ae497d1347d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/replicationsUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a replication for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationUpdate.json */ -async function replicationUpdate() { +async function replicationUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -46,7 +46,7 @@ async function replicationUpdate() { console.log(result); } -async function main() { +async function main(): Promise { replicationUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsCancelSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsCancelSample.ts index 01d31e2f9be6..26932186e7dc 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsCancelSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsCancelSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Cancel an existing run. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsCancel.json */ -async function runsCancel() { +async function runsCancel(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function runsCancel() { console.log(result); } -async function main() { +async function main(): Promise { runsCancel(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsGetLogSasUrlSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsGetLogSasUrlSample.ts index 55860923692a..b7e9183cf13d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsGetLogSasUrlSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsGetLogSasUrlSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets a link to download the run logs. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGetLogSasUrl.json */ -async function runsGetLogSasUrl() { +async function runsGetLogSasUrl(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function runsGetLogSasUrl() { console.log(result); } -async function main() { +async function main(): Promise { runsGetLogSasUrl(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsGetSample.ts index a87f6e146add..20a239b40392 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the detailed information for a given run. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json */ -async function runsGet() { +async function runsGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -35,7 +35,7 @@ async function runsGet() { console.log(result); } -async function main() { +async function main(): Promise { runsGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsListSample.ts index 8ab203554084..71c689e4527e 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsListSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Gets all the runs for a registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsList.json */ -async function runsList() { +async function runsList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -47,7 +47,7 @@ async function runsList() { console.log(resArray); } -async function main() { +async function main(): Promise { runsList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsUpdateSample.ts index 096d16871a4b..2120476f58b9 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/runsUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Patch the run properties. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsUpdate.json */ -async function runsUpdate() { +async function runsUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -44,7 +44,7 @@ async function runsUpdate() { console.log(result); } -async function main() { +async function main(): Promise { runsUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsCreateSample.ts index 9371488243e9..969ea7850c6b 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a scope map for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapCreate.json */ -async function scopeMapCreate() { +async function scopeMapCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -50,7 +50,7 @@ async function scopeMapCreate() { console.log(result); } -async function main() { +async function main(): Promise { scopeMapCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsDeleteSample.ts index f47c5745a573..b050a56c4b59 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a scope map from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapDelete.json */ -async function scopeMapDelete() { +async function scopeMapDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function scopeMapDelete() { console.log(result); } -async function main() { +async function main(): Promise { scopeMapDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsGetSample.ts index d54d7bb9f6cd..993bd5cef7a8 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the specified scope map. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapGet.json */ -async function scopeMapGet() { +async function scopeMapGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function scopeMapGet() { console.log(result); } -async function main() { +async function main(): Promise { scopeMapGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsListSample.ts index ba8493b8bd5e..216168c2b720 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the scope maps for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapList.json */ -async function scopeMapList() { +async function scopeMapList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function scopeMapList() { console.log(resArray); } -async function main() { +async function main(): Promise { scopeMapList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsUpdateSample.ts index 261003f32879..b6e1165a26b8 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/scopeMapsUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a scope map with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapUpdate.json */ -async function scopeMapUpdate() { +async function scopeMapUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -50,7 +50,7 @@ async function scopeMapUpdate() { console.log(result); } -async function main() { +async function main(): Promise { scopeMapUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsCreateSample.ts index 3bad82e5071d..0257dddf1f7f 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a task run for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsCreate.json */ -async function taskRunsCreate() { +async function taskRunsCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -56,7 +56,7 @@ async function taskRunsCreate() { console.log(result); } -async function main() { +async function main(): Promise { taskRunsCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsDeleteSample.ts index ea5c9c49bd18..c5795bc92a6d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a specified task run resource. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsDelete.json */ -async function taskRunsDelete() { +async function taskRunsDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function taskRunsDelete() { console.log(result); } -async function main() { +async function main(): Promise { taskRunsDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsGetDetailsSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsGetDetailsSample.ts index 0be7d55beac5..d51859c32ae4 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsGetDetailsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsGetDetailsSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the detailed information for a given task run that includes all secrets. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGetDetails.json */ -async function taskRunsGetDetails() { +async function taskRunsGetDetails(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function taskRunsGetDetails() { console.log(result); } -async function main() { +async function main(): Promise { taskRunsGetDetails(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsGetSample.ts index 92bc09d66632..252cf02e29bf 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the detailed information for a given task run. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json */ -async function taskRunsGet() { +async function taskRunsGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function taskRunsGet() { console.log(result); } -async function main() { +async function main(): Promise { taskRunsGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsListSample.ts index 66aa263b6fae..b15f43968944 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the task runs for a specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsList.json */ -async function taskRunsList() { +async function taskRunsList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -40,7 +40,7 @@ async function taskRunsList() { console.log(resArray); } -async function main() { +async function main(): Promise { taskRunsList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsUpdateSample.ts index c14ed0d8759f..05e67bc752ee 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/taskRunsUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a task run with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json */ -async function taskRunsUpdate() { +async function taskRunsUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -57,7 +57,7 @@ async function taskRunsUpdate() { console.log(result); } -async function main() { +async function main(): Promise { taskRunsUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksCreateSample.ts index 9a031fb3a9a8..8213fa3d3061 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a task for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate.json */ -async function tasksCreate() { +async function tasksCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -96,7 +96,7 @@ async function tasksCreate() { * @summary Creates a task for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate_QuickTask.json */ -async function tasksCreateQuickTask() { +async function tasksCreateQuickTask(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -132,7 +132,7 @@ async function tasksCreateQuickTask() { * @summary Creates a task for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json */ -async function tasksCreateWithSystemAndUserIdentities() { +async function tasksCreateWithSystemAndUserIdentities(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -212,7 +212,7 @@ async function tasksCreateWithSystemAndUserIdentities() { * @summary Creates a task for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json */ -async function tasksCreateWithUserIdentities() { +async function tasksCreateWithUserIdentities(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -293,7 +293,7 @@ async function tasksCreateWithUserIdentities() { * @summary Creates a task for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json */ -async function tasksCreateWithUserIdentitiesWithSystemIdentity() { +async function tasksCreateWithUserIdentitiesWithSystemIdentity(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -360,7 +360,7 @@ async function tasksCreateWithUserIdentitiesWithSystemIdentity() { console.log(result); } -async function main() { +async function main(): Promise { tasksCreate(); tasksCreateQuickTask(); tasksCreateWithSystemAndUserIdentities(); diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksDeleteSample.ts index c4a4af311ab2..69604fefd66d 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a specified task. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksDelete.json */ -async function tasksDelete() { +async function tasksDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function tasksDelete() { console.log(result); } -async function main() { +async function main(): Promise { tasksDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksGetDetailsSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksGetDetailsSample.ts index 957e0267a7e1..8d64f41e18d3 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksGetDetailsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksGetDetailsSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Returns a task with extended information that includes all secrets. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGetDetails.json */ -async function tasksGetDetails() { +async function tasksGetDetails(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function tasksGetDetails() { console.log(result); } -async function main() { +async function main(): Promise { tasksGetDetails(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksGetSample.ts index 02bc084908b5..bd91b64049c9 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Get the properties of a specified task. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json */ -async function tasksGet() { +async function tasksGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -39,7 +39,7 @@ async function tasksGet() { console.log(result); } -async function main() { +async function main(): Promise { tasksGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksListSample.ts index 7dfb792ab395..1f03d592af4a 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the tasks for a specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksList.json */ -async function tasksList() { +async function tasksList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -37,7 +37,7 @@ async function tasksList() { console.log(resArray); } -async function main() { +async function main(): Promise { tasksList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksUpdateSample.ts index a902baf425f4..bea9da897883 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tasksUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a task with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate.json */ -async function tasksUpdate() { +async function tasksUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -83,7 +83,7 @@ async function tasksUpdate() { * @summary Updates a task with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_QuickTask.json */ -async function tasksUpdateQuickTask() { +async function tasksUpdateQuickTask(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -116,7 +116,7 @@ async function tasksUpdateQuickTask() { * @summary Updates a task with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json */ -async function tasksUpdateWithKeyVaultCustomCredentials() { +async function tasksUpdateWithKeyVaultCustomCredentials(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -181,7 +181,7 @@ async function tasksUpdateWithKeyVaultCustomCredentials() { * @summary Updates a task with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json */ -async function tasksUpdateWithMsiCustomCredentials() { +async function tasksUpdateWithMsiCustomCredentials(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -234,7 +234,7 @@ async function tasksUpdateWithMsiCustomCredentials() { * @summary Updates a task with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json */ -async function tasksUpdateWithOpaqueCustomCredentials() { +async function tasksUpdateWithOpaqueCustomCredentials(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "4385cf00-2d3a-425a-832f-f4285b1c9dce"; @@ -286,7 +286,7 @@ async function tasksUpdateWithOpaqueCustomCredentials() { console.log(result); } -async function main() { +async function main(): Promise { tasksUpdate(); tasksUpdateQuickTask(); tasksUpdateWithKeyVaultCustomCredentials(); diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensCreateSample.ts index d83b03b5c772..320f8448d3ae 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a token for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenCreate.json */ -async function tokenCreate() { +async function tokenCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -57,7 +57,7 @@ async function tokenCreate() { console.log(result); } -async function main() { +async function main(): Promise { tokenCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensDeleteSample.ts index 4cb1d55bba73..6014ef418241 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a token from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenDelete.json */ -async function tokenDelete() { +async function tokenDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function tokenDelete() { console.log(result); } -async function main() { +async function main(): Promise { tokenDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensGetSample.ts index e13701de6de4..bee5f9e23df8 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the specified token. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenGet.json */ -async function tokenGet() { +async function tokenGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function tokenGet() { console.log(result); } -async function main() { +async function main(): Promise { tokenGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensListSample.ts index d5c50d55825c..7a303e8db583 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the tokens for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenList.json */ -async function tokenList() { +async function tokenList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -37,7 +37,7 @@ async function tokenList() { console.log(resArray); } -async function main() { +async function main(): Promise { tokenList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensUpdateSample.ts index ef3d13fcb406..529b16f2cac3 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/tokensUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a token with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenUpdate.json */ -async function tokenUpdate() { +async function tokenUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -56,7 +56,7 @@ async function tokenUpdate() { console.log(result); } -async function main() { +async function main(): Promise { tokenUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksCreateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksCreateSample.ts index b2bfcc8e25c0..7b0c7cf8953e 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksCreateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksCreateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Creates a webhook for a container registry with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookCreate.json */ -async function webhookCreate() { +async function webhookCreate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -52,7 +52,7 @@ async function webhookCreate() { console.log(result); } -async function main() { +async function main(): Promise { webhookCreate(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksDeleteSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksDeleteSample.ts index 5a4715d128c5..5501ca64ef74 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksDeleteSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksDeleteSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Deletes a webhook from a container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookDelete.json */ -async function webhookDelete() { +async function webhookDelete(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function webhookDelete() { console.log(result); } -async function main() { +async function main(): Promise { webhookDelete(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksGetCallbackConfigSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksGetCallbackConfigSample.ts index 9349d2a9440a..402b7f052f56 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksGetCallbackConfigSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksGetCallbackConfigSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the configuration of service URI and custom headers for the webhook. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookGetCallbackConfig.json */ -async function webhookGetCallbackConfig() { +async function webhookGetCallbackConfig(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function webhookGetCallbackConfig() { console.log(result); } -async function main() { +async function main(): Promise { webhookGetCallbackConfig(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksGetSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksGetSample.ts index 0006c6cb5a51..e39fed4398f3 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksGetSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksGetSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Gets the properties of the specified webhook. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookGet.json */ -async function webhookGet() { +async function webhookGet(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function webhookGet() { console.log(result); } -async function main() { +async function main(): Promise { webhookGet(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksListEventsSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksListEventsSample.ts index 0d604647b940..88d10ba4c239 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksListEventsSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksListEventsSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists recent events for the specified webhook. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookListEvents.json */ -async function webhookListEvents() { +async function webhookListEvents(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -42,7 +42,7 @@ async function webhookListEvents() { console.log(resArray); } -async function main() { +async function main(): Promise { webhookListEvents(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksListSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksListSample.ts index b89fb2222b1d..619d3054b279 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksListSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksListSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Lists all the webhooks for the specified container registry. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookList.json */ -async function webhookList() { +async function webhookList(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -40,7 +40,7 @@ async function webhookList() { console.log(resArray); } -async function main() { +async function main(): Promise { webhookList(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksPingSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksPingSample.ts index b1bcc41df8c8..375e1eeadd6b 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksPingSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksPingSample.ts @@ -18,7 +18,7 @@ import "dotenv/config"; * @summary Triggers a ping event to be sent to the webhook. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookPing.json */ -async function webhookPing() { +async function webhookPing(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -39,7 +39,7 @@ async function webhookPing() { console.log(result); } -async function main() { +async function main(): Promise { webhookPing(); } diff --git a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksUpdateSample.ts b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksUpdateSample.ts index 9f5d6cf5dfe5..a38cf8eb6ac8 100644 --- a/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksUpdateSample.ts +++ b/sdk/containerregistry/arm-containerregistry/samples/v11-beta/typescript/src/webhooksUpdateSample.ts @@ -21,7 +21,7 @@ import "dotenv/config"; * @summary Updates a webhook with the specified parameters. * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookUpdate.json */ -async function webhookUpdate() { +async function webhookUpdate(): Promise { const subscriptionId = process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; @@ -51,7 +51,7 @@ async function webhookUpdate() { console.log(result); } -async function main() { +async function main(): Promise { webhookUpdate(); } diff --git a/sdk/containerregistry/arm-containerregistry/test/containerregistry_examples.spec.ts b/sdk/containerregistry/arm-containerregistry/test/containerregistry_examples.spec.ts index 6b875b19df71..ef52b7ea50ba 100644 --- a/sdk/containerregistry/arm-containerregistry/test/containerregistry_examples.spec.ts +++ b/sdk/containerregistry/arm-containerregistry/test/containerregistry_examples.spec.ts @@ -6,12 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { - env, - Recorder, - RecorderStartOptions, - isPlaybackMode, -} from "@azure-tools/test-recorder"; +import type { RecorderStartOptions } from "@azure-tools/test-recorder"; +import { env, Recorder, isPlaybackMode } from "@azure-tools/test-recorder"; import { createTestCredential } from "@azure-tools/test-credential"; import { ContainerRegistryManagementClient } from "../src/containerRegistryManagementClient.js"; import { describe, it, assert, beforeEach, afterEach } from "vitest"; @@ -20,7 +16,7 @@ const replaceableVariables: Record = { AZURE_CLIENT_ID: "azure_client_id", AZURE_CLIENT_SECRET: "azure_client_secret", AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888" + SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888", }; const recorderOptions: RecorderStartOptions = { @@ -44,15 +40,19 @@ describe("ContainerRegistry test", () => { let registryName: string; // let importPipelineName: string; // let exportPipelineName: string; - let taskName: string + let taskName: string; - beforeEach(async function (ctx) { + beforeEach(async (ctx) => { recorder = new Recorder(ctx); await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; + subscriptionId = env.SUBSCRIPTION_ID || ""; // This is an example of how the environment variables are used const credential = createTestCredential(); - client = new ContainerRegistryManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); + client = new ContainerRegistryManagementClient( + credential, + subscriptionId, + recorder.configureClientOptions({}), + ); location = "eastus"; resourceGroup = "myjstest"; registryName = "myregistryxxxyy"; @@ -61,196 +61,136 @@ describe("ContainerRegistry test", () => { taskName = "mytaskxxx"; }); - afterEach(async function () { + afterEach(async () => { await recorder.stop(); }); - it("registries create test", async function () { - const res = await client.registries.beginCreateAndWait(resourceGroup, registryName, { - location: location, - tags: { - key: "value" + it("registries create test", async () => { + const res = await client.registries.beginCreateAndWait( + resourceGroup, + registryName, + { + location: location, + tags: { + key: "value", + }, + sku: { + name: "Premium", + }, + adminUserEnabled: false, }, - sku: { - name: "Premium" - }, - adminUserEnabled: false - }, testPollingOptions); - assert.equal(res.name, registryName) + testPollingOptions, + ); + assert.equal(res.name, registryName); }); - // it("importPipelines create test", async function() { - // const res = await client.importPipelines.beginCreateAndWait(resourceGroup,registryName,importPipelineName,{ - // location: location, - // identity: { - // type: "SystemAssigned" - // }, - // source: { - // type: "AzureStorageBlobContainer", - // uri: "https://accountname.blob.core.windows.net/containername", - // keyVaultUri: "https://myvault.vault.azure.net/secrets/acrimportsas" - // }, - // options: [ - // "OverwriteTags", - // "DeleteSourceBlobOnSuccess", - // "ContinueOnErrors" - // ] - // },testPollingOptions); - // assert.equal(res.name,importPipelineName) - // }); - - // it("exportPipelines create test", async function() { - // const res = await client.exportPipelines.beginCreateAndWait(resourceGroup,registryName,exportPipelineName,{ - // location: location, - // identity: { - // type: "SystemAssigned" - // }, - // target: { - // type: "AzureStorageBlobContainer", - // uri: "https://accountname.blob.core.windows.net/containername", - // keyVaultUri: "https://myvault.vault.azure.net/secrets/acrexportsas" - // }, - // options: [ - // "OverwriteBlobs" - // ] - // },testPollingOptions); - // assert.equal(res.name,exportPipelineName); - // }); - - // it("importPipelines get test", async function() { - // const res = await client.importPipelines.get(resourceGroup,registryName,importPipelineName); - // assert.equal(res.name,importPipelineName) - // }); - - // it("exportPipelines get test", async function() { - // const res = await client.exportPipelines.get(resourceGroup,registryName,exportPipelineName); - // assert.equal(res.name,exportPipelineName) - // }); - - // it("importPipelines list test", async function() { - // const resArray = new Array(); - // for await (let item of client.importPipelines.list(resourceGroup,registryName)){ - // resArray.push(item); - // } - // assert.equal(resArray.length,1); - // }); - - // it("exportPipelines list test", async function() { - // const resArray = new Array(); - // for await (let item of client.exportPipelines.list(resourceGroup,registryName)){ - // resArray.push(item); - // } - // assert.equal(resArray.length,1); - // }); - - // it("importPipelines delete test", async function() { - // const res = await client.importPipelines.beginDeleteAndWait(resourceGroup,registryName,importPipelineName,testPollingOptions); - // const resArray = new Array(); - // for await (let item of client.importPipelines.list(resourceGroup,registryName)){ - // resArray.push(item); - // } - // assert.equal(resArray.length,0); - // }); - - // it("exportPipelines delete test", async function() { - // const res = await client.exportPipelines.beginDeleteAndWait(resourceGroup,registryName,exportPipelineName,testPollingOptions); - // const resArray = new Array(); - // for await (let item of client.exportPipelines.list(resourceGroup,registryName)){ - // resArray.push(item); - // } - // assert.equal(resArray.length,0); - // }); - - it("tasks create test", async function () { - const res = await client.tasks.beginCreateAndWait(resourceGroup, registryName, taskName, { - location: location, - tags: { - testkey: "value" - }, - status: "Enabled", - platform: { - os: "Linux", - architecture: "amd64" - }, - agentConfiguration: { - cpu: 2 - }, - step: { - type: "Docker", - contextPath: "https://github.com/SteveLasker/node-helloworld", - imageNames: ["testtask:v1"], - dockerFilePath: "DockerFile", - isPushEnabled: true, - noCache: false + it("tasks create test", async () => { + const res = await client.tasks.beginCreateAndWait( + resourceGroup, + registryName, + taskName, + { + location: location, + tags: { + testkey: "value", + }, + status: "Enabled", + platform: { + os: "Linux", + architecture: "amd64", + }, + agentConfiguration: { + cpu: 2, + }, + step: { + type: "Docker", + contextPath: "https://github.com/SteveLasker/node-helloworld", + imageNames: ["testtask:v1"], + dockerFilePath: "DockerFile", + isPushEnabled: true, + noCache: false, + }, + trigger: { + baseImageTrigger: { + name: "myBaseImageTrigger", + baseImageTriggerType: "Runtime", + updateTriggerPayloadType: "Default", + status: "Enabled", + }, + }, }, - trigger: { - baseImageTrigger: { - name: "myBaseImageTrigger", - baseImageTriggerType: "Runtime", - updateTriggerPayloadType: "Default", - status: "Enabled" - } - } - }, testPollingOptions); + testPollingOptions, + ); assert.equal(res.name, taskName); }); - it("tasks get test", async function () { + it("tasks get test", async () => { const res = await client.tasks.get(resourceGroup, registryName, taskName); assert.equal(res.name, taskName); }); - it("tasks list test", async function () { + it("tasks list test", async () => { const resArray = new Array(); - for await (let item of client.tasks.list(resourceGroup, registryName)) { + for await (const item of client.tasks.list(resourceGroup, registryName)) { resArray.push(item); } assert.equal(resArray.length, 1); }); - it("tasks update test", async function () { - const res = await client.tasks.beginUpdateAndWait(resourceGroup, registryName, taskName, { - tags: { - testkey: "value" - }, - status: "Enabled", - platform: { - os: "Linux", - architecture: "amd64" - }, - agentConfiguration: { - cpu: 2 - }, - step: { - type: "Docker", - contextPath: "https://github.com/SteveLasker/node-helloworld", - imageNames: ["testtask:v1"], - dockerFilePath: "DockerFile", - isPushEnabled: true, - noCache: false + it("tasks update test", async () => { + const res = await client.tasks.beginUpdateAndWait( + resourceGroup, + registryName, + taskName, + { + tags: { + testkey: "value", + }, + status: "Enabled", + platform: { + os: "Linux", + architecture: "amd64", + }, + agentConfiguration: { + cpu: 2, + }, + step: { + type: "Docker", + contextPath: "https://github.com/SteveLasker/node-helloworld", + imageNames: ["testtask:v1"], + dockerFilePath: "DockerFile", + isPushEnabled: true, + noCache: false, + }, + trigger: { + baseImageTrigger: { + name: "myBaseImageTrigger", + baseImageTriggerType: "Runtime", + updateTriggerPayloadType: "Default", + status: "Enabled", + }, + }, }, - trigger: { - baseImageTrigger: { - name: "myBaseImageTrigger", - baseImageTriggerType: "Runtime", - updateTriggerPayloadType: "Default", - status: "Enabled" - } - } - }, testPollingOptions); + testPollingOptions, + ); assert.equal(res.type, "Microsoft.ContainerRegistry/registries/tasks"); }); - it("tasks delete test", async function () { - await client.tasks.beginDeleteAndWait(resourceGroup, registryName, taskName, testPollingOptions); + it("tasks delete test", async () => { + await client.tasks.beginDeleteAndWait( + resourceGroup, + registryName, + taskName, + testPollingOptions, + ); const resArray = new Array(); - for await (let item of client.tasks.list(resourceGroup, registryName)) { + for await (const item of client.tasks.list(resourceGroup, registryName)) { resArray.push(item); } assert.equal(resArray.length, 0); }); - it("registries delete test", async function () { + it("registries delete test", async () => { await client.registries.beginDeleteAndWait(resourceGroup, registryName, testPollingOptions); }); }); diff --git a/sdk/containerregistry/arm-containerregistry/test/snippets.spec.ts b/sdk/containerregistry/arm-containerregistry/test/snippets.spec.ts new file mode 100644 index 000000000000..d1df5c853453 --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/test/snippets.spec.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ContainerRegistryManagementClient } from "../src/index.js"; +import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { setLogLevel } from "@azure/logger"; +import { describe, it } from "vitest"; + +describe("snippets", () => { + it("ReadmeSampleCreateClient_Node", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new ContainerRegistryManagementClient( + new DefaultAzureCredential(), + subscriptionId, + ); + }); + + it("ReadmeSampleCreateClient_Browser", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", + }); + const client = new ContainerRegistryManagementClient(credential, subscriptionId); + }); + + it("SetLogLevel", async () => { + setLogLevel("info"); + }); +}); diff --git a/sdk/containerregistry/arm-containerregistry/tsconfig.browser.config.json b/sdk/containerregistry/arm-containerregistry/tsconfig.browser.config.json index b6586181d006..0c8bafa97126 100644 --- a/sdk/containerregistry/arm-containerregistry/tsconfig.browser.config.json +++ b/sdk/containerregistry/arm-containerregistry/tsconfig.browser.config.json @@ -1,17 +1,6 @@ { - "extends": "./.tshy/build.json", - "include": [ - "./src/**/*.ts", - "./src/**/*.mts", - "./test/**/*.spec.ts", - "./test/**/*.mts" - ], - "exclude": [ - "./test/**/node/**/*.ts" - ], - "compilerOptions": { - "outDir": "./dist-test/browser", - "rootDir": ".", - "skipLibCheck": true - } + "extends": [ + "./tsconfig.test.json", + "../../../tsconfig.browser.base.json" + ] } diff --git a/sdk/containerregistry/arm-containerregistry/vitest.browser.config.ts b/sdk/containerregistry/arm-containerregistry/vitest.browser.config.ts index b48c61b2ef46..182729ab5ce9 100644 --- a/sdk/containerregistry/arm-containerregistry/vitest.browser.config.ts +++ b/sdk/containerregistry/arm-containerregistry/vitest.browser.config.ts @@ -9,9 +9,9 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: [ - "dist-test/browser/test/**/*.spec.js", - ], + include: ["dist-test/browser/test/**/*.spec.js",], + testTimeout: 1200000, + hookTimeout: 1200000, }, }), ); diff --git a/sdk/containerregistry/arm-containerregistry/vitest.config.ts b/sdk/containerregistry/arm-containerregistry/vitest.config.ts index 2a4750c84292..40e031385dd8 100644 --- a/sdk/containerregistry/arm-containerregistry/vitest.config.ts +++ b/sdk/containerregistry/arm-containerregistry/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,8 +9,8 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - hookTimeout: 1200000, testTimeout: 1200000, + hookTimeout: 1200000, }, }), ); diff --git a/sdk/containerregistry/container-registry/README.md b/sdk/containerregistry/container-registry/README.md index 4e72c90e6b29..62b57fd932e8 100644 --- a/sdk/containerregistry/container-registry/README.md +++ b/sdk/containerregistry/container-registry/README.md @@ -53,14 +53,11 @@ npm install @azure/container-registry The [Azure Identity library][identity] provides easy Azure Active Directory support for authentication. -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT; +```ts snippet:ReadmeSampleCreateClient_Node +import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry"; +import { DefaultAzureCredential } from "@azure/identity"; + +const endpoint = "https://myregistryname.azurecr.io"; // Create a ContainerRegistryClient that will authenticate through Active Directory const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, @@ -76,14 +73,11 @@ To authenticate with a registry in a [National Cloud](https://learn.microsoft.co - Set the `authorityHost` in the credential options or via the `AZURE_AUTHORITY_HOST` environment variable - Set the `audience` in `ContainerRegistryClientOptions` -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential, AzureAuthorityHosts } = require("@azure/identity"); +```ts snippet:ReadmeSampleCreateClient_NationalCloud +import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry"; +import { DefaultAzureCredential, AzureAuthorityHosts } from "@azure/identity"; -const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT; +const endpoint = "https://myregistryname.azurecr.cn"; // Create a ContainerRegistryClient that will authenticate through AAD in the China national cloud const client = new ContainerRegistryClient( endpoint, @@ -110,310 +104,234 @@ For more information please see [Container Registry Concepts](https://learn.micr Iterate through the collection of repositories in the registry. -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function main() { - // endpoint should be in the form of "https://myregistryname.azurecr.io" - // where "myregistryname" is the actual name of your registry - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { - audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, - }); - - console.log("Listing repositories"); - const iterator = client.listRepositoryNames(); - for await (const repository of iterator) { - console.log(` repository: ${repository}`); - } -} +```ts snippet:SampleReadmeListRepositories +import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry"; +import { DefaultAzureCredential } from "@azure/identity"; -main().catch((err) => { - console.error("The sample encountered an error:", err); +const endpoint = "https://myregistryname.azurecr.io"; +const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, }); + +const iterator = client.listRepositoryNames(); +for await (const repository of iterator) { + console.log(` repository: ${repository}`); +} ``` #### List tags with anonymous access -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); +```ts snippet:SampleReadmeListTagsAnonymous +import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry"; -async function main() { - // Get the service endpoint from the environment - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - - // Create a new ContainerRegistryClient for anonymous access - const client = new ContainerRegistryClient(endpoint, { - audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, - }); +const endpoint = "https://myregistryname.azurecr.io"; +// Create a new ContainerRegistryClient for anonymous access +const client = new ContainerRegistryClient(endpoint, { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, +}); - // Obtain a RegistryArtifact object to get access to image operations - const image = client.getArtifact("library/hello-world", "latest"); +// Obtain a RegistryArtifact object to get access to image operations +const image = client.getArtifact("library/hello-world", "latest"); - // List the set of tags on the hello_world image tagged as "latest" - const tagIterator = image.listTagProperties(); +// List the set of tags on the hello_world image tagged as "latest" +const tagIterator = image.listTagProperties(); - // Iterate through the image's tags, listing the tagged alias for the image - console.log(`${image.fullyQualifiedReference} has the following aliases:`); - for await (const tag of tagIterator) { - console.log(` ${tag.registryLoginServer}/${tag.repositoryName}:${tag.name}`); - } +// Iterate through the image's tags, listing the tagged alias for the image +console.log(`${image.fullyQualifiedReference} has the following aliases:`); +for await (const tag of tagIterator) { + console.log(` ${tag.registryLoginServer}/${tag.repositoryName}:${tag.name}`); } - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); ``` #### Set artifact properties -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function main() { - // Get the service endpoint from the environment - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; +```ts snippet:SampleReadmeSetArtifactProperties +import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry"; +import { DefaultAzureCredential } from "@azure/identity"; - // Create a new ContainerRegistryClient and RegistryArtifact to access image operations - const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { - audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, - }); - const image = client.getArtifact("library/hello-world", "v1"); +const endpoint = "https://myregistryname.azurecr.io"; +const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, +}); - // Set permissions on the image's "latest" tag - await image.updateTagProperties("latest", { canWrite: false, canDelete: false }); -} +const image = client.getArtifact("library/hello-world", "v1"); -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); +// Set permissions on the image's "latest" tag +await image.updateTagProperties("latest", { canWrite: false, canDelete: false }); ``` #### Delete images -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function main() { - // Get the service endpoint from the environment - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - // Create a new ContainerRegistryClient - const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { - audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, - }); +```ts snippet:SampleReadmeDeleteImages +import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry"; +import { DefaultAzureCredential } from "@azure/identity"; + +const endpoint = "https://myregistryname.azurecr.io"; +const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, +}); - // Iterate through repositories - const repositoryNames = client.listRepositoryNames(); - for await (const repositoryName of repositoryNames) { - const repository = client.getRepository(repositoryName); - // Obtain the images ordered from newest to oldest by passing the `order` option - const imageManifests = repository.listManifestProperties({ - order: "LastUpdatedOnDescending", - }); - const imagesToKeep = 3; - let imageCount = 0; - // Delete images older than the first three. - for await (const manifest of imageManifests) { - imageCount++; - if (imageCount > imagesToKeep) { - const image = repository.getArtifact(manifest.digest); - console.log(`Deleting image with digest ${manifest.digest}`); - console.log(` Deleting the following tags from the image:`); - for (const tagName of manifest.tags) { - console.log(` ${manifest.repositoryName}:${tagName}`); - image.deleteTag(tagName); - } - await image.delete(); +// Iterate through repositories +const repositoryNames = client.listRepositoryNames(); +for await (const repositoryName of repositoryNames) { + const repository = client.getRepository(repositoryName); + // Obtain the images ordered from newest to oldest by passing the `order` option + const imageManifests = repository.listManifestProperties({ + order: "LastUpdatedOnDescending", + }); + const imagesToKeep = 3; + let imageCount = 0; + // Delete images older than the first three. + for await (const manifest of imageManifests) { + imageCount++; + if (imageCount > imagesToKeep) { + const image = repository.getArtifact(manifest.digest); + console.log(`Deleting image with digest ${manifest.digest}`); + console.log(` Deleting the following tags from the image:`); + for (const tagName of manifest.tags) { + console.log(` ${manifest.repositoryName}:${tagName}`); + image.deleteTag(tagName); } + await image.delete(); } } } - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); ``` ### Blob and manifest operations #### Upload images -```javascript -const { ContainerRegistryContentClient } = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -async function main() { - // endpoint should be in the form of "https://myregistryname.azurecr.io" - // where "myregistryname" is the actual name of your registry - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - const repository = process.env.CONTAINER_REGISTRY_REPOSITORY || "library/hello-world"; - const client = new ContainerRegistryContentClient( - endpoint, - repository, - new DefaultAzureCredential(), - ); - - const config = Buffer.from("Sample config"); - const { digest: configDigest, sizeInBytes: configSize } = await client.uploadBlob(config); - - const layer = Buffer.from("Sample layer"); - const { digest: layerDigest, sizeInBytes: layerSize } = await client.uploadBlob(layer); - - const manifest = { - schemaVersion: 2, - config: { - digest: configDigest, - size: configSize, - mediaType: "application/vnd.oci.image.config.v1+json", +```ts snippet:SampleReadmeUploadImages +import { ContainerRegistryContentClient } from "@azure/container-registry"; +import { DefaultAzureCredential } from "@azure/identity"; + +const endpoint = "https://myregistryname.azurecr.io"; +const repository = "library/hello-world"; +const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), +); + +const config = Buffer.from("Sample config"); +const { digest: configDigest, sizeInBytes: configSize } = await client.uploadBlob(config); + +const layer = Buffer.from("Sample layer"); +const { digest: layerDigest, sizeInBytes: layerSize } = await client.uploadBlob(layer); + +const manifest = { + schemaVersion: 2, + config: { + digest: configDigest, + size: configSize, + mediaType: "application/vnd.oci.image.config.v1+json", + }, + layers: [ + { + digest: layerDigest, + size: layerSize, + mediaType: "application/vnd.oci.image.layer.v1.tar", }, - layers: [ - { - digest: layerDigest, - size: layerSize, - mediaType: "application/vnd.oci.image.layer.v1.tar", - }, - ], - }; - - await client.setManifest(manifest, { tag: "demo" }); -} + ], +}; -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); +await client.setManifest(manifest, { tag: "demo" }); ``` #### Download images -```javascript -const { +```ts snippet:SampleReadmeDownloadImages +import { ContainerRegistryContentClient, KnownManifestMediaType, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); -const dotenv = require("dotenv"); -const fs = require("fs"); -dotenv.config(); + OciImageManifest, +} from "@azure/container-registry"; +import { DefaultAzureCredential } from "@azure/identity"; +import { writeFileSync, createWriteStream } from "node:fs"; + +const endpoint = "https://myregistryname.azurecr.io"; +const repository = "library/hello-world"; +const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), +); -function trimSha(digest) { - const index = digest.indexOf(":"); - return index === -1 ? digest : digest.substring(index); -} +// Download the manifest to obtain the list of files in the image based on the tag +const result = await client.getManifest("demo"); -async function main() { - // endpoint should be in the form of "https://myregistryname.azurecr.io" - // where "myregistryname" is the actual name of your registry - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - const repository = process.env.CONTAINER_REGISTRY_REPOSITORY || "library/hello-world"; - const client = new ContainerRegistryContentClient( - endpoint, - repository, - new DefaultAzureCredential(), - ); - - // Download the manifest to obtain the list of files in the image based on the tag - const result = await client.getManifest("demo"); - - if (result.mediaType !== KnownManifestMediaType.OciImageManifest) { - throw new Error("Expected an OCI image manifest"); - } +if (result.mediaType !== KnownManifestMediaType.OciImageManifest) { + throw new Error("Expected an OCI image manifest"); +} - const manifest = result.manifest; +const manifest = result.manifest as OciImageManifest; - // Manifests of all media types have a buffer containing their content; this can be written to a file. - fs.writeFileSync("manifest.json", result.content); +// Manifests of all media types have a buffer containing their content; this can be written to a file. +writeFileSync("manifest.json", result.content); - const configResult = await client.downloadBlob(manifest.config.digest); - const configFile = fs.createWriteStream("config.json"); - configResult.content.pipe(configFile); +const configResult = await client.downloadBlob(manifest.config.digest); +const configFile = createWriteStream("config.json"); +configResult.content.pipe(configFile); - // Download and write out the layers - for (const layer of manifest.layers) { - const fileName = trimSha(layer.digest); - const layerStream = fs.createWriteStream(fileName); - const downloadLayerResult = await client.downloadBlob(layer.digest); - downloadLayerResult.content.pipe(layerStream); - } +const trimSha = (digest: string): string => { + const index = digest.indexOf(":"); + return index === -1 ? digest : digest.substring(index); +}; + +// Download and write out the layers +for (const layer of manifest.layers) { + const fileName = trimSha(layer.digest); + const layerStream = createWriteStream(fileName); + const downloadLayerResult = await client.downloadBlob(layer.digest); + downloadLayerResult.content.pipe(layerStream); } - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); ``` #### Delete manifest -```javascript -const { ContainerRegistryContentClient } = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -async function main() { - // Get the service endpoint from the environment - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - const repository = process.env.CONTAINER_REGISTRY_REPOSITORY || "library/hello-world"; - // Create a new ContainerRegistryClient - const client = new ContainerRegistryContentClient( - endpoint, - repository, - new DefaultAzureCredential(), - ); - - const downloadResult = await client.getManifest("latest"); - await client.deleteManifest(downloadResult.digest); -} +```ts snippet:SampleReadmeDeleteManifest +import { ContainerRegistryContentClient } from "@azure/container-registry"; +import { DefaultAzureCredential } from "@azure/identity"; -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); +const endpoint = "https://myregistryname.azurecr.io"; +const repository = "library/hello-world"; +const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), +); + +const downloadResult = await client.getManifest("latest"); +await client.deleteManifest(downloadResult.digest); ``` #### Delete blob -```javascript -const { +```ts snippet:SampleReadmeDeleteBlob +import { ContainerRegistryContentClient, KnownManifestMediaType, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -async function main() { - // Get the service endpoint from the environment - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - const repository = process.env.CONTAINER_REGISTRY_REPOSITORY || "library/hello-world"; - // Create a new ContainerRegistryClient - const client = new ContainerRegistryContentClient( - endpoint, - repository, - new DefaultAzureCredential(), - ); - - const downloadResult = await client.getManifest("latest"); - - if (downloadResult.mediaType !== KnownManifestMediaType.OciImageManifest) { - throw new Error("Expected an OCI image manifest"); - } + OciImageManifest, +} from "@azure/container-registry"; +import { DefaultAzureCredential } from "@azure/identity"; - for (const layer of downloadResult.manifest.layers) { - await client.deleteBlob(layer.digest); - } +const endpoint = "https://myregistryname.azurecr.io"; +const repository = "library/hello-world"; +const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), +); + +const downloadResult = await client.getManifest("latest"); + +if (downloadResult.mediaType !== KnownManifestMediaType.OciImageManifest) { + throw new Error("Expected an OCI image manifest"); +} + +for (const layer of (downloadResult.manifest as OciImageManifest).layers) { + await client.deleteBlob(layer.digest); } ``` diff --git a/sdk/containerregistry/container-registry/TROUBLESHOOTING.md b/sdk/containerregistry/container-registry/TROUBLESHOOTING.md index bf8551ff2e3b..4f0eac0a61a4 100644 --- a/sdk/containerregistry/container-registry/TROUBLESHOOTING.md +++ b/sdk/containerregistry/container-registry/TROUBLESHOOTING.md @@ -10,8 +10,8 @@ Container registry service methods throw [`RestError`] on failure. 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`: -```javascript -const { setLogLevel } = require("@azure/logger"); +```ts snippet:SetLogLevel +import { setLogLevel } from "@azure/logger"; setLogLevel("info"); ``` @@ -73,11 +73,22 @@ In rare cases, transient error (such as connection reset) can happen during blob The following code snippet shows how to access detailed error information: -```ts -const config = Buffer.from(`{"hello":"world"}`); +```ts snippet:SampleReadmeErrorHandling +import { ContainerRegistryContentClient } from "@azure/container-registry"; +import { DefaultAzureCredential } from "@azure/identity"; +import { isRestError } from "@azure/core-rest-pipeline"; + +const endpoint = "https://myregistryname.azurecr.io"; +const repository = "library/hello-world"; +const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), +); +const config = Buffer.from(`{"hello":"world"}`); try { - const uploadResult = await contentClient.uploadBlob(config); + const uploadResult = await client.uploadBlob(config); console.log(`Uploaded blob: digest - ${uploadResult.digest}, size - ${uploadResult.sizeInBytes}`); } catch (e) { // isRestError is exported by @azure/core-rest-pipeline diff --git a/sdk/containerregistry/container-registry/package.json b/sdk/containerregistry/container-registry/package.json index 52413dee8ded..07fdf4dffcac 100644 --- a/sdk/containerregistry/container-registry/package.json +++ b/sdk/containerregistry/container-registry/package.json @@ -47,7 +47,7 @@ "unit-test": "npm run unit-test:node && npm run unit-test:browser", "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run test:vitest", - "update-snippets": "echo skipped" + "update-snippets": "dev-tool run update-snippets" }, "files": [ "dist/", @@ -76,7 +76,7 @@ "@azure/core-auth": "^1.9.0", "@azure/core-client": "^1.9.2", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.18.0", + "@azure/core-rest-pipeline": "^1.18.2", "@azure/core-tracing": "^1.2.0", "@azure/logger": "^1.1.4", "tslib": "^2.8.1" diff --git a/sdk/containerregistry/container-registry/src/containerRegistryClient.ts b/sdk/containerregistry/container-registry/src/containerRegistryClient.ts index e2799c457bc6..9c8e3e6f3a76 100644 --- a/sdk/containerregistry/container-registry/src/containerRegistryClient.ts +++ b/sdk/containerregistry/container-registry/src/containerRegistryClient.ts @@ -58,14 +58,15 @@ export class ContainerRegistryClient { * Creates an instance of a ContainerRegistryClient. * * Example usage: - * ```ts - * import { ContainerRegistryClient } from "@azure/container-registry"; - * import { DefaultAzureCredential} from "@azure/identity"; + * ```ts snippet:ReadmeSampleCreateClient_Node + * import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * const client = new ContainerRegistryClient( - * "", - * new DefaultAzureCredential() - * ); + * const endpoint = "https://myregistryname.azurecr.io"; + * // Create a ContainerRegistryClient that will authenticate through Active Directory + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { + * audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, + * }); * ``` * @param endpoint - the URL endpoint of the container registry * @param credential - used to authenticate requests to the service @@ -84,12 +85,14 @@ export class ContainerRegistryClient { * methods will throw errors. * * Example usage: - * ```ts - * import { ContainerRegistryClient } from "@azure/container-registry"; + * ```ts snippet:ReadmeSampleCreateClient_Anonymous + * import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry"; * - * const client = new ContainerRegistryClient( - * "", - * ); + * const endpoint = "https://myregistryname.azurecr.io"; + * // Create a new ContainerRegistryClient for anonymous access + * const client = new ContainerRegistryClient(endpoint, { + * audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, + * }); * ``` * @param endpoint - the URL endpoint of the container registry * @param options - optional configuration used to send requests to the service @@ -200,41 +203,22 @@ export class ContainerRegistryClient { * Returns an async iterable iterator to list names of repositories in this registry. * * Example usage: - * ```javascript - * let client = new ContainerRegistryClient(url, credential); - * for await (const repository of client.listRepositoryNames()) { - * console.log("repository name: ", repository); - * } - * ``` + * ```ts snippet:SampleReadmeListRepositories + * import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `iter.next()`: + * const endpoint = "https://myregistryname.azurecr.io"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { + * audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, + * }); * - * ```javascript - * let iter = client.listRepositoryNames(); - * let item = await iter.next(); - * while (!item.done) { - * console.log(`repository name: ${item.value}`); - * item = await iter.next(); + * const iterator = client.listRepositoryNames(); + * for await (const repository of iterator) { + * console.log(` repository: ${repository}`); * } * ``` * - * Example using `byPage()`: - * - * ```javascript - * const pages = client.listRepositoryNames().byPage({ maxPageSize: 2 }); - * let page = await pages.next(); - * let i = 1; - * while (!page.done) { - * if (page.value) { - * console.log(`-- page ${i++}`); - * for (const name of page.value) { - * console.log(` repository name: ${name}`); - * } - * } - * page = await pages.next(); - * } - * ``` - * @param options - + * @param options - The options for the request */ public listRepositoryNames( // eslint-disable-next-line @azure/azure-sdk/ts-naming-options diff --git a/sdk/containerregistry/container-registry/src/containerRepository.ts b/sdk/containerregistry/container-registry/src/containerRepository.ts index ea9f20507724..8959543b728e 100644 --- a/sdk/containerregistry/container-registry/src/containerRepository.ts +++ b/sdk/containerregistry/container-registry/src/containerRepository.ts @@ -77,7 +77,7 @@ export interface ContainerRepository { getArtifact(tagOrDigest: string): RegistryArtifact; /** * Retrieves the properties of this repository. - * @param options - + * @param options - The options for the operation. */ getProperties(options?: GetRepositoryPropertiesOptions): Promise; /** @@ -85,17 +85,23 @@ export interface ContainerRepository { * * Example usage: * - * ```javascript - * const client = new ContainerRegistryClient(url, credential); - * const repository = client.getRepository(repositoryName) + * ```ts snippet:ContainerRepositoryUpdateProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + * const repository = client.getRepository(repositoryName); + * * const updated = await repository.updateProperties({ * canDelete: false, * canList: false, * canRead: false, - * canWrite: false + * canWrite: false, * }); * ``` - * @param options - + * @param options - The options for the operation. */ updateProperties( options: UpdateRepositoryPropertiesOptions, @@ -107,42 +113,21 @@ export interface ContainerRepository { * * Example using `for-await-of` syntax: * - * ```javascript - * const client = new ContainerRegistryClient(url, credential); - * const repository = client.getRepository(repositoryName) - * for await (const manifest of repository.listManifestProperties()) { - * console.log("manifest: ", manifest); - * } - * ``` + * ```ts snippet:ContainerRepositoryListManifestProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `iter.next()`: + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + * const repository = client.getRepository(repositoryName); * - * ```javascript - * const iter = repository.listManifestProperties(); - * let item = await iter.next(); - * while (!item.done) { - * console.log("manifest properties: ", item.value); - * item = await iter.next(); + * for await (const manifest of repository.listManifestProperties()) { + * console.log("manifest: ", manifest); * } * ``` * - * Example using `byPage()`: - * - * ```javascript - * const pages = repository.listManifestProperties().byPage({ maxPageSize: 2 }); - * let page = await pages.next(); - * let i = 1; - * while (!page.done) { - * if (page.value) { - * console.log(`-- page ${i++}`); - * for (const manifestProperties of page.value) { - * console.log(` manifest properties: ${manifestProperties}`); - * } - * } - * page = await pages.next(); - * } - * ``` - * @param options - + * @param options - The options for the operation. */ listManifestProperties( options?: ListManifestPropertiesOptions, @@ -205,7 +190,7 @@ export class ContainerRepositoryImpl { /** * Retrieves the properties of this repository. - * @param options - + * @param options - The options for the operation. */ public async getProperties( options: GetRepositoryPropertiesOptions = {}, @@ -224,17 +209,23 @@ export class ContainerRepositoryImpl { * * Example usage: * - * ```javascript - * const client = new ContainerRegistryClient(url, credential); - * const repository = client.getRepository(repositoryName) + * ```ts snippet:ContainerRepositoryUpdateProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + * const repository = client.getRepository(repositoryName); + * * const updated = await repository.updateProperties({ * canDelete: false, * canList: false, * canRead: false, - * canWrite: false + * canWrite: false, * }); * ``` - * @param options - + * @param options - The options for the operation. */ public async updateProperties( options: UpdateRepositoryPropertiesOptions, @@ -262,42 +253,21 @@ export class ContainerRepositoryImpl { * * Example using `for-await-of` syntax: * - * ```javascript - * const client = new ContainerRegistryClient(url, credential); - * const repository = client.getRepository(repositoryName) - * for await (const manifest of repository.listManifestProperties()) { - * console.log("manifest: ", manifest); - * } - * ``` + * ```ts snippet:ContainerRepositoryListManifestProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `iter.next()`: + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + * const repository = client.getRepository(repositoryName); * - * ```javascript - * const iter = repository.listManifestProperties(); - * let item = await iter.next(); - * while (!item.done) { - * console.log("manifest properties: ", item.value); - * item = await iter.next(); + * for await (const manifest of repository.listManifestProperties()) { + * console.log("manifest: ", manifest); * } * ``` * - * Example using `byPage()`: - * - * ```javascript - * const pages = repository.listManifestProperties().byPage({ maxPageSize: 2 }); - * let page = await pages.next(); - * let i = 1; - * while (!page.done) { - * if (page.value) { - * console.log(`-- page ${i++}`); - * for (const manifestProperties of page.value) { - * console.log(` manifest properties: ${manifestProperties}`); - * } - * } - * page = await pages.next(); - * } - * ``` - * @param options - + * @param options - The options for the operation. */ public listManifestProperties( options: ListManifestPropertiesOptions = {}, diff --git a/sdk/containerregistry/container-registry/src/content/containerRegistryContentClient.ts b/sdk/containerregistry/container-registry/src/content/containerRegistryContentClient.ts index 6214e26adb1e..b3c014ddb93e 100644 --- a/sdk/containerregistry/container-registry/src/content/containerRegistryContentClient.ts +++ b/sdk/containerregistry/container-registry/src/content/containerRegistryContentClient.ts @@ -103,14 +103,16 @@ export class ContainerRegistryContentClient { * Creates an instance of a ContainerRegistryContentClient for managing container images and artifacts. * * Example usage: - * ```ts + * ```ts snippet:SampleReadmeCreateContainerRegistryContentClient * import { ContainerRegistryContentClient } from "@azure/container-registry"; - * import { DefaultAzureCredential} from "@azure/identity"; + * import { DefaultAzureCredential } from "@azure/identity"; * + * const endpoint = "https://myregistryname.azurecr.io"; + * const repository = "library/hello-world"; * const client = new ContainerRegistryContentClient( - * "", - * "", - * new DefaultAzureCredential() + * endpoint, + * repository, + * new DefaultAzureCredential(), * ); * ``` * @param endpoint - the URL endpoint of the container registry diff --git a/sdk/containerregistry/container-registry/src/registryArtifact.ts b/sdk/containerregistry/container-registry/src/registryArtifact.ts index 2ae2f9cc7d6f..37b6db33bf59 100644 --- a/sdk/containerregistry/container-registry/src/registryArtifact.ts +++ b/sdk/containerregistry/container-registry/src/registryArtifact.ts @@ -114,14 +114,21 @@ export interface RegistryArtifact { * * Example usage: * - * ```javascript - * const client = new ContainerRegistryClient(url, credential); - * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest) + * ```ts snippet:RegistryArtifactUpdateManifestProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const artifactTagOrDigest = "latest"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + * + * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest); * const updated = await artifact.updateManifestProperties({ * canDelete: false, * canList: false, * canRead: false, - * canWrite: false + * canWrite: false, * }); * ``` * @param options - @@ -132,7 +139,7 @@ export interface RegistryArtifact { /** * Retrieves the properties of the specified tag. * @param tag - the tag to retrieve properties. - * @param options - + * @param options - options to get tag properties */ getTagProperties(tag: string, options?: GetTagPropertiesOptions): Promise; /** @@ -140,14 +147,22 @@ export interface RegistryArtifact { * * Example usage: * - * ```javascript - * const client = new ContainerRegistryClient(url, credential); - * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest) + * ```ts snippet:RegistryArtifactUpdateTagProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const artifactTagOrDigest = "latest"; + * const tag = "latest"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + * + * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest); * const updated = await artifact.updateTagProperties(tag, { * canDelete: false, * canList: false, * canRead: false, - * canWrite: false + * canWrite: false, * }); * ``` * @param tag - name of the tag to update properties on @@ -162,43 +177,22 @@ export interface RegistryArtifact { * * Example using `for-await-of` syntax: * - * ```javascript - * const client = new ContainerRegistryClient(url, credentials); - * const repository = client.getRepository(repositoryName); - * const artifact = repository.getArtifact(digest) - * for await (const tag of artifact.listTagProperties()) { - * console.log("tag: ", tag); - * } - * ``` + * ```ts snippet:RegistryArtifactListTagProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `iter.next()`: + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const artifactTagOrDigest = "latest"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); * - * ```javascript - * const iter = artifact.listTagProperties(); - * let item = await iter.next(); - * while (!item.done) { - * console.log("tag properties: ", item.value); - * item = await iter.next(); + * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest); + * for await (const tag of artifact.listTagProperties()) { + * console.log("tag: ", tag); * } * ``` * - * Example using `byPage()`: - * - * ```javascript - * const pages = artifact.listTagProperties().byPage({ maxPageSize: 2 }); - * let page = await pages.next(); - * let i = 1; - * while (!page.done) { - * if (page.value) { - * console.log(`-- page ${i++}`); - * for (const tagProperties of page.value) { - * console.log(` repository name: ${tagProperties}`); - * } - * } - * page = await pages.next(); - * } - * ``` - * @param options - + * @param options - options to list tags */ listTagProperties( options?: ListTagPropertiesOptions, @@ -338,17 +332,24 @@ export class RegistryArtifactImpl { * * Example usage: * - * ```javascript - * const client = new ContainerRegistryClient(url, credential); - * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest) + * ```ts snippet:RegistryArtifactUpdateManifestProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const artifactTagOrDigest = "latest"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + * + * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest); * const updated = await artifact.updateManifestProperties({ * canDelete: false, * canList: false, * canRead: false, - * canWrite: false + * canWrite: false, * }); * ``` - * @param options - + * @param options - options to update manifest properties */ public async updateManifestProperties( options: UpdateManifestPropertiesOptions, @@ -382,7 +383,7 @@ export class RegistryArtifactImpl { /** * Retrieves the properties of the specified tag. * @param tag - the tag to retrieve properties. - * @param options - + * @param options - options to get tag properties */ public async getTagProperties( tag: string, @@ -410,18 +411,26 @@ export class RegistryArtifactImpl { * * Example usage: * - * ```javascript - * const client = new ContainerRegistryClient(url, credential); - * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest) + * ```ts snippet:RegistryArtifactUpdateTagProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; + * + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const artifactTagOrDigest = "latest"; + * const tag = "latest"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + * + * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest); * const updated = await artifact.updateTagProperties(tag, { * canDelete: false, * canList: false, * canRead: false, - * canWrite: false + * canWrite: false, * }); * ``` * @param tag - name of the tag to update properties on - * @param options - + * @param options - options to update tag properties */ public async updateTagProperties( tag: string, @@ -457,43 +466,22 @@ export class RegistryArtifactImpl { * * Example using `for-await-of` syntax: * - * ```javascript - * const client = new ContainerRegistryClient(url, credentials); - * const repository = client.getRepository(repositoryName); - * const artifact = repository.getArtifact(digest) - * for await (const tag of artifact.listTagProperties()) { - * console.log("tag: ", tag); - * } - * ``` + * ```ts snippet:RegistryArtifactListTagProperties + * import { ContainerRegistryClient } from "@azure/container-registry"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `iter.next()`: + * const endpoint = "https://myregistryname.azurecr.io"; + * const repositoryName = "library/hello-world"; + * const artifactTagOrDigest = "latest"; + * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); * - * ```javascript - * const iter = artifact.listTagProperties(); - * let item = await iter.next(); - * while (!item.done) { - * console.log("tag properties: ", item.value); - * item = await iter.next(); + * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest); + * for await (const tag of artifact.listTagProperties()) { + * console.log("tag: ", tag); * } * ``` * - * Example using `byPage()`: - * - * ```javascript - * const pages = artifact.listTagProperties().byPage({ maxPageSize: 2 }); - * let page = await pages.next(); - * let i = 1; - * while (!page.done) { - * if (page.value) { - * console.log(`-- page ${i++}`); - * for (const tagProperties of page.value) { - * console.log(` repository name: ${tagProperties}`); - * } - * } - * page = await pages.next(); - * } - * ``` - * @param options - + * @param options - options to list tags */ public listTagProperties( options: ListTagPropertiesOptions = {}, diff --git a/sdk/containerregistry/container-registry/test/snippets.spec.ts b/sdk/containerregistry/container-registry/test/snippets.spec.ts new file mode 100644 index 000000000000..352a2b5e5cf9 --- /dev/null +++ b/sdk/containerregistry/container-registry/test/snippets.spec.ts @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + ContainerRegistryClient, + ContainerRegistryContentClient, + KnownContainerRegistryAudience, + KnownManifestMediaType, + OciImageManifest, +} from "../src/index.js"; +import { AzureAuthorityHosts, DefaultAzureCredential } from "@azure/identity"; +import { setLogLevel } from "@azure/logger"; +import { describe, it } from "vitest"; +import { createWriteStream, writeFileSync } from "node:fs"; +import { isRestError } from "@azure/core-rest-pipeline"; + +describe("snippets", () => { + it("ReadmeSampleCreateClient_Node", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + // Create a ContainerRegistryClient that will authenticate through Active Directory + const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, + }); + }); + + it("ReadmeSampleCreateClient_Anonymous", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + // Create a new ContainerRegistryClient for anonymous access + const client = new ContainerRegistryClient(endpoint, { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, + }); + }); + + it("ReadmeSampleCreateClient_NationalCloud", async () => { + const endpoint = "https://myregistryname.azurecr.cn"; + // Create a ContainerRegistryClient that will authenticate through AAD in the China national cloud + const client = new ContainerRegistryClient( + endpoint, + new DefaultAzureCredential({ authorityHost: AzureAuthorityHosts.AzureChina }), + { + audience: KnownContainerRegistryAudience.AzureResourceManagerChina, + }, + ); + }); + + it("SampleReadmeListRepositories", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, + }); + // @ts-preserve-whitespace + const iterator = client.listRepositoryNames(); + for await (const repository of iterator) { + console.log(` repository: ${repository}`); + } + }); + + it("SampleReadmeListTagsAnonymous", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + // Create a new ContainerRegistryClient for anonymous access + const client = new ContainerRegistryClient(endpoint, { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, + }); + // @ts-preserve-whitespace + // Obtain a RegistryArtifact object to get access to image operations + const image = client.getArtifact("library/hello-world", "latest"); + // @ts-preserve-whitespace + // List the set of tags on the hello_world image tagged as "latest" + const tagIterator = image.listTagProperties(); + // @ts-preserve-whitespace + // Iterate through the image's tags, listing the tagged alias for the image + console.log(`${image.fullyQualifiedReference} has the following aliases:`); + for await (const tag of tagIterator) { + console.log(` ${tag.registryLoginServer}/${tag.repositoryName}:${tag.name}`); + } + }); + + it("SampleReadmeSetArtifactProperties", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, + }); + // @ts-preserve-whitespace + const image = client.getArtifact("library/hello-world", "v1"); + // @ts-preserve-whitespace + // Set permissions on the image's "latest" tag + await image.updateTagProperties("latest", { canWrite: false, canDelete: false }); + }); + + it("SampleReadmeDeleteImages", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { + audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, + }); + // @ts-preserve-whitespace + // Iterate through repositories + const repositoryNames = client.listRepositoryNames(); + for await (const repositoryName of repositoryNames) { + const repository = client.getRepository(repositoryName); + // Obtain the images ordered from newest to oldest by passing the `order` option + const imageManifests = repository.listManifestProperties({ + order: "LastUpdatedOnDescending", + }); + const imagesToKeep = 3; + let imageCount = 0; + // Delete images older than the first three. + for await (const manifest of imageManifests) { + imageCount++; + if (imageCount > imagesToKeep) { + const image = repository.getArtifact(manifest.digest); + console.log(`Deleting image with digest ${manifest.digest}`); + console.log(` Deleting the following tags from the image:`); + for (const tagName of manifest.tags) { + console.log(` ${manifest.repositoryName}:${tagName}`); + image.deleteTag(tagName); + } + await image.delete(); + } + } + } + }); + + it("SampleReadmeCreateContainerRegistryContentClient", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repository = "library/hello-world"; + const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), + ); + }); + + it("SampleReadmeUploadImages", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repository = "library/hello-world"; + const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), + ); + // @ts-preserve-whitespace + const config = Buffer.from("Sample config"); + const { digest: configDigest, sizeInBytes: configSize } = await client.uploadBlob(config); + // @ts-preserve-whitespace + const layer = Buffer.from("Sample layer"); + const { digest: layerDigest, sizeInBytes: layerSize } = await client.uploadBlob(layer); + // @ts-preserve-whitespace + const manifest = { + schemaVersion: 2, + config: { + digest: configDigest, + size: configSize, + mediaType: "application/vnd.oci.image.config.v1+json", + }, + layers: [ + { + digest: layerDigest, + size: layerSize, + mediaType: "application/vnd.oci.image.layer.v1.tar", + }, + ], + }; + // @ts-preserve-whitespace + await client.setManifest(manifest, { tag: "demo" }); + }); + + it("SampleReadmeDownloadImages", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repository = "library/hello-world"; + const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), + ); + // @ts-preserve-whitespace + // Download the manifest to obtain the list of files in the image based on the tag + const result = await client.getManifest("demo"); + // @ts-preserve-whitespace + if (result.mediaType !== KnownManifestMediaType.OciImageManifest) { + throw new Error("Expected an OCI image manifest"); + } + // @ts-preserve-whitespace + const manifest = result.manifest as OciImageManifest; + // @ts-preserve-whitespace + // Manifests of all media types have a buffer containing their content; this can be written to a file. + writeFileSync("manifest.json", result.content); + // @ts-preserve-whitespace + const configResult = await client.downloadBlob(manifest.config.digest); + const configFile = createWriteStream("config.json"); + configResult.content.pipe(configFile); + // @ts-preserve-whitespace + const trimSha = (digest: string): string => { + const index = digest.indexOf(":"); + return index === -1 ? digest : digest.substring(index); + }; + // @ts-preserve-whitespace + // Download and write out the layers + for (const layer of manifest.layers) { + const fileName = trimSha(layer.digest); + const layerStream = createWriteStream(fileName); + const downloadLayerResult = await client.downloadBlob(layer.digest); + downloadLayerResult.content.pipe(layerStream); + } + }); + + it("SampleReadmeDeleteManifest", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repository = "library/hello-world"; + const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), + ); + // @ts-preserve-whitespace + const downloadResult = await client.getManifest("latest"); + await client.deleteManifest(downloadResult.digest); + }); + + it("SampleReadmeDeleteBlob", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repository = "library/hello-world"; + const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), + ); + // @ts-preserve-whitespace + const downloadResult = await client.getManifest("latest"); + // @ts-preserve-whitespace + if (downloadResult.mediaType !== KnownManifestMediaType.OciImageManifest) { + throw new Error("Expected an OCI image manifest"); + } + // @ts-preserve-whitespace + for (const layer of (downloadResult.manifest as OciImageManifest).layers) { + await client.deleteBlob(layer.digest); + } + }); + + it("SampleReadmeErrorHandling", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repository = "library/hello-world"; + const client = new ContainerRegistryContentClient( + endpoint, + repository, + new DefaultAzureCredential(), + ); + // @ts-preserve-whitespace + const config = Buffer.from(`{"hello":"world"}`); + + try { + const uploadResult = await client.uploadBlob(config); + console.log( + `Uploaded blob: digest - ${uploadResult.digest}, size - ${uploadResult.sizeInBytes}`, + ); + } catch (e) { + // isRestError is exported by @azure/core-rest-pipeline + if ( + isRestError(e) && + e.statusCode === 404 && + (e.details as any).errors.some((error: any) => error.code === "BLOB_UPLOAD_INVALID") + ) { + // Retry upload + } else { + throw e; + } + } + }); + + it("ContainerRepositoryUpdateProperties", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repositoryName = "library/hello-world"; + const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + const repository = client.getRepository(repositoryName); + // @ts-preserve-whitespace + const updated = await repository.updateProperties({ + canDelete: false, + canList: false, + canRead: false, + canWrite: false, + }); + }); + + it("ContainerRepositoryListManifestProperties", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repositoryName = "library/hello-world"; + const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + const repository = client.getRepository(repositoryName); + // @ts-preserve-whitespace + for await (const manifest of repository.listManifestProperties()) { + console.log("manifest: ", manifest); + } + }); + + it("RegistryArtifactUpdateManifestProperties", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repositoryName = "library/hello-world"; + const artifactTagOrDigest = "latest"; + const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + // @ts-preserve-whitespace + const artifact = client.getArtifact(repositoryName, artifactTagOrDigest); + const updated = await artifact.updateManifestProperties({ + canDelete: false, + canList: false, + canRead: false, + canWrite: false, + }); + }); + + it("RegistryArtifactUpdateTagProperties", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repositoryName = "library/hello-world"; + const artifactTagOrDigest = "latest"; + const tag = "latest"; + const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + // @ts-preserve-whitespace + const artifact = client.getArtifact(repositoryName, artifactTagOrDigest); + const updated = await artifact.updateTagProperties(tag, { + canDelete: false, + canList: false, + canRead: false, + canWrite: false, + }); + }); + + it("RegistryArtifactListTagProperties", async () => { + const endpoint = "https://myregistryname.azurecr.io"; + const repositoryName = "library/hello-world"; + const artifactTagOrDigest = "latest"; + const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential()); + // @ts-preserve-whitespace + const artifact = client.getArtifact(repositoryName, artifactTagOrDigest); + for await (const tag of artifact.listTagProperties()) { + console.log("tag: ", tag); + } + }); + + it("SetLogLevel", async () => { + setLogLevel("info"); + }); +}); diff --git a/sdk/containerregistry/container-registry/tsconfig.browser.config.json b/sdk/containerregistry/container-registry/tsconfig.browser.config.json deleted file mode 100644 index 75871518e3a0..000000000000 --- a/sdk/containerregistry/container-registry/tsconfig.browser.config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] -}